local index = Var("GameCommand"):GetIndex();
local sName = Var("GameCommand"):GetName();

local genericGainFocusCmd = cmd(finishtweening;visible,true);
local genericLoseFocusCmd = cmd(visible,false);

local toasty;
if GetUserPref("Toasty") == nil then
	toasty = "Forden";
	SetUserPref("Toasty",toasty);
else
	toasty = GetUserPref("Toasty")
end;

local t = Def.ActorFrame{
	OffFocusedCommand=function(self)
		SetUserPref("Toasty",sName);
	end;
	-- icon
	Def.ActorFrame{
		Name="IconFrame"..index;

		LoadActor("_icon base")..{
			Name="DefaultIndicator";
			BeginCommand=function(self)
				self:glow( HSVA(192,0.75,1,0.75) );
				self:zoom(1.075);
				if toasty == sName then
					self:visible(true);
				else
					self:visible(false);
				end;
			end;
			OffCommand=cmd(linear,0.2;glow,HSVA(192,0.75,1,0);diffusealpha,0);
		};

		LoadActor("_icon base")..{
			GainFocusCommand=cmd(accelerate,0.2;glow,color("1,0.75,0,0.75"));
			LoseFocusCommand=cmd(finishtweening;decelerate,0.2;glow,color("1,1,1,0"));
			OffCommand=cmd(linear,0.2;diffusealpha,0);
		};

		LoadActor( "_icon "..sName )..{
			GainFocusCommand=cmd(accelerate,0.2;diffuse,color("1,1,1,1"));
			LoseFocusCommand=cmd(finishtweening;decelerate,0.2;diffuse,color("1,1,1,0.5"));
			OffCommand=cmd(linear,0.2;diffusealpha,0);
		};
	};
};

return t;