local color_name;
local name = Var("GameCommand"):GetText();
local item = Var("GameCommand"):GetName();
local DisplayRatio = THEME:GetMetric( Var("LoadingScreen"),"" .. item .. "Ratio");
local DisplayHeight = THEME:GetMetric( Var("LoadingScreen"),"" .. item .. "Height");
local DisplayWidth = THEME:GetMetric( Var("LoadingScreen"),"" .. item .. "Width");
local diffusecolor = "1,1,1,1";

return Def.ActorFrame { 
	GainFocusCommand=cmd(stoptweening;linear,0.15;zoom,1);
	LoseFocusCommand=cmd(stoptweening;linear,0.15;zoom,0.8);

	Def.ActorFrame { 
		OnCommand=cmd(rotationz,45*(index==0 and 1 or -1);zoomx,1.0;zoomy,1.0;bounceend,0.45;zoom,1;rotationz,0;
			runcommandsonleaves,cmd(diffusealpha,0;decelerate,0.25;diffusealpha,1));
		OffCommand=cmd(zoomx,1.0;zoomy,1.0;bouncebegin,0.35;zoom,1;rotationz,45*(index==0 and 1 or -1);
			runcommandsonleaves,cmd(bouncebegin,0.35;diffusealpha,0));
		LoadActor("pill diffuse") .. {
			InitCommand=cmd(diffusecolor,color(diffusecolor));
			DisabledCommand=cmd(diffuse,color("#222222"););
            EnabledCommand=cmd(diffuse,color(diffusecolor));
		};
		LoadActor("pill highlight") .. {
			InitCommand=cmd(visible,false;);
			GainFocusCommand=cmd(visible,true;);
			LoseFocusCommand=cmd(visible,false);
			DisabledCommand=cmd(diffuse,color("#222222"););
            EnabledCommand=cmd(diffuse,color(diffusecolor));
		};
		LoadActor("pill highlight") .. {
			InitCommand=cmd(blend,"BlendMode_Add";visible,false;);
			GainFocusCommand=cmd(visible,true;stopeffect;diffuseshift;effectcolor1,color("1,1,1,0.5");effectcolor2,color("0,0,0,1"););
			LoseFocusCommand=cmd(visible,false);
			DisabledCommand=cmd(diffuse,color("#222222"););
            EnabledCommand=cmd(diffuse,color("FFFFFF"););
		};
		LoadFont("Fancy","Header") .. {
			InitCommand=cmd(y,-50;settext,title;diffuse,color("#FFFFFF77");shadowlength,0;);
			DisabledCommand=cmd(diffuse,color("#222222"););
            EnabledCommand=cmd(diffuse,color(diffusecolor););
            
		};
		LoadFont("Ergo","Normal") .. {
			InitCommand=cmd(y,4;settext,name;shadowlength,1;zoom,0.8;);
			DisabledCommand=cmd(diffuse,color("#222222"););
            EnabledCommand=cmd(diffuse,color("FFFFFF"););
		};
        Def.Actor {
            OffFocusedCommand=function(self)
            PREFSMAN:SetPreference( "DisplayAspectRatio", DisplayRatio );
            PREFSMAN:SetPreference( "DisplayHeight", DisplayHeight );
            PREFSMAN:SetPreference( "DisplayWidth", DisplayWidth );
            end;
        };
	};
};
