mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-26 14:00:48 +00:00
actionbar: update reagent count on bag update
This commit is contained in:
@@ -49,6 +49,12 @@ pfUI:RegisterModule("actionbar", function ()
|
|||||||
local reagentscan = CreateFrame("GameTooltip", "pfReagentScanner", UIParent, "GameTooltipTemplate")
|
local reagentscan = CreateFrame("GameTooltip", "pfReagentScanner", UIParent, "GameTooltipTemplate")
|
||||||
reagentscan:SetOwner(UIParent, "ANCHOR_NONE")
|
reagentscan:SetOwner(UIParent, "ANCHOR_NONE")
|
||||||
|
|
||||||
|
hooksecurefunc("ActionButton_OnEvent", function()
|
||||||
|
if event == "BAG_UPDATE" and arg1 < 5 then
|
||||||
|
ActionButton_Update()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
local oldIsConsumableAction = IsConsumableAction
|
local oldIsConsumableAction = IsConsumableAction
|
||||||
_G.IsConsumableAction = function(slot)
|
_G.IsConsumableAction = function(slot)
|
||||||
if oldIsConsumableAction(slot) then return true end
|
if oldIsConsumableAction(slot) then return true end
|
||||||
@@ -63,12 +69,14 @@ pfUI:RegisterModule("actionbar", function ()
|
|||||||
local _, start = strfind(line,SPELL_REAGENTS,1)
|
local _, start = strfind(line,SPELL_REAGENTS,1)
|
||||||
if start then
|
if start then
|
||||||
reagentslots[slot] = strsub(line,start+1)
|
reagentslots[slot] = strsub(line,start+1)
|
||||||
|
this:RegisterEvent("BAG_UPDATE")
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
this:UnregisterEvent("BAG_UPDATE")
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user