local Player = ...
assert( Player );

t = Def.ActorFrame{
	-- background
	Def.Quad {
		InitCommand=cmd(vertalign,bottom;x,SCREEN_CENTER_X-117;zoomx,60;zoomy,80);
		OnCommand=cmd(diffuse,color("0,0,0,0");linear,0.2;diffusealpha,1;diffusetopedge,color("0.8,0.8,0.8,0.5"););
		OffCommand=cmd(linear,0.2;diffusealpha,0);
	};

	-- marvelous bar
	Def.Quad {
		InitCommand=cmd(vertalign,bottom;x,SCREEN_CENTER_X-142;zoomx,10;);
		OnCommand=cmd(diffuse,color("1,0.86,0,0");linear,0.2;diffusealpha,1;playcommand,"Set");
		OffCommand=cmd(linear,0.2;diffusealpha,0);
		SetCommand=function(self, param)
			local steps = GAMESTATE:GetCurrentSteps(Player);
			local rv = steps:GetRadarValues( Player );
			local totalSteps = rv:GetValue('RadarCategory_TapsAndHolds');
			local marvs = STATSMAN:GetCurStageStats():GetPlayerStageStats(Player):GetTapNoteScores('TapNoteScore_W1');
			local mPercent = (marvs / totalSteps) * 100;
			self:zoomy( mPercent * 0.4);
		end;
	};
	-- perfect bar
	Def.Quad {
		InitCommand=cmd(vertalign,bottom;x,SCREEN_CENTER_X-132;;zoomx,10;);
		OnCommand=cmd(linear,0.2;diffusealpha,1;playcommand,"Set");
		OffCommand=cmd(linear,0.2;diffusealpha,0);
		SetCommand=function(self, param)
			local steps = GAMESTATE:GetCurrentSteps(Player);
			local rv = steps:GetRadarValues( Player );
			local totalSteps = rv:GetValue('RadarCategory_TapsAndHolds');
			local perfs = STATSMAN:GetCurStageStats():GetPlayerStageStats(Player):GetTapNoteScores('TapNoteScore_W2');
			local pPercent = (perfs / totalSteps) * 100;
			self:zoomy( pPercent * 0.4);
		end;
	};
	-- great bar
	Def.Quad {
		InitCommand=cmd(vertalign,bottom;x,SCREEN_CENTER_X-122;;zoomx,10;);
		OnCommand=cmd(diffuse,color("0.94,0.64,0,0");linear,0.2;diffusealpha,1;playcommand,"Set");
		OffCommand=cmd(linear,0.2;diffusealpha,0);
		SetCommand=function(self, param)
			local steps = GAMESTATE:GetCurrentSteps(Player);
			local rv = steps:GetRadarValues( Player );
			local totalSteps = rv:GetValue('RadarCategory_TapsAndHolds');
			local greats = STATSMAN:GetCurStageStats():GetPlayerStageStats(Player):GetTapNoteScores('TapNoteScore_W3');
			local gr8Percent = (greats / totalSteps) * 100;
			self:zoomy( gr8Percent * 0.4);
		end;
	};
	-- good bar
	Def.Quad {
		InitCommand=cmd(vertalign,bottom;x,SCREEN_CENTER_X-112;;zoomx,10;);
		OnCommand=cmd(diffuse,color("0,0.42,1,0");linear,0.2;diffusealpha,1;playcommand,"Set");
		OffCommand=cmd(linear,0.2;diffusealpha,0);
		SetCommand=function(self, param)
			local steps = GAMESTATE:GetCurrentSteps(Player);
			local rv = steps:GetRadarValues( Player );
			local totalSteps = rv:GetValue('RadarCategory_TapsAndHolds');
			local goods = STATSMAN:GetCurStageStats():GetPlayerStageStats(Player):GetTapNoteScores('TapNoteScore_W4');
			local goodPercent = (goods / totalSteps) * 100;
			self:zoomy( goodPercent * 0.4);
		end;
	};
	-- bad bar
	Def.Quad {
		InitCommand=cmd(vertalign,bottom;x,SCREEN_CENTER_X-102;;zoomx,10;);
		OnCommand=cmd(diffuse,color("0.9375,0,1,0");linear,0.2;diffusealpha,1;playcommand,"Set");
		OffCommand=cmd(linear,0.2;diffusealpha,0);
		SetCommand=function(self, param)
			local steps = GAMESTATE:GetCurrentSteps(Player);
			local rv = steps:GetRadarValues( Player );
			local totalSteps = rv:GetValue('RadarCategory_TapsAndHolds');
			local bads = STATSMAN:GetCurStageStats():GetPlayerStageStats(Player):GetTapNoteScores('TapNoteScore_W5');
			local badPercent = (bads / totalSteps) * 100;
			self:zoomy( badPercent * 0.4);
		end;
	};
	-- dtx bar
	Def.Quad {
		InitCommand=cmd(vertalign,bottom;x,SCREEN_CENTER_X-92;;zoomx,10;);
		OnCommand=cmd(diffuse,color("1,0,0,0");linear,0.2;diffusealpha,1;playcommand,"Set");
		OffCommand=cmd(linear,0.2;diffusealpha,0);
		SetCommand=function(self, param)
			local steps = GAMESTATE:GetCurrentSteps(Player);
			local rv = steps:GetRadarValues( Player );
			local totalSteps = rv:GetValue('RadarCategory_TapsAndHolds');
			local dtxs = STATSMAN:GetCurStageStats():GetPlayerStageStats(Player):GetTapNoteScores('TapNoteScore_Miss');
			local dtxPercent = (dtxs / totalSteps) * 100;
			self:zoomy( dtxPercent * 0.4);
		end;
	};
};
return t;