Skip to content

Commit 078d6e0

Browse files
committed
Fix overlay glow on Retail after LAB update
1 parent e905eae commit 078d6e0

File tree

3 files changed

+47
-20
lines changed

3 files changed

+47
-20
lines changed

ConsolePort/ConsolePort.toc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Title: Console Port
44
## Notes: Gamepad addon suite
55
## AddonCompartmentFunc: ConsolePort
6-
## Version: 3.1.10
6+
## Version: 3.1.11
77

88
## Author: Sebastian Lindfors
99
## X-Website: https://github.com/seblindfors/ConsolePort

ConsolePort/Libs/Local/ActionButton.lua

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -138,26 +138,11 @@ function Lib.SkinUtility.SkinChargeCooldown(self, skin, reset)
138138
end)
139139
end
140140

141-
function Lib.SkinUtility.NegateAssistedCombat(self)
142-
-- Negate LAB:UpdateAssistedCombatRotationFrame.
143-
self.AssistedCombatRotationFrame = { UpdateState = nop };
144-
end
145-
146-
do -- Lib.SkinUtility.SkinOverlayGlow
147-
function Lib.SkinUtility.SkinOverlayGlow(self, onShow, onHide)
148-
if self.__LBGoverlaySkin then return end;
149-
self.ShowOverlayGlow = onShow;
150-
self.HideOverlayGlow = onHide;
151-
self.__LBGoverlaySkin = true;
152-
end
153-
end -- Lib.SkinUtility.SkinOverlayGlow
154-
155141
---------------------------------------------------------------
156142
-- Skins
157143
---------------------------------------------------------------
158144

159145
do -- Lib.Skin.ColorSwatchProc
160-
local SkinOverlayGlow = Lib.SkinUtility.SkinOverlayGlow;
161146
local SwatchPool = CreateFramePool('Frame', UIParent, 'CPSwatchHighlightTemplate')
162147

163148
local function OnShowOverlay(self)
@@ -186,7 +171,7 @@ do -- Lib.Skin.ColorSwatchProc
186171
Lib.Skin.ColorSwatchProc = function(self, config) config = config or {};
187172
self.__procText = config.procText or self.__procText;
188173
self.__procNoSwatch = config.noSwatch or self.__procNoSwatch;
189-
SkinOverlayGlow(self, OnShowOverlay, OnHideOverlay)
174+
Lib.SkinUtility.SkinOverlayGlow(self, OnShowOverlay, OnHideOverlay)
190175
end;
191176
end -- Lib.Skin.ColorSwatchProc
192177

@@ -200,7 +185,7 @@ do -- Lib.Skin.RingButton
200185
local obj, scale;
201186
local r, g, b = CPPieMenuMixin.SliceColors.Accent:GetRGB()
202187
local size = self:GetSize()
203-
Lib.SkinUtility.NegateAssistedCombat(self)
188+
Lib.SkinUtility.SkinRotationHelper(self)
204189
do obj = self.NormalTexture;
205190
scale = 110 / 64;
206191
obj:ClearAllPoints()
@@ -421,7 +406,7 @@ do -- Workaround for LAB's private type meta map.
421406
setmetatable(Lib.TypeMetaMap, {__index = function(self, k)
422407
local ReferenceHeader = CreateFrame('Frame', 'ConsolePortABRefHeader', nil, 'SecureHandlerStateTemplate')
423408
local ReferenceButton = LAB:CreateButton('ref', '$parentButton', ReferenceHeader)
424-
Lib.SkinUtility.NegateAssistedCombat(ReferenceButton)
409+
Lib.SkinUtility.SkinRotationHelper(ReferenceButton)
425410
for meta, dummy in pairs({
426411
empty = 0;
427412
action = 1;
@@ -471,6 +456,48 @@ function LBG.HideOverlayGlow(button)
471456
return HideOverlayGlow(button)
472457
end
473458

459+
local AlertFrameDummy = {
460+
Show = nop; Hide = nop;
461+
Play = nop; Stop = nop;
462+
SetAtlas = nop;
463+
};
464+
465+
local function OnAlertFrameShown(self)
466+
LBG.ShowOverlayGlow(self:GetParent())
467+
end
468+
469+
local function OnAlertFrameHidden(self)
470+
LBG.HideOverlayGlow(self:GetParent())
471+
end
472+
473+
function Lib.SkinUtility.SkinRotationHelper(self)
474+
-- Negate ActionButtonSpellAlertManager
475+
local alert = CreateFrame('Frame', nil, self)
476+
477+
alert:Hide()
478+
alert.ProcStartFlipbook = AlertFrameDummy;
479+
alert.ProcLoopFlipbook = AlertFrameDummy;
480+
alert.ProcAltGlow = AlertFrameDummy;
481+
alert.ProcStartAnim = AlertFrameDummy;
482+
alert:SetScript('OnShow', OnAlertFrameShown)
483+
alert:SetScript('OnHide', OnAlertFrameHidden)
484+
485+
self.SpellActivationAlert = alert;
486+
487+
-- Negate LAB:UpdateAssistedCombatRotationFrame.
488+
local frame = CreateFrame('Frame', nil, self)
489+
frame.UpdateState = nop;
490+
frame.SpellActivationAlert = self.SpellActivationAlert;
491+
self.AssistedCombatRotationFrame = frame;
492+
end
493+
494+
function Lib.SkinUtility.SkinOverlayGlow(self, onShow, onHide)
495+
if self.__LBGoverlaySkin then return end;
496+
self.ShowOverlayGlow = onShow;
497+
self.HideOverlayGlow = onHide;
498+
self.__LBGoverlaySkin = true;
499+
end
500+
474501
end -- LBG hook
475502

476503
---------------------------------------------------------------

ConsolePort_Bar/Widget/Button/Button.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function SlotButton:OnLoad()
8383
self:CreateEnvironment()
8484
self:SetAttribute(env.Attributes.GUID, true)
8585
env.LIB.Skin.SlotButton(self)
86-
env.LIB.SkinUtility.NegateAssistedCombat(self)
86+
env.LIB.SkinUtility.SkinRotationHelper(self)
8787
end
8888

8989
function SlotButton:OnTypeChanged(isAction)

0 commit comments

Comments
 (0)