-- the screen lasts longer than it should and I don't know a fix for it

local t = Def.ActorFrame {
	-- song BG
	LoadSongBackground() .. {
		Condition=not GAMESTATE:IsCourseMode();
		InitCommand=cmd(diffusealpha,0;sleep,1.3);
		OnCommand=cmd(linear,0.13;glow,1,1,1,1;linear,0.333;diffusealpha,1;glow,1,1,1,0);
	};

	-- song title
	LoadFont("_digital sans")..{
		Condition=not GAMESTATE:IsCourseMode();
		
		Text="";
		
		InitCommand=cmd(x,SCREEN_CENTER_X+100;y,SCREEN_CENTER_Y+100;shadowlength,0;diffusealpha,0;playcommand,"Set");
		OnCommand=cmd(sleep,1.3;linear,0.15;addx,-100;diffusealpha,1);
		OffCommand=cmd(linear,0.15;diffusealpha,0;);
		
		SetCommand=function(self)
			self:settext( GAMESTATE:GetCurrentSong():GetDisplayFullTitle() );
		end;
	};
	
	-- song author
	LoadFont("_digital sans")..{
		Condition=not GAMESTATE:IsCourseMode();
		
		Text="";
		
		InitCommand=cmd(x,SCREEN_CENTER_X+100;y,SCREEN_CENTER_Y+125;shadowlength,0;diffusealpha,0;playcommand,"Set");
		OnCommand=cmd(sleep,1.3;linear,0.15;addx,-100;diffusealpha,1);
		OffCommand=cmd(linear,0.15;diffusealpha,0;);
		
		SetCommand=function(self)
			self:settext( GAMESTATE:GetCurrentSong():GetDisplayArtist() );
		end;
	};
	
	-- lol echodance
	LoadFont("_digital sans")..{
		Condition=not GAMESTATE:IsCourseMode() and GAMESTATE:GetCurrentSong():GetGroupName() == "Echodance";
		
		Text="LOL ECHODANCE";
		
		InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;shadowlength,0;diffusealpha,0;zoom,2);
		OnCommand=cmd(sleep,1.3;linear,0.15;diffuse,color("1,0,0,1"));
		OffCommand=cmd(linear,0.15;diffusealpha,0;);
	};
};

local function AddChild( name )
	local curStage = GAMESTATE:GetCurrentStage();
	
	-- final stage
	if curStage == "Stage_Final" then
		-- "final"
		t[#t+1] = LoadActor( "../_stage/final/" );
		-- "stage"
		t[#t+1] = LoadActor( "../_stage/stage/" );
	
	-- extra stage
	elseif curStage == "Stage_Extra1" or curStage == "Stage_Extra2" then
		-- "extra"
		t[#t+1] = LoadActor( "../_stage/extra/" );
		-- "stage"
		t[#t+1] = LoadActor( "../_stage/stage/" );
	
	-- event mode
	elseif curStage == "Stage_Event" then
		-- "event"
		t[#t+1] = LoadActor( "../_stage/event/" );
		-- "mode"
		t[#t+1] = LoadActor( "../_stage/mode/" );
	
	-- nonstop
	elseif curStage == "Stage_Nonstop" then
		-- "non"
		t[#t+1] = LoadActor( "../_stage/non/" );
		-- "stop"
		t[#t+1] = LoadActor( "../_stage/stop/" );
	
	-- oni mode
	elseif curStage == "Stage_Oni" then
		-- "oni"
		t[#t+1] = LoadActor( "../_stage/oni/" );
		-- "mode"
		t[#t+1] = LoadActor( "../_stage/mode/" );
	
	-- most stages are like this
	else
		t[#t+1] = LoadActor( "../_stage/stage/" );
		t[#t+1] = LoadActor( "../_stage/" .. name ) .. {
			Condition=GAMESTATE:GetCurrentStage() == "Stage_" .. name;
		};
	end
end

for i = 1, 6, 1 do
	AddChild( i );
end
AddChild( "Final" );
AddChild( "Extra1" );
AddChild( "Extra2" );
AddChild( "Event" );
AddChild( "Nonstop" );
AddChild( "Oni" );
return t;
