beginnings of vendor price functionality
This commit is contained in:
@@ -262,10 +262,11 @@ function public.tooltip(setter)
|
||||
end
|
||||
|
||||
AuxInfoTooltip:SetOwner(UIParent, 'ANCHOR_NONE')
|
||||
AuxInfoTooltip.money = 0
|
||||
setter(AuxInfoTooltip)
|
||||
AuxInfoTooltip:Show()
|
||||
|
||||
local tooltip = {}
|
||||
local tooltip = { money=AuxInfoTooltip.money }
|
||||
for i = 1, TOOLTIP_LENGTH do
|
||||
|
||||
local left_text = getglobal('AuxInfoTooltipTextLeft'..i):GetText()
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
<OnUpdate>
|
||||
Aux.info.reanchor_tooltip()
|
||||
</OnUpdate>
|
||||
<OnTooltipAddMoney>
|
||||
this.money = arg1
|
||||
</OnTooltipAddMoney>
|
||||
</Scripts>
|
||||
</GameTooltip>
|
||||
</Ui>
|
||||
@@ -562,7 +562,6 @@ function m.suggestions(blizzard_filter, num_parts)
|
||||
local suggestions = {}
|
||||
|
||||
if blizzard_filter.name
|
||||
and Aux.static.item_id(strupper(blizzard_filter.name))
|
||||
and not blizzard_filter.min_level
|
||||
and not blizzard_filter.max_level
|
||||
and not blizzard_filter.class
|
||||
|
||||
+17
-1
@@ -2,6 +2,8 @@ local private, public = {}, {}
|
||||
Aux.tooltip = public
|
||||
|
||||
local game_tooltip_hooks = {}
|
||||
local hooked_setter
|
||||
local game_tooltip_money
|
||||
|
||||
function public.on_load()
|
||||
for func, hook in game_tooltip_hooks do
|
||||
@@ -9,7 +11,10 @@ function public.on_load()
|
||||
Aux.hook(
|
||||
func,
|
||||
function(...)
|
||||
local results = {Aux.orig[GameTooltip][func](unpack(arg))}
|
||||
hooked_setter = true
|
||||
game_tooltip_money = 0
|
||||
local results = {Aux.orig[GameTooltip][func](unpack(arg)) }
|
||||
hooked_setter = false
|
||||
hook(unpack(arg))
|
||||
return unpack(results)
|
||||
end,
|
||||
@@ -27,6 +32,14 @@ function public.on_load()
|
||||
end
|
||||
return result
|
||||
end
|
||||
local orig = GameTooltip:GetScript('OnTooltipAddMoney')
|
||||
GameTooltip:SetScript('OnTooltipAddMoney', function(...)
|
||||
if hooked_setter then
|
||||
game_tooltip_money = arg1
|
||||
else
|
||||
return orig(unpack(arg))
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function private.extend_tooltip(tooltip, hyperlink, quantity)
|
||||
@@ -98,6 +111,9 @@ function private.extend_tooltip(tooltip, hyperlink, quantity)
|
||||
end
|
||||
end
|
||||
|
||||
if tooltip == GameTooltip and game_tooltip_money > 0 then
|
||||
SetTooltipMoney(tooltip, game_tooltip_money)
|
||||
end
|
||||
tooltip:Show()
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user