Replicate old Add() method signature structure
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user