mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-24 04:50:49 +00:00
thirdparty: adapt supermacro to new actionbars
This commit is contained in:
+11
-17
@@ -1149,25 +1149,23 @@ pfUI:RegisterModule("thirdparty", "vanilla", function ()
|
|||||||
if C.thirdparty.supermacro.enable == "0" then return end
|
if C.thirdparty.supermacro.enable == "0" then return end
|
||||||
if not pfUI.bars then return end
|
if not pfUI.bars then return end
|
||||||
|
|
||||||
-- refresh super macro texture
|
-- hook events to include SuperMacro refreshs
|
||||||
local function SMRefresh()
|
local ButtonFullUpdate = pfUI.bars.ButtonFullUpdate
|
||||||
local slot = this:GetID()
|
pfUI.bars.ButtonFullUpdate = function(button)
|
||||||
local text = GetActionText(slot)
|
-- run the old function
|
||||||
|
ButtonFullUpdate(button)
|
||||||
|
|
||||||
|
-- update with SuperMacro textures
|
||||||
|
if not button then return end
|
||||||
|
local text = GetActionText(button:GetID())
|
||||||
|
|
||||||
if text then
|
if text then
|
||||||
if _G.SM_ACTION_SPELL and _G.SM_ACTION_SPELL["regular"] and _G.SM_ACTION_SPELL["regular"][text] then
|
if _G.SM_ACTION_SPELL and _G.SM_ACTION_SPELL["regular"] and _G.SM_ACTION_SPELL["regular"][text] then
|
||||||
this.icon:SetTexture(_G.SM_ACTION_SPELL["regular"][text].texture)
|
button.icon:SetTexture(_G.SM_ACTION_SPELL["regular"][text].texture)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- hook events to include SuperMacro refreshs
|
|
||||||
local ButtonEvent = pfUI.bars[1][1]:GetScript("OnEvent")
|
|
||||||
local function NewButtonEvent()
|
|
||||||
ButtonEvent()
|
|
||||||
SMRefresh()
|
|
||||||
end
|
|
||||||
|
|
||||||
-- hook events to include SuperMacro refreshs
|
-- hook events to include SuperMacro refreshs
|
||||||
local ButtonEnter = pfUI.bars[1][1]:GetScript("OnEnter")
|
local ButtonEnter = pfUI.bars[1][1]:GetScript("OnEnter")
|
||||||
local function NewButtonEnter()
|
local function NewButtonEnter()
|
||||||
@@ -1185,11 +1183,7 @@ pfUI:RegisterModule("thirdparty", "vanilla", function ()
|
|||||||
|
|
||||||
-- trigger the event whenever SuperMacro got an update
|
-- trigger the event whenever SuperMacro got an update
|
||||||
hooksecurefunc("SM_UpdateActionSpell", function()
|
hooksecurefunc("SM_UpdateActionSpell", function()
|
||||||
for i=1,10 do
|
for slot=1,120 do pfUI.bars.update[slot] = true end
|
||||||
for j=1,12 do
|
|
||||||
pfUI.bars[i][j].forceupdate = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user