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

Commit 7a2c9ab

Browse files
committed
fix crash in status buttons with .elements change
1 parent fcb8bdb commit 7a2c9ab

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

Objects/STATUSBTN.lua

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -717,25 +717,25 @@ function STATUSBTN:mirrorbar_Start(type, value, maxvalue, scale, paused, label)
717717
MirrorWatch[type].mbar = mbar
718718
MirrorWatch[type].label = label
719719

720-
mbar.sb.mirror = type
721-
mbar.sb.value = (value / 1000)
722-
mbar.sb.maxvalue = (maxvalue / 1000)
723-
mbar.sb.scale = scale
720+
mbar.elements.SB.mirror = type
721+
mbar.elements.SB.value = (value / 1000)
722+
mbar.elements.SB.maxvalue = (maxvalue / 1000)
723+
mbar.elements.SB.scale = scale
724724

725725
if paused > 0 then
726-
mbar.sb.paused = 1
726+
mbar.elements.SB.paused = 1
727727
else
728-
mbar.sb.paused = nil
728+
mbar.elements.SB.paused = nil
729729
end
730730

731731
local color = MirrorTimerColors[type]
732732

733-
mbar.sb:SetMinMaxValues(0, (maxvalue / 1000))
734-
mbar.sb:SetValue(mbar.sb.value)
735-
mbar.sb:SetStatusBarColor(color.r, color.g, color.b)
733+
mbar.elements.SB:SetMinMaxValues(0, (maxvalue / 1000))
734+
mbar.elements.SB:SetValue(mbar.elements.SB.value)
735+
mbar.elements.SB:SetStatusBarColor(color.r, color.g, color.b)
736736

737-
mbar.sb:SetAlpha(1)
738-
mbar.sb:Show()
737+
mbar.elements.SB:SetAlpha(1)
738+
mbar.elements.SB:Show()
739739
end
740740
end
741741
end
@@ -760,7 +760,7 @@ function STATUSBTN:mirrorbar_Stop(type)
760760
MirrorWatch[type].label = ""
761761
MirrorWatch[type].timer = ""
762762

763-
mbar.sb.mirror = nil
763+
mbar.elements.SB.mirror = nil
764764
end
765765
end
766766
end

XML/NeuronStatusBarTemplate.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@
282282
</Frames>
283283
<Scripts>
284284
<OnShow>
285-
self.feedback:SetStatusBarColor(self:GetParent().sb:GetStatusBarColor())
285+
self.feedback:SetStatusBarColor(self:GetParent().elements.SB:GetStatusBarColor())
286286
</OnShow>
287287
</Scripts>
288288
</CheckButton>

0 commit comments

Comments
 (0)