-- ScreenGameplay Overlay. This is where the magic happens.

local oldBPM = 0;

local t = Def.ActorFrame{
	
	-- // start mysterious middle //
	
	LoadActor("middleframe")..{
		InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_TOP+36);
	};
	
	--[[
	LoadFont("", "std07_63")..{
		Text="change";
		InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_TOP+24;shadowlength,0);
		OnCommand=cmd(playcommand,"Set");
		SetCommand=function(self)
			local BPM = math.floor(GAMESTATE:GetSongBPS() * 60);
			
			-- get oldBPM out of there early if it hasn't been set yet :|
			if oldBPM == 0 then
				self:settext(BPM);
			else
				if( oldBPM > BPM ) then
					self:linear(0.2);
					self:diffuse(color("0,0,1,1"));
				elseif( oldBPM < BPM ) then
					self:linear(0.2);
					self:diffuse(color("1,0,0,1"));
				elseif oldBPM == BPM then
					return;
				else
					self:linear(0.2);
					self:diffuse(color("1,1,1,1"));
				end;
				
				self:settext( BPM );
			end;
			local oldBPM = BPM;
		end;
		LifeChangedMessageCommand=cmd(playcommand,"Set");
	};
	]]
	
	-- // end mysterious middle //
	
	-- // start player decorations //
	-- player 1 side
	Def.Quad{
		InitCommand=cmd(x,SCREEN_CENTER_X-157;y,SCREEN_TOP+38;zoomto,192,4);
		BeginCommand=cmd(diffuse,DifficultyColor(GAMESTATE:GetCurrentSteps(PLAYER_1):GetDifficulty()));
		OnCommand=cmd(fadeleft,0.25;faderight,0.25);
		Condition=GAMESTATE:IsSideJoined(PLAYER_1);
	};
	
	-- player 2 side
	Def.Quad{
		InitCommand=cmd(x,SCREEN_CENTER_X+157;y,SCREEN_TOP+38;zoomto,192,4);
		BeginCommand=cmd(diffuse,DifficultyColor(GAMESTATE:GetCurrentSteps(PLAYER_2):GetDifficulty()));
		OnCommand=cmd(fadeleft,0.25;faderight,0.25);
		Condition=GAMESTATE:IsSideJoined(PLAYER_2);
	};
	-- // end player decorations //
	
	-- // start lifebars //
	-- p1
	LoadActor("lifemeter",PLAYER_1)..{
		InitCommand=cmd(x,SCREEN_CENTER_X-282;y,SCREEN_TOP+38);
	};
	
	-- p2
	LoadActor("lifemeter",PLAYER_2)..{
		InitCommand=cmd(x,SCREEN_CENTER_X+282;y,SCREEN_TOP+38);
	};
	-- // end lifebars //
};

return t;

-- coded over a Winter by the following individuals:
-- Synikal (Main code)
-- NAKET Coder (Ancillary code)