Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Commit 5f013de

Browse files
committed
Try to fix Extra action button flickering, again
1 parent 613799f commit 5f013de

File tree

5 files changed

+20
-25
lines changed

5 files changed

+20
-25
lines changed

Neuron.toc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ XML\NeuronStatusBarTemplate.xml
5353
Neuron-Startup.lua
5454

5555
Neuron-GUI.lua
56-
XML\Neuron-GUI.xml
56+
XML\Neuron-GUI.xml

Objects/BUTTON.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,7 @@ function BUTTON:CancelCooldownTimer(stopAnimation)
148148
end
149149
self.iconframecooldown.timer:SetText("")
150150

151-
if self.data.alpha then
152-
self:SetAlpha(self.data.alpha) --try to restore the original alpha
153-
else
154-
self:SetAlpha(1)
155-
end
151+
self:SetObjectVisibility()
156152

157153
self.iconframecooldown.showCountdownTimer = false
158154
self.iconframecooldown.showCountdownAlpha = false
@@ -167,7 +163,10 @@ end
167163
function BUTTON:SetCooldownTimer(start, duration, enable, showCountdownTimer, modrate, color1, color2, showCountdownAlpha, charges, maxCharges)
168164

169165
if not self.isShown then --if the button isn't shown, don't do set any cooldowns
170-
self:CancelCooldownTimer(true)
166+
--if there's currently a timer, cancel it
167+
if self:TimeLeft(self.iconframecooldown.cooldownTimer) ~= 0 then
168+
self:CancelCooldownTimer(true)
169+
end
171170
return
172171
end
173172

@@ -500,6 +499,7 @@ function BUTTON:SetObjectVisibility()
500499
else
501500
self:SetAlpha(0)
502501
end
502+
503503
else
504504

505505
if InCombatLockdown() then

Objects/EXITBTN.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ end
6666

6767

6868
function EXITBTN:OnEvent(event, ...)
69-
self:SetButtonTex()
69+
self:UpdateIcon()
7070
self:SetObjectVisibility()
7171
end
7272

@@ -83,7 +83,8 @@ function EXITBTN:SetObjectVisibility(show)
8383

8484
end
8585

86-
function EXITBTN:SetButtonTex()
86+
---overwrite function in parent class BUTTON
87+
function EXITBTN:UpdateIcon()
8788

8889
self.iconframeicon:SetTexture("Interface\\AddOns\\Neuron\\Images\\new_vehicle_exit")
8990

Objects/EXTRABTN.lua

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ function EXTRABTN:SetType()
5757
self:RegisterEvent("ZONE_CHANGED", "OnEvent")
5858
self:RegisterEvent("SPELLS_CHANGED", "OnEvent")
5959
self:RegisterEvent("PLAYER_ENTERING_WORLD", "OnEvent")
60-
self:RegisterEvent("SPELL_UPDATE_COOLDOWN", "OnEvent")
61-
self:RegisterEvent("SPELL_UPDATE_CHARGES", "OnEvent")
62-
self:RegisterEvent("SPELL_UPDATE_USABLE", "OnEvent")
60+
--self:RegisterEvent("SPELL_UPDATE_COOLDOWN", "OnEvent")
61+
--self:RegisterEvent("SPELL_UPDATE_CHARGES", "OnEvent")
62+
--self:RegisterEvent("SPELL_UPDATE_USABLE", "OnEvent")
6363

6464
self:SetAttribute("type1", "action")
6565

@@ -70,16 +70,13 @@ function EXTRABTN:SetType()
7070
self:SetScript("OnEnter", function(self, ...) self:OnEnter(...) end)
7171
self:SetScript("OnLeave", GameTooltip_Hide)
7272

73-
74-
7573
self:SetSkinned()
7674
end
7775

7876

7977
function EXTRABTN:OnEvent(event, ...)
8078

8179
self:UpdateButton()
82-
self:SetObjectVisibility()
8380

8481
if event == "PLAYER_ENTERING_WORLD" then
8582
self.binder:ApplyBindings()
@@ -107,6 +104,8 @@ function EXTRABTN:UpdateButton()
107104
_, self.spellID = GetActionInfo(self.actionID)
108105
self.spellName, _, self.spellIcon = GetSpellInfo(self.spellID);
109106

107+
self:SetObjectVisibility()
108+
110109
if self.spellID then
111110
self:UpdateIcon()
112111

@@ -137,11 +136,6 @@ end
137136

138137
---overwrite function in parent class BUTTON
139138
function EXTRABTN:UpdateIcon()
140-
self:SetButtonTex()
141-
end
142-
143-
144-
function EXTRABTN:SetButtonTex()
145139

146140
self.iconframeicon:SetTexture(self.spellIcon)
147141

@@ -153,6 +147,7 @@ function EXTRABTN:SetButtonTex()
153147
else
154148
self.style:Hide()
155149
end
150+
156151
end
157152

158153

Objects/ZONEABILITYBTN.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ end
7979
function ZONEABILITYBTN:OnEvent(event, ...)
8080

8181
self:UpdateButton();
82-
self:SetObjectVisibility()
8382

8483
if event == "PLAYER_ENTERING_WORLD" then
8584
self.binder:ApplyBindings()
@@ -93,6 +92,8 @@ function ZONEABILITYBTN:UpdateButton()
9392
self.spellID = GetZoneAbilitySpellInfo();
9493
self.spellName, _, self.spellIcon = GetSpellInfo(self.spellID);
9594

95+
self:SetObjectVisibility()
96+
9697
if self.spellID then
9798
self:UpdateIcon()
9899

@@ -127,10 +128,6 @@ end
127128

128129
---overwrite function in parent class BUTTON
129130
function ZONEABILITYBTN:UpdateIcon()
130-
self:SetButtonTex()
131-
end
132-
133-
function ZONEABILITYBTN:SetButtonTex()
134131

135132
self.iconframeicon:SetTexture(self.spellIcon);
136133

@@ -142,8 +139,10 @@ function ZONEABILITYBTN:SetButtonTex()
142139
else
143140
self.style:Hide()
144141
end
142+
145143
end
146144

145+
147146
function ZONEABILITYBTN:OnEnter(...)
148147

149148
if (self.bar) then

0 commit comments

Comments
 (0)