local color_name;
local index = Var("GameCommand"):GetIndex();
local name = Var("GameCommand"):GetText();
local title = THEME:GetString( Var "LoadingScreen", name .. "Title" );
local explanation = THEME:GetString( Var "LoadingScreen", name .. "Explanation" );
local diffusecolor = THEME:GetMetric( Var("LoadingScreen"),"" .. name .. "Color");

return Def.ActorFrame { 
	GainFocusCommand=cmd(stoptweening;linear,0.15;zoom,1);
	LoseFocusCommand=cmd(stoptweening;linear,0.15;zoom,0.8);
	Def.ActorFrame {
        FOV=90;
		OnCommand=cmd(zoom,0;bounceend,0.25;zoom,1);
		OffCommand=cmd(bouncebegin,0.25;zoom,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,20;settext,explanation;shadowlength,1;zoom,0.8;);
			DisabledCommand=cmd(diffuse,color("#222222"););
            EnabledCommand=cmd(diffuse,color("FFFFFF"););
		};
	};
};
