better way to handle emphasized bars
This commit is contained in:
parent
5ec09c0402
commit
6637e06f17
15
main.lua
15
main.lua
|
@ -1,7 +1,9 @@
|
||||||
|
|
||||||
|
local me = ...
|
||||||
local plugin = BigWigs:GetPlugin("Bars")
|
local plugin = BigWigs:GetPlugin("Bars")
|
||||||
local db = plugin.db.profile
|
local db = plugin.db.profile
|
||||||
|
|
||||||
|
-- "bars" l&f
|
||||||
local function style(bar)
|
local function style(bar)
|
||||||
bar.candyBarLabel:SetJustifyH("LEFT")
|
bar.candyBarLabel:SetJustifyH("LEFT")
|
||||||
bar.candyBarLabel:ClearAllPoints()
|
bar.candyBarLabel:ClearAllPoints()
|
||||||
|
@ -9,11 +11,7 @@ local function style(bar)
|
||||||
|
|
||||||
bar.candyBarDuration:SetJustifyH("LEFT")
|
bar.candyBarDuration:SetJustifyH("LEFT")
|
||||||
bar.candyBarDuration:ClearAllPoints()
|
bar.candyBarDuration:ClearAllPoints()
|
||||||
bar.candyBarDuration:Point("RIGHT", bar, "LEFT", -2, 0)
|
bar.candyBarDuration:Point("RIGHT", bar, "LEFT", -3, 0)
|
||||||
|
|
||||||
if (bar.remaining < db.emphasizeTime) then
|
|
||||||
bar:SetTextColor(1, 0, 0)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
plugin:RegisterBarStyle("GioNoBars", {
|
plugin:RegisterBarStyle("GioNoBars", {
|
||||||
|
@ -22,3 +20,10 @@ plugin:RegisterBarStyle("GioNoBars", {
|
||||||
ApplyStyle = style,
|
ApplyStyle = style,
|
||||||
GetStyleName = function() return "Gio No Bars" end,
|
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)
|
||||||
|
|
Loading…
Reference in New Issue