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["FireSource"] = CreateStatic("FireSource")
|
||||
defaultLib["TextManager"] = CreateStatic("TextManager")
|
||||
defaultLib["NetEntityEvent"] = CreateStatic("Networking.NetEntityEvent")
|
||||
|
||||
defaultLib["AIObjective"] = CreateStatic("AIObjective")
|
||||
defaultLib["AIObjectiveChargeBatteries"] = CreateStatic("AIObjectiveChargeBatteries")
|
||||
|
||||
@@ -53,6 +53,7 @@ RegisterBarotrauma("PhysicsBody")
|
||||
RegisterBarotrauma("InvSlotType")
|
||||
RegisterBarotrauma("ItemPrefab")
|
||||
RegisterBarotrauma("SerializableProperty")
|
||||
|
||||
RegisterBarotrauma("StatusEffect")
|
||||
RegisterBarotrauma("FireSource")
|
||||
RegisterBarotrauma("ContentPackage")
|
||||
@@ -178,6 +179,10 @@ RegisterBarotrauma("Networking.IReadMessage")
|
||||
RegisterBarotrauma("Networking.ServerPacketHeader")
|
||||
RegisterBarotrauma("Networking.ClientPacketHeader")
|
||||
RegisterBarotrauma("Networking.DeliveryMethod")
|
||||
RegisterBarotrauma("Networking.DeliveryMethod")
|
||||
RegisterBarotrauma("Networking.NetEntityEvent")
|
||||
RegisterBarotrauma("Networking.NetEntityEvent+Type")
|
||||
RegisterBarotrauma("Networking.INetSerializable")
|
||||
|
||||
RegisterBarotrauma("Rand+RandSync")
|
||||
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;
|
||||
string logValue = "";
|
||||
if (type == typeof(string))
|
||||
|
||||
@@ -746,6 +746,11 @@ namespace Barotrauma
|
||||
env.hook.EnqueueFunction(callback, e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public void CreateEntityEvent(INetSerializable entity, object[] extraData)
|
||||
{
|
||||
GameMain.NetworkMember.CreateEntityEvent(entity, extraData);
|
||||
}
|
||||
}
|
||||
|
||||
public partial class LuaHook
|
||||
|
||||
Reference in New Issue
Block a user