From d7c754dca73627b923d3252a5767734a31bef76d Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Tue, 22 Jul 2008 13:37:28 +0000 Subject: [PATCH] Fix a few lua errors. I do not actually see the time being displayed anywhere. --- .../ScreenSelectMusic decorations/default.lua | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/default.lua b/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/default.lua index cab2efcd0d..4eae1b85c7 100644 --- a/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/default.lua +++ b/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/default.lua @@ -321,10 +321,14 @@ t[#t+1] = Def.ActorFrame{ InitCommand=cmd(x,-56;y,-10;shadowlength,0;diffuse,color("#E2E2E2");diffusebottomedge,color("#CECECE");strokecolor,color("#00000000")); SetCommand=function(self) local Song = GAMESTATE:GetCurrentSong(); - local time = Song:MusicLengthSeconds(); - time = SecondsToMSSMsMs(time); - time = string.sub(time, 0, string.len(time)-3); - self:settext( time ); + if Song then + local time = Song:MusicLengthSeconds(); + time = SecondsToMSSMsMs(time); + time = string.sub(time, 0, string.len(time)-3); + self:settext( time ); + else + self:settext( "" ); + end end; }; LoadFont("_venacti bold 24px")..{ @@ -332,10 +336,14 @@ t[#t+1] = Def.ActorFrame{ InitCommand=cmd(x,32;y,-4;shadowlength,0;skewx,-0.2;diffusebottomedge,color("#068EE1FF");strokecolor,color("#FF000000")); SetCommand=function(self) local Song = GAMESTATE:GetCurrentSong(); - local postfix = " STAGES"; - if Song:IsLong() then self:settext("2"..postfix); - elseif Song:IsMarathon() then self:settext("3"..postfix); - end; + if Song then + local postfix = " STAGES"; + if Song:IsLong() then self:settext("2"..postfix); + elseif Song:IsMarathon() then self:settext("3"..postfix); + end; + else + self:settext( "" ); + end end; };