refactoring
This commit is contained in:
+3
-3
@@ -34,12 +34,12 @@ do
|
||||
}
|
||||
|
||||
function public.source(item_id)
|
||||
return unpack(data[item_id] or {})
|
||||
return unpack(data[item_id] or tt)
|
||||
end
|
||||
end
|
||||
|
||||
function LOAD()
|
||||
ARMOR = set-from
|
||||
ARMOR = set
|
||||
'INVTYPE_HEAD'
|
||||
'INVTYPE_NECK'
|
||||
'INVTYPE_SHOULDER'
|
||||
@@ -55,7 +55,7 @@ function LOAD()
|
||||
'INVTYPE_TRINKET'
|
||||
'INVTYPE_CLOAK'
|
||||
'INVTYPE_HOLDABLE'
|
||||
WEAPON = set-from
|
||||
WEAPON = set
|
||||
'INVTYPE_2HWEAPON'
|
||||
'INVTYPE_WEAPONMAINHAND'
|
||||
'INVTYPE_WEAPON'
|
||||
|
||||
+10
-14
@@ -8,20 +8,16 @@ hooked_setter = nil
|
||||
game_tooltip_money = nil
|
||||
|
||||
function LOAD()
|
||||
for func, hook in game_tooltip_hooks do
|
||||
local func, hook = func, hook
|
||||
_m.hook(
|
||||
func,
|
||||
function(...)
|
||||
hooked_setter = true
|
||||
game_tooltip_money = 0
|
||||
local results = {orig[GameTooltip][func](unpack(arg)) }
|
||||
hooked_setter = false
|
||||
hook(unpack(arg))
|
||||
return unpack(results)
|
||||
end,
|
||||
GameTooltip
|
||||
)
|
||||
for name, f in game_tooltip_hooks do
|
||||
local name, f = name, f
|
||||
_m.hook(name, GameTooltip, function(...) temp(arg)
|
||||
hooked_setter = true
|
||||
game_tooltip_money = 0
|
||||
local ret = {orig[GameTooltip][name](unpack(arg))}
|
||||
hooked_setter = false
|
||||
f(unpack(arg))
|
||||
return unpack(ret)
|
||||
end)
|
||||
end
|
||||
local orig = SetItemRef
|
||||
setglobal('SetItemRef', function(...)
|
||||
|
||||
Reference in New Issue
Block a user