local gc = Var("GameCommand")
local itemName = gc:GetName()
local itemText = gc:GetText()

-- todo: different color for each item?

return Def.ActorFrame{
	LoadActor(THEME:GetPathG("_data","item main"))..{
		GainFocusCommand=cmd(linear,0.125;diffusealpha,1);
		LoseFocusCommand=cmd(stoptweening;linear,0.125;diffusealpha,0.65);
		OffCommand=function(self)
			local flip = itemName == "General" and -1 or 1
			self:linear(0.25)
			self:addx(SCREEN_WIDTH*flip)
		end;
	};
	Def.ActorFrame{
		Name="IconSection";
		InitCommand=cmd(x,-200);
		LoadActor(THEME:GetPathG("_data","iconbase"))..{
			GainFocusCommand=cmd(linear,0.125;diffusealpha,1);
			LoseFocusCommand=cmd(stoptweening;linear,0.125;diffusealpha,0.5);
			OffCommand=function(self)
				local flip = itemName == "General" and -1 or 1
				self:linear(0.25)
				self:addx(SCREEN_WIDTH*flip)
			end;
		};
		LoadActor(THEME:GetPathG("_data",itemName))..{
			GainFocusCommand=cmd(linear,0.125;diffusealpha,1);
			LoseFocusCommand=cmd(stoptweening;linear,0.125;diffusealpha,0.45);
			OffCommand=function(self)
				local flip = itemName == "General" and -1 or 1
				self:linear(0.25)
				self:addx(SCREEN_WIDTH*flip)
			end;
		};
	};
	LoadFont("_francophilsans Bold 24px")..{
		Name="Header";
		InitCommand=cmd(x,-144;y,-20;halign,0;shadowlength,1;uppercase,true;NoStroke;shadowcolor,color("0.1,0.1,0.1,0.75");),
		BeginCommand=cmd(settext,THEME:GetString("ScreenDataMain",itemText)),
		GainFocusCommand=cmd(linear,0.125;zoom,20/24;diffuse,HSVA(200,1,1,1);),
		LoseFocusCommand=cmd(stoptweening;linear,0.125;zoom,16/24;diffuse,HSVA(200,0,1,0.5);),
		OffCommand=function(self)
			local flip = itemName == "General" and -1 or 1
			self:linear(0.25)
			self:addx(SCREEN_WIDTH*flip)
		end;
	};
	LoadFont("_dejavu sans bold 24px")..{
		Name="Explanation";
		InitCommand=cmd(x,-144;align,0,0;zoom,12/24;shadowlength,1;wrapwidthpixels,370*2);
		BeginCommand=cmd(settext,THEME:GetString("ScreenDataMain",itemName.."Explain"));
		GainFocusCommand=cmd(linear,0.125;diffuse,color("1,1,1,1");),
		LoseFocusCommand=cmd(stoptweening;linear,0.125;diffuse,color("0.75,0.75,0.75,0.5");),
		OffCommand=function(self)
			local flip = itemName == "General" and -1 or 1
			self:linear(0.25)
			self:addx(SCREEN_WIDTH*flip)
		end;
	};
};