local c;
local player = Var "Player";

local JudgeCmds = {
	TapNoteScore_W1 = THEME:GetMetric( "Judgment", "JudgmentW1Command" );
	TapNoteScore_W2 = THEME:GetMetric( "Judgment", "JudgmentW2Command" );
	TapNoteScore_W3 = THEME:GetMetric( "Judgment", "JudgmentW3Command" );
	TapNoteScore_W4 = THEME:GetMetric( "Judgment", "JudgmentW4Command" );
	TapNoteScore_W5 = THEME:GetMetric( "Judgment", "JudgmentW5Command" );
	TapNoteScore_Miss = THEME:GetMetric( "Judgment", "JudgmentMissCommand" );
};

local t = Def.ActorFrame {
 InitCommand=cmd(zoom,0.5);
	LoadFont("Common Normal") .. {
		Name="Judgment";
		InitCommand=cmd(visible,false;NoStroke;shadowlength,1;zoom,0.75;);
		ResetCommand=cmd(finishtweening;x,0;y,0;stopeffect;visible,false);
	};
	InitCommand = function(self)
		c = self:GetChildren();
	end;

	JudgmentMessageCommand=function(self, param)
		if param.Player ~= player then return end;
		if param.HoldNoteScore then return end;

		self:playcommand("Reset");

		c.Judgment:visible( true );
-- 		c.Judgment:settext(param.TapNoteOffset);
		local tno = param.TapNoteOffset * 1000
		c.Judgment:settext(math.floor(tno));
 		JudgeCmds[param.TapNoteScore](c.Judgment);
--[[ 		c.Judgment:finishtweening();
		c.Judgment:zoomx(1.3);
		c.Judgment:decelerate(0.2);
		c.Judgment:zoomx(1);		 --]]
	end;
};

return t;
