diff --git a/api/config.lua b/api/config.lua index c335fad2..09bd22b5 100644 --- a/api/config.lua +++ b/api/config.lua @@ -628,6 +628,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("bars", nil, "pagemastershift", "0") pfUI:UpdateConfig("bars", nil, "pagemasterctrl", "0") pfUI:UpdateConfig("bars", nil, "druidstealth", "0") + pfUI:UpdateConfig("bars", nil, "priestshadow", "0") pfUI:UpdateConfig("bars", nil, "showcastable", "1") pfUI:UpdateConfig("bars", nil, "glowrange", "1") pfUI:UpdateConfig("bars", nil, "rangecolor", "1,0.1,0.1,1") diff --git a/env/translations_enUS.lua b/env/translations_enUS.lua index aaa565f7..4e5e0841 100644 --- a/env/translations_enUS.lua +++ b/env/translations_enUS.lua @@ -788,6 +788,7 @@ pfUI_translation["enUS"] = { ["Switch Pages On Alt Key Press"] = nil, ["Switch Pages On Ctrl Key Press"] = nil, ["Switch Pages On Druid Stealth"] = nil, + ["Switch Pages On Priest Shadowform"] = nil, ["Switch Pages On Shift Key Press"] = nil, ["Systeminfo"] = nil, ["Target"] = nil, diff --git a/modules/actionbar.lua b/modules/actionbar.lua index 10af21fc..950af601 100644 --- a/modules/actionbar.lua +++ b/modules/actionbar.lua @@ -853,16 +853,20 @@ pfUI:RegisterModule("actionbar", function () end end - local cat, stealth local inCatForm = nil local prowlActive = nil - -- Cat Form ID per vanilla 1.12 SpellShapeshiftForm.dbc. + -- Form IDs per vanilla 1.12 SpellShapeshiftForm.dbc. local CAT_FORM = 1 + local SHADOWFORM = 28 local function HasCatForm() return GetShapeshiftFormID() == CAT_FORM and true or nil end + local function InShadowform() + return GetShapeshiftFormID() == SHADOWFORM and true or nil + end + local function FullScan() if class ~= "DRUID" then return nil end inCatForm = HasCatForm() @@ -872,7 +876,7 @@ pfUI:RegisterModule("actionbar", function () -- pagemaster / meta page switch do - local prowl, shift, ctrl, alt, default = 8, 6, 5, 3, 1 + local formpage, shift, ctrl, alt, default = 8, 6, 5, 3, 1 -- set temporary pagemaster bindings keybinds if C.bars.pagemaster == "1" then @@ -890,8 +894,10 @@ pfUI:RegisterModule("actionbar", function () end) end - -- setup page switch frame - local prowling = nil + -- setup page switch frame. `formpaging` is the shared "auto-page is + -- active" flag; druid prowl and priest shadowform each drive it, and + -- no character is ever both, so one flag covers both features. + local formpaging = nil local pageswitch = CreateFrame("Frame", "pfActionBarPageSwitch", UIParent) pageswitch:RegisterEvent("PLAYER_ENTERING_WORLD") pageswitch:RegisterEvent("UPDATE_SHAPESHIFT_FORM") @@ -905,10 +911,17 @@ pfUI:RegisterModule("actionbar", function () return end + if class == "PRIEST" then + if event == "UPDATE_SHAPESHIFT_FORM" or event == "PLAYER_ENTERING_WORLD" then + formpaging = InShadowform() + end + return + end + if class ~= "DRUID" then return end if event == "PLAYER_ENTERING_WORLD" then - prowling = FullScan() + formpaging = FullScan() return end @@ -917,7 +930,7 @@ pfUI:RegisterModule("actionbar", function () inCatForm = HasCatForm() if not inCatForm then prowlActive = nil - prowling = nil + formpaging = nil end return end @@ -927,10 +940,10 @@ pfUI:RegisterModule("actionbar", function () if inCatForm then if IsStealthed() then prowlActive = true - prowling = true + formpaging = true else prowlActive = nil - prowling = nil + formpaging = nil end end end) @@ -946,7 +959,7 @@ pfUI:RegisterModule("actionbar", function () if PROWL_IDS[spellId] then inCatForm = true prowlActive = true - prowling = true + formpaging = true end end pageswitch:SetScript("OnUpdate", function() @@ -964,11 +977,12 @@ pfUI:RegisterModule("actionbar", function () SwitchBar(default) end - -- switch actionbar page if druid stealth is detected - if C.bars.druidstealth == "1" then - if prowling and _G.CURRENT_ACTIONBAR_PAGE == 1 then - SwitchBar(prowl) - elseif not prowling and _G.CURRENT_ACTIONBAR_PAGE == 8 then + -- switch actionbar page while druid stealth / priest shadowform is active + if (class == "DRUID" and C.bars.druidstealth == "1") + or (class == "PRIEST" and C.bars.priestshadow == "1") then + if formpaging and _G.CURRENT_ACTIONBAR_PAGE == 1 then + SwitchBar(formpage) + elseif not formpaging and _G.CURRENT_ACTIONBAR_PAGE == 8 then SwitchBar(default) end end diff --git a/modules/gui.lua b/modules/gui.lua index 0b587cd9..98923e00 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -2575,6 +2575,7 @@ pfUI:RegisterModule("gui", function () CreateConfig(U["bars"], T["Switch Pages On Shift Key Press"], C.bars, "pagemastershift", "checkbox") CreateConfig(U["bars"], T["Switch Pages On Ctrl Key Press"], C.bars, "pagemasterctrl", "checkbox") CreateConfig(U["bars"], T["Switch Pages On Druid Stealth"], C.bars, "druidstealth", "checkbox") + CreateConfig(U["bars"], T["Switch Pages On Priest Shadowform"], C.bars, "priestshadow", "checkbox") CreateConfig(nil, T["Range Based Hunter Paging"], C.bars, "hunterbar", "checkbox", nil, nil, nil, nil) end)