From cf06d4d754cfa06a5f0f95bacef8026ad32426d7 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 26 Feb 2009 15:16:03 +0100 Subject: [PATCH] Added an assertion with an detailed error message to debug an error in the action button code. --- ActionButton.lua | 1 + Bar.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ActionButton.lua b/ActionButton.lua index 284bb2b..0776ad5 100644 --- a/ActionButton.lua +++ b/ActionButton.lua @@ -265,6 +265,7 @@ end function Button:RefreshStateAction(state) local state = tonumber(state or self:GetAttribute("state")) or 0 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) if action > 120 and action <= 126 then diff --git a/Bar.lua b/Bar.lua index c5c67f0..efa3432 100644 --- a/Bar.lua +++ b/Bar.lua @@ -380,7 +380,7 @@ function Bar:ControlFadeOut() fade = min(max(fade, 0), 100) / 100 self:SetAlpha(fade) else - self:SetAlpha(self.config.fadeoutalpha) + self:SetAlpha(self.config.fadeoutalpha or 0) end self.faded = true end