mirror of
https://github.com/brues-code/pfUI.git
synced 2026-11-03 01:16:56 +00:00
Pick cooldown timers per feature with one dropdown
Each feature's settings page now picks its own timers - None, Numbers,
Sweep, or Numbers And Sweep - in place of the "Show Numbers On", "Show
Sweep On" and "Reverse Sweep On" lists on Settings -> Cooldown. Unit
frames get theirs per frame again ("Buff And Debuff Timers" and
"Indicator Timers"), so party and pet can drop their numbers while the
target keeps them. The other dropdowns sit on Action Bars, Bags & Bank,
Buff/Debuff Icons, Totem Icons, Tooltip and Nameplates.
Settings -> Cooldown keeps the shared font, size, threshold, tenths and
colors, plus the timers of Spellbook And Character, Loss Of Control and
Other Addons, which have no page of their own.
CreateCooldown(parent, kind, config, key, name) reads its mode from
config[key]. The kind says only what it times: "spell" hides numbers on
the global cooldown, "aura" drains its sweep, "timer" fills it. The
reverse option is gone; the direction follows the kind.
The migration carries every old setting into its timers: the
C.cooldown kind tables, appearance.cd's foreign and Blizzard toggles,
the buff frame's sweep, the nameplate debuff options, and each unit
frame's timer text, sweep and "Show Time Left" from before the kinds,
so frames that had their own settings keep them. Reverse options are
dropped.
This commit is contained in:
@@ -1007,7 +1007,7 @@ pfUI:RegisterModule("actionbar", function ()
|
||||
f.slot = id
|
||||
|
||||
-- cooldown
|
||||
f.cd = CreateCooldown(f, "actionbar", f:GetName() .. "Cooldown")
|
||||
f.cd = CreateCooldown(f, "spell", C.bars, "timers", f:GetName() .. "Cooldown")
|
||||
|
||||
-- icon
|
||||
f.icon = f:CreateTexture(button_name .. "Icon", "BACKGROUND")
|
||||
|
||||
+1
-1
@@ -415,7 +415,7 @@ pfUI:RegisterModule("bags", function ()
|
||||
-- reaches it after that
|
||||
local slotframe = pfUI.bags[bag].slots[slot].frame
|
||||
local cdname = slotframe:GetName() .. "Cooldown"
|
||||
slotframe.cd = CreateCooldown(slotframe, "bags", cdname)
|
||||
slotframe.cd = CreateCooldown(slotframe, "spell", C.appearance.bags, "timers", cdname)
|
||||
_G[cdname] = slotframe.cd
|
||||
|
||||
if not pfUI.bags[bag].slots[slot].frame.backdrop then
|
||||
|
||||
+1
-1
@@ -152,7 +152,7 @@ pfUI:RegisterModule("buff", function ()
|
||||
|
||||
-- the sweep and the duration numbers (the template covers the button and
|
||||
-- starts hidden); RefreshBuffButton starts its timer
|
||||
buff.cd = CreateCooldown(buff, "buff", buttonName .. "Cooldown")
|
||||
buff.cd = CreateCooldown(buff, "aura", C.buffs, "timers", buttonName .. "Cooldown")
|
||||
buff.cd:SetFrameLevel(buff:GetFrameLevel() + 1)
|
||||
buff.overlay:SetFrameLevel(buff:GetFrameLevel() + 2)
|
||||
|
||||
|
||||
+22
-33
@@ -981,6 +981,12 @@ pfUI:RegisterModule("gui", function ()
|
||||
"BOTTOMRIGHT:" .. T["Bottom Right"],
|
||||
"off:" .. T["Disabled"]
|
||||
},
|
||||
["cooldown_timers"] = {
|
||||
"off:" .. T["None"],
|
||||
"text:" .. T["Numbers"],
|
||||
"sweep:" .. T["Sweep"],
|
||||
"both:" .. T["Numbers And Sweep"]
|
||||
},
|
||||
["uf_debuff_indicator"] = {
|
||||
"0:" .. T["Disabled"],
|
||||
"1:" .. T["Legacy"],
|
||||
@@ -1597,23 +1603,6 @@ pfUI:RegisterModule("gui", function ()
|
||||
end)
|
||||
|
||||
CreateGUIEntry(T["Settings"], T["Cooldown"], function()
|
||||
-- every kind of cooldown CreateCooldown makes, as C.cooldown groups.
|
||||
-- Other addons' cooldowns only lose numbers or sweep (see
|
||||
-- api/cooldown.lua), so giving them back takes a reload
|
||||
local kinds = {
|
||||
{ "actionbar", T["Action Bars"] },
|
||||
{ "bags", T["Bags"] },
|
||||
{ "blizzard", T["Spellbook And Character"] },
|
||||
{ "unitframe", T["Unit Frame Auras"] },
|
||||
{ "indicator", T["Buff Indicators"] },
|
||||
{ "nameplate", T["Nameplate Debuffs"] },
|
||||
{ "buff", T["Player Buffs"] },
|
||||
{ "tooltip", T["Tooltip Auras"] },
|
||||
{ "totem", T["Totems"] },
|
||||
{ "lossofcontrol", T["Loss Of Control"] },
|
||||
{ "foreign", T["Other Addons"] },
|
||||
}
|
||||
|
||||
CreateConfig(nil, COUNTDOWN_FOR_COOLDOWNS_TEXT, "CVAR", "countdownForCooldowns", "checkbox")
|
||||
CreateConfig(UpdateCooldowns, T["Font"], C.cooldown, "font", "dropdown", pfUI.gui.dropdowns.fonts)
|
||||
CreateConfig(nil, T["Font Size"], C.cooldown, "font_size")
|
||||
@@ -1626,22 +1615,14 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(UpdateCooldowns, T["Cooldown Color (Hours)"], C.cooldown, "hourcolor", "color")
|
||||
CreateConfig(UpdateCooldowns, T["Cooldown Color (Days)"], C.cooldown, "daycolor", "color")
|
||||
|
||||
CreateConfig(nil, T["Show Numbers On"], nil, nil, "header")
|
||||
for _, kind in ipairs(kinds) do
|
||||
CreateConfig(kind[1] ~= "foreign" and UpdateCooldowns or nil, kind[2], C.cooldown[kind[1]], "text", "checkbox")
|
||||
end
|
||||
|
||||
CreateConfig(nil, T["Show Sweep On"], nil, nil, "header")
|
||||
for _, kind in ipairs(kinds) do
|
||||
CreateConfig(kind[1] ~= "foreign" and UpdateCooldowns or nil, kind[2], C.cooldown[kind[1]], "animation", "checkbox")
|
||||
end
|
||||
|
||||
CreateConfig(nil, T["Reverse Sweep On"], nil, nil, "header")
|
||||
for _, kind in ipairs(kinds) do
|
||||
if kind[1] ~= "foreign" then
|
||||
CreateConfig(UpdateCooldowns, kind[2], C.cooldown[kind[1]], "reverse", "checkbox")
|
||||
end
|
||||
end
|
||||
-- the timers of cooldowns no other page covers. Other addons' cooldowns
|
||||
-- only lose numbers or sweep (see api/cooldown.lua), so giving them
|
||||
-- back takes a reload
|
||||
local timers = pfUI.gui.dropdowns.cooldown_timers
|
||||
CreateConfig(nil, T["Timers"], nil, nil, "header")
|
||||
CreateConfig(UpdateCooldowns, T["Spellbook And Character"], C.cooldown, "blizzard_timers", "dropdown", timers)
|
||||
CreateConfig(UpdateCooldowns, T["Loss Of Control"], C.cooldown, "lossofcontrol_timers", "dropdown", timers)
|
||||
CreateConfig(nil, T["Other Addons"], C.cooldown, "foreign_timers", "dropdown", timers)
|
||||
end)
|
||||
|
||||
CreateGUIEntry(T["Settings"], T["Screenshot"], function()
|
||||
@@ -2206,6 +2187,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(U[c], T["Automatic Class Text Color"], C.unitframes[c], "classcolor", "checkbox")
|
||||
|
||||
CreateConfig(U[c], T["Buffs"], nil, nil, "header")
|
||||
CreateConfig(UpdateCooldowns, T["Buff And Debuff Timers"], C.unitframes[c], "aura_timers", "dropdown", pfUI.gui.dropdowns.cooldown_timers)
|
||||
CreateConfig(U[c], T["Buff Position"], C.unitframes[c], "buffs", "dropdown", pfUI.gui.dropdowns.uf_buff_position)
|
||||
CreateConfig(U[c], T["Buff Size"], C.unitframes[c], "buffsize")
|
||||
CreateConfig(U[c], T["Buff Limit"], C.unitframes[c], "bufflimit")
|
||||
@@ -2239,6 +2221,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(U[c], T["Buff/Debuff Indicators"], nil, nil, "header")
|
||||
CreateConfig(U[c], T["Enable Indicators"], C.unitframes[c], "buff_indicator", "checkbox")
|
||||
CreateConfig(U[c], T["Show Stacks"], C.unitframes[c], "indicator_stacks", "checkbox")
|
||||
CreateConfig(UpdateCooldowns, T["Indicator Timers"], C.unitframes[c], "indicator_timers", "dropdown", pfUI.gui.dropdowns.cooldown_timers)
|
||||
CreateConfig(U[c], T["Indicator Size"], C.unitframes[c], "indicator_size")
|
||||
CreateConfig(U[c], T["Indicator Spacing"], C.unitframes[c], "indicator_spacing", "dropdown", pfUI.gui.dropdowns.spacing)
|
||||
CreateConfig(U[c], T["Indicator Position"], C.unitframes[c], "indicator_pos", "dropdown", pfUI.gui.dropdowns.positions)
|
||||
@@ -2325,6 +2308,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(nil, T["Bagslots Per Row"], C.appearance.bags, "bagrowlength")
|
||||
CreateConfig(nil, T["Bankslots Per Row"], C.appearance.bags, "bankrowlength")
|
||||
CreateConfig(nil, T["Item Slot Size"], C.appearance.bags, "icon_size")
|
||||
CreateConfig(UpdateCooldowns, T["Cooldown Timers"], C.appearance.bags, "timers", "dropdown", pfUI.gui.dropdowns.cooldown_timers)
|
||||
CreateConfig(nil, T["Auto Sell Grey Items"], C.global, "autosell", "checkbox")
|
||||
CreateConfig(nil, T["Auto Repair Items"], C.global, "autorepair", "checkbox")
|
||||
CreateConfig(nil, T["Auto Sort When Opening Bags"], C.appearance.bags, "autoSortOnOpen", "checkbox")
|
||||
@@ -2373,6 +2357,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(U["buff"], T["Number Of Weapon Buffs Per Row"], C.buffs, "wepbuffrowsize")
|
||||
CreateConfig(U["buff"], T["Number Of Buffs Per Row"], C.buffs, "buffrowsize")
|
||||
CreateConfig(U["buff"], T["Number Of Debuffs Per Row"], C.buffs, "debuffrowsize")
|
||||
CreateConfig(UpdateCooldowns, T["Duration Timers"], C.buffs, "timers", "dropdown", pfUI.gui.dropdowns.cooldown_timers)
|
||||
CreateConfig(U["buff"], T["Show Duration Inside Buff"], C.buffs, "textinside", "checkbox")
|
||||
CreateConfig(U["buff"], T["Stack Count Font Size"], C.buffs, "fontsize")
|
||||
end)
|
||||
@@ -2382,6 +2367,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(U["totems"], T["Icon Size"], C.totems, "iconsize")
|
||||
CreateConfig(U["totems"], T["Spacing"], C.totems, "spacing", "dropdown", pfUI.gui.dropdowns.spacing)
|
||||
CreateConfig(U["totems"], T["Show Background"], C.totems, "showbg", "checkbox")
|
||||
CreateConfig(UpdateCooldowns, T["Duration Timers"], C.totems, "timers", "dropdown", pfUI.gui.dropdowns.cooldown_timers)
|
||||
end)
|
||||
|
||||
CreateGUIEntry(T["Buffs"], T["Player Buff Bar"], function()
|
||||
@@ -2448,6 +2434,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(U["bars"], T["Self Cast: Right Click"], C.bars, "rightself", "checkbox")
|
||||
CreateConfig(U["bars"], T["Button Animation"], C.bars, "animation", "dropdown", pfUI.gui.dropdowns.actionbuttonanimations)
|
||||
CreateConfig(U["bars"], T["Button Animation Trigger"], C.bars, "animmode", "dropdown", pfUI.gui.dropdowns.animationmode)
|
||||
CreateConfig(UpdateCooldowns, T["Cooldown Timers"], C.bars, "timers", "dropdown", pfUI.gui.dropdowns.cooldown_timers)
|
||||
CreateConfig(U["bars"], T["Show Animation On Hidden Bars"], C.bars, "animalways", "checkbox")
|
||||
CreateConfig(U["bars"], T["Show Reagent Count"], C.bars, "reagents", "checkbox")
|
||||
CreateConfig(U["bars"], T["Highlight Equipped Items"], C.bars, "showequipped", "checkbox")
|
||||
@@ -2677,6 +2664,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(nil, T["Always Show Health In Percent"], C.tooltip, "alwaysperc", "checkbox")
|
||||
CreateConfig(nil, T["Show Movement Speed"], C.tooltip, "movespeed", "checkbox")
|
||||
CreateConfig(nil, T["Show Unit Buffs"], C.tooltip, "showbuffs", "checkbox")
|
||||
CreateConfig(UpdateCooldowns, T["Unit Buff Timers"], C.tooltip, "aura_timers", "dropdown", pfUI.gui.dropdowns.cooldown_timers)
|
||||
CreateConfig(nil, T["Show Unit IDs"], C.tooltip, "unitid", "checkbox")
|
||||
end)
|
||||
|
||||
@@ -2840,6 +2828,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(U["nameplates"], T["Debuff Icon Offset"], C.nameplates, "debuffoffset")
|
||||
CreateConfig(U["nameplates"], T["Debuff Icon Size"], C.nameplates, "debuffsize")
|
||||
CreateConfig(U["nameplates"], T["Show Debuff Stacks"], C.nameplates.debuffs, "showstacks", "checkbox")
|
||||
CreateConfig(UpdateCooldowns, T["Debuff Timers"], C.nameplates, "debuff_timers", "dropdown", pfUI.gui.dropdowns.cooldown_timers)
|
||||
|
||||
CreateConfig(U["nameplates"], T["Filter Mode"], C.nameplates.debuffs, "filter", "dropdown", pfUI.gui.dropdowns.buffbarfilter)
|
||||
CreateConfig(U["nameplates"], T["Blacklist"], C.nameplates.debuffs, "blacklist", "list")
|
||||
|
||||
@@ -34,7 +34,7 @@ pfUI:RegisterModule("lossofcontrol", function ()
|
||||
frame.icon.tex = frame.icon:CreateTexture(nil, "ARTWORK")
|
||||
HandleIcon(frame.icon, frame.icon.tex)
|
||||
|
||||
frame.cd = CreateCooldown(frame.icon, "lossofcontrol")
|
||||
frame.cd = CreateCooldown(frame.icon, "timer", C.cooldown, "lossofcontrol_timers")
|
||||
frame.cd:SetAllPoints(frame.icon.tex)
|
||||
|
||||
frame.label = frame:CreateFontString(nil, "OVERLAY")
|
||||
|
||||
@@ -684,7 +684,7 @@ pfUI:RegisterModule("nameplates", function ()
|
||||
icon.stacks:SetJustifyV("BOTTOM")
|
||||
icon.stacks:SetTextColor(1,1,0)
|
||||
|
||||
icon.cd = CreateCooldown(icon, "nameplate", plate.platename.."Debuff"..index.."Cooldown")
|
||||
icon.cd = CreateCooldown(icon, "aura", C.nameplates, "debuff_timers", plate.platename.."Debuff"..index.."Cooldown")
|
||||
icon.cd:SetFrameLevel(icon:GetFrameLevel() + 2)
|
||||
|
||||
plate.debuffs[index] = icon
|
||||
|
||||
+1
-1
@@ -216,7 +216,7 @@ pfUI:RegisterModule("tooltip", function ()
|
||||
icon.stacks:SetFont(C.tooltip.font_tooltip, C.tooltip.font_tooltip_size, "OUTLINE")
|
||||
icon.stacks:SetTextColor(1, 1, 1, 1)
|
||||
|
||||
icon.cd = CreateCooldown(icon, "tooltip")
|
||||
icon.cd = CreateCooldown(icon, "aura", C.tooltip, "aura_timers")
|
||||
return icon
|
||||
end
|
||||
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ pfUI:RegisterModule("totems", function ()
|
||||
self.bar[i].cdbg = self.bar[i].cdbg or CreateFrame("Frame", nil, self.bar[i])
|
||||
self.bar[i].cdbg:SetSize(self.iconsize - 3, self.iconsize - 3)
|
||||
self.bar[i].cdbg:SetPoint("CENTER", self.bar[i], "CENTER", 0, 0)
|
||||
self.bar[i].cd = self.bar[i].cd or CreateCooldown(self.bar[i].cdbg, "totem", "pfTotemsBar"..i.."Cooldown")
|
||||
self.bar[i].cd = self.bar[i].cd or CreateCooldown(self.bar[i].cdbg, "aura", C.totems, "timers", "pfTotemsBar"..i.."Cooldown")
|
||||
|
||||
self.bar[i]:RegisterForClicks("LeftButtonUp", "RightButtonUp")
|
||||
self.bar[i]:SetScript("OnClick", self.OnClick)
|
||||
|
||||
Reference in New Issue
Block a user