--todo: redo most of this shit!
local t = Def.ActorFrame{
	-- PARKING LOT
	Def.ActorFrame{
		Name="PARKING LOT Section";
		InitCommand=cmd(Center);
		
		Def.ActorProxy {
			Name="PARKING LOT Proxy";
			BeginCommand=function(self)
				local banner = SCREENMAN:GetTopScreen():GetChild('Banner');
				self:SetTarget(banner);
			end;
			OffCommand=cmd(linear,0.2;diffusealpha,0);
		};
		
		--[[ start gates ]]
		
		LoadActor("_mask")..{
			InitCommand=cmd(MaskSource);
		};
		
		LoadActor("_gate top")..{
			InitCommand=cmd(y,-20;MaskDest);
			OnCommand=cmd(accelerate,0.25;addy,-40);
		};
		
		LoadActor("_gate bot")..{
			InitCommand=cmd(y,20;MaskDest);
			OnCommand=cmd(accelerate,0.25;addy,40);
		};
		
		--[[ end gates ]]
		
		LoadActor( "banner frame" ) .. {
			OffCommand=cmd(decelerate,0.5;diffusealpha,0);
		};
	};
	
	-- bpm display
	Def.ActorFrame{
		Name="GenericInfoSection";
		InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y-52);
		CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
		CurrentCourseChangedMessageCommand=cmd(playcommand,"Set");
		SetCommand=function(self)
			-- check for a song or course. if there isn't one, hide it;
			-- otherwise, display it.
			local song = GAMESTATE:GetCurrentSong();
			local course = GAMESTATE:GetCurrentCourse();
			
			if song or course then self:visible(true)
			else self:visible(false);
			end;
		end;
		
		Def.BPMDisplay{
			File=THEME:GetPathF("_bm", "delico");
			Name="BPMDisplay";
			InitCommand=cmd(x,-108;horizalign,right;shadowlength,1);
			OnCommand=cmd(stoptweening);
			OffCommand=cmd(linear,0.2;diffusealpha,0);
			SetCommand=function(self) self:SetFromGameState() end;
			CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
			CurrentCourseChangedMessageCommand=cmd(playcommand,"Set");
		};
		LoadFont("_bm delico")..{
			Name="BPMLabel";
			InitCommand=cmd(x,-104;horizalign,left;settext,"BPM";shadowlength,1);
			OffCommand=cmd(linear,0.2;diffusealpha,0);
		};
		
		LoadFont("_bm delico") .. {
			Name="SongLength";
			InitCommand=cmd(x,108;shadowlength,1;diffusealpha,0);
			OnCommand=cmd(linear,0.2;diffusealpha,1);
			OffCommand=cmd(linear,0.2;diffusealpha,0);
			
			CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
			CurrentCourseChangedMessageCommand=cmd(playcommand,"Set");
			
			SetCommand=function(self)
				local song = GAMESTATE:GetCurrentSong()
				local course = GAMESTATE:GetCurrentCourse()
				if song or course then self:visible(true)
				else self:visible(false); return;
				end;
				
				local time;
				if song then time = song:MusicLengthSeconds() end
				if course then
					local st = GAMESTATE:GetCurrentStyle():GetStepsType();
					time = course:GetTotalSeconds( st );
				end;
				if time then
					local finalText = SecondsToMSSMsMs(time);
					self:settext( string.sub(finalText, 0, string.len(finalText)-3) );
				else
					self:settext( "xx:xx" );
				end
			end;
		};
	};
	
	-- song options
	LoadFont("_pf tempesta seven 8px") .. {
		Name="SongOptions";
		InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y+52;playcommand,"Set";shadowlength,1;diffusealpha,0);
		OnCommand=cmd(linear,0.2;diffusealpha,1);
		OffCommand=cmd(linear,0.2;diffusealpha,0);

		SetCommand=function(self)
			local sText = GAMESTATE:GetSongOptionsString()
			sText = string.gsub(sText, ", ", "\n")
			self:settext( sText )
			if GAMESTATE:IsAnExtraStage() then
				self:diffuseshift();
			end
		end;
		SongOptionsChangedMessageCommand=cmd(playcommand,"Set");
	};
	
	-- radarbars [this is temp]
	LoadActor("RadarBars",PLAYER_1)..{
		--InitCommand=cmd(x,SCREEN_CENTER_X*0.165;y,SCREEN_CENTER_Y);
		InitCommand=cmd(x,SCREEN_WIDTH*0.0825;y,SCREEN_CENTER_Y*0.9;player,PLAYER_1);
	};
	
	LoadActor("RadarBars",PLAYER_2)..{
		InitCommand=cmd(x,SCREEN_WIDTH*0.7875;y,SCREEN_CENTER_Y*0.9;player,PLAYER_2);
	};
	-- difficulty [this is temp]
	LoadActor("Difficulty",PLAYER_1)..{
		InitCommand=cmd(x,SCREEN_WIDTH*0.0825;y,SCREEN_CENTER_Y+32;player,PLAYER_1);
	};
	
	LoadActor("Difficulty",PLAYER_2)..{
		InitCommand=cmd(x,SCREEN_WIDTH*0.7875;y,SCREEN_CENTER_Y+32;player,PLAYER_2);
	};
	
	-- Fade out here; this and the message for the options should appear
	-- over every single object in this screen.
	Def.Quad {
		InitCommand=cmd(diffuse,color("#000000");FullScreen;diffusealpha,0);
		OffCommand=cmd(cropbottom,1;fadebottom,.5;linear,0.3;cropbottom,-0.5;diffusealpha,1);
	};
	
	LoadFont("_frutiger 24px")..{
		Text="Press &START; for options";
		InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;vertalign,bottom);
		OnCommand=cmd(visible,false);
		ShowPressStartForOptionsCommand=cmd(visible,true;zoom,1.5;decelerate,1;zoom,1);
		ShowEnteringOptionsCommand=cmd(settext,"Entering Options...";hurrytweening,0.1;sleep,1;accelerate,0.1;zoomy,0);
	};
};

return t;

--[[
Copyright © 2008 AJ Kelly
All rights reserved.

This code is licensed under AJ's Generic Use of Code License.
An up to date copy can be found at the following address:
http://kki.ajworld.net/wiki/AJ%27s_Generic_Use_of_Code_License
However, keep in mind that the code in this file is bound to the exact
specifications found in this file.
That is to say, changes are not retroactive.

When using parts of this code in your theme, you agree to the following points:

1. Not hide/require registration for any theme that uses the code from the
public IF there is a public release. (This means private themes and themes for
commercial games can use the code without worry.)

2. Not compile the code down to bytecode (if the code is Lua) in a public
theme. (Yes, it can be reversed, but regardless, this hinders openness and
sharing.)

3. This code is a unique/nontrivial creation, therefore, credit should be
given to the creator of the code if used in another theme.
]]