support course backgrounds in the default theme. todo: make the course display do more
This commit is contained in:
@@ -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 {
|
t[#t+1] = Def.Quad {
|
||||||
InitCommand=cmd(Center;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;diffuse,Color("Black"));
|
InitCommand=cmd(Center;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;diffuse,Color("Black"));
|
||||||
};
|
};
|
||||||
|
if GAMESTATE:IsCourseMode() then
|
||||||
|
t[#t+1] = LoadActor("CourseDisplay");
|
||||||
|
else
|
||||||
t[#t+1] = Def.Sprite {
|
t[#t+1] = Def.Sprite {
|
||||||
InitCommand=cmd(Center);
|
InitCommand=cmd(Center);
|
||||||
BeginCommand=cmd(LoadFromCurrentSongBackground);
|
BeginCommand=cmd(LoadFromCurrentSongBackground);
|
||||||
OnCommand=cmd(diffusealpha,0;scaletoclipped,SCREEN_WIDTH,SCREEN_HEIGHT;sleep,0.5;linear,0.50;diffusealpha,1;sleep,3);
|
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 {
|
t[#t+1] = Def.ActorFrame {
|
||||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);
|
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);
|
||||||
|
|||||||
Reference in New Issue
Block a user