better way to handle emphasized bars

This commit is contained in:
Sergio Álvarez 2018-07-28 18:54:38 +02:00
parent 5ec09c0402
commit 6637e06f17
1 changed files with 10 additions and 5 deletions

View File

@ -1,7 +1,9 @@
local me = ...
local plugin = BigWigs:GetPlugin("Bars")
local db = plugin.db.profile
-- "bars" l&f
local function style(bar)
bar.candyBarLabel:SetJustifyH("LEFT")
bar.candyBarLabel:ClearAllPoints()
@ -9,11 +11,7 @@ local function style(bar)
bar.candyBarDuration:SetJustifyH("LEFT")
bar.candyBarDuration:ClearAllPoints()
bar.candyBarDuration:Point("RIGHT", bar, "LEFT", -2, 0)
if (bar.remaining < db.emphasizeTime) then
bar:SetTextColor(1, 0, 0)
end
bar.candyBarDuration:Point("RIGHT", bar, "LEFT", -3, 0)
end
plugin:RegisterBarStyle("GioNoBars", {
@ -22,3 +20,10 @@ plugin:RegisterBarStyle("GioNoBars", {
ApplyStyle = style,
GetStyleName = function() return "Gio No Bars" end,
})
-- emphasized text color
local function styleEmphasized(msg, plugin, bar)
bar:SetTextColor(1, 0, 0)
end
BigWigsLoader.RegisterMessage(me, "BigWigs_BarEmphasized", styleEmphasized)