diff --git a/info.lua b/info.lua
index ec99480..e64ab97 100644
--- a/info.lua
+++ b/info.lua
@@ -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()
diff --git a/info.xml b/info.xml
index b4c5ed4..3f6382f 100644
--- a/info.xml
+++ b/info.xml
@@ -8,6 +8,9 @@
Aux.info.reanchor_tooltip()
+
+ this.money = arg1
+
\ No newline at end of file
diff --git a/scan_util.lua b/scan_util.lua
index 85bdea5..2cb6a50 100644
--- a/scan_util.lua
+++ b/scan_util.lua
@@ -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
diff --git a/tooltip.lua b/tooltip.lua
index 31f0f3a..d48179b 100644
--- a/tooltip.lua
+++ b/tooltip.lua
@@ -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
diff --git a/util.lua b/util.lua
index c3dd686..f843534 100644
--- a/util.lua
+++ b/util.lua
@@ -57,6 +57,16 @@ function Aux.util.inventory_iterator()
end
end
+function public.loop_inventory(f)
+ for bag = 0, 4 do
+ if GetBagName(bag) then
+ for slot = 1, GetContainerNumSlots(bag) do
+ f(bag, slot)
+ end
+ end
+ end
+end
+
function public.safe_index(...)
local target = arg[1]