<ActorFrame> <children>


<Layer 
      Font="_numbers3" 
      Text="" 
      InitCommand="x,SCREEN_CENTER_X-125;y,SCREEN_BOTTOM-22;zoom,0.7;shadowlength,0" 
      OnCommand="%function(self) 
         local rate = 1 
         if GAMESTATE:IsPlayerEnabled(PLAYER_1) then 
            for i=0.1, 2.0, .1 do 
               if GAMESTATE:PlayerIsUsingModifier(PLAYER_1,i..'xmusic') then rate = i end 
            end 
         end 
         if GAMESTATE:IsPlayerEnabled(PLAYER_2) then 
            for i=0.1, 2.0, .1 do 
               if GAMESTATE:PlayerIsUsingModifier(PLAYER_2,i..'xmusic') then rate = i end 
            end 
         end 
         GAMESTATE:SetEnv('Rate',rate) 
         self:queuecommand('Update') 
      end" 
      UpdateCommand="%function(self) 
         local BPM = tonumber(SCREENMAN:GetTopScreen():GetChild('BPMDisplay'):GetChild('Text'):GetText()) 
         local rate = GAMESTATE:GetEnv('Rate') 
         BPM = BPM * rate 
         self:settext(BPM) 
         self:sleep(.05) 
         self:queuecommand('Update') 
      end" 
   /> 
		<BitmapText
			Text="BPM"
			File="Common Normal"
			InitCommand="shadowlength,0"
			OnCommand="x,SCREEN_CENTER_X-125;y,SCREEN_BOTTOM-7;zoom,0.4;shadowlength,0;draworder,1000"
			OffCommand="zoom,0"
		/>




<Layer File="meter frame" 
 OnCommand="zoom,0.6;y,SCREEN_CENTER_Y+142;x,40" />

		<Layer
			Type="SongMeterDisplay"
			StreamWidth="640"
			StreamPath="meter stream"
		OnCommand="x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y+189" >	
			OffCommand="diffusealpha,0"			
<Tip
				File="tip"
				OnCommand="zoom,0.6;draworder,50"
OffCommand="hidden,1"
			/>
		</Layer>


		<Layer
			Type="BitmapText"
			Font="Common Normal"
			OnCommand="zoomy,0.35;zoomx,0.4;shadowlength,0;draworder,1"
			InitCommand="animate,0;playcommand,Update"
		OffCommand="hidden,1"					CurrentSongChangedMessageCommand="x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y-236;playcommand,Update"
			UpdateCommand="%SetFromSongTitleAndCourseTitle"
		/>




<Layer Type="Quad" OnCommand="%function(self) self:hidden(1) self:sleep(0.5); self:queuecommand('Register');
 
-- Credit to TaroNuke for all of this code to make the PA counter work. You are amazing! :D
 
--initialize all judgment counts to 0 in case we want it for anything
for i=1,6 do
 _G['P1W'..i] = 0
 _G['P2W'..i] = 0
end
self:queuecommand('Update') end"
 
RegisterCommand="%function(self)
   if SCREENMAN:GetTopScreen():GetChild('PlayerP1') then
       SCREENMAN:GetTopScreen():GetChild('PlayerP1'):GetChild('Judgment'):aux(1);
   end
   if SCREENMAN:GetTopScreen():GetChild('PlayerP2') then
       SCREENMAN:GetTopScreen():GetChild('PlayerP2'):GetChild('Judgment'):aux(2);
   end
end"
 
P0W1MessageCommand="%function(self)
    P1W1 = P1W1+1;
if gradecount_P1 then
gradecount_P1:x(77); --position it
gradecount_P1:y(SCREEN_CENTER_Y+140);
gradecount_P1:horizalign('right');
gradecount_P1:settext(P1W1..'\n'..P1W2..'\n'..P1W3..'\n'..P1W4..'\n'..P1W5..'\n'..P1W6); --set text to the value        
end
end"
 
P0W2MessageCommand="%function(self)
    P1W2 = P1W2+1;
if gradecount_P1 then
gradecount_P1:x(77); --position it
gradecount_P1:y(SCREEN_CENTER_Y+140);
gradecount_P1:horizalign('right');
gradecount_P1:settext(P1W1..'\n'..P1W2..'\n'..P1W3..'\n'..P1W4..'\n'..P1W5..'\n'..P1W6); --set text to the value        
end
end"
 
P0W3MessageCommand="%function(self)
    P1W3 = P1W3+1;
if gradecount_P1 then
gradecount_P1:x(77); --position it
gradecount_P1:y(SCREEN_CENTER_Y+140);
gradecount_P1:horizalign('right');
gradecount_P1:settext(P1W1..'\n'..P1W2..'\n'..P1W3..'\n'..P1W4..'\n'..P1W5..'\n'..P1W6); --set text to the value        
end
end"
 
P0W4MessageCommand="%function(self)
    P1W4 = P1W4+1;
if gradecount_P1 then
gradecount_P1:x(77); --position it
gradecount_P1:y(SCREEN_CENTER_Y+140);
gradecount_P1:horizalign('right');
gradecount_P1:settext(P1W1..'\n'..P1W2..'\n'..P1W3..'\n'..P1W4..'\n'..P1W5..'\n'..P1W6); --set text to the value        
end
end"
 
P0W5MessageCommand="%function(self)
    P1W5 = P1W5+1;
if gradecount_P1 then
gradecount_P1:x(77); --position it
gradecount_P1:y(SCREEN_CENTER_Y+140);
gradecount_P1:horizalign('right');
gradecount_P1:settext(P1W1..'\n'..P1W2..'\n'..P1W3..'\n'..P1W4..'\n'..P1W5..'\n'..P1W6); --set text to the value        
end
end"
 
P0W6MessageCommand="%function(self)
    P1W6 = P1W6+1;
if gradecount_P1 then
gradecount_P1:x(77); --position it
gradecount_P1:y(SCREEN_CENTER_Y+140);
gradecount_P1:horizalign('right');
gradecount_P1:settext(P1W1..'\n'..P1W2..'\n'..P1W3..'\n'..P1W4..'\n'..P1W5..'\n'..P1W6); --set text to the value       
end
end"/> 
 
<Layer File="_Arial 14 Shadow" Text="" OnCommand="shadowlength,0;zoom,0.55;maxwidth,60" InitCommand="%function(self) gradecount_P1 = self; end" />
 



-- added the judgments separately even though I could technically concatenate them within the counting code -Halo
<Layer File="_Arial 14 Shadow" Text="Marvelous: " OnCommand="shadowlength,0;maxwidth,80;horizalign,left;zoom,0.5;y,SCREEN_CENTER_Y+107;x,5" />
<Layer File="_Arial 14 Shadow" Text="Perfect: " OnCommand="shadowlength,0;diffuse,#FFFF00;horizalign,left;zoom,0.5;y,SCREEN_CENTER_Y+120;x,5" />
<Layer File="_Arial 14 Shadow" Text="Great: " OnCommand="shadowlength,0;diffuse,#00FF00;horizalign,left;zoom,0.5;y,SCREEN_CENTER_Y+133;x,5" />
<Layer File="_Arial 14 Shadow" Text="Good: " OnCommand="shadowlength,0;diffuse,#0099FF;horizalign,left;zoom,0.5;y,SCREEN_CENTER_Y+146;x,5" />
<Layer File="_Arial 14 Shadow" Text="Boo: " OnCommand="shadowlength,0;diffuse,#FF33CC;horizalign,left;zoom,0.5;y,SCREEN_CENTER_Y+159;x,5" />
<Layer File="_Arial 14 Shadow" Text="Miss: " OnCommand="shadowlength,0;diffuse,#FF0000;horizalign,left;zoom,0.5;y,SCREEN_CENTER_Y+172;x,5" />









 

	</children>