diff --git a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Compatibility/ILuaCsHook.cs b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Compatibility/ILuaCsHook.cs index 69e57544d..7dfdb8291 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Compatibility/ILuaCsHook.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Compatibility/ILuaCsHook.cs @@ -8,9 +8,9 @@ public interface ILuaCsHook : ILuaPatcher, ILuaCsShim { // Event Services [Obsolete("ACsMod is deprecated. Use ILuaEventService.Add() instead.")] - void Add(string eventName, string identifier, LuaCsFunc callback); + void Add(string eventName, string identifier, LuaCsFunc callback, object owner = null); [Obsolete("ACsMod is deprecated. Use ILuaEventService.Add() instead.")] - void Add(string eventName, LuaCsFunc callback); + void Add(string eventName, LuaCsFunc callback, object owner = null); // Does anyone use this? TODO: Analyze old Lua mods for usage scenarios. //bool Exists(string eventName, string identifier); object Call(string eventName, params object[] args); diff --git a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Services/EventService.cs b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Services/EventService.cs index 8803ca2c8..0323fad08 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Services/EventService.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Services/EventService.cs @@ -103,7 +103,7 @@ public partial class EventService : IEventService #region LuaEventSystem - public void Add(string eventName, string identifier, LuaCsFunc callback) + public void Add(string eventName, string identifier, LuaCsFunc callback, object owner = null) { Guard.IsNotNullOrWhiteSpace(eventName, nameof(eventName)); Guard.IsNotNullOrWhiteSpace(identifier, nameof(identifier)); @@ -123,7 +123,7 @@ public partial class EventService : IEventService } } - public void Add(string eventName, LuaCsFunc callback) + public void Add(string eventName, LuaCsFunc callback, object owner = null) { // random ident, we hope for no conflicts :barodev:. Add(eventName, Random.Shared.NextInt64().ToString() ,callback);