From 7a2c9ab6802bfe770850938719f9b81058d7a012 Mon Sep 17 00:00:00 2001 From: Britt Yazel Date: Wed, 1 Apr 2020 15:16:19 -0700 Subject: [PATCH] fix crash in status buttons with .elements change --- Objects/STATUSBTN.lua | 24 ++++++++++++------------ XML/NeuronStatusBarTemplate.xml | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Objects/STATUSBTN.lua b/Objects/STATUSBTN.lua index 2a0d873f..4a4fe895 100644 --- a/Objects/STATUSBTN.lua +++ b/Objects/STATUSBTN.lua @@ -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 @@ -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 diff --git a/XML/NeuronStatusBarTemplate.xml b/XML/NeuronStatusBarTemplate.xml index 13a55387..d7f7aa62 100644 --- a/XML/NeuronStatusBarTemplate.xml +++ b/XML/NeuronStatusBarTemplate.xml @@ -282,7 +282,7 @@ - self.feedback:SetStatusBarColor(self:GetParent().sb:GetStatusBarColor()) + self.feedback:SetStatusBarColor(self:GetParent().elements.SB:GetStatusBarColor())