local curStage = GAMESTATE:GetCurrentStage();

-- todo: the different effectmagnitudes
local stages = {
	   Stage_1st = { Background = "1",      BGVelocityX = -0.25, ModelColor = "blue", XSpin = 0, YSpin = 75, ZSpin = 50 },
	   Stage_2nd = { Background = "2",      BGVelocityX = -0.25, ModelColor = "pink", XSpin = 0, YSpin = 75, ZSpin = 50 },
	   Stage_3rd = { Background = "3",      BGVelocityX = -0.25, ModelColor = "orange", XSpin = 0, YSpin = 75, ZSpin = 50 },
	   Stage_4th = { Background = "4",      BGVelocityX = -0.25, ModelColor = "yellow", XSpin = 0, YSpin = 75, ZSpin = 50 },
	   Stage_5th = { Background = "5",      BGVelocityX = -0.25, ModelColor = "purple", XSpin = 0, YSpin = 75, ZSpin = 50 },
	   Stage_6th = { Background = "6",      BGVelocityX = -0.25, ModelColor = "lightblue", XSpin = 0, YSpin = 75, ZSpin = 50 },
	 Stage_Final = { Background = "final",  BGVelocityX = -0.25, ModelColor = "green", XSpin = 0, YSpin = 75, ZSpin = 50 },
	Stage_Extra1 = { Background = "extra1", BGVelocityX = -0.50, ModelColor = "red", XSpin = 0, YSpin = 300, ZSpin = 0 },
	Stage_Extra2 = { Background = "extra2", BGVelocityX = -0.50, ModelColor = "red", XSpin = 100, YSpin = 300, ZSpin = 50 },
	 Stage_Event = { Background = "event",  BGVelocityX = -0.25, ModelColor = "green", XSpin = 0, YSpin = 75, ZSpin = 0 },
};

local spinX, spinY, spinZ = stages[curStage].XSpin, stages[curStage].YSpin, stages[curStage].ZSpin

local t = Def.ActorFrame{
	LoadActor("back")..{ InitCommand=cmd(FullScreen); };
	-- stage decorations
	LoadActor( "ScreenSelectMusic stage ".. stages[curStage].Background )..{
		InitCommand=cmd(Center;setsize,SCREEN_WIDTH,SCREEN_HEIGHT;diffusealpha,0.5;);
		OnCommand=cmd(texcoordvelocity,stages[curStage].BGVelocityX,0;);
	};
};

local bUse3dModels = GetAdhocPref("Enable3DModels");
if bUse3dModels then
	t[#t+1] = LoadActor( THEME:GetPathB("_shared","models/_popcandymodel"), stages[curStage].ModelColor )..{
		InitCommand=cmd(x,SCREEN_CENTER_X+160;y,SCREEN_CENTER_Y+110;);
		OnCommand=cmd(zoom,4.0;spin;effectmagnitude,spinX,spinY,spinZ;);
	};
end;

return t;