support course backgrounds in the default theme. todo: make the course display do more

This commit is contained in:
AJ Kelly
2011-08-21 21:38:09 -05:00
parent 39f3a978eb
commit faa79db48d
2 changed files with 41 additions and 5 deletions
@@ -0,0 +1,32 @@
if not GAMESTATE:IsCourseMode() then return Def.ActorFrame{} end; -- short circuit
local course = GAMESTATE:GetCurrentCourse()
local t = Def.ActorFrame{
-- background
Def.Sprite{
InitCommand=cmd(Center);
BeginCommand=function(self)
if course:GetBackgroundPath() then
self:Load( course:GetBackgroundPath() )
else
-- default to the BG of the first song in the course
self:LoadFromCurrentSongBackground()
end
end;
OnCommand=cmd(diffusealpha,0;scaletoclipped,SCREEN_WIDTH,SCREEN_HEIGHT;sleep,0.5;linear,0.50;diffusealpha,1;sleep,3);
};
-- alternate background
Def.Sprite{
InitCommand=cmd(Center;);
BeginCommand=cmd(LoadFromCurrentSongBackground;scaletoclipped,SCREEN_WIDTH,SCREEN_HEIGHT;diffusealpha,0);
OnCommand=cmd(sleep,4;playcommand,"Show");
ShowCommand=function(self)
if course:HasBackground() then
self:accelerate(0.25)
self:diffusealpha(1)
end
end;
};
};
return t;
@@ -22,11 +22,15 @@ local t = Def.ActorFrame {};
t[#t+1] = Def.Quad {
InitCommand=cmd(Center;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;diffuse,Color("Black"));
};
t[#t+1] = Def.Sprite {
InitCommand=cmd(Center);
BeginCommand=cmd(LoadFromCurrentSongBackground);
OnCommand=cmd(diffusealpha,0;scaletoclipped,SCREEN_WIDTH,SCREEN_HEIGHT;sleep,0.5;linear,0.50;diffusealpha,1;sleep,3);
};
if GAMESTATE:IsCourseMode() then
t[#t+1] = LoadActor("CourseDisplay");
else
t[#t+1] = Def.Sprite {
InitCommand=cmd(Center);
BeginCommand=cmd(LoadFromCurrentSongBackground);
OnCommand=cmd(diffusealpha,0;scaletoclipped,SCREEN_WIDTH,SCREEN_HEIGHT;sleep,0.5;linear,0.50;diffusealpha,1;sleep,3);
};
end
t[#t+1] = Def.ActorFrame {
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);