mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-11 16:10:01 +00:00
actionbar: entire rewrite of the actionbars
Final squashed commit of the actionbars. Ready for master. Config migration is now armed, you can't go back without backups.
This commit is contained in:
+1028
-642
File diff suppressed because it is too large
Load Diff
+14
-12
@@ -671,30 +671,32 @@ pfUI:RegisterModule("chat", function ()
|
||||
end
|
||||
end
|
||||
|
||||
-- to make sure SHOW_MULTI_ACTIONBAR_1 is set to the real value, we need to wait.
|
||||
-- to make sure the bars are set up properly, we need to wait.
|
||||
local pfChatArrangeFrame = CreateFrame("Frame", "pfChatArrange", UIParent)
|
||||
pfChatArrangeFrame:RegisterEvent("CVAR_UPDATE")
|
||||
pfChatArrangeFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
pfChatArrangeFrame:SetScript("OnEvent", function()
|
||||
pfUI.chat.editbox:ClearAllPoints()
|
||||
|
||||
local anchor = pfUI.chat.left
|
||||
if pfUI.bars and SHOW_MULTI_ACTIONBAR_1 then
|
||||
anchor = pfUI.bars.bottomleft
|
||||
elseif pfUI.bars and pfUI.bars.actionmain:IsShown() then
|
||||
anchor = pfUI.bars.actionmain
|
||||
if pfUI.bars and pfUI.bars[6]:IsShown() then
|
||||
anchor = pfUI.bars[6]
|
||||
elseif pfUI.bars and pfUI.bars[1]:IsShown() then
|
||||
anchor = pfUI.bars[1]
|
||||
end
|
||||
|
||||
pfUI.chat.editbox:SetPoint("BOTTOMLEFT", anchor, "TOPLEFT", 0, default_border*3)
|
||||
pfUI.chat.editbox:SetPoint("BOTTOMRIGHT", anchor, "TOPRIGHT", 0, default_border*3)
|
||||
if C.chat.text.input_width ~= "0" then
|
||||
pfUI.chat.editbox:SetPoint("BOTTOM", anchor, "TOP", 0, default_border*3)
|
||||
pfUI.chat.editbox:SetWidth(C.chat.text.input_width)
|
||||
else
|
||||
pfUI.chat.editbox:SetWidth(anchor:GetWidth())
|
||||
pfUI.chat.editbox:SetPoint("BOTTOMLEFT", anchor, "TOPLEFT", 0, default_border*3)
|
||||
pfUI.chat.editbox:SetPoint("BOTTOMRIGHT", anchor, "TOPRIGHT", 0, default_border*3)
|
||||
end
|
||||
|
||||
UpdateMovable(pfUI.chat.editbox)
|
||||
end)
|
||||
|
||||
if C.chat.text.input_width == "0" then
|
||||
pfUI.chat.editbox:SetWidth(default_border*3 + C.bars.icon_size * 12 + default_border * 12) -- actionbar size
|
||||
else
|
||||
pfUI.chat.editbox:SetWidth(C.chat.text.input_width)
|
||||
end
|
||||
|
||||
ChatFrameEditBox:SetParent(pfUI.chat.editbox)
|
||||
ChatFrameEditBox:SetAllPoints(pfUI.chat.editbox)
|
||||
|
||||
+90
-45
@@ -87,6 +87,20 @@ pfUI:RegisterModule("gui", function ()
|
||||
end
|
||||
end
|
||||
|
||||
if category == "UVAR" then
|
||||
category = {}
|
||||
category[config] = _G[config]
|
||||
|
||||
local update = ufunc
|
||||
|
||||
ufunc = function()
|
||||
_G[config] = this:GetChecked() and "1" or "0"
|
||||
if update then
|
||||
update()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
frame.category = category
|
||||
frame.config = config
|
||||
|
||||
@@ -717,9 +731,17 @@ pfUI:RegisterModule("gui", function ()
|
||||
"BOTTOMRIGHT:" .. T["Bottom Right"],
|
||||
}
|
||||
|
||||
pfUI.gui.dropdowns.num_actionbar_buttons = BarLayoutOptions(NUM_ACTIONBAR_BUTTONS)
|
||||
pfUI.gui.dropdowns.num_shapeshift_slots = BarLayoutOptions(NUM_SHAPESHIFT_SLOTS)
|
||||
pfUI.gui.dropdowns.num_pet_action_slots = BarLayoutOptions(NUM_PET_ACTION_SLOTS)
|
||||
pfUI.gui.dropdowns.actionbuttonanimations = {
|
||||
"none:" .. T["None"],
|
||||
"zoomfade:" .. T["Zoom & Fade"],
|
||||
"shrinkreturn:" .. T["Shrink & Return"],
|
||||
"elasticzoom:" .. T["Elastic Zoom"],
|
||||
"wobblezoom:" .. T["Wobble Zoom"],
|
||||
}
|
||||
|
||||
pfUI.gui.dropdowns.actionbarbuttons = {
|
||||
"1","2","3","4","5","6","7","8","9","10","11","12"
|
||||
}
|
||||
|
||||
pfUI.gui.dropdowns.loot_rarity = {}
|
||||
for i=0, getn(_G.ITEM_QUALITY_COLORS)-2 do
|
||||
@@ -1236,59 +1258,80 @@ pfUI:RegisterModule("gui", function ()
|
||||
pfUI.gui.tabs.actionbar = pfUI.gui.tabs:CreateTabChild(T["Actionbar"], nil, nil, nil, true)
|
||||
pfUI.gui.tabs.actionbar.tabs = CreateTabFrame(pfUI.gui.tabs.actionbar, "TOP", true)
|
||||
|
||||
local barnames = { {11, "Stance/Shapeshift Bar"}, {12, "Pet Actionbar"}, {1, "Main Actionbar"},
|
||||
{6, "Top Actionbar"}, {5, "Left Actionbar"}, {3, "Right Actionbar"}, {4, "Vertical Actionbar"},
|
||||
{2, "Paging Actionbar"}, {7, "Special Actionbar"}, {8, "Stance Bar 1"}, {9, "Stance Bar 2"}, {10, "Stance Bar 3"} }
|
||||
|
||||
-- >> General
|
||||
pfUI.gui.tabs.actionbar.tabs.general = pfUI.gui.tabs.actionbar.tabs:CreateTabChild(T["General"], true)
|
||||
pfUI.gui.tabs.actionbar.tabs.general:SetScript("OnShow", function()
|
||||
if not this.setup then
|
||||
CreateConfig(nil, this, T["Icon Size"], C.bars, "icon_size")
|
||||
CreateConfig(nil, this, T["Enable Action Bar Backgrounds"], C.bars, "background", "checkbox")
|
||||
CreateConfig(MultiActionBar_UpdateGridVisibility, this, T["Always Show Action Bar Buttons"], "GVAR", "ALWAYS_SHOW_MULTIBARS", "checkbox")
|
||||
CreateConfig(nil, this, T["Enable Range Display On Hotkeys"], C.bars, "glowrange", "checkbox")
|
||||
CreateConfig(nil, this, T["Range Display Color"], C.bars, "rangecolor", "color")
|
||||
CreateConfig(nil, this, T["Show Macro Text"], C.bars, "showmacro", "checkbox")
|
||||
CreateConfig(nil, this, T["Show Hotkey Text"], C.bars, "showkeybind", "checkbox")
|
||||
CreateConfig(nil, this, T["Show Equipped Items"], C.bars, "showequipped", "checkbox")
|
||||
CreateConfig(nil, this, T["Enable Range Based Auto Paging (Hunter)"], C.bars, "hunterbar", "checkbox")
|
||||
CreateConfig(nil, this, T["Enable Action On Key Down"], C.bars, "keydown", "checkbox")
|
||||
CreateConfig(nil, this, T["Switch Bar On Meta Key Press"], C.bars, "pagemaster", "checkbox")
|
||||
CreateConfig(nil, this, T["Show Indicator For Castable Pet Actions"], C.bars, "showcastable", "checkbox")
|
||||
CreateConfig(update["bars"], this, T["Trigger Actions On Key Down"], C.bars, "keydown", "checkbox")
|
||||
CreateConfig(update["bars"], this, T["Alt Self Cast For All Hotkeys"], C.bars, "altself", "checkbox")
|
||||
CreateConfig(update["bars"], this, T["Button Animation"], C.bars, "animation", "dropdown", pfUI.gui.dropdowns.actionbuttonanimations)
|
||||
CreateConfig(update["bars"], this, T["Highlight Equipped Items"], C.bars, "showequipped", "checkbox")
|
||||
CreateConfig(update["bars"], this, T["Equipped Item Color"], C.bars, "eqcolor", "color")
|
||||
CreateConfig(update["bars"], this, T["Highlight Out Of Range Spells"], C.bars, "glowrange", "checkbox")
|
||||
CreateConfig(update["bars"], this, T["Out Of Range Color"], C.bars, "rangecolor", "color")
|
||||
CreateConfig(update["bars"], this, T["Highlight Out Of Mana Spells"], C.bars, "showoom", "checkbox")
|
||||
CreateConfig(update["bars"], this, T["Out Of Mana Color"], C.bars, "oomcolor", "color")
|
||||
CreateConfig(update["bars"], this, T["Highlight Not Usable Spells"], C.bars, "showna", "checkbox")
|
||||
CreateConfig(update["bars"], this, T["Not Usable Color"], C.bars, "nacolor", "color")
|
||||
CreateConfig(update["bars"], this, T["Lock Actionbars"], "UVAR", "LOCK_ACTIONBAR", "checkbox")
|
||||
|
||||
CreateConfig(nil, this, "Font Options", nil, nil, "header")
|
||||
CreateConfig(update["bars"], this, T["Font"], C.bars, "font", "dropdown", pfUI.gui.dropdowns.fonts)
|
||||
CreateConfig(update["bars"], this, T["Font Padding"], C.bars, "font_offset")
|
||||
CreateConfig(update["bars"], this, T["Macro Text Size"], C.bars, "macro_size")
|
||||
CreateConfig(update["bars"], this, T["Macro Text Color"], C.bars, "macro_color", "color")
|
||||
CreateConfig(update["bars"], this, T["Item Count Text Size"], C.bars, "count_size")
|
||||
CreateConfig(update["bars"], this, T["Item Count Text Color"], C.bars, "count_color", "color")
|
||||
CreateConfig(update["bars"], this, T["Keybind Text Size"], C.bars, "bind_size")
|
||||
CreateConfig(update["bars"], this, T["Keybind Text Color"], C.bars, "bind_color", "color")
|
||||
|
||||
CreateConfig(nil, this, "Auto Paging", nil, nil, "header")
|
||||
CreateConfig(nil, this, T["Switch Pages On Meta Key Press"], C.bars, "pagemaster", "checkbox")
|
||||
CreateConfig(nil, this, T["Range Based Hunter Paging"], C.bars, "hunterbar", "checkbox")
|
||||
this.setup = true
|
||||
end
|
||||
end)
|
||||
|
||||
-- >> Layout
|
||||
pfUI.gui.tabs.actionbar.tabs.layout = pfUI.gui.tabs.actionbar.tabs:CreateTabChild(T["Layout"], true)
|
||||
pfUI.gui.tabs.actionbar.tabs.layout:SetScript("OnShow", function()
|
||||
pfUI.gui.tabs.actionbar.tabs.bars = pfUI.gui.tabs.actionbar.tabs:CreateTabChild("Bars", true)
|
||||
pfUI.gui.tabs.actionbar.tabs.bars:SetScript("OnShow", function()
|
||||
if not this.setup then
|
||||
CreateConfig(UIParent_ManageFramePositions, this, T["Enable Second Actionbar (BottomLeft)"], "GVAR", "SHOW_MULTI_ACTIONBAR_1", "checkbox")
|
||||
CreateConfig(UIParent_ManageFramePositions, this, T["Enable Left Actionbar (BottomRight)"], "GVAR", "SHOW_MULTI_ACTIONBAR_2", "checkbox")
|
||||
CreateConfig(UIParent_ManageFramePositions, this, T["Enable Right Actionbar (Right)"], "GVAR", "SHOW_MULTI_ACTIONBAR_3", "checkbox")
|
||||
CreateConfig(UIParent_ManageFramePositions, this, T["Enable Vertical Actionbar (TwoRight)"], "GVAR", "SHOW_MULTI_ACTIONBAR_4", "checkbox")
|
||||
for _, data in pairs(barnames) do
|
||||
local id, caption = data[1], data[2]
|
||||
local formfactors = BarLayoutOptions(id < 11 and NUM_ACTIONBAR_BUTTONS or id > 11 and NUM_SHAPESHIFT_SLOTS or NUM_PET_ACTION_SLOTS)
|
||||
CreateConfig(update[c], this, caption, nil, nil, "header")
|
||||
CreateConfig(update["bars"], this, T["Enable"], C.bars["bar"..id], "enable", "checkbox")
|
||||
|
||||
CreateConfig(update[c], this, T["Form Factor"], nil, nil, "header")
|
||||
CreateConfig(nil, this, T["Main Actionbar (ActionMain)"], C.bars.actionmain, "formfactor", "dropdown", pfUI.gui.dropdowns.num_actionbar_buttons)
|
||||
CreateConfig(nil, this, T["Second Actionbar (BottomLeft)"], C.bars.bottomleft, "formfactor", "dropdown", pfUI.gui.dropdowns.num_actionbar_buttons)
|
||||
CreateConfig(nil, this, T["Left Actionbar (BottomRight)"], C.bars.bottomright, "formfactor", "dropdown", pfUI.gui.dropdowns.num_actionbar_buttons)
|
||||
CreateConfig(nil, this, T["Right Actionbar (Right)"], C.bars.right, "formfactor", "dropdown", pfUI.gui.dropdowns.num_actionbar_buttons)
|
||||
CreateConfig(nil, this, T["Vertical Actionbar (TwoRight)"], C.bars.tworight, "formfactor", "dropdown", pfUI.gui.dropdowns.num_actionbar_buttons)
|
||||
CreateConfig(nil, this, T["Shapeshift Bar (BarShapeShift)"], C.bars.shapeshift, "formfactor", "dropdown", pfUI.gui.dropdowns.num_shapeshift_slots)
|
||||
CreateConfig(nil, this, T["Pet Bar (BarPet)"], C.bars.pet, "formfactor", "dropdown", pfUI.gui.dropdowns.num_pet_action_slots)
|
||||
this.setup = true
|
||||
end
|
||||
end)
|
||||
if id ~= 11 and id ~= 12 then
|
||||
CreateConfig(update["bars"], this, T["Buttons"], C.bars["bar"..id], "buttons", "dropdown", pfUI.gui.dropdowns.actionbarbuttons)
|
||||
|
||||
-- >> Autohide
|
||||
pfUI.gui.tabs.actionbar.tabs.autohide = pfUI.gui.tabs.actionbar.tabs:CreateTabChild(T["Autohide"], true)
|
||||
pfUI.gui.tabs.actionbar.tabs.autohide:SetScript("OnShow", function()
|
||||
if not this.setup then
|
||||
CreateConfig(nil, this, T["Seconds Until Action Bars Autohide"], C.bars, "hide_time")
|
||||
CreateConfig(nil, this, T["Enable Autohide For BarActionMain"], C.bars, "hide_actionmain", "checkbox")
|
||||
CreateConfig(nil, this, T["Enable Autohide For BarBottomLeft"], C.bars, "hide_bottomleft", "checkbox")
|
||||
CreateConfig(nil, this, T["Enable Autohide For BarBottomRight"], C.bars, "hide_bottomright", "checkbox")
|
||||
CreateConfig(nil, this, T["Enable Autohide For BarRight"], C.bars, "hide_right", "checkbox")
|
||||
CreateConfig(nil, this, T["Enable Autohide For BarTwoRight"], C.bars, "hide_tworight", "checkbox")
|
||||
CreateConfig(nil, this, T["Enable Autohide For BarShapeShift"], C.bars, "hide_shapeshift", "checkbox")
|
||||
CreateConfig(nil, this, T["Enable Autohide For BarPet"], C.bars, "hide_pet", "checkbox")
|
||||
if id ~= 1 then
|
||||
CreateConfig(update["bars"], this, T["Pageable"], C.bars["bar"..id], "pageable", "checkbox")
|
||||
end
|
||||
end
|
||||
|
||||
if id == 12 then
|
||||
CreateConfig(update["bars"], this, T["Auto-Castable Action Indicator"], C.bars, "showcastable", "checkbox")
|
||||
end
|
||||
|
||||
CreateConfig(update["bars"], this, T["Icon Size"], C.bars["bar"..id], "icon_size")
|
||||
CreateConfig(update["bars"], this, T["Layout"], C.bars["bar"..id], "formfactor", "dropdown", formfactors)
|
||||
CreateConfig(update["bars"], this, T["Bar Background"], C.bars["bar"..id], "background", "checkbox")
|
||||
CreateConfig(update["bars"], this, T["Show Hotkey Text"], C.bars["bar"..id], "showkeybind", "checkbox")
|
||||
|
||||
if id ~= 11 and id ~= 12 then
|
||||
CreateConfig(update["bars"], this, T["Show Macro Text"], C.bars["bar"..id], "showmacro", "checkbox")
|
||||
CreateConfig(update["bars"], this, T["Show Item Count Text"], C.bars["bar"..id], "showcount", "checkbox")
|
||||
elseif id ~= 11 then
|
||||
CreateConfig(update["bars"], this, T["Show Empty Buttons"], C.bars["bar"..id], "showempty", "checkbox")
|
||||
end
|
||||
|
||||
CreateConfig(update["bars"], this, T["Enable Autohide"], C.bars["bar"..id], "autohide", "checkbox")
|
||||
CreateConfig(update["bars"], this, T["Autohide Timeout"], C.bars["bar"..id], "hide_time")
|
||||
end
|
||||
this.setup = true
|
||||
end
|
||||
end)
|
||||
@@ -1477,6 +1520,8 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(nil, this, "SortBags", C.thirdparty.sortbags, "enable", "checkbox")
|
||||
CreateConfig(nil, this, "MrPlow", C.thirdparty.mrplow, "enable", "checkbox")
|
||||
CreateConfig(nil, this, "FlightMap", C.thirdparty.flightmap, "enable", "checkbox")
|
||||
CreateConfig(nil, this, "TheoryCraft", C.thirdparty.theorycraft, "enable", "checkbox")
|
||||
CreateConfig(nil, this, "SuperMacro", C.thirdparty.supermacro, "enable", "checkbox")
|
||||
CreateConfig(nil, this, "AtlasLoot", C.thirdparty.atlasloot, "enable", "checkbox")
|
||||
CreateConfig(nil, this, "MyRolePlay", C.thirdparty.myroleplay, "enable", "checkbox")
|
||||
CreateConfig(nil, this, "DruidManaBar", C.thirdparty.druidmana, "enable", "checkbox")
|
||||
|
||||
+22
-9
@@ -1,14 +1,23 @@
|
||||
pfUI:RegisterModule("hoverbind", function ()
|
||||
local default_border = C.appearance.border.default
|
||||
local keymap = {
|
||||
["BonusActionButton"] = "ACTIONBUTTON",
|
||||
["MultiBarBottomLeftButton"] = "MULTIACTIONBAR1BUTTON",
|
||||
["MultiBarBottomRightButton"] = "MULTIACTIONBAR2BUTTON",
|
||||
["MultiBarRightButton"] = "MULTIACTIONBAR3BUTTON",
|
||||
["MultiBarLeftButton"] = "MULTIACTIONBAR4BUTTON",
|
||||
["ShapeshiftButton"] = "SHAPESHIFTBUTTON",
|
||||
["PetActionButton"] = "BONUSACTIONBUTTON",
|
||||
-- buttons to binding association
|
||||
["pfActionBarMainButton"] = "ACTIONBUTTON",
|
||||
["pfActionBarTopButton"] = "MULTIACTIONBAR1BUTTON",
|
||||
["pfActionBarLeftButton"] = "MULTIACTIONBAR2BUTTON",
|
||||
["pfActionBarRightButton"] = "MULTIACTIONBAR3BUTTON",
|
||||
["pfActionBarVerticalButton"] = "MULTIACTIONBAR4BUTTON",
|
||||
["pfActionBarStancesButton"] = "SHAPESHIFTBUTTON",
|
||||
["pfActionBarPetButton"] = "BONUSACTIONBUTTON",
|
||||
|
||||
-- special buttons
|
||||
["pfActionBarPagingButton"] = "PFPAGING",
|
||||
["pfActionBarSpecialButton"] = "PFSPECIAL",
|
||||
["pfActionBarStancePaging1Button"] = "PFSTANCEONE",
|
||||
["pfActionBarStancePaging2Button"] = "PFSTANCETWO",
|
||||
["pfActionBarStancePaging3Button"] = "PFSTANCETHREE",
|
||||
}
|
||||
|
||||
local modifiers = {
|
||||
["ALT"] = "ALT-",
|
||||
["CTRL"] = "CTRL-",
|
||||
@@ -54,7 +63,9 @@ pfUI:RegisterModule("hoverbind", function ()
|
||||
local hovername = (frame and frame.GetName) and (frame:GetName()) or ""
|
||||
local binding = pfUI.hoverbind:GetBinding(hovername)
|
||||
if arg1 == "ESCAPE" and not binding then pfUI.hoverbind:Hide() return end
|
||||
if (binding) then
|
||||
if binding == "NOBIND" then
|
||||
UIErrorsFrame:AddMessage(T["Keybinding failed due to client restrictions."], 1, .2, .2)
|
||||
elseif binding then
|
||||
if arg1 == "ESCAPE" then
|
||||
local key = (GetBindingKey(binding))
|
||||
if (key) then
|
||||
@@ -77,7 +88,9 @@ pfUI:RegisterModule("hoverbind", function ()
|
||||
function pfUI.hoverbind:GetBinding(button_name)
|
||||
local found,_,buttontype,buttonindex = string.find(button_name,"^(%a+)(%d+)$")
|
||||
if found then
|
||||
if keymap[buttontype] then
|
||||
if keymap[buttontype] and keymap[buttontype] == "NOBIND" then
|
||||
return "NOBIND"
|
||||
elseif keymap[buttontype] then
|
||||
return string.format("%s%d",keymap[buttontype],buttonindex)
|
||||
elseif buttontype == "ActionButton" then
|
||||
return string.format("ACTIONBUTTON%d",buttonindex)
|
||||
|
||||
+4
-4
@@ -715,16 +715,16 @@ pfUI:RegisterModule("panel", function()
|
||||
pfUI.panel.autohide:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
pfUI.panel.autohide:SetScript("OnEvent", function()
|
||||
if C.panel.hide_leftchat == "1" then
|
||||
CreateAutohide(pfUI.panel.left)
|
||||
EnableAutohide(pfUI.panel.left, 2)
|
||||
end
|
||||
if C.panel.hide_rightchat == "1" then
|
||||
CreateAutohide(pfUI.panel.right)
|
||||
EnableAutohide(pfUI.panel.right, 2)
|
||||
end
|
||||
if C.panel.hide_minimap == "1" then
|
||||
CreateAutohide(pfUI.panel.minimap)
|
||||
EnableAutohide(pfUI.panel.minimap, 2)
|
||||
end
|
||||
if C.panel.hide_microbar == "1" then
|
||||
CreateAutohide(pfUI.panel.microbutton)
|
||||
EnableAutohide(pfUI.panel.microbutton, 2)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
@@ -666,6 +666,72 @@ pfUI:RegisterModule("thirdparty", function ()
|
||||
FlightMapTimesText:SetFont(pfUI.font_default, 12, "OUTLINE")
|
||||
end)
|
||||
|
||||
HookAddonOrVariable("TheoryCraft_SetUpButton", function()
|
||||
if C.thirdparty.theorycraft.enable == "0" then return end
|
||||
|
||||
-- set pfUI bar font
|
||||
if TheoryCraft_Settings then
|
||||
TheoryCraft_Settings["FontPath"] = C.bars.font
|
||||
end
|
||||
|
||||
if not pfUI.bars then return end
|
||||
|
||||
-- make theorycraft aware of pfUI bars
|
||||
for i=1,10 do
|
||||
for j=1,10 do
|
||||
TheoryCraft_SetUpButton(pfUI.bars[i][j]:GetName(), "Normal")
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
HookAddonOrVariable("SM_GetActionSpell", function()
|
||||
if C.thirdparty.supermacro.enable == "0" then return end
|
||||
if not pfUI.bars then return end
|
||||
|
||||
-- refresh super macro texture
|
||||
local function SMRefresh()
|
||||
local slot = this:GetID()
|
||||
local text = GetActionText(slot)
|
||||
|
||||
if 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)
|
||||
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
|
||||
local ButtonEnter = pfUI.bars[1][1]:GetScript("OnEnter")
|
||||
local function NewButtonEnter()
|
||||
ButtonEnter()
|
||||
SM_ActionButton_SetTooltip()
|
||||
end
|
||||
|
||||
-- reassign the new event handler
|
||||
for i=1,10 do
|
||||
for j=1,12 do
|
||||
pfUI.bars[i][j]:SetScript("OnEvent", NewButtonEvent)
|
||||
pfUI.bars[i][j]:SetScript("OnEnter", NewButtonEnter)
|
||||
end
|
||||
end
|
||||
|
||||
-- trigger the event whenever SuperMacro got an update
|
||||
hooksecurefunc("SM_UpdateActionSpell", function()
|
||||
for i=1,10 do
|
||||
for j=1,12 do
|
||||
pfUI.bars[i][j].forceupdate = true
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
HookAddonOrVariable("AtlasLoot", function()
|
||||
if C.thirdparty.atlasloot.enable == "0" then return end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user