From 122a6d2db313a022a1c5785a1a08bcd350293d9d Mon Sep 17 00:00:00 2001 From: Vincent Cassiau Date: Sun, 18 May 2025 14:42:19 +0200 Subject: [PATCH 1/2] feat: dynamic click-through for bars based on configured modifier keys --- Core.lua | 16 +++++++++++----- Core_BCC.lua | 16 +++++++++++----- Core_Vanilla.lua | 16 +++++++++++----- Core_Wrath.lua | 16 +++++++++++----- 4 files changed, 44 insertions(+), 20 deletions(-) diff --git a/Core.lua b/Core.lua index 417c71f..ac5a29f 100644 --- a/Core.lua +++ b/Core.lua @@ -138,11 +138,9 @@ do bar.candyBarLabel:SetFont(media:Fetch("font", db.profile.font), db.profile.fontSize, flags) bar.candyBarDuration:SetFont(media:Fetch("font", db.profile.font), db.profile.fontSize, flags) bar:SetScript("OnMouseUp", BarOnClick) - if db.profile.barOnShift ~= "NONE" or db.profile.barOnControl ~= "NONE" or db.profile.barOnAlt ~= "NONE" then - bar:EnableMouse(true) - else - bar:EnableMouse(false) - end + bar:EnableMouse((IsShiftKeyDown() and db.profile.barOnShift ~= "NONE") + or (IsControlKeyDown() and db.profile.barOnControl ~= "NONE") + or (IsAltKeyDown() and db.profile.barOnAlt ~= "NONE")) bar:Start(maxBarTime) RearrangeBars() return bar @@ -210,6 +208,14 @@ do end end end + API:RegisterEvent("MODIFIER_STATE_CHANGED", function() + local enabled = (IsShiftKeyDown() and db.profile.barOnShift ~= "NONE") + or (IsControlKeyDown() and db.profile.barOnControl ~= "NONE") + or (IsAltKeyDown() and db.profile.barOnAlt ~= "NONE") + for bar in next, activeBars do + bar:EnableMouse(enabled) + end + end) function API:RegisterZone(id) zoneIds[id] = self diff --git a/Core_BCC.lua b/Core_BCC.lua index 16a42eb..0b050ba 100644 --- a/Core_BCC.lua +++ b/Core_BCC.lua @@ -137,11 +137,9 @@ do bar.candyBarLabel:SetFont(media:Fetch("font", db.profile.font), db.profile.fontSize, flags) bar.candyBarDuration:SetFont(media:Fetch("font", db.profile.font), db.profile.fontSize, flags) bar:SetScript("OnMouseUp", BarOnClick) - if db.profile.barOnShift ~= "NONE" or db.profile.barOnControl ~= "NONE" or db.profile.barOnAlt ~= "NONE" then - bar:EnableMouse(true) - else - bar:EnableMouse(false) - end + bar:EnableMouse((IsShiftKeyDown() and db.profile.barOnShift ~= "NONE") + or (IsControlKeyDown() and db.profile.barOnControl ~= "NONE") + or (IsAltKeyDown() and db.profile.barOnAlt ~= "NONE")) bar:Start(maxBarTime) RearrangeBars() return bar @@ -209,6 +207,14 @@ do end end end + API:RegisterEvent("MODIFIER_STATE_CHANGED", function() + local enabled = (IsShiftKeyDown() and db.profile.barOnShift ~= "NONE") + or (IsControlKeyDown() and db.profile.barOnControl ~= "NONE") + or (IsAltKeyDown() and db.profile.barOnAlt ~= "NONE") + for bar in next, activeBars do + bar:EnableMouse(enabled) + end + end) function API:RegisterZone(id) zoneIds[id] = self diff --git a/Core_Vanilla.lua b/Core_Vanilla.lua index e24123d..add2483 100644 --- a/Core_Vanilla.lua +++ b/Core_Vanilla.lua @@ -137,11 +137,9 @@ do bar.candyBarLabel:SetFont(media:Fetch("font", db.profile.font), db.profile.fontSize, flags) bar.candyBarDuration:SetFont(media:Fetch("font", db.profile.font), db.profile.fontSize, flags) bar:SetScript("OnMouseUp", BarOnClick) - if db.profile.barOnShift ~= "NONE" or db.profile.barOnControl ~= "NONE" or db.profile.barOnAlt ~= "NONE" then - bar:EnableMouse(true) - else - bar:EnableMouse(false) - end + bar:EnableMouse((IsShiftKeyDown() and db.profile.barOnShift ~= "NONE") + or (IsControlKeyDown() and db.profile.barOnControl ~= "NONE") + or (IsAltKeyDown() and db.profile.barOnAlt ~= "NONE")) bar:Start(maxBarTime) RearrangeBars() return bar @@ -209,6 +207,14 @@ do end end end + API:RegisterEvent("MODIFIER_STATE_CHANGED", function() + local enabled = (IsShiftKeyDown() and db.profile.barOnShift ~= "NONE") + or (IsControlKeyDown() and db.profile.barOnControl ~= "NONE") + or (IsAltKeyDown() and db.profile.barOnAlt ~= "NONE") + for bar in next, activeBars do + bar:EnableMouse(enabled) + end + end) function API:RegisterZone(id) zoneIds[id] = self diff --git a/Core_Wrath.lua b/Core_Wrath.lua index 4fb1e7d..51072a1 100644 --- a/Core_Wrath.lua +++ b/Core_Wrath.lua @@ -137,11 +137,9 @@ do bar.candyBarLabel:SetFont(media:Fetch("font", db.profile.font), db.profile.fontSize, flags) bar.candyBarDuration:SetFont(media:Fetch("font", db.profile.font), db.profile.fontSize, flags) bar:SetScript("OnMouseUp", BarOnClick) - if db.profile.barOnShift ~= "NONE" or db.profile.barOnControl ~= "NONE" or db.profile.barOnAlt ~= "NONE" then - bar:EnableMouse(true) - else - bar:EnableMouse(false) - end + bar:EnableMouse((IsShiftKeyDown() and db.profile.barOnShift ~= "NONE") + or (IsControlKeyDown() and db.profile.barOnControl ~= "NONE") + or (IsAltKeyDown() and db.profile.barOnAlt ~= "NONE")) bar:Start(maxBarTime) RearrangeBars() return bar @@ -209,6 +207,14 @@ do end end end + API:RegisterEvent("MODIFIER_STATE_CHANGED", function() + local enabled = (IsShiftKeyDown() and db.profile.barOnShift ~= "NONE") + or (IsControlKeyDown() and db.profile.barOnControl ~= "NONE") + or (IsAltKeyDown() and db.profile.barOnAlt ~= "NONE") + for bar in next, activeBars do + bar:EnableMouse(enabled) + end + end) function API:RegisterZone(id) zoneIds[id] = self From a2ebb20098859421924f6b4716ab6f02948fe8ba Mon Sep 17 00:00:00 2001 From: Vincent Cassiau Date: Sun, 18 May 2025 21:35:17 +0200 Subject: [PATCH 2/2] fix(core): only register MODIFIER_STATE_CHANGED in battlegrounds, arenas and test mode - Add UpdateBarMouseState function to manage bar interactivity - Register MODIFIER_STATE_CHANGED only in PvP zones - Implement polling timer for test mode outside PvP zones - Apply consistent implementation across all Core files (Retail, BCC, Vanilla, Wrath) - Clean up timers and events properly in StopAllBars --- Core.lua | 93 +++++++++++++++++++++++++++++++++--------------- Core_BCC.lua | 78 ++++++++++++++++++++++++++++------------ Core_Vanilla.lua | 78 +++++++++++++++++++++++++++++----------- Core_Wrath.lua | 57 ++++++++++++++++++++++------- 4 files changed, 222 insertions(+), 84 deletions(-) diff --git a/Core.lua b/Core.lua index ac5a29f..5349490 100644 --- a/Core.lua +++ b/Core.lua @@ -1,4 +1,3 @@ - -- LOCALS local addonName, mod = ... local frame = CreateFrame("Frame", "CappingFrame", UIParent) @@ -12,6 +11,21 @@ local zoneIds = {} local activeBars = { } frame.bars = activeBars +local function UpdateBarMouseState() + if not db then return end + local enabled = (IsShiftKeyDown() and db.profile.barOnShift ~= "NONE") + or (IsControlKeyDown() and db.profile.barOnControl ~= "NONE") + or (IsAltKeyDown() and db.profile.barOnAlt ~= "NONE") + for bar in next, activeBars do + bar:EnableMouse(enabled) + end +end + +local function IsInPvPZone() + local _, instanceType = GetInstanceInfo() + return instanceType == "pvp" or instanceType == "arena" +end + -- LIBRARIES local candy = LibStub("LibCandyBar-3.0") local media = LibStub("LibSharedMedia-3.0") @@ -172,6 +186,17 @@ do for bar in next, activeBars do bar:Stop() end + -- Clean up test mode timer + if core and core.testModeTimer then + core.testModeTimer:Cancel() + core.testModeTimer = nil + end + -- Clean up any remaining events outside of PvP zones + if core and core:IsEventRegistered("MODIFIER_STATE_CHANGED") then + if not IsInPvPZone() then + core:UnregisterEvent("MODIFIER_STATE_CHANGED") + end + end end function API:GetBar(text) @@ -185,11 +210,13 @@ do do local eventMap = {} frame:SetScript("OnEvent", function(_, event, ...) - for k,v in next, eventMap[event] do - if type(v) == "function" then - v(...) - else - k[v](k, ...) + if eventMap[event] then + for k,v in next, eventMap[event] do + if type(v) == "function" then + v(...) + else + k[v](k, ...) + end end end end) @@ -207,16 +234,10 @@ do eventMap[event] = nil end end - end - API:RegisterEvent("MODIFIER_STATE_CHANGED", function() - local enabled = (IsShiftKeyDown() and db.profile.barOnShift ~= "NONE") - or (IsControlKeyDown() and db.profile.barOnControl ~= "NONE") - or (IsAltKeyDown() and db.profile.barOnAlt ~= "NONE") - for bar in next, activeBars do - bar:EnableMouse(enabled) + function API:IsEventRegistered(event) + return eventMap[event] and eventMap[event][self] and true or false end - end) - + end function API:RegisterZone(id) zoneIds[id] = self end @@ -840,21 +861,26 @@ do local GetInstanceInfo = GetInstanceInfo function core:PLAYER_ENTERING_WORLD() local _, instanceType, _, _, _, _, _, id = GetInstanceInfo() - if zoneIds[id] then - prevZone = id - self:RegisterEvent("PLAYER_LEAVING_WORLD") - zoneIds[id]:EnterZone(id) - elseif zoneIds[instanceType] then - prevZone = instanceType - self:RegisterEvent("PLAYER_LEAVING_WORLD") - zoneIds[instanceType]:EnterZone(id) - end + if zoneIds[id] then + prevZone = id + self:RegisterEvent("PLAYER_LEAVING_WORLD") + zoneIds[id]:EnterZone(id) + self:RegisterEvent("MODIFIER_STATE_CHANGED", UpdateBarMouseState) + UpdateBarMouseState() + elseif zoneIds[instanceType] then + prevZone = instanceType + self:RegisterEvent("PLAYER_LEAVING_WORLD") + zoneIds[instanceType]:EnterZone(id) + self:RegisterEvent("MODIFIER_STATE_CHANGED", UpdateBarMouseState) + UpdateBarMouseState() + end end function core:PLAYER_LEAVING_WORLD() - self:UnregisterEvent("PLAYER_LEAVING_WORLD") - self:StopAllBars() - zoneIds[prevZone]:ExitZone() - prevZone = nil + self:UnregisterEvent("PLAYER_LEAVING_WORLD") + self:UnregisterEvent("MODIFIER_STATE_CHANGED") + self:StopAllBars() + zoneIds[prevZone]:ExitZone() + prevZone = nil end end @@ -863,6 +889,15 @@ function core:Test(locale) core:StartBar(locale.otherBars, 75, 1582141, "colorOther") -- Interface/Icons/Achievement_PVP_Legion03 core:StartBar(locale.allianceBars, 45, 132486, "colorAlliance") -- Interface/Icons/INV_BannerPVP_02 core:StartBar(locale.hordeBars, 25, 132485, "colorHorde") -- Interface/Icons/INV_BannerPVP_01 + + -- Use polling only outside of PvP zones where MODIFIER_STATE_CHANGED doesn't work + if not IsInPvPZone() then + self.testModeTimer = C_Timer.NewTicker(0.2, function() + UpdateBarMouseState() + end) + end + + UpdateBarMouseState() end frame.Test = core.Test @@ -906,4 +941,4 @@ do openOpts() end end) -end +end \ No newline at end of file diff --git a/Core_BCC.lua b/Core_BCC.lua index 0b050ba..953aef3 100644 --- a/Core_BCC.lua +++ b/Core_BCC.lua @@ -11,6 +11,21 @@ local zoneIds = {} local activeBars = { } frame.bars = activeBars +local function UpdateBarMouseState() + if not db then return end + local enabled = (IsShiftKeyDown() and db.profile.barOnShift ~= "NONE") + or (IsControlKeyDown() and db.profile.barOnControl ~= "NONE") + or (IsAltKeyDown() and db.profile.barOnAlt ~= "NONE") + for bar in next, activeBars do + bar:EnableMouse(enabled) + end +end + +local function IsInPvPZone() + local _, instanceType = GetInstanceInfo() + return instanceType == "pvp" or instanceType == "arena" +end + -- LIBRARIES local candy = LibStub("LibCandyBar-3.0") local media = LibStub("LibSharedMedia-3.0") @@ -171,6 +186,17 @@ do for bar in next, activeBars do bar:Stop() end + -- Clean up test mode timer + if self.testModeTimer then + self.testModeTimer:Cancel() + self.testModeTimer = nil + end + -- Clean up any remaining events outside of PvP zones + if self:IsEventRegistered("MODIFIER_STATE_CHANGED") then + if not IsInPvPZone() then + self:UnregisterEvent("MODIFIER_STATE_CHANGED") + end + end end function API:GetBar(text) @@ -207,15 +233,6 @@ do end end end - API:RegisterEvent("MODIFIER_STATE_CHANGED", function() - local enabled = (IsShiftKeyDown() and db.profile.barOnShift ~= "NONE") - or (IsControlKeyDown() and db.profile.barOnControl ~= "NONE") - or (IsAltKeyDown() and db.profile.barOnAlt ~= "NONE") - for bar in next, activeBars do - bar:EnableMouse(enabled) - end - end) - function API:RegisterZone(id) zoneIds[id] = self end @@ -802,6 +819,11 @@ do SelectAvailableQuest(id) end end + + function API:IsEventRegistered(event) + if not frame.events then return false end + return frame.events[event] and true or false + end function mod:NewMod() local t = {} @@ -893,21 +915,26 @@ do local GetInstanceInfo = GetInstanceInfo function core:PLAYER_ENTERING_WORLD() local _, instanceType, _, _, _, _, _, id = GetInstanceInfo() - if zoneIds[id] then - prevZone = id - self:RegisterEvent("PLAYER_LEAVING_WORLD") - zoneIds[id]:EnterZone(id) - elseif zoneIds[instanceType] then - prevZone = instanceType - self:RegisterEvent("PLAYER_LEAVING_WORLD") - zoneIds[instanceType]:EnterZone(id) - end + if zoneIds[id] then + prevZone = id + self:RegisterEvent("PLAYER_LEAVING_WORLD") + zoneIds[id]:EnterZone(id) + self:RegisterEvent("MODIFIER_STATE_CHANGED", UpdateBarMouseState) + UpdateBarMouseState() + elseif zoneIds[instanceType] then + prevZone = instanceType + self:RegisterEvent("PLAYER_LEAVING_WORLD") + zoneIds[instanceType]:EnterZone(id) + self:RegisterEvent("MODIFIER_STATE_CHANGED", UpdateBarMouseState) + UpdateBarMouseState() + end end function core:PLAYER_LEAVING_WORLD() - self:UnregisterEvent("PLAYER_LEAVING_WORLD") - self:StopAllBars() - zoneIds[prevZone]:ExitZone() - prevZone = nil + self:UnregisterEvent("PLAYER_LEAVING_WORLD") + self:UnregisterEvent("MODIFIER_STATE_CHANGED") + self:StopAllBars() + zoneIds[prevZone]:ExitZone() + prevZone = nil end end @@ -916,6 +943,13 @@ function core:Test(locale) core:StartBar(locale.otherBars, 75, 132333, "colorOther") -- Interface/Icons/Ability_warrior_battleshout core:StartBar(locale.allianceBars, 45, 132486, "colorAlliance") -- Interface/Icons/INV_BannerPVP_02 core:StartBar(locale.hordeBars, 25, 132485, "colorHorde") -- Interface/Icons/INV_BannerPVP_01 + + if not IsInPvPZone() then + if self.testModeTimer then self.testModeTimer:Cancel() end + self.testModeTimer = C_Timer.NewTicker(0.2, function() + UpdateBarMouseState() + end) + end end frame.Test = core.Test diff --git a/Core_Vanilla.lua b/Core_Vanilla.lua index add2483..89173ff 100644 --- a/Core_Vanilla.lua +++ b/Core_Vanilla.lua @@ -11,6 +11,21 @@ local zoneIds = {} local activeBars = { } frame.bars = activeBars +local function UpdateBarMouseState() + if not db then return end + local enabled = (IsShiftKeyDown() and db.profile.barOnShift ~= "NONE") + or (IsControlKeyDown() and db.profile.barOnControl ~= "NONE") + or (IsAltKeyDown() and db.profile.barOnAlt ~= "NONE") + for bar in next, activeBars do + bar:EnableMouse(enabled) + end +end + +local function IsInPvPZone() + local _, instanceType = GetInstanceInfo() + return instanceType == "pvp" or instanceType == "arena" +end + -- LIBRARIES local candy = LibStub("LibCandyBar-3.0") local media = LibStub("LibSharedMedia-3.0") @@ -171,6 +186,17 @@ do for bar in next, activeBars do bar:Stop() end + -- Clean up test mode timer + if self.testModeTimer then + self.testModeTimer:Cancel() + self.testModeTimer = nil + end + -- Clean up any remaining events outside of PvP zones + if self:IsEventRegistered("MODIFIER_STATE_CHANGED") then + if not IsInPvPZone() then + self:UnregisterEvent("MODIFIER_STATE_CHANGED") + end + end end function API:GetBar(text) @@ -207,14 +233,7 @@ do end end end - API:RegisterEvent("MODIFIER_STATE_CHANGED", function() - local enabled = (IsShiftKeyDown() and db.profile.barOnShift ~= "NONE") - or (IsControlKeyDown() and db.profile.barOnControl ~= "NONE") - or (IsAltKeyDown() and db.profile.barOnAlt ~= "NONE") - for bar in next, activeBars do - bar:EnableMouse(enabled) - end - end) +-- UpdateBarMouseState removed (already defined above) function API:RegisterZone(id) zoneIds[id] = self @@ -796,6 +815,11 @@ do SelectAvailableQuest(id) end end + + function API:IsEventRegistered(event) + if not frame.events then return false end + return frame.events[event] and true or false + end function mod:NewMod() local t = {} @@ -887,21 +911,26 @@ do local GetInstanceInfo = GetInstanceInfo function core:PLAYER_ENTERING_WORLD() local _, instanceType, _, _, _, _, _, id = GetInstanceInfo() - if zoneIds[id] then - prevZone = id - self:RegisterEvent("PLAYER_LEAVING_WORLD") - zoneIds[id]:EnterZone(id) - elseif zoneIds[instanceType] then - prevZone = instanceType - self:RegisterEvent("PLAYER_LEAVING_WORLD") - zoneIds[instanceType]:EnterZone(id) - end + if zoneIds[id] then + prevZone = id + self:RegisterEvent("PLAYER_LEAVING_WORLD") + zoneIds[id]:EnterZone(id) + self:RegisterEvent("MODIFIER_STATE_CHANGED", UpdateBarMouseState) + UpdateBarMouseState() + elseif zoneIds[instanceType] then + prevZone = instanceType + self:RegisterEvent("PLAYER_LEAVING_WORLD") + zoneIds[instanceType]:EnterZone(id) + self:RegisterEvent("MODIFIER_STATE_CHANGED", UpdateBarMouseState) + UpdateBarMouseState() + end end function core:PLAYER_LEAVING_WORLD() - self:UnregisterEvent("PLAYER_LEAVING_WORLD") - self:StopAllBars() - zoneIds[prevZone]:ExitZone() - prevZone = nil + self:UnregisterEvent("PLAYER_LEAVING_WORLD") + self:UnregisterEvent("MODIFIER_STATE_CHANGED") + self:StopAllBars() + zoneIds[prevZone]:ExitZone() + prevZone = nil end end @@ -910,6 +939,13 @@ function core:Test(locale) core:StartBar(locale.otherBars, 75, 132089, "colorOther") -- Interface/Icons/Ability_ambush core:StartBar(locale.allianceBars, 45, 132486, "colorAlliance") -- Interface/Icons/INV_BannerPVP_02 core:StartBar(locale.hordeBars, 25, 132485, "colorHorde") -- Interface/Icons/INV_BannerPVP_01 + + if not IsInPvPZone() then + if self.testModeTimer then self.testModeTimer:Cancel() end + self.testModeTimer = C_Timer.NewTicker(0.2, function() + UpdateBarMouseState() + end) + end end frame.Test = core.Test diff --git a/Core_Wrath.lua b/Core_Wrath.lua index 51072a1..7ca7e75 100644 --- a/Core_Wrath.lua +++ b/Core_Wrath.lua @@ -11,6 +11,21 @@ local zoneIds = {} local activeBars = { } frame.bars = activeBars +local function UpdateBarMouseState() + if not db then return end + local enabled = (IsShiftKeyDown() and db.profile.barOnShift ~= "NONE") + or (IsControlKeyDown() and db.profile.barOnControl ~= "NONE") + or (IsAltKeyDown() and db.profile.barOnAlt ~= "NONE") + for bar in next, activeBars do + bar:EnableMouse(enabled) + end +end + +local function IsInPvPZone() + local _, instanceType = GetInstanceInfo() + return instanceType == "pvp" or instanceType == "arena" +end + -- LIBRARIES local candy = LibStub("LibCandyBar-3.0") local media = LibStub("LibSharedMedia-3.0") @@ -171,6 +186,17 @@ do for bar in next, activeBars do bar:Stop() end + -- Clean up test mode timer + if self.testModeTimer then + self.testModeTimer:Cancel() + self.testModeTimer = nil + end + -- Clean up any remaining events outside of PvP zones + if self:IsEventRegistered("MODIFIER_STATE_CHANGED") then + if not IsInPvPZone() then + self:UnregisterEvent("MODIFIER_STATE_CHANGED") + end + end end function API:GetBar(text) @@ -206,15 +232,10 @@ do eventMap[event] = nil end end - end - API:RegisterEvent("MODIFIER_STATE_CHANGED", function() - local enabled = (IsShiftKeyDown() and db.profile.barOnShift ~= "NONE") - or (IsControlKeyDown() and db.profile.barOnControl ~= "NONE") - or (IsAltKeyDown() and db.profile.barOnAlt ~= "NONE") - for bar in next, activeBars do - bar:EnableMouse(enabled) + function API:IsEventRegistered(event) + return eventMap[event] and eventMap[event][self] and true or false end - end) + end function API:RegisterZone(id) zoneIds[id] = self @@ -897,17 +918,22 @@ do prevZone = id self:RegisterEvent("PLAYER_LEAVING_WORLD") zoneIds[id]:EnterZone(id) + self:RegisterEvent("MODIFIER_STATE_CHANGED", UpdateBarMouseState) + UpdateBarMouseState() elseif zoneIds[instanceType] then prevZone = instanceType self:RegisterEvent("PLAYER_LEAVING_WORLD") zoneIds[instanceType]:EnterZone(id) + self:RegisterEvent("MODIFIER_STATE_CHANGED", UpdateBarMouseState) + UpdateBarMouseState() end end function core:PLAYER_LEAVING_WORLD() - self:UnregisterEvent("PLAYER_LEAVING_WORLD") - self:StopAllBars() - zoneIds[prevZone]:ExitZone() - prevZone = nil + self:UnregisterEvent("PLAYER_LEAVING_WORLD") + self:UnregisterEvent("MODIFIER_STATE_CHANGED") + self:StopAllBars() + zoneIds[prevZone]:ExitZone() + prevZone = nil end end @@ -916,6 +942,13 @@ function core:Test(locale) core:StartBar(locale.otherBars, 75, 132333, "colorOther") -- Interface/Icons/Ability_warrior_battleshout core:StartBar(locale.allianceBars, 45, 132486, "colorAlliance") -- Interface/Icons/INV_BannerPVP_02 core:StartBar(locale.hordeBars, 25, 132485, "colorHorde") -- Interface/Icons/INV_BannerPVP_01 + + if not IsInPvPZone() then + if self.testModeTimer then self.testModeTimer:Cancel() end + self.testModeTimer = C_Timer.NewTicker(0.2, function() + UpdateBarMouseState() + end) + end end frame.Test = core.Test