From 958335a01c15e12cc19596838dbb1864e48c4554 Mon Sep 17 00:00:00 2001 From: Evil Factory <36804725+evilfactory@users.noreply.github.com> Date: Sat, 28 Mar 2026 14:14:11 -0300 Subject: [PATCH] Replicate old Add() method signature structure --- .../SharedSource/LuaCs/Compatibility/ILuaCsHook.cs | 4 ++-- .../SharedSource/LuaCs/_Services/EventService.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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);