4 Commits
Author SHA1 Message Date
Brues 3e50a0b34f Turn on countdownForCooldowns when migrating the old cooldown settings
pfUI drew its own cooldown numbers before; the native countdown shows
them only with the countdownForCooldowns cvar on, and only the first-run
setup set it. Upgraded installs showed no numbers at all, so the
cooldown settings migration turns the cvar on as it removes
appearance.cd.
2026-11-01 00:23:39 -05:00
Brues 3faeafdfc5 Migrate the old cooldown settings into C.cooldown
The shared appearance.cd values (font, size, threshold, tenths, colors)
move to the cooldown table. "Enable Durations On Foreign Frames" and
"Hide Foreign Cooldown Animations" become the Other Addons numbers and
sweep; the spellbook and character slots take that sweep, and the
foreign numbers when "Enable Durations On Blizzard Frames" was off.

Each module's old options move to its kind: the bars, bags and totems
reverse, the buffs sweep and reverse, and the nameplate debuff text,
sweep and reverse, with "Enable Debuff Timers" off turning off both
numbers and sweep. Unit frames had one set per frame and now share one:
the target frame's timer options and the raid frames' "Show Time Left"
stand for the rest. The per-frame keys, appearance.cd and bars.cd_size
are removed.

The migration is keyed on the old keys rather than the version, so it
also runs on dev installs, and runs once.
2026-10-31 23:52:28 -05:00
Brues b2cffcb3c2 Load each module and skin through securecallfunction so one error no longer stops the rest from loading 2026-10-31 21:17:42 -05:00
Brues 5476a28982 Skin menu dividers: CreateMenuDivider draws a 1px border-colored line; use it in the radar menu 2026-10-31 21:04:11 -05:00
4 changed files with 89 additions and 3 deletions
+65
View File
@@ -1431,6 +1431,71 @@ function pfUI:MigrateConfig()
pfUI_config.unitframes.always2dportrait = nil pfUI_config.unitframes.always2dportrait = nil
end end
-- migrate the scattered cooldown settings into the cooldown table; keyed
-- on the old settings rather than the version, like the portrait style
local cooldown = pfUI_config.cooldown
local cd = pfUI_config.appearance.cd
if cd then
for _, entry in pairs({ "font", "font_size", "dynamicsize", "threshold", "milliseconds",
"lowcolor", "normalcolor", "minutecolor", "hourcolor", "daycolor" }) do
cooldown[entry] = cd[entry] or cooldown[entry]
end
cooldown.foreign.text = cd.foreign or cooldown.foreign.text
if cd.hideanim then
cooldown.foreign.animation = cd.hideanim == "1" and "0" or "1"
end
-- spellbook and character slots took the foreign sweep, and with the
-- Blizzard toggle off the foreign numbers too
cooldown.blizzard.animation = cooldown.foreign.animation
if cd.blizzard == "0" then
cooldown.blizzard.text = cooldown.foreign.text
end
-- pfUI drew its own numbers before; the native countdown shows them
-- only with this cvar on, which only the first-run setup sets
SetCVar("countdownForCooldowns", "1")
pfUI_config.appearance.cd = nil
end
local function move(config, old, kind, entry)
if config[old] then
cooldown[kind][entry] = config[old]
config[old] = nil
end
end
move(pfUI_config.bars, "cooldown_reverse", "actionbar", "reverse")
move(pfUI_config.appearance.bags, "cooldown_reverse", "bags", "reverse")
move(pfUI_config.buffs, "cooldown_anim", "buff", "animation")
move(pfUI_config.buffs, "cooldown_reverse", "buff", "reverse")
move(pfUI_config.totems, "cooldown_reverse", "totem", "reverse")
move(pfUI_config.nameplates, "debufftext", "nameplate", "text")
move(pfUI_config.nameplates, "debuffanim", "nameplate", "animation")
move(pfUI_config.nameplates, "debreverse", "nameplate", "reverse")
if pfUI_config.nameplates.debufftimers == "0" then
cooldown.nameplate.text, cooldown.nameplate.animation = "0", "0"
end
-- one setting now covers every unit frame: the target frame's auras and
-- the raid frames' indicators stand for the rest
move(pfUI_config.unitframes.target, "cooldown_text", "unitframe", "text")
move(pfUI_config.unitframes.target, "cooldown_anim", "unitframe", "animation")
move(pfUI_config.unitframes.target, "cooldown_reverse", "unitframe", "reverse")
move(pfUI_config.unitframes.raid, "indicator_time", "indicator", "text")
for _, unit in pairs(pfUI_config.unitframes) do
if type(unit) == "table" then
unit.cooldown_text, unit.cooldown_anim, unit.cooldown_reverse, unit.indicator_time = nil, nil, nil, nil
end
end
pfUI_config.nameplates.debufftimers = nil
pfUI_config.bars.cd_size = nil
-- Remove "Show only own debuffs" from unitframes and nameplates -- Remove "Show only own debuffs" from unitframes and nameplates
-- (feature was removed; only Target Debuff Bar in buffwatch keeps it) -- (feature was removed; only Target Debuff Bar in buffwatch keeps it)
if pfUI_config.nameplates then if pfUI_config.nameplates then
+19
View File
@@ -86,6 +86,25 @@ do
end end
end end
-- [ CreateMenuDivider ]
-- Adds a divider to a pfUIMenuStyleMixin menu: a 1px line in the border
-- color in place of the stock divider art. The style itself cannot do this,
-- as menu entries draw their own art.
-- 'description' [table] the menu description to add the divider to
-- returns: [table] the divider's element description
do
local function SkinDivider(frame)
frame.divider:SetHeight(1)
frame.divider:SetColorTexture(GetStringColor(pfUI_config.appearance.border.color))
end
function pfUI.api.CreateMenuDivider(description)
local divider = description:CreateDivider()
divider:AddInitializer(SkinDivider)
return divider
end
end
-- [ pfUIDropdownTemplate ] -- [ pfUIDropdownTemplate ]
-- Mixin of the template in ui-widgets.xml: a dropdown that shows its selection -- Mixin of the template in ui-widgets.xml: a dropdown that shows its selection
-- as text, with pfUI's arrow box at the right. -- as text, with pfUI's arrow box at the right.
+1 -1
View File
@@ -85,7 +85,7 @@ pfUI:RegisterModule("radar", function ()
for _, yards in ipairs(RANGES) do for _, yards in ipairs(RANGES) do
rootDescription:CreateRadio(yards .. " yd", IsRange, SetRange, yards) rootDescription:CreateRadio(yards .. " yd", IsRange, SetRange, yards)
end end
rootDescription:CreateDivider() CreateMenuDivider(rootDescription)
rootDescription:CreateButton(HIDE, function() radar:Hide() end) rootDescription:CreateButton(HIDE, function() radar:Hide() end)
end end
+4 -2
View File
@@ -345,14 +345,16 @@ function pfUI:RegisterSkin(name, func, arg3)
end end
end end
-- an error in one module or skin goes to the error handler without
-- stopping the ones that load after it
function pfUI:LoadModule(m) function pfUI:LoadModule(m)
setfenv(pfUI.module[m], pfUI:GetEnvironment()) setfenv(pfUI.module[m], pfUI:GetEnvironment())
pfUI.module[m]() securecallfunction(pfUI.module[m])
end end
function pfUI:LoadSkin(s) function pfUI:LoadSkin(s)
setfenv(pfUI.skin[s], pfUI:GetEnvironment()) setfenv(pfUI.skin[s], pfUI:GetEnvironment())
pfUI.skin[s]() securecallfunction(pfUI.skin[s])
end end
pfUI:SetScript("OnEvent", function() pfUI:SetScript("OnEvent", function()