Added an assertion with an detailed error message to debug an error in the action button code.
This commit is contained in:
@@ -265,6 +265,7 @@ end
|
|||||||
function Button:RefreshStateAction(state)
|
function Button:RefreshStateAction(state)
|
||||||
local state = tonumber(state or self:GetAttribute("state")) or 0
|
local state = tonumber(state or self:GetAttribute("state")) or 0
|
||||||
local action = self.stateactions[state]
|
local action = self.stateactions[state]
|
||||||
|
assert(action, ("No valid action for state %d on button %d of Bar %d"):format(state, self.rid, self.parent.id))
|
||||||
self:SetAttribute("action-"..state, action)
|
self:SetAttribute("action-"..state, action)
|
||||||
|
|
||||||
if action > 120 and action <= 126 then
|
if action > 120 and action <= 126 then
|
||||||
|
|||||||
@@ -380,7 +380,7 @@ function Bar:ControlFadeOut()
|
|||||||
fade = min(max(fade, 0), 100) / 100
|
fade = min(max(fade, 0), 100) / 100
|
||||||
self:SetAlpha(fade)
|
self:SetAlpha(fade)
|
||||||
else
|
else
|
||||||
self:SetAlpha(self.config.fadeoutalpha)
|
self:SetAlpha(self.config.fadeoutalpha or 0)
|
||||||
end
|
end
|
||||||
self.faded = true
|
self.faded = true
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user