Change DefaultHook.lua to use Hook.Patch
This commit is contained in:
@@ -1,81 +1,87 @@
|
|||||||
|
|
||||||
Hook.HookMethod(
|
Hook.Patch(
|
||||||
"Barotrauma.Item", "TryInteract",
|
"Barotrauma.Item", "TryInteract",
|
||||||
{
|
{
|
||||||
"Barotrauma.Character",
|
"Barotrauma.Character",
|
||||||
"System.Boolean",
|
"System.Boolean",
|
||||||
"System.Boolean",
|
"System.Boolean",
|
||||||
"System.Boolean"
|
"System.Boolean"
|
||||||
},
|
},
|
||||||
function (instance, p)
|
function(instance, p)
|
||||||
if Hook.Call("item.interact", instance, p.picker, p.ignoreRequiredItems, p.forceSelectKey, p.forceActionKey) == true then
|
if Hook.Call("item.interact", instance, p["picker"], p["ignoreRequiredItems"], p["forceSelectKey"], p["forceActionKey"]) == true then
|
||||||
return false
|
p.PreventExecution = true
|
||||||
end
|
return false
|
||||||
end,
|
end
|
||||||
Hook.HookMethodType.Before
|
end,
|
||||||
|
Hook.HookMethodType.Before
|
||||||
)
|
)
|
||||||
|
|
||||||
Hook.HookMethod(
|
Hook.Patch(
|
||||||
"Barotrauma.Item", "ApplyTreatment",
|
"Barotrauma.Item", "ApplyTreatment",
|
||||||
{
|
{
|
||||||
"Barotrauma.Character",
|
"Barotrauma.Character",
|
||||||
"Barotrauma.Character",
|
"Barotrauma.Character",
|
||||||
"Barotrauma.Limb"
|
"Barotrauma.Limb"
|
||||||
},
|
},
|
||||||
function (instance, p)
|
function(instance, p)
|
||||||
if Hook.Call("item.applyTreatment", instance, p.user, p.character, p.targetLimb) then
|
if Hook.Call("item.applyTreatment", instance, p["user"], p["character"], p["targetLimb"]) then
|
||||||
return false
|
p.PreventExecution = true
|
||||||
end
|
return false
|
||||||
end,
|
end
|
||||||
Hook.HookMethodType.Before
|
end,
|
||||||
|
Hook.HookMethodType.Before
|
||||||
)
|
)
|
||||||
|
|
||||||
Hook.HookMethod(
|
Hook.Patch(
|
||||||
"Barotrauma.Item", "Combine",
|
"Barotrauma.Item", "Combine",
|
||||||
{
|
{
|
||||||
"Barotrauma.Item",
|
"Barotrauma.Item",
|
||||||
"Barotrauma.Character"
|
"Barotrauma.Character"
|
||||||
},
|
},
|
||||||
function (instance, p)
|
function(instance, p)
|
||||||
if Hook.Call("item.combine", instance, p.item, p.user) == true then
|
if Hook.Call("item.combine", instance, p["item"], p["user"]) == true then
|
||||||
return false
|
p.PreventExecution = true
|
||||||
end
|
return false
|
||||||
end,
|
end
|
||||||
Hook.HookMethodType.Before
|
end,
|
||||||
|
Hook.HookMethodType.Before
|
||||||
)
|
)
|
||||||
|
|
||||||
Hook.HookMethod(
|
Hook.Patch(
|
||||||
"Barotrauma.Item", "Drop",
|
"Barotrauma.Item", "Drop",
|
||||||
function (instance, p)
|
function(instance, p)
|
||||||
if Hook.Call("item.drop", instance, p.dropper) == true then
|
if Hook.Call("item.drop", instance, p["dropper"]) == true then
|
||||||
return false
|
p.PreventExecution = true
|
||||||
end
|
return false
|
||||||
end,
|
end
|
||||||
Hook.HookMethodType.Before
|
end,
|
||||||
|
Hook.HookMethodType.Before
|
||||||
)
|
)
|
||||||
|
|
||||||
Hook.HookMethod(
|
Hook.Patch(
|
||||||
"Barotrauma.Item", "Equip",
|
"Barotrauma.Item", "Equip",
|
||||||
{
|
{
|
||||||
"Barotrauma.Character"
|
"Barotrauma.Character"
|
||||||
},
|
},
|
||||||
function (instance, p)
|
function(instance, p)
|
||||||
if Hook.Call("item.equip", instance, p.character) == true then
|
if Hook.Call("item.equip", instance, p["character"]) == true then
|
||||||
return false
|
p.PreventExecution = true
|
||||||
end
|
return false
|
||||||
end,
|
end
|
||||||
Hook.HookMethodType.Before
|
end,
|
||||||
|
Hook.HookMethodType.Before
|
||||||
)
|
)
|
||||||
|
|
||||||
Hook.HookMethod(
|
Hook.Patch(
|
||||||
"Barotrauma.Item", "Unequip",
|
"Barotrauma.Item", "Unequip",
|
||||||
{
|
{
|
||||||
"Barotrauma.Character"
|
"Barotrauma.Character"
|
||||||
},
|
},
|
||||||
function (instance, p)
|
function(instance, p)
|
||||||
if Hook.Call("item.unequip", instance, p.character) == true then
|
if Hook.Call("item.unequip", instance, p["character"]) == true then
|
||||||
return false
|
p.PreventExecution = true
|
||||||
end
|
return false
|
||||||
end,
|
end
|
||||||
Hook.HookMethodType.Before
|
end,
|
||||||
|
Hook.HookMethodType.Before
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user