From 74dfe384e33d366b2135aaaf4b3c2e64b2a8ce75 Mon Sep 17 00:00:00 2001 From: Kkthnx <40672673+Kkthnx@users.noreply.github.com> Date: Sun, 14 Apr 2024 01:59:18 -0400 Subject: [PATCH] Update Styles --- KkthnxUI/Modules/Blizzard/Elements/MirrorBars.lua | 13 +++++-------- KkthnxUI/Modules/Blizzard/Elements/TimerTracker.lua | 6 ++---- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/KkthnxUI/Modules/Blizzard/Elements/MirrorBars.lua b/KkthnxUI/Modules/Blizzard/Elements/MirrorBars.lua index 8d629269..a66cd3d0 100644 --- a/KkthnxUI/Modules/Blizzard/Elements/MirrorBars.lua +++ b/KkthnxUI/Modules/Blizzard/Elements/MirrorBars.lua @@ -1,10 +1,7 @@ local K, C = KkthnxUI[1], KkthnxUI[2] local Module = K:GetModule("Blizzard") --- Sourced: NDui - -local function SetupMirrorBar(bar) - -- local statusBar = bar.StatusBar +local function StyleMirrorBar(bar) local statusbar = bar.StatusBar or _G[bar:GetName() .. "StatusBar"] if statusbar then statusbar:SetAllPoints() @@ -13,7 +10,6 @@ local function SetupMirrorBar(bar) end local text = bar.Text - local spark = bar.Spark bar:SetSize(222, 22) bar:StripTextures(true) @@ -23,21 +19,22 @@ local function SetupMirrorBar(bar) text:SetFont(text:GetFont(), 12, nil) text:SetPoint("BOTTOM", bar, "TOP", 0, 4) - spark = bar:CreateTexture(nil, "OVERLAY") + local spark = bar:CreateTexture(nil, "OVERLAY") spark:SetSize(64, bar:GetHeight()) spark:SetTexture(C["Media"].Textures.Spark128Texture) spark:SetBlendMode("ADD") spark:SetPoint("CENTER", statusbar:GetStatusBarTexture(), "RIGHT", 0, 0) bar:CreateBorder() + + bar.styled = true -- set styled flag on the bar end function Module:CreateMirrorBars() hooksecurefunc(MirrorTimerContainer, "SetupTimer", function(self, timer) local bar = self:GetAvailableTimer(timer) if not bar.styled then - SetupMirrorBar(bar) - bar.styled = true + StyleMirrorBar(bar) end end) end diff --git a/KkthnxUI/Modules/Blizzard/Elements/TimerTracker.lua b/KkthnxUI/Modules/Blizzard/Elements/TimerTracker.lua index 3f032805..ebe78cbb 100644 --- a/KkthnxUI/Modules/Blizzard/Elements/TimerTracker.lua +++ b/KkthnxUI/Modules/Blizzard/Elements/TimerTracker.lua @@ -1,11 +1,9 @@ local K, C = KkthnxUI[1], KkthnxUI[2] local Module = K:GetModule("Blizzard") --- Sourced: NDui - local pairs = pairs -local function SetupTimerTracker(bar) +local function StyleTimerBar(bar) local texture = K.GetTexture(C["General"].Texture) bar:SetSize(222, 22) @@ -27,7 +25,7 @@ function Module:CreateTimerTracker() local function UpdateTimerTracker() for _, timer in pairs(_G.TimerTracker.timerList) do if timer.bar and not timer.bar.styled then -- only apply style if not styled before - SetupTimerTracker(timer.bar) + StyleTimerBar(timer.bar) end end end