Only load the background if it exists.

Took us awhile to find it.
This commit is contained in:
Jason Felds
2011-06-10 21:40:56 -04:00
parent ee742856b2
commit b78c5350e3
2 changed files with 8 additions and 2 deletions
@@ -5,7 +5,10 @@ t[#t+1] = Def.ActorFrame {
Def.Sprite {
OnCommand=function(self)
if GAMESTATE:GetCurrentSong() then
self:LoadBackground( GAMESTATE:GetCurrentSong():GetBackgroundPath() );
local song = GAMESTATE:GetCurrentSong();
if song:HasBackground() then
self:LoadBackground(song:GetBackgroundPath());
end;
self:scaletoclipped( SCREEN_WIDTH+1,SCREEN_HEIGHT );
(cmd(fadebottom,0.25;fadetop,0.25;croptop,48/480;cropbottom,48/480))(self);
else
@@ -6,7 +6,10 @@ t[#t+1] = Def.ActorFrame {
Condition=not GAMESTATE:IsCourseMode();
OnCommand=function(self)
if GAMESTATE:GetCurrentSong() then
self:LoadBackground( GAMESTATE:GetCurrentSong():GetBackgroundPath() );
local song = GAMESTATE:GetCurrentSong();
if song:HasBackground() then
self:LoadBackground(song:GetBackgroundPath());
end;
self:scaletoclipped( SCREEN_WIDTH+1,SCREEN_HEIGHT );
(cmd(fadebottom,0.25;fadetop,0.25;croptop,48/480;cropbottom,48/480))(self);
else