Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion MidnightSimpleUnitFrames/Core/MSUF_ColorsCore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -509,13 +509,16 @@ local function ResetCastbarBackgroundColor()
g.castbarBgR, g.castbarBgG, g.castbarBgB, g.castbarBgA = nil, nil, nil, nil; PushVisualUpdates()
end

-- ── Cast Colors (interruptible / non-interruptible / feedback) ──
-- ── Cast Colors (interruptible / non-interruptible / interrupt unavailable / feedback) ──
local function GetInterruptibleCastColor() return _getRGBPalette("castbarInterruptibleR", "castbarInterruptibleG", "castbarInterruptibleB", "castbarInterruptibleColor", "turquoise", 0, 0.9, 0.8) end
MSUF_GetInterruptibleCastColor = GetInterruptibleCastColor
local function SetInterruptibleCastColor(r, g, b) _setRGB("castbarInterruptibleR", "castbarInterruptibleG", "castbarInterruptibleB", r, g, b, 0, 0.9, 0.8) end
local function GetNonInterruptibleCastColor() return _getRGBTonumber("castbarNonInterruptibleR", "castbarNonInterruptibleG", "castbarNonInterruptibleB", "castbarNonInterruptibleColor", "red", 0.4, 0.01, 0.01) end
MSUF_GetNonInterruptibleCastColor = GetNonInterruptibleCastColor
local function SetNonInterruptibleCastColor(r, g, b) _setRGB("castbarNonInterruptibleR", "castbarNonInterruptibleG", "castbarNonInterruptibleB", r, g, b, 0.4, 0.01, 0.01) end
local function GetInterruptUnavailableCastColor() return _getRGBTonumber("castbarInterruptUnavailableR", "castbarInterruptUnavailableG", "castbarInterruptUnavailableB", "castbarInterruptUnavailableColor", nil, 1.0, 0.494117647, 0.137254902) end
MSUF_GetInterruptUnavailableCastColor = GetInterruptUnavailableCastColor
local function SetInterruptUnavailableCastColor(r, g, b) _setRGB("castbarInterruptUnavailableR", "castbarInterruptUnavailableG", "castbarInterruptUnavailableB", r, g, b, 1.0, 0.494117647, 0.137254902) end
local function GetInterruptFeedbackCastColor() return _getRGBTonumber("castbarInterruptFeedbackR", "castbarInterruptFeedbackG", "castbarInterruptFeedbackB", "castbarInterruptFeedbackColor", "yellow", 1.0, 0.82, 0.0) end
local function SetInterruptFeedbackCastColor(r, g, b) _setRGB("castbarInterruptFeedbackR", "castbarInterruptFeedbackG", "castbarInterruptFeedbackB", r, g, b, 1.0, 0.82, 0.0) end

Expand Down Expand Up @@ -680,6 +683,8 @@ ns._colorsAPI = {
SetInterruptibleCastColor = SetInterruptibleCastColor,
GetNonInterruptibleCastColor = GetNonInterruptibleCastColor,
SetNonInterruptibleCastColor = SetNonInterruptibleCastColor,
GetInterruptUnavailableCastColor = GetInterruptUnavailableCastColor,
SetInterruptUnavailableCastColor = SetInterruptUnavailableCastColor,
GetInterruptFeedbackCastColor = GetInterruptFeedbackCastColor,
SetInterruptFeedbackCastColor = SetInterruptFeedbackCastColor,
GetPlayerCastbarOverrideEnabled = GetPlayerCastbarOverrideEnabled,
Expand Down
2 changes: 1 addition & 1 deletion MidnightSimpleUnitFrames/Menu2/MSUF_Menu2_SearchData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Data.KEYWORDS = {
opt_bars = "global style bars textures texture gradient gradient direction hp power absorb display heal prediction incoming heals highlight priority prio display overlay highlight borders outline border aggro purge boss target glow dispel overlay unitframe unit frame debuff tint any debuff dispellable rounded round corners rounded texture rounded frames rounded frame texture rounded unit frames rounded group frames rounded power bars rounded mouseover highlights mouseover bar colors background tint backdrop bg dark mode shared texture opacity alpha health texture power texture frame outline abgerundet abrundung runde kanten ecken abrunden einschalten ausschalten",
opt_fonts = "global style fonts font family size outline shadow color text readability name hp power health spell cooldown bigger smaller text size name shortening realm names truncate font color",
auras2 = "global style unit auras buffs debuffs icon size caps rows spacing sorting cooldown timer text tooltip private aura filter override dispel stealable only mine own buffs own debuffs pandemic reminders click through clickthrough aura position aura size",
opt_castbar = "global style castbar textures outline shake fill direction empowered casts empower stages evoker augmentation devastation preservation hold release interrupt ready focus kick kick cooldown demon hunter demonhunter dh havoc vengeance devour consume magic disrupt counterspell pummel rebuke wind shear mind freeze skull bash muzzle spear hand strike counter shot quell silence name shortening latency spark channel ticks gcd global cooldown boss castbar target castbar focus castbar player castbar",
opt_castbar = "global style castbar textures outline shake fill direction empowered casts empower stages evoker augmentation devastation preservation hold release interrupt ready focus kick kick cooldown interrupt unavailable unavailable kick unavailable cooldown color demon hunter demonhunter dh havoc vengeance devour consume magic disrupt counterspell pummel rebuke wind shear mind freeze skull bash muzzle spear hand strike counter shot quell silence name shortening latency spark channel ticks gcd global cooldown boss castbar target castbar focus castbar player castbar",
opt_colors = "global style colors class bar colors background backgrond backround bg backdrop tint opacity alpha unitframe colors npc type colors bar colors bar outline border color unit frame border group frame border dispel castbar mouseover highlight gameplay superellipse color swatches portrait colors power colors font color health color reaction color aura colors crosshair colors dark mode custom color missing health white background bar background tint preserve hp color hp track black mana rage energy focus runic power insanity fury pain essence astral power lunar power maelstrom combo points holy power soul shards chi arcane charges runes stagger class power",
opt_misc = "global style miscellaneous misc language localization localisation locale translation range fade range check range checker distance check out of range unit frame range check ui behavior tooltip tooltips combat settings general blizzard frames default frames hide blizzard disable blizzard update intervals performance minimap minimap icon target sounds version check menu behavior snap edge snap",
classpower = "class resources combo points holy power soul shards chi maelstrom eclipse essence evoker runes runic power stagger brewmaster resource prediction auto hide detached power bar alternative mana behavior style quick actions class power resource bar alternate mana monk druid rogue paladin warlock death knight",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ local function ApplyCastbarColors()
ApplyColors()
if ns and type(ns.MSUF_UpdateCastbarVisuals) == "function" then pcall(ns.MSUF_UpdateCastbarVisuals) end
if ns and type(ns.MSUF_UpdateCastbarTextures_Immediate) == "function" then pcall(ns.MSUF_UpdateCastbarTextures_Immediate) end
CallGlobal("MSUF_KickReady_RefreshAll")
end

local function ApplyGameplayColors()
Expand Down Expand Up @@ -921,6 +922,9 @@ local function BuildColors(ctx)
ColorValueAt(ctx, castbar, "Not ready color (kick on cooldown)", 12, -310,
function() return TableRGB(G(), "kickNotReadyColor", 1, 0, 0) end,
function(r, g, c) SetTableRGB(G(), "kickNotReadyColor", r, g, c); ApplyCastbarColors() end)
ColorValueAt(ctx, castbar, "Unavailable fill color", 12, -346,
function() return ApiRGB("GetInterruptUnavailableCastColor", 1.0, 0.494117647, 0.137254902) end,
function(r, g, c) ApiSetRGB("SetInterruptUnavailableCastColor", r, g, c); ApplyCastbarColors() end)
ButtonAt(castbar, "Reset castbar colors", 12, -470, 170, function()
local api = ColorAPI()
if type(api.ResetCastbarTextColorToGlobal) == "function" then pcall(api.ResetCastbarTextColorToGlobal) end
Expand All @@ -929,6 +933,7 @@ local function BuildColors(ctx)
local g = G()
g.castbarInterruptibleR, g.castbarInterruptibleG, g.castbarInterruptibleB = nil, nil, nil
g.castbarNonInterruptibleR, g.castbarNonInterruptibleG, g.castbarNonInterruptibleB = nil, nil, nil
g.castbarInterruptUnavailableR, g.castbarInterruptUnavailableG, g.castbarInterruptUnavailableB = nil, nil, nil
g.castbarInterruptFeedbackR, g.castbarInterruptFeedbackG, g.castbarInterruptFeedbackB = nil, nil, nil
g.playerCastbarOverrideEnabled = false
g.playerCastbarOverrideMode = "CLASS"
Expand Down
28 changes: 23 additions & 5 deletions MidnightSimpleUnitFrames/Menu2/Pages/MSUF_Menu2_GlobalCastbars.lua
Original file line number Diff line number Diff line change
Expand Up @@ -708,14 +708,22 @@ local function BuildCastbars(ctx)
local ok, r, g, b = pcall(_G.MSUF_ResolveCastbarColors)
if ok and r then ir, ig, ib = r, g or ig, b or ib end
end
local kickKey = KickReadyKey(unit)
if kind ~= "interrupted"
and kickKey and ReadGBool(kickKey, false)
and ReadG("kickReadyStyle", "border") == "fill"
and (unit == "target" or unit == "focus" or unit == "boss")
and type(_G.MSUF_ResolveInterruptUnavailableCastColor) == "function" then
local ok, r, g, b = pcall(_G.MSUF_ResolveInterruptUnavailableCastColor)
if ok and r and g and b then ir, ig, ib = r, g, b end
end
if now < (self.interruptUntil or 0) then
ir, ig, ib = 0.90, 0.14, 0.20
end
ir, ig, ib = GlowBlend(ir, ig, ib, progress)

if self.bar.SetBackdropBorderColor then
self.bar:SetBackdropBorderColor(T.colors.borderSoft[1], T.colors.borderSoft[2], T.colors.borderSoft[3], T.colors.borderSoft[4] or 0.7)
local kickKey = KickReadyKey(unit)
if kickKey and ReadGBool(kickKey, false) and ReadG("kickReadyStyle", "border") == "border" then
self.bar:SetBackdropBorderColor(0.24, 0.86, 0.46, 0.95)
end
Expand Down Expand Up @@ -1318,11 +1326,18 @@ local function BuildCastbars(ctx)
local style = W.Dropdown(kick, "Indicator style", {
{ value = "border", text = "Castbar border" },
{ value = "box", text = "Color box next to cast" },
{ value = "fill", text = "Unavailable cast fill" },
}, 260)
W.MoveWidget(style, kick, kickRightX, -88, 300)
M.BindDropdown(ctx, style,
function() return ReadG("kickReadyStyle", "border") end,
function(v) SetG("kickReadyStyle", v or "border", "MSUF2_KICK_READY_STYLE", { castbar = true, preview = true }); ApplyCastbars("MSUF2_KICK_READY_STYLE"); RefreshCastPreview() end)
function(v)
SetG("kickReadyStyle", v or "border", "MSUF2_KICK_READY_STYLE", { castbar = true, preview = true })
ApplyCastbars("MSUF2_KICK_READY_STYLE")
Call("MSUF_KickReady_RefreshAll")
RefreshCastPreview()
if syncKickReady then syncKickReady() end
end)
local size = W.Slider(kick, "Indicator size", 8, 32, 1, 300)
W.MoveWidget(size, kick, kickRightX, -142, 320)
M.BindSlider(ctx, size,
Expand All @@ -1338,7 +1353,7 @@ local function BuildCastbars(ctx)
RefreshCastPreview()
if syncKickReady then syncKickReady() end
end)
local colorHint = W.Text(kick, "Ready / cooldown colors: Colors menu > Interrupt Ready Indicator", kickRightX, -228, 370, T.colors.muted)
local colorHint = W.Text(kick, "Colors: Colors menu > Castbar Colors", kickRightX, -228, 370, T.colors.muted)
W.LabelAt(kick, "Placement", kickLeftX, -178, 160, "GameFontNormalSmall", T.colors.accent)
local anchor = W.Dropdown(kick, "Anchor", {
{ value = "RIGHT", text = "Right" },
Expand All @@ -1363,8 +1378,11 @@ local function BuildCastbars(ctx)
syncKickReady = function()
local enabled = ReadGBool("kickReadyShowTarget", false) or ReadGBool("kickReadyShowFocus", false) or ReadGBool("kickReadyShowBoss", false)
local autoOn = ReadGBool("kickReadyAutoSize", true)
SetControlsEnabled({ style, auto, anchor, offX, offY }, enabled)
SetControlEnabled(size, enabled and not autoOn)
local isFill = ReadG("kickReadyStyle", "border") == "fill"
SetControlEnabled(style, enabled)
SetControlEnabled(auto, enabled and not isFill)
SetControlEnabled(size, enabled and not isFill and not autoOn)
SetControlsEnabled({ anchor, offX, offY }, enabled and not isFill)
SetControlEnabled(colorHint, enabled)
end
M.AddRefresher(ctx, syncKickReady)
Expand Down
Loading