From 6637e06f17a6c21bd70b21c293d5a42fc771af50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20=C3=81lvarez?= Date: Sat, 28 Jul 2018 18:54:38 +0200 Subject: [PATCH] better way to handle emphasized bars --- main.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/main.lua b/main.lua index de2339c..e100f1a 100644 --- a/main.lua +++ b/main.lua @@ -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)