Skip to content

Commit 5512eff

Browse files
committed
fix: use another solution to override
1 parent 8a68126 commit 5512eff

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

Modules/Skins/Blizzard/CooldownViewer.lua

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,23 @@ local ipairs = ipairs
1010
local pairs = pairs
1111

1212
local hookFunctions = {
13-
RefreshSpellCooldownInfo = S.CooldownManager_RefreshSpellCooldownInfo,
14-
OnSpellActivationOverlayGlowShowEvent = S.CooldownManager_ShowGlowEvent,
15-
OnSpellActivationOverlayGlowHideEvent = S.CooldownManager_HideGlowEvent,
16-
RefreshOverlayGlow = S.CooldownManager_RefreshOverlayGlow,
17-
SetTimerShown = S.CooldownManager_SetTimerShown,
13+
RefreshSpellCooldownInfo = ES.CooldownManager_RefreshSpellCooldownInfo,
14+
OnSpellActivationOverlayGlowShowEvent = function(...)
15+
if not S.db or not S.db.cooldownViewer.general.useBlizzardGlow then
16+
return ES.CooldownManager_ShowGlowEvent(...)
17+
end
18+
end,
19+
OnSpellActivationOverlayGlowHideEvent = function(...)
20+
if not S.db or not S.db.cooldownViewer.general.useBlizzardGlow then
21+
return ES.CooldownManager_HideGlowEvent(...)
22+
end
23+
end,
24+
RefreshOverlayGlow = function(...)
25+
if not S.db or not S.db.cooldownViewer.general.useBlizzardGlow then
26+
return ES.CooldownManager_RefreshOverlayGlow(...)
27+
end
28+
end,
29+
SetTimerShown = ES.CooldownManager_SetTimerShown,
1830
}
1931

2032
function ES:CooldownManager_SkinItemFrame(frame)
@@ -39,18 +51,6 @@ function ES:CooldownManager_SkinItemFrame(frame)
3951
end
4052
end
4153

42-
function S:RefreshElvUICustomGlowOnCooldownManager()
43-
if self.db.cooldownViewer.general.useBlizzardGlow then
44-
hookFunctions.OnSpellActivationOverlayGlowHideEvent = nil
45-
hookFunctions.OnSpellActivationOverlayGlowShowEvent = nil
46-
hookFunctions.RefreshOverlayGlow = nil
47-
else
48-
hookFunctions.OnSpellActivationOverlayGlowHideEvent = S.CooldownManager_HideGlowEvent
49-
hookFunctions.OnSpellActivationOverlayGlowShowEvent = S.CooldownManager_ShowGlowEvent
50-
hookFunctions.RefreshOverlayGlow = S.CooldownManager_RefreshOverlayGlow
51-
end
52-
end
53-
5454
local function UpdateFrameAndStrata(frame, config)
5555
frame:SetFrameStrata(S.db.cooldownViewer[config].frameStrata)
5656
frame:SetFrameLevel(S.db.cooldownViewer[config].frameLevel)
@@ -187,8 +187,6 @@ function S:Blizzard_CooldownViewer_Modification()
187187
if self.db.cooldownViewer.essential.enable then
188188
self:CooldownManager_HandleViewer(_G.EssentialCooldownViewer)
189189
end
190-
191-
self:RefreshElvUICustomGlowOnCooldownManager()
192190
end
193191

194192
function S:Blizzard_CooldownViewer()

Options/Skins.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ options.cooldownViewer = {
518518
end,
519519
set = function(info, value)
520520
E.private.WT.skins.cooldownViewer[info[#info - 1]][info[#info]] = value
521-
S:RefreshElvUICustomGlowOnCooldownManager()
521+
E:StaticPopup_Show("PRIVATE_RL")
522522
end,
523523
disabled = function()
524524
return not E.private.WT.skins.cooldownViewer.enable

0 commit comments

Comments
 (0)