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

Commit

Permalink
fix crash in status buttons with .elements change
Browse files Browse the repository at this point in the history
  • Loading branch information
brittyazel committed Apr 1, 2020
1 parent fcb8bdb commit 7a2c9ab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions Objects/STATUSBTN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -717,25 +717,25 @@ function STATUSBTN:mirrorbar_Start(type, value, maxvalue, scale, paused, label)
MirrorWatch[type].mbar = mbar
MirrorWatch[type].label = label

mbar.sb.mirror = type
mbar.sb.value = (value / 1000)
mbar.sb.maxvalue = (maxvalue / 1000)
mbar.sb.scale = scale
mbar.elements.SB.mirror = type
mbar.elements.SB.value = (value / 1000)
mbar.elements.SB.maxvalue = (maxvalue / 1000)
mbar.elements.SB.scale = scale

if paused > 0 then
mbar.sb.paused = 1
mbar.elements.SB.paused = 1
else
mbar.sb.paused = nil
mbar.elements.SB.paused = nil
end

local color = MirrorTimerColors[type]

mbar.sb:SetMinMaxValues(0, (maxvalue / 1000))
mbar.sb:SetValue(mbar.sb.value)
mbar.sb:SetStatusBarColor(color.r, color.g, color.b)
mbar.elements.SB:SetMinMaxValues(0, (maxvalue / 1000))
mbar.elements.SB:SetValue(mbar.elements.SB.value)
mbar.elements.SB:SetStatusBarColor(color.r, color.g, color.b)

mbar.sb:SetAlpha(1)
mbar.sb:Show()
mbar.elements.SB:SetAlpha(1)
mbar.elements.SB:Show()
end
end
end
Expand All @@ -760,7 +760,7 @@ function STATUSBTN:mirrorbar_Stop(type)
MirrorWatch[type].label = ""
MirrorWatch[type].timer = ""

mbar.sb.mirror = nil
mbar.elements.SB.mirror = nil
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion XML/NeuronStatusBarTemplate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
</Frames>
<Scripts>
<OnShow>
self.feedback:SetStatusBarColor(self:GetParent().sb:GetStatusBarColor())
self.feedback:SetStatusBarColor(self:GetParent().elements.SB:GetStatusBarColor())
</OnShow>
</Scripts>
</CheckButton>
Expand Down

0 comments on commit 7a2c9ab

Please sign in to comment.