diff --git a/api/config.lua b/api/config.lua index e8e67631..f53fa8a7 100644 --- a/api/config.lua +++ b/api/config.lua @@ -472,6 +472,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("bars", nil, "showequipped", "1") pfUI:UpdateConfig("bars", nil, "hunterbar", "0") pfUI:UpdateConfig("bars", nil, "keydown", "0") + pfUI:UpdateConfig("bars", nil, "pagemaster", "0") pfUI:UpdateConfig("bars", nil, "hide_time", "1") pfUI:UpdateConfig("bars", nil, "hide_actionmain", "0") pfUI:UpdateConfig("bars", nil, "hide_bottomleft", "0") diff --git a/modules/actionbar.lua b/modules/actionbar.lua index 8c351aad..be859559 100644 --- a/modules/actionbar.lua +++ b/modules/actionbar.lua @@ -54,6 +54,42 @@ pfUI:RegisterModule("actionbar", function () end, true) end + if C.bars.pagemaster == "1" then + local modifier = { "ALT", "SHIFT", "CTRL" } + local buttons = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "+", "=", "ยด" } + local shift, ctrl, alt, default = 6, 5, 3, 1 + local current = CURRENT_ACTIONBAR_PAGE + + local function SwitchBar(bar) + if CURRENT_ACTIONBAR_PAGE ~= bar then + CURRENT_ACTIONBAR_PAGE = bar + ChangeActionBarPage() + end + end + + local pagemaster = CreateFrame("Frame", "pfPageMaster", UIParent) + pagemaster:RegisterEvent("PLAYER_ENTERING_WORLD") + pagemaster:SetScript("OnEvent", function() + for _,mod in pairs(modifier) do + for _,but in pairs(buttons) do + SetBinding(mod.."-"..but) + end + end + end) + + pagemaster:SetScript("OnUpdate", function() + if IsShiftKeyDown() then + SwitchBar(shift) + elseif IsControlKeyDown() then + SwitchBar(ctrl) + elseif IsAltKeyDown() then + SwitchBar(alt) + else + SwitchBar(default) + end + end) + end + -- reagent counter local reagentslots = { } local reagentscan = CreateFrame("GameTooltip", "pfReagentScanner", UIParent, "GameTooltipTemplate") diff --git a/modules/gui.lua b/modules/gui.lua index af5d5ed4..83227177 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -953,6 +953,7 @@ pfUI:RegisterModule("gui", function () 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") this.setup = true end end)