add NetEntityEvent, CreateEntityEvent and item.readPropertyChange hook
This commit is contained in:
@@ -62,6 +62,7 @@ defaultLib["Entity"] = CreateStatic("Entity")
|
|||||||
defaultLib["Physics"] = CreateStatic("Physics")
|
defaultLib["Physics"] = CreateStatic("Physics")
|
||||||
defaultLib["FireSource"] = CreateStatic("FireSource")
|
defaultLib["FireSource"] = CreateStatic("FireSource")
|
||||||
defaultLib["TextManager"] = CreateStatic("TextManager")
|
defaultLib["TextManager"] = CreateStatic("TextManager")
|
||||||
|
defaultLib["NetEntityEvent"] = CreateStatic("Networking.NetEntityEvent")
|
||||||
|
|
||||||
defaultLib["AIObjective"] = CreateStatic("AIObjective")
|
defaultLib["AIObjective"] = CreateStatic("AIObjective")
|
||||||
defaultLib["AIObjectiveChargeBatteries"] = CreateStatic("AIObjectiveChargeBatteries")
|
defaultLib["AIObjectiveChargeBatteries"] = CreateStatic("AIObjectiveChargeBatteries")
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ RegisterBarotrauma("PhysicsBody")
|
|||||||
RegisterBarotrauma("InvSlotType")
|
RegisterBarotrauma("InvSlotType")
|
||||||
RegisterBarotrauma("ItemPrefab")
|
RegisterBarotrauma("ItemPrefab")
|
||||||
RegisterBarotrauma("SerializableProperty")
|
RegisterBarotrauma("SerializableProperty")
|
||||||
|
|
||||||
RegisterBarotrauma("StatusEffect")
|
RegisterBarotrauma("StatusEffect")
|
||||||
RegisterBarotrauma("FireSource")
|
RegisterBarotrauma("FireSource")
|
||||||
RegisterBarotrauma("ContentPackage")
|
RegisterBarotrauma("ContentPackage")
|
||||||
@@ -178,6 +179,10 @@ RegisterBarotrauma("Networking.IReadMessage")
|
|||||||
RegisterBarotrauma("Networking.ServerPacketHeader")
|
RegisterBarotrauma("Networking.ServerPacketHeader")
|
||||||
RegisterBarotrauma("Networking.ClientPacketHeader")
|
RegisterBarotrauma("Networking.ClientPacketHeader")
|
||||||
RegisterBarotrauma("Networking.DeliveryMethod")
|
RegisterBarotrauma("Networking.DeliveryMethod")
|
||||||
|
RegisterBarotrauma("Networking.DeliveryMethod")
|
||||||
|
RegisterBarotrauma("Networking.NetEntityEvent")
|
||||||
|
RegisterBarotrauma("Networking.NetEntityEvent+Type")
|
||||||
|
RegisterBarotrauma("Networking.INetSerializable")
|
||||||
|
|
||||||
RegisterBarotrauma("Rand+RandSync")
|
RegisterBarotrauma("Rand+RandSync")
|
||||||
RegisterBarotrauma("Skill")
|
RegisterBarotrauma("Skill")
|
||||||
|
|||||||
@@ -2718,6 +2718,10 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var result = new LuaResult(GameMain.Lua.hook.Call("item.readPropertyChange", this, property, parentObject, allowEditing));
|
||||||
|
if (result.Bool())
|
||||||
|
return;
|
||||||
|
|
||||||
Type type = property.PropertyType;
|
Type type = property.PropertyType;
|
||||||
string logValue = "";
|
string logValue = "";
|
||||||
if (type == typeof(string))
|
if (type == typeof(string))
|
||||||
|
|||||||
@@ -746,6 +746,11 @@ namespace Barotrauma
|
|||||||
env.hook.EnqueueFunction(callback, e.ToString());
|
env.hook.EnqueueFunction(callback, e.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void CreateEntityEvent(INetSerializable entity, object[] extraData)
|
||||||
|
{
|
||||||
|
GameMain.NetworkMember.CreateEntityEvent(entity, extraData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public partial class LuaHook
|
public partial class LuaHook
|
||||||
|
|||||||
Reference in New Issue
Block a user