mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-21 11:50:49 +00:00
Add priest shadowform auto-paging, sharing the druid-stealth flag
Mirror the druid-stealth page switch for priests: swap to the auto page (8) while in Shadowform, back to the default page when it drops. Driven by UPDATE_SHAPESHIFT_FORM (form ID 28), which fully covers shadowform on its own -- no prowl-style stealth substate to chase. Fold the new state into the existing prowl machinery instead of duplicating it: prowl/shadowform are mutually exclusive by class, so one shared `formpaging` flag and one page constant serve both, and the OnUpdate switch collapses to a single class-gated block.
This commit is contained in:
@@ -628,6 +628,7 @@ function pfUI:LoadConfig()
|
|||||||
pfUI:UpdateConfig("bars", nil, "pagemastershift", "0")
|
pfUI:UpdateConfig("bars", nil, "pagemastershift", "0")
|
||||||
pfUI:UpdateConfig("bars", nil, "pagemasterctrl", "0")
|
pfUI:UpdateConfig("bars", nil, "pagemasterctrl", "0")
|
||||||
pfUI:UpdateConfig("bars", nil, "druidstealth", "0")
|
pfUI:UpdateConfig("bars", nil, "druidstealth", "0")
|
||||||
|
pfUI:UpdateConfig("bars", nil, "priestshadow", "0")
|
||||||
pfUI:UpdateConfig("bars", nil, "showcastable", "1")
|
pfUI:UpdateConfig("bars", nil, "showcastable", "1")
|
||||||
pfUI:UpdateConfig("bars", nil, "glowrange", "1")
|
pfUI:UpdateConfig("bars", nil, "glowrange", "1")
|
||||||
pfUI:UpdateConfig("bars", nil, "rangecolor", "1,0.1,0.1,1")
|
pfUI:UpdateConfig("bars", nil, "rangecolor", "1,0.1,0.1,1")
|
||||||
|
|||||||
Vendored
+1
@@ -788,6 +788,7 @@ pfUI_translation["enUS"] = {
|
|||||||
["Switch Pages On Alt Key Press"] = nil,
|
["Switch Pages On Alt Key Press"] = nil,
|
||||||
["Switch Pages On Ctrl Key Press"] = nil,
|
["Switch Pages On Ctrl Key Press"] = nil,
|
||||||
["Switch Pages On Druid Stealth"] = nil,
|
["Switch Pages On Druid Stealth"] = nil,
|
||||||
|
["Switch Pages On Priest Shadowform"] = nil,
|
||||||
["Switch Pages On Shift Key Press"] = nil,
|
["Switch Pages On Shift Key Press"] = nil,
|
||||||
["Systeminfo"] = nil,
|
["Systeminfo"] = nil,
|
||||||
["Target"] = nil,
|
["Target"] = nil,
|
||||||
|
|||||||
+29
-15
@@ -853,16 +853,20 @@ pfUI:RegisterModule("actionbar", function ()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local cat, stealth
|
|
||||||
local inCatForm = nil
|
local inCatForm = nil
|
||||||
local prowlActive = 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 CAT_FORM = 1
|
||||||
|
local SHADOWFORM = 28
|
||||||
local function HasCatForm()
|
local function HasCatForm()
|
||||||
return GetShapeshiftFormID() == CAT_FORM and true or nil
|
return GetShapeshiftFormID() == CAT_FORM and true or nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function InShadowform()
|
||||||
|
return GetShapeshiftFormID() == SHADOWFORM and true or nil
|
||||||
|
end
|
||||||
|
|
||||||
local function FullScan()
|
local function FullScan()
|
||||||
if class ~= "DRUID" then return nil end
|
if class ~= "DRUID" then return nil end
|
||||||
inCatForm = HasCatForm()
|
inCatForm = HasCatForm()
|
||||||
@@ -872,7 +876,7 @@ pfUI:RegisterModule("actionbar", function ()
|
|||||||
|
|
||||||
-- pagemaster / meta page switch
|
-- pagemaster / meta page switch
|
||||||
do
|
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
|
-- set temporary pagemaster bindings keybinds
|
||||||
if C.bars.pagemaster == "1" then
|
if C.bars.pagemaster == "1" then
|
||||||
@@ -890,8 +894,10 @@ pfUI:RegisterModule("actionbar", function ()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- setup page switch frame
|
-- setup page switch frame. `formpaging` is the shared "auto-page is
|
||||||
local prowling = nil
|
-- 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)
|
local pageswitch = CreateFrame("Frame", "pfActionBarPageSwitch", UIParent)
|
||||||
pageswitch:RegisterEvent("PLAYER_ENTERING_WORLD")
|
pageswitch:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||||
pageswitch:RegisterEvent("UPDATE_SHAPESHIFT_FORM")
|
pageswitch:RegisterEvent("UPDATE_SHAPESHIFT_FORM")
|
||||||
@@ -905,10 +911,17 @@ pfUI:RegisterModule("actionbar", function ()
|
|||||||
return
|
return
|
||||||
end
|
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 class ~= "DRUID" then return end
|
||||||
|
|
||||||
if event == "PLAYER_ENTERING_WORLD" then
|
if event == "PLAYER_ENTERING_WORLD" then
|
||||||
prowling = FullScan()
|
formpaging = FullScan()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -917,7 +930,7 @@ pfUI:RegisterModule("actionbar", function ()
|
|||||||
inCatForm = HasCatForm()
|
inCatForm = HasCatForm()
|
||||||
if not inCatForm then
|
if not inCatForm then
|
||||||
prowlActive = nil
|
prowlActive = nil
|
||||||
prowling = nil
|
formpaging = nil
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -927,10 +940,10 @@ pfUI:RegisterModule("actionbar", function ()
|
|||||||
if inCatForm then
|
if inCatForm then
|
||||||
if IsStealthed() then
|
if IsStealthed() then
|
||||||
prowlActive = true
|
prowlActive = true
|
||||||
prowling = true
|
formpaging = true
|
||||||
else
|
else
|
||||||
prowlActive = nil
|
prowlActive = nil
|
||||||
prowling = nil
|
formpaging = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
@@ -946,7 +959,7 @@ pfUI:RegisterModule("actionbar", function ()
|
|||||||
if PROWL_IDS[spellId] then
|
if PROWL_IDS[spellId] then
|
||||||
inCatForm = true
|
inCatForm = true
|
||||||
prowlActive = true
|
prowlActive = true
|
||||||
prowling = true
|
formpaging = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
pageswitch:SetScript("OnUpdate", function()
|
pageswitch:SetScript("OnUpdate", function()
|
||||||
@@ -964,11 +977,12 @@ pfUI:RegisterModule("actionbar", function ()
|
|||||||
SwitchBar(default)
|
SwitchBar(default)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- switch actionbar page if druid stealth is detected
|
-- switch actionbar page while druid stealth / priest shadowform is active
|
||||||
if C.bars.druidstealth == "1" then
|
if (class == "DRUID" and C.bars.druidstealth == "1")
|
||||||
if prowling and _G.CURRENT_ACTIONBAR_PAGE == 1 then
|
or (class == "PRIEST" and C.bars.priestshadow == "1") then
|
||||||
SwitchBar(prowl)
|
if formpaging and _G.CURRENT_ACTIONBAR_PAGE == 1 then
|
||||||
elseif not prowling and _G.CURRENT_ACTIONBAR_PAGE == 8 then
|
SwitchBar(formpage)
|
||||||
|
elseif not formpaging and _G.CURRENT_ACTIONBAR_PAGE == 8 then
|
||||||
SwitchBar(default)
|
SwitchBar(default)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -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 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 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 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)
|
CreateConfig(nil, T["Range Based Hunter Paging"], C.bars, "hunterbar", "checkbox", nil, nil, nil, nil)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user