mirror of
https://github.com/brues-code/pfUI.git
synced 2026-11-01 16:36:56 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e50a0b34f | ||
|
|
3faeafdfc5 | ||
|
|
b2cffcb3c2 | ||
|
|
5476a28982 |
@@ -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
|
||||||
|
|||||||
@@ -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
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user