Deprecate Hook.HookMethod
This commit is contained in:
@@ -120,6 +120,7 @@ namespace Barotrauma
|
|||||||
private static MethodInfo _miHookLuaCsPatchRetPrefix = typeof(LuaCsHook).GetMethod("HookLuaCsPatchRetPrefix", BindingFlags.NonPublic | BindingFlags.Static);
|
private static MethodInfo _miHookLuaCsPatchRetPrefix = typeof(LuaCsHook).GetMethod("HookLuaCsPatchRetPrefix", BindingFlags.NonPublic | BindingFlags.Static);
|
||||||
private static MethodInfo _miHookLuaCsPatchRetPostfix = typeof(LuaCsHook).GetMethod("HookLuaCsPatchRetPostfix", BindingFlags.NonPublic | BindingFlags.Static);
|
private static MethodInfo _miHookLuaCsPatchRetPostfix = typeof(LuaCsHook).GetMethod("HookLuaCsPatchRetPostfix", BindingFlags.NonPublic | BindingFlags.Static);
|
||||||
|
|
||||||
|
// TODO: deprecate this
|
||||||
public void HookMethod(string identifier, MethodInfo method, LuaCsCompatPatchFunc patch, HookMethodType hookType = HookMethodType.Before, ACsMod owner = null)
|
public void HookMethod(string identifier, MethodInfo method, LuaCsCompatPatchFunc patch, HookMethodType hookType = HookMethodType.Before, ACsMod owner = null)
|
||||||
{
|
{
|
||||||
if (identifier == null || method == null || patch == null)
|
if (identifier == null || method == null || patch == null)
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ function Hook.Call(eventName, parameters) end
|
|||||||
-- @tparam string methodName
|
-- @tparam string methodName
|
||||||
-- @tparam function callback
|
-- @tparam function callback
|
||||||
-- @realm shared
|
-- @realm shared
|
||||||
|
-- @deprecated
|
||||||
-- @usage
|
-- @usage
|
||||||
-- Hook.HookMethod("Barotrauma.CharacterInfo", "IncreaseSkillLevel", function (instance, ptable)
|
-- Hook.HookMethod("Barotrauma.CharacterInfo", "IncreaseSkillLevel", function (instance, ptable)
|
||||||
-- print(string.format("%s gained % xp", instance.Character.Name, ptable.increase))
|
-- print(string.format("%s gained % xp", instance.Character.Name, ptable.increase))
|
||||||
|
|||||||
Reference in New Issue
Block a user