local t = Def.ActorFrame {

	-- hack, with bganimations you need an actor frame in an actor frame in order to be
	-- able to recieve messages in the "parent" frame
	Def.ActorFrame {
		LoadActor("Music_Glow") .. {
				OnCommand=cmd(rainbow;effectperiod,40;zoom,1.1;x,SCREEN_WIDTH/2;y,SCREEN_HEIGHT/2;blend,"BlendMode_Add";queuecommand,"DoZooms");
				DoZoomsCommand=cmd(zoom,1.1;linear,1;zoom,1.2;linear,1;zoom,1.1;queuecommand,"DoZooms");
				OffCommand=cmd(stoptweening);
				
				StartSelectingStepsMessageCommand=cmd(stoptweening;queuecommand,"DoZoomsBig");
				
				DoZoomsBigCommand=cmd(zoom,1.3;linear,1;zoom,1.4;linear,1;zoom,1.3;queuecommand,"DoZoomsBig");


				CurrentSongChangedMessageCommand=cmd(stoptweening;queuecommand,"DoZooms");
				
				StepsChosenMessageCommand=cmd(linear,0.2;diffusealpha,0);				
				
		};

		Def.Banner{
			InitCommand=cmd(x,SCREEN_WIDTH/2;y,SCREEN_HEIGHT/2;scaletoclipped,200,200);

			CurrentSongMessageCommand=function(self,params)
				self:LoadFromSong(params.Song);						
			end;

			StartSelectingStepsMessageCommand=cmd(zoom,1.2);


			CurrentSongChangedMessageCommand=cmd(stoptweening;zoom,0.5;linear,0.2;zoom,1);
			
			
			StepsChosenMessageCommand=cmd(linear,0.3;zoom,5;diffusealpha,0);
		};

		LoadActor("Glow_Line") .. {
			OnCommand=cmd(blend,"BlendMode_Add";zoom,1.5;queuecommand,"LoopGlowDown");
			LoopGlowDownCommand=cmd(x,SCREEN_WIDTH/2-2;y,SCREEN_HEIGHT/2+16;diffusealpha,0;linear,0.3;diffusealpha,0.4;linear,3;addy,80;linear,0.5;diffusealpha,0;sleep,1;queuecommand,"LoopGlowDown");
			OffCommand=cmd(stoptweening);
		};

		LoadActor("Glow_Line") .. {
			OnCommand=cmd(blend,"BlendMode_Add";rotationz,180;zoom,1.5;queuecommand,"LoopGlowDown");
			LoopGlowDownCommand=cmd(x,SCREEN_WIDTH/2-2;y,SCREEN_HEIGHT/2-16;diffusealpha,0;linear,0.3;diffusealpha,0.4;linear,3;addy,-80;linear,0.5;diffusealpha,0;sleep,1;queuecommand,"LoopGlowDown");		
			OffCommand=cmd(stoptweening);
		};



	LoadActor("ARROW.png")..{
		InitCommand=cmd(zoomx,1;zoomy,1.5;x,SCREEN_WIDTH/2-150;y,SCREEN_HEIGHT/2;diffuseramp;effectcolor2,0.7,0.7,0.7,0.7;effectcolor1,1,1,1,1);	
	};	

	LoadActor("ARROW2.png")..{
		InitCommand=cmd(zoomx,1;zoomy,1.5;x,SCREEN_WIDTH/2+150;y,SCREEN_HEIGHT/2;diffuseramp;effectcolor2,0.7,0.7,0.7,0.7;effectcolor1,1,1,1,1);	
	};



		-----------  visibility mods -------------------

		LoadActor("HIDDEN")..{

		Name="vishid";
		OnCommand=cmd(x,SCREEN_WIDTH/2-240;y,SCREEN_HEIGHT/2+170);

		};	

		LoadActor("SUDDEN")..{

		Name="vissud";
		OnCommand=cmd(x,SCREEN_WIDTH/2-240;y,SCREEN_HEIGHT/2+170);

		};	

		LoadActor("BLINK")..{

		Name="visblink";
		OnCommand=cmd(x,SCREEN_WIDTH/2-240;y,SCREEN_HEIGHT/2+170);

		};	

		LoadActor("BLIND")..{

		Name="visblind";
		OnCommand=cmd(x,SCREEN_WIDTH/2-240;y,SCREEN_HEIGHT/2+170);

		};	





		LoadActor("HIDDEN")..{

		Name="vishidp2";
		OnCommand=cmd(x,SCREEN_WIDTH/2+240;y,SCREEN_HEIGHT/2+170);

		};	

		LoadActor("SUDDEN")..{

		Name="vissudp2";
		OnCommand=cmd(x,SCREEN_WIDTH/2+240;y,SCREEN_HEIGHT/2+170);

		};	

		LoadActor("BLINK")..{

		Name="visblinkp2";
		OnCommand=cmd(x,SCREEN_WIDTH/2+240;y,SCREEN_HEIGHT/2+170);

		};	

		LoadActor("BLIND")..{

		Name="visblindp2";
		OnCommand=cmd(x,SCREEN_WIDTH/2+240;y,SCREEN_HEIGHT/2+170);

		};	


		-----------  transform mods -------------------

		LoadActor("Flip")..{

		Name="transflip";
		OnCommand=cmd(x,SCREEN_WIDTH/2-240;y,SCREEN_HEIGHT/2+140);

		};	

		LoadActor("ROTATE-L")..{

		Name="transrotl";
		OnCommand=cmd(x,SCREEN_WIDTH/2-240;y,SCREEN_HEIGHT/2+140);

		};	

		LoadActor("ROTATE-R")..{

		Name="transrotr";
		OnCommand=cmd(x,SCREEN_WIDTH/2-240;y,SCREEN_HEIGHT/2+140);

		};	

		LoadActor("RANDOM")..{

		Name="transrandom";
		OnCommand=cmd(x,SCREEN_WIDTH/2-240;y,SCREEN_HEIGHT/2+140);

		};	


		LoadActor("Flip")..{

		Name="transflipp2";
		OnCommand=cmd(x,SCREEN_WIDTH/2+240;y,SCREEN_HEIGHT/2+140);

		};	

		LoadActor("ROTATE-L")..{

		Name="transrotlp2";
		OnCommand=cmd(x,SCREEN_WIDTH/2+240;y,SCREEN_HEIGHT/2+140);

		};	

		LoadActor("ROTATE-R")..{

		Name="transrotrp2";
		OnCommand=cmd(x,SCREEN_WIDTH/2+240;y,SCREEN_HEIGHT/2+140);

		};	

		LoadActor("RANDOM")..{

		Name="transrandomp2";
		OnCommand=cmd(x,SCREEN_WIDTH/2+240;y,SCREEN_HEIGHT/2+140);

		};	


		-----------  speed mods -------------------
		-- ez2dancers speed mods (2x,4x) roughly equate to ddrs 2x and 4x

		LoadActor("Speed_4")..{

		Name="speed4x";
		OnCommand=cmd(x,SCREEN_WIDTH/2-240;y,SCREEN_HEIGHT/2+110);

		};	

		LoadActor("Speed_2")..{
		Name="speed2x";
		OnCommand=cmd(x,SCREEN_WIDTH/2-240;y,SCREEN_HEIGHT/2+110);

		};	


		LoadActor("Speed_4")..{

		Name="speed4xp2";
		OnCommand=cmd(x,SCREEN_WIDTH/2+240;y,SCREEN_HEIGHT/2+110);

		};	

		LoadActor("Speed_2")..{
		Name="speed2xp2";
		OnCommand=cmd(x,SCREEN_WIDTH/2+240;y,SCREEN_HEIGHT/2+110);

		};	

	 	OnCommand=function(self)
	 	
			--- hack hack, change the timing windows so that we only deal with a small subset of judgements ---	 	
	 	
	 		PREFSMAN:SetPreference("TimingWindowSecondsW1",0); 
	 		PREFSMAN:SetPreference("TimingWindowSecondsW2",0.4); -- cool
	 		PREFSMAN:SetPreference("TimingWindowSecondsW3",0);
			PREFSMAN:SetPreference("TimingWindowSecondsW4",1.0); -- good
			PREFSMAN:SetPreference("TimingWindowSecondsW5",0); 
	 	
	 	
	 	
	 	
	 	
			local p1opts = GAMESTATE:GetPlayerState("PlayerNumber_P1"):GetPlayerOptions("ModsLevel_Preferred");
			local speed2 = self:GetChild("speed2x");
			local speed4 = self:GetChild("speed4x");
			
			local transflip = self:GetChild("transflip");
			local transrotl = self:GetChild("transrotl");
			local transrotr = self:GetChild("transrotr");
			local transrandom = self:GetChild("transrandom");
			
			local vishid = self:GetChild("vishid");
			local vissud = self:GetChild("vissud");
			local visblink = self:GetChild("visblink");
			local visblind = self:GetChild("visblind");



			local p2opts = GAMESTATE:GetPlayerState("PlayerNumber_P2"):GetPlayerOptions("ModsLevel_Preferred");
			local speed2p2 = self:GetChild("speed2xp2");
			local speed4p2 = self:GetChild("speed4xp2");
			
			local transflipp2 = self:GetChild("transflipp2");
			local transrotlp2 = self:GetChild("transrotlp2");
			local transrotrp2 = self:GetChild("transrotrp2");
			local transrandomp2 = self:GetChild("transrandomp2");
			
			local vishidp2 = self:GetChild("vishidp2");
			local vissudp2 = self:GetChild("vissudp2");
			local visblinkp2 = self:GetChild("visblinkp2");
			local visblindp2 = self:GetChild("visblindp2");



			speed2p2:visible(0);
			speed4p2:visible(0);
			transrandomp2:visible(0);
			transrotrp2:visible(0);
			transrotlp2:visible(0);
			transflipp2:visible(0);
			visblindp2:visible(0);
			visblinkp2:visible(0);
			vissudp2:visible(0);
			vishidp2:visible(0);

			speed2:visible(0);
			speed4:visible(0);
			transrandom:visible(0);
			transrotr:visible(0);
			transrotl:visible(0);
			transflip:visible(0);
			visblind:visible(0);
			visblink:visible(0);
			vissud:visible(0);
			vishid:visible(0);
			
			if string.find(p1opts,"2x") == 1 then
				speed2:visible(1);
			elseif string.find(p1opts,"4x") == 1 then
				speed4:visible(1);
			end;
	 	
			if string.find(p1opts,".*Mirror.*") == 1 then
				transflip:visible(1);
			elseif string.find(p1opts,".*Left.*") == 1 then
				transrotl:visible(1);
			elseif string.find(p1opts,".*Right.*") == 1 then
				transrotr:visible(1);
			elseif string.find(p1opts,".*Shuffle.*") == 1 then
				transrandom:visible(1);
			end;
		 	
		 	
			if string.find(p1opts,".*Hidden.*") == 1 then
				vishid:visible(1);
			elseif string.find(p1opts,".*Sudden.*") == 1 then
				vissud:visible(1);
			elseif string.find(p1opts,".*Blink.*") == 1 then
				visblink:visible(1);
			elseif string.find(p1opts,".*Stealth.*") == 1 then
				visblind:visible(1);
			end;		 	
		 	




			if string.find(p2opts,"2x") == 1 then
				speed2p2:visible(1);
			elseif string.find(p2opts,"4x") == 1 then
				speed4p2:visible(1);
			end;
	 	
			if string.find(p2opts,".*Mirror.*") == 1 then
				transflipp2:visible(1);
			elseif string.find(p2opts,".*Left.*") == 1 then
				transrotlp2:visible(1);
			elseif string.find(p2opts,".*Right.*") == 1 then
				transrotrp2:visible(1);
			elseif string.find(p2opts,".*Shuffle.*") == 1 then
				transrandomp2:visible(1);
			end;
		 	
		 	
			if string.find(p2opts,".*Hidden.*") == 1 then
				vishidp2:visible(1);
			elseif string.find(p2opts,".*Sudden.*") == 1 then
				vissudp2:visible(1);
			elseif string.find(p2opts,".*Blink.*") == 1 then
				visblinkp2:visible(1);
			elseif string.find(p2opts,".*Stealth.*") == 1 then
				visblindp2:visible(1);
			end;
		 	
		 	
	 	end;


		CodeMessageCommand=function(self,params) 

			local p1opts = GAMESTATE:GetPlayerState("PlayerNumber_P1"):GetPlayerOptions("ModsLevel_Preferred");
			local speed2 = self:GetChild("speed2x");
			local speed4 = self:GetChild("speed4x");
			
			local transflip = self:GetChild("transflip");
			local transrotl = self:GetChild("transrotl");
			local transrotr = self:GetChild("transrotr");
			local transrandom = self:GetChild("transrandom");
			
			local vishid = self:GetChild("vishid");
			local vissud = self:GetChild("vissud");
			local visblink = self:GetChild("visblink");
			local visblind = self:GetChild("visblind");
			
			
			local modonsound = self:GetChild("ModsOnSound");
			local modoffsound = self:GetChild("ModsOffSound");

			if params.PlayerNumber == "PlayerNumber_P1" then
				if params.Name == "SpeedMod" then 
					if string.find(p1opts,"2x") ~= 1 and string.find(p1opts,"4x") ~= 1  then
						GAMESTATE:GetPlayerState("PlayerNumber_P1"):SetPlayerOptions("ModsLevel_Preferred",p1opts .. ",2x");
						speed2:visible(1);
						modonsound:play();
						
					elseif string.find(p1opts,"2x") == 1 then
						GAMESTATE:GetPlayerState("PlayerNumber_P1"):SetPlayerOptions("ModsLevel_Preferred",p1opts .. ",4x");
						speed4:visible(1);
						speed2:visible(0);
						modonsound:play();
						
					else
						GAMESTATE:GetPlayerState("PlayerNumber_P1"):SetPlayerOptions("ModsLevel_Preferred",string.gsub(p1opts, "4x", ""));
						speed4:visible(0);					
						modoffsound:play();
	
					end;
				end;
				
				if params.Name == "FootTransform" then 
					if string.find(p1opts,".*Mirror.*") ~= 1 and string.find(p1opts,".*Left.*") ~= 1 and string.find(p1opts,".*Right.*") ~= 1 and string.find(p1opts,".*Shuffle.*") ~= 1 then
						GAMESTATE:GetPlayerState("PlayerNumber_P1"):SetPlayerOptions("ModsLevel_Preferred",p1opts .. ",Mirror");
						transflip:visible(1);
						modonsound:play();
						
					elseif string.find(p1opts,".*Mirror.*") == 1 then
						GAMESTATE:GetPlayerState("PlayerNumber_P1"):SetPlayerOptions("ModsLevel_Preferred",string.gsub(p1opts, "Mirror,", "")..",Left");
						transrotl:visible(1);
						transflip:visible(0);
						modonsound:play();

					elseif string.find(p1opts,".*Left.*") == 1 then
						GAMESTATE:GetPlayerState("PlayerNumber_P1"):SetPlayerOptions("ModsLevel_Preferred",string.gsub(p1opts, "Left,", "")..",Right");
						transrotr:visible(1);
						transrotl:visible(0);
						modonsound:play();

					elseif string.find(p1opts,".*Right.*") == 1 then
						GAMESTATE:GetPlayerState("PlayerNumber_P1"):SetPlayerOptions("ModsLevel_Preferred",string.gsub(p1opts, "Right,", "")..",Shuffle");
						transrandom:visible(1);
						transrotr:visible(0);
						modonsound:play();
						
					else
						GAMESTATE:GetPlayerState("PlayerNumber_P1"):SetPlayerOptions("ModsLevel_Preferred",string.gsub(p1opts, "Shuffle,", ""));
						transrandom:visible(0);					
						modoffsound:play();
	
					end;
				end;				

				if params.Name == "HideMod" then 
					if string.find(p1opts,".*Hidden.*") ~= 1 and string.find(p1opts,".*Sudden.*") ~= 1 and string.find(p1opts,".*Blink.*") ~= 1 and string.find(p1opts,".*Stealth.*") ~= 1 then
						GAMESTATE:GetPlayerState("PlayerNumber_P1"):SetPlayerOptions("ModsLevel_Preferred",p1opts .. ",Hidden");
						vishid:visible(1);
						modonsound:play();
						
					elseif string.find(p1opts,".*Hidden.*") == 1 then
						GAMESTATE:GetPlayerState("PlayerNumber_P1"):SetPlayerOptions("ModsLevel_Preferred",string.gsub(p1opts, "Hidden,", "")..",Sudden");
						vissud:visible(1);
						vishid:visible(0);
						modonsound:play();

					elseif string.find(p1opts,".*Sudden.*") == 1 then
						GAMESTATE:GetPlayerState("PlayerNumber_P1"):SetPlayerOptions("ModsLevel_Preferred",string.gsub(p1opts, "Sudden,", "")..",Blink");
						visblink:visible(1);
						vissud:visible(0);
						modonsound:play();

					elseif string.find(p1opts,".*Blink.*") == 1 then
						GAMESTATE:GetPlayerState("PlayerNumber_P1"):SetPlayerOptions("ModsLevel_Preferred",string.gsub(p1opts, "Blink,", "")..",Stealth");
						visblind:visible(1);
						visblink:visible(0);
						modonsound:play();
						
					else
						GAMESTATE:GetPlayerState("PlayerNumber_P1"):SetPlayerOptions("ModsLevel_Preferred",string.gsub(p1opts, "Stealth,", ""));
						visblind:visible(0);					
						modoffsound:play();
	
					end;
				end;	
				

			end;
			
			
			
			
			
			
			
			
			
			
			
			
			
			

			local p2opts = GAMESTATE:GetPlayerState("PlayerNumber_P2"):GetPlayerOptions("ModsLevel_Preferred");
			local speed2p2 = self:GetChild("speed2xp2");
			local speed4p2 = self:GetChild("speed4xp2");
			
			local transflipp2 = self:GetChild("transflipp2");
			local transrotlp2 = self:GetChild("transrotlp2");
			local transrotrp2 = self:GetChild("transrotrp2");
			local transrandomp2 = self:GetChild("transrandomp2");
			
			local vishidp2 = self:GetChild("vishidp2");
			local vissudp2 = self:GetChild("vissudp2");
			local visblinkp2 = self:GetChild("visblinkp2");
			local visblindp2 = self:GetChild("visblindp2");
			
			
			if params.PlayerNumber == "PlayerNumber_P2" then
				if params.Name == "SpeedMod" then 
					if string.find(p2opts,"2x") ~= 1 and string.find(p2opts,"4x") ~= 1  then
						GAMESTATE:GetPlayerState("PlayerNumber_P2"):SetPlayerOptions("ModsLevel_Preferred",p2opts .. ",2x");
						speed2p2:visible(1);
						modonsound:play();
						
					elseif string.find(p2opts,"2x") == 1 then
						GAMESTATE:GetPlayerState("PlayerNumber_P2"):SetPlayerOptions("ModsLevel_Preferred",p2opts .. ",4x");
						speed4p2:visible(1);
						speed2p2:visible(0);
						modonsound:play();
						
					else
						GAMESTATE:GetPlayerState("PlayerNumber_P2"):SetPlayerOptions("ModsLevel_Preferred",string.gsub(p2opts, "4x", ""));
						speed4p2:visible(0);					
						modoffsound:play();
	
					end;
				end;
				
				if params.Name == "FootTransform" then 
					if string.find(p2opts,".*Mirror.*") ~= 1 and string.find(p2opts,".*Left.*") ~= 1 and string.find(p2opts,".*Right.*") ~= 1 and string.find(p2opts,".*Shuffle.*") ~= 1 then
						GAMESTATE:GetPlayerState("PlayerNumber_P2"):SetPlayerOptions("ModsLevel_Preferred",p2opts .. ",Mirror");
						transflipp2:visible(1);
						modonsound:play();
						
					elseif string.find(p2opts,".*Mirror.*") == 1 then
						GAMESTATE:GetPlayerState("PlayerNumber_P2"):SetPlayerOptions("ModsLevel_Preferred",string.gsub(p2opts, "Mirror,", "")..",Left");
						transrotlp2:visible(1);
						transflipp2:visible(0);
						modonsound:play();

					elseif string.find(p2opts,".*Left.*") == 1 then
						GAMESTATE:GetPlayerState("PlayerNumber_P2"):SetPlayerOptions("ModsLevel_Preferred",string.gsub(p2opts, "Left,", "")..",Right");
						transrotrp2:visible(1);
						transrotlp2:visible(0);
						modonsound:play();

					elseif string.find(p2opts,".*Right.*") == 1 then
						GAMESTATE:GetPlayerState("PlayerNumber_P2"):SetPlayerOptions("ModsLevel_Preferred",string.gsub(p2opts, "Right,", "")..",Shuffle");
						transrandomp2:visible(1);
						transrotrp2:visible(0);
						modonsound:play();
						
					else
						GAMESTATE:GetPlayerState("PlayerNumber_P2"):SetPlayerOptions("ModsLevel_Preferred",string.gsub(p2opts, "Shuffle,", ""));
						transrandomp2:visible(0);					
						modoffsound:play();
	
					end;
				end;				

				if params.Name == "HideMod" then 
					if string.find(p2opts,".*Hidden.*") ~= 1 and string.find(p2opts,".*Sudden.*") ~= 1 and string.find(p2opts,".*Blink.*") ~= 1 and string.find(p2opts,".*Stealth.*") ~= 1 then
						GAMESTATE:GetPlayerState("PlayerNumber_P2"):SetPlayerOptions("ModsLevel_Preferred",p2opts .. ",Hidden");
						vishidp2:visible(1);
						modonsound:play();
						
					elseif string.find(p2opts,".*Hidden.*") == 1 then
						GAMESTATE:GetPlayerState("PlayerNumber_P2"):SetPlayerOptions("ModsLevel_Preferred",string.gsub(p2opts, "Hidden,", "")..",Sudden");
						vissudp2:visible(1);
						vishidp2:visible(0);
						modonsound:play();

					elseif string.find(p2opts,".*Sudden.*") == 1 then
						GAMESTATE:GetPlayerState("PlayerNumber_P2"):SetPlayerOptions("ModsLevel_Preferred",string.gsub(p2opts, "Sudden,", "")..",Blink");
						visblinkp2:visible(1);
						vissudp2:visible(0);
						modonsound:play();

					elseif string.find(p2opts,".*Blink.*") == 1 then
						GAMESTATE:GetPlayerState("PlayerNumber_P2"):SetPlayerOptions("ModsLevel_Preferred",string.gsub(p2opts, "Blink,", "")..",Stealth");
						visblindp2:visible(1);
						visblinkp2:visible(0);
						modonsound:play();
						
					else
						GAMESTATE:GetPlayerState("PlayerNumber_P2"):SetPlayerOptions("ModsLevel_Preferred",string.gsub(p2opts, "Stealth,", ""));
						visblindp2:visible(0);					
						modoffsound:play();
	
					end;
				end;	
				
			end;			
			
			
			
			
			
			
			
			
			
			
			
			
		end;		





		LoadActor("black") .. {
				OnCommand=cmd(zoom,512;x,SCREEN_WIDTH/2;y,SCREEN_HEIGHT/2;diffusealpha,0);

				StepsChosenMessageCommand=cmd(linear,0.3;diffusealpha,1);				
				
		};




		LoadActor( THEME:GetPathS("", "FX12.ogg") ) .. {
			Name="ModsOnSound";
		};
		LoadActor( THEME:GetPathS("", "FX13.ogg") ) .. {
			Name="ModsOffSound";
		};
		

	};
	LoadActor( THEME:GetPathS("", "Common Start.ogg") ) .. {
		SSMPlayerJoinedMessageCommand=cmd(play);

	};	
		
	LoadActor("SongDifficultyA") .. {
		OnCommand=cmd(playcommand,"Set");
		CurrentStepsP1ChangedMessage=cmd(playcommand,"Set");
		CurrentStepsP2ChangedMessage=cmd(playcommand,"Set");
		CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
		SetCommand=function(self)
			local song = GAMESTATE:GetCurrentSong();
			local steps = GAMESTATE:GetCurrentSteps(GAMESTATE:GetMasterPlayerNumber());
			local diff = 0;
			
			if song and steps then
				diff = steps:GetMeter();
			end;

			if diff < 3 then
				self:visible(true);
			else
				self:visible(false);
			end;
		end;
		
		OffCommand=cmd(linear,0.2;diffusealpha,0);		
	
	};
	
	LoadActor("SongDifficultyB") .. {
		OnCommand=cmd(playcommand,"Set");
		CurrentStepsP1ChangedMessage=cmd(playcommand,"Set");
		CurrentStepsP2ChangedMessage=cmd(playcommand,"Set");
		CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
		SetCommand=function(self)
			local song = GAMESTATE:GetCurrentSong();
			local steps = GAMESTATE:GetCurrentSteps(GAMESTATE:GetMasterPlayerNumber());
			local diff = 0;
			
			if song and steps then
				diff = steps:GetMeter();
			end;

			if diff < 5 and diff >= 3 then
				self:visible(true);
			else
				self:visible(false);
			end;
		end;	
		
		OffCommand=cmd(linear,0.2;diffusealpha,0);		
	};

	LoadActor("SongDifficultyC") .. {
		OnCommand=cmd(playcommand,"Set");
		CurrentStepsP1ChangedMessage=cmd(playcommand,"Set");
		CurrentStepsP2ChangedMessage=cmd(playcommand,"Set");
		CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
		SetCommand=function(self)
			local song = GAMESTATE:GetCurrentSong();
			local steps = GAMESTATE:GetCurrentSteps(GAMESTATE:GetMasterPlayerNumber());
			local diff = 0;
			
			if song and steps then
				diff = steps:GetMeter();
			end;

			if diff < 7 and diff >= 5 then
				self:visible(true);
			else
				self:visible(false);
			end;
		end;	
		
		OffCommand=cmd(linear,0.2;diffusealpha,0);
	};

	LoadActor("SongDifficultyD") .. {
		OnCommand=cmd(playcommand,"Set");
		CurrentStepsP1ChangedMessage=cmd(playcommand,"Set");
		CurrentStepsP2ChangedMessage=cmd(playcommand,"Set");
		CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
		SetCommand=function(self)
			local song = GAMESTATE:GetCurrentSong();
			local steps = GAMESTATE:GetCurrentSteps(GAMESTATE:GetMasterPlayerNumber());
			local diff = 0;
			
			if song and steps then
				diff = steps:GetMeter();
			end;

			if diff >= 7 then
				self:visible(true);
			else
				self:visible(false);
			end;
		end;		
		
		OffCommand=cmd(linear,0.2;diffusealpha,0);
	};

	LoadActor("SongDifficultyF") .. {
		OnCommand=cmd(playcommand,"Set");
		CurrentStepsP1ChangedMessage=cmd(playcommand,"Set");
		CurrentStepsP2ChangedMessage=cmd(playcommand,"Set");
		CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
		SetCommand=function(self)
			local song = GAMESTATE:GetCurrentSong();
			local steps = GAMESTATE:GetCurrentSteps(GAMESTATE:GetMasterPlayerNumber());
			local diff = 0;
			
			if song and steps then
				diff = steps:GetMeter();
			end;

			if diff >= 9 then
				self:visible(true);
			else
				self:visible(false);
			end;
		end;		
		
		OffCommand=cmd(linear,0.2;diffusealpha,0);
	};

	LoadActor("SongDifficultyG") .. {
		OnCommand=cmd(playcommand,"Set");
		CurrentStepsP1ChangedMessage=cmd(playcommand,"Set");
		CurrentStepsP2ChangedMessage=cmd(playcommand,"Set");
		CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
		SetCommand=function(self)
			local song = GAMESTATE:GetCurrentSong();
			local steps = GAMESTATE:GetCurrentSteps(GAMESTATE:GetMasterPlayerNumber());
			local diff = 0;
			
			if song and steps then
				diff = steps:GetMeter();
			end;

			if diff >= 10 then
				self:visible(true);
			else
				self:visible(false);
			end;
		end;		
		
		OffCommand=cmd(linear,0.2;diffusealpha,0);
	};
	
	LoadActor("2Player") .. {
	InitCommand=cmd(x,THEME:GetMetric(Var "LoadingScreen","CreditsP2X")+10;y,THEME:GetMetric(Var "LoadingScreen","CreditsP2Y")-20;visible,0;diffusealpha,0;linear,0.5;diffusealpha,1;zoom,1;playcommand,"CheckCoins");
	PlayerJoinedMessageCommand=cmd(playcommand,"CheckCoins");

	CheckCoinsCommand=function(self)
		if GAMESTATE:IsPlayerEnabled("PlayerNumber_P2") == false then
			self:visible(0);
		else
			self:visible(1);
		end;
	end;
	};	
	
	LoadActor("1Player") .. {
	InitCommand=cmd(x,THEME:GetMetric(Var "LoadingScreen","CreditsP1X")-10;y,THEME:GetMetric(Var "LoadingScreen","CreditsP1Y")-20;visible,0;diffusealpha,0;linear,0.5;diffusealpha,1;zoom,1;playcommand,"CheckCoins");
	PlayerJoinedMessageCommand=cmd(playcommand,"CheckCoins");

	CheckCoinsCommand=function(self)
		if GAMESTATE:IsPlayerEnabled("PlayerNumber_P1") == false then
			self:visible(0);
		else
			self:visible(1);
		end;
	end;
	};











		
	

};

return t;		

