-- eval stage
local event = PREFSMAN:GetPreference("EventMode")
local mode = GAMESTATE:GetPlayMode()
local showStage = (not event) and (mode == 'PlayMode_Regular' or mode == 'PlayMode_Rave' or mode == 'PlayMode_Battle')

return AutoText("frutiger",true)..{
	InitCommand=cmd(diffuse,color("0,0,0,1");shadowlength,0;zoom,0.5;NoStroke);
	BeginCommand=cmd(visible,showStage);
	OnCommand=cmd(playcommand,"Set");
	OffCommand=cmd(linear,0.2;diffusealpha,0);
	SetCommand=function(self)
		local curStage = GAMESTATE:GetCurrentStage()
		local screen = SCREENMAN:GetTopScreen();

		if screen and screen.GetStageStats then
			local stageStats = screen:GetStageStats();
			curStage = stageStats:GetStage();
		end

		local text = THEME:GetString("Stage",string.sub(curStage,7));
		self:settext(text.." Stage")

		if curStage == 'Stage_Final' then
			self:diffuse( color("0.8,0,0,1") );
		else
			self:diffuse( color("0,0,0,1") );
		end;
	end;
};