<ActorFrame InitCommand="%function(self)
	ProfileImageSize = 65
	end"><children>

	<Layer Type="Quad" OnCommand="queuecommand,PlaySound" PlaySoundCommand="%function(self) AudioPlay('Internal/profile') end" />

	<Layer
		File="@ThemeFile('p1bg_inactive')"
		Condition="not GAMESTATE:IsPlayerEnabled(PLAYER_1)"
		OnCommand="x,SCREEN_CENTER_X-160;y,SCREEN_CENTER_Y-126"
		/>
	<Layer
		File="@ThemeFile('p1bg_active')"
		Condition="GAMESTATE:IsPlayerEnabled(PLAYER_1)"
		OnCommand="x,SCREEN_CENTER_X-160;y,SCREEN_CENTER_Y+5"
		/>

		<!-- PLAYER 1 INFORMATION -->
<Layer Type="ActorFrame" OnCommand="x,SCREEN_CENTER_X-160;y,SCREEN_CENTER_Y-87" Condition="GAMESTATE:IsPlayerEnabled(PLAYER_1)"><children>
	<Layer
            Type="Quad"
            OnCommand="%function(self)
            self:zoomto(ProfileImageSize+2,ProfileImageSize+2,0,0)
            self:shadowlength(1)
            end"
            />
        <Layer
            Type="Quad"
            OnCommand="%function(self)
            self:zoomto(ProfileImageSize-2,ProfileImageSize-2,0,0)
            self:shadowlength(1)
            self:diffuse(0,0,0,1)
            end"
            />
           <Layer
        File="@ThemeFile('ProfileIcon/userP1')"
        OnCommand="%function(self)
        self:zoomto(ProfileImageSize,ProfileImageSize,0,0);
        end"
        />

        <Layer
            Font="_sui generis"
            Text=" "
            OnCommand="zoom,0.8;shadowlength,1;sleep,0.01;queuecommand,Update"
            UpdateCommand="%function(self)
            self:addy(60)
            self:settext( GetProfileName(1) )
            end"
            />

        <Layer
            Font="_sui generis"
            Text="Total Steps"
            OnCommand="x,-140;y,87;zoom,0.6;shadowlength,1;horizalign,left"
            />
        <Layer
            Font="_sui generis"
            Text="0"
            OnCommand="x,140;y,87;zoom,0.6;shadowlength,1;diffuse,0,1,1,1;horizalign,right;sleep,0.05;queuecommand,TotalSongCheck"
            TotalSongCheckCommand="%function(self)
            local Pr = PROFILEMAN:GetMachineProfile():GetSaved()
            if not Pr.DWITotalStepsHitP1 then
            	self:settext('0')
            	Pr.DWITotalStepsHitP1 = 0
            	PROFILEMAN:SaveMachineProfile()
            else
            	self:settext( Pr.DWITotalStepsHitP1 )
            end
            end"
            />

        <Layer
            Font="_sui generis"
            Text="0"
            OnCommand="x,140;y,105;zoom,0.6;shadowlength,1;diffuse,1,1,0,1;horizalign,right;sleep,0.05;queuecommand,TotalSongCheck"
            TotalSongCheckCommand="%function(self)
            self:settext( 'Perfect: '.. FormatPercentScore( GetTotalPercentComplete(STEPS_TYPE_DANCE_SINGLE))  )
            end"
            />

        <Layer
            Font="_sui generis"
            Text="Highest Percentage"
            OnCommand="x,-140;y,125;zoom,0.6;shadowlength,1;horizalign,left"
            />

        <Layer
            Font="_sui generis"
            Text="0"
            OnCommand="x,135;y,125;zoom,0.6;shadowlength,1;horizalign,right;sleep,0.05;queuecommand,TotalSongCheck"
            TotalSongCheckCommand="%function(self)
            local possible = PROFILEMAN:GetMachineProfile():GetCoursesPossible(STEPS_TYPE_DANCE_SINGLE,COURSE_DIFFICULTY_REGULAR)+
                PROFILEMAN:GetMachineProfile():GetCoursesPossible(STEPS_TYPE_DANCE_SINGLE,COURSE_DIFFICULTY_DIFFICULT)
            local actual = PROFILEMAN:GetMachineProfile():GetCoursesActual(STEPS_TYPE_DANCE_SINGLE,COURSE_DIFFICULTY_REGULAR)+
                PROFILEMAN:GetMachineProfile():GetCoursesActual(STEPS_TYPE_DANCE_SINGLE,COURSE_DIFFICULTY_DIFFICULT)
            	self:settext( string.format( '%5.2f', ( possible - actual ) ) ..'%' )
            end"
            />

        <Layer
            Font="_sui generis"
            Text="Highest Score"
            OnCommand="x,-140;y,145;zoom,0.6;shadowlength,1;horizalign,left"
            />

            <Layer
            Font="_score"
            Text="0"
            OnCommand="x,130;y,168;zoom,0.9;shadowlength,1;diffuse,0,1,1,1;horizalign,right;sleep,0.05;queuecommand,TotalSongCheck"
            TotalSongCheckCommand="%function(self)
            local Pr = PROFILEMAN:GetMachineProfile():GetSaved()
            if not Pr.DWIHighestScoreNonstopP1 then
                self:settext( string.format('% 9d','0') )
                Pr.DWIHighestScoreNonstopP1 = 0
                PROFILEMAN:SaveMachineProfile()
            else
                self:settext( string.format('% 9d', Pr.DWIHighestScoreNonstopP1 ) )
            end
            end"
            />

        <Layer
            Font="_sui generis"
            Text="Longest Time"
            OnCommand="x,-140;y,190;zoom,0.6;shadowlength,1;horizalign,left"
            />

            <Layer
            Font="_score"
            Text="0"
            OnCommand="x,130;y,210;zoom,0.7;shadowlength,1;diffuse,0,1,1,1;horizalign,right;sleep,0.05;queuecommand,TotalSongCheck"
            TotalSongCheckCommand="%function(self)
            local Pr = PROFILEMAN:GetMachineProfile():GetSaved()
            if not Pr.DWILongestTimeNonstopP1 then
                self:settext( SecondsToHHMMSS(0) )
                Pr.DWILongestTimeNonstopP1 = 0
                PROFILEMAN:SaveMachineProfile()
            else
                self:settext( SecondsToHHMMSS( Pr.DWILongestTimeNonstopP1 ) )
            end
            end"
            />

        <Layer
            Font="_sui generis"
            Text="Highest Combo"
            OnCommand="x,-140;y,228;zoom,0.6;shadowlength,1;horizalign,left"
            />

            <Layer
		File="@ThemeFile('Combo label')"
		OnCommand="x,110;y,247;zoom,0.65"
		/>

        <Layer
            Font="Combo numbers"
            Text="0"
            OnCommand="x,80;y,245;zoom,0.4;shadowlength,1;horizalign,right;sleep,0.05;queuecommand,TotalSongCheck"
            TotalSongCheckCommand="%function(self)
            local Pr = PROFILEMAN:GetMachineProfile():GetSaved()
            if not Pr.DWIHighestComboNonstopP1 then
            	self:settext('0')
            	Pr.DWIHighestComboNonstopP1 = 0
            	PROFILEMAN:SaveMachineProfile()
            else
            	self:settext( Pr.DWIHighestComboNonstopP1 )
            end
            end"
            />
    </children></Layer>








	<Layer
		File="@ThemeFile('p2bg_inactive')"
		Condition="not GAMESTATE:IsPlayerEnabled(PLAYER_2)"
		OnCommand="x,SCREEN_CENTER_X+160;y,SCREEN_CENTER_Y-126"
		/>
	<Layer
		File="@ThemeFile('p2bg_active')"
		Condition="GAMESTATE:IsPlayerEnabled(PLAYER_2)"
		OnCommand="x,SCREEN_CENTER_X+160;y,SCREEN_CENTER_Y+5"
		/>




		<!-- PLAYER 2 INFORMATION -->
<Layer Type="ActorFrame" OnCommand="x,SCREEN_CENTER_X+160;y,SCREEN_CENTER_Y-87" Condition="GAMESTATE:IsPlayerEnabled(PLAYER_2)"><children>
    <Layer
            Type="Quad"
            OnCommand="%function(self)
            self:zoomto(ProfileImageSize+2,ProfileImageSize+2,0,0)
            self:shadowlength(1)
            end"
            />
        <Layer
            Type="Quad"
            OnCommand="%function(self)
            self:zoomto(ProfileImageSize-2,ProfileImageSize-2,0,0)
            self:shadowlength(1)
            self:diffuse(0,0,0,1)
            end"
            />
           <Layer
        File="@ThemeFile('ProfileIcon/userP2')"
        OnCommand="%function(self)
        self:zoomto(ProfileImageSize,ProfileImageSize,0,0);
        end"
        />

        <Layer
            Font="_sui generis"
            Text=" "
            OnCommand="zoom,0.8;shadowlength,1;sleep,0.01;queuecommand,Update"
            UpdateCommand="%function(self)
            self:addy(60)
            self:settext( GetProfileName(2) )
            end"
            />

        <Layer
            Font="_sui generis"
            Text="Total Steps"
            OnCommand="x,-140;y,87;zoom,0.6;shadowlength,1;horizalign,left"
            />
        <Layer
            Font="_sui generis"
            Text="0"
            OnCommand="x,140;y,87;zoom,0.6;shadowlength,1;diffuse,0,1,1,1;horizalign,right;sleep,0.05;queuecommand,TotalSongCheck"
            TotalSongCheckCommand="%function(self)
            local Pr = PROFILEMAN:GetMachineProfile():GetSaved()
            if not Pr.DWITotalStepsHitP2 then
                self:settext('0')
                Pr.DWITotalStepsHitP2 = 0
                PROFILEMAN:SaveMachineProfile()
            else
                self:settext( Pr.DWITotalStepsHitP2 )
            end
            end"
            />

        <Layer
            Font="_sui generis"
            Text="0"
            OnCommand="x,140;y,105;zoom,0.6;shadowlength,1;diffuse,1,1,0,1;horizalign,right;sleep,0.05;queuecommand,TotalSongCheck"
            TotalSongCheckCommand="%function(self)
            self:settext( 'Perfect: '.. FormatPercentScore( GetTotalPercentComplete(STEPS_TYPE_DANCE_SINGLE))  )
            end"
            />

        <Layer
            Font="_sui generis"
            Text="Highest Percentage"
            OnCommand="x,-140;y,125;zoom,0.6;shadowlength,1;horizalign,left"
            />

        <Layer
            Font="_sui generis"
            Text="0"
            OnCommand="x,135;y,125;zoom,0.6;shadowlength,1;horizalign,right;sleep,0.05;queuecommand,TotalSongCheck"
            TotalSongCheckCommand="%function(self)
            local possible = PROFILEMAN:GetMachineProfile():GetCoursesPossible(STEPS_TYPE_DANCE_SINGLE,COURSE_DIFFICULTY_REGULAR)+
                PROFILEMAN:GetMachineProfile():GetCoursesPossible(STEPS_TYPE_DANCE_SINGLE,COURSE_DIFFICULTY_DIFFICULT)
            local actual = PROFILEMAN:GetMachineProfile():GetCoursesActual(STEPS_TYPE_DANCE_SINGLE,COURSE_DIFFICULTY_REGULAR)+
                PROFILEMAN:GetMachineProfile():GetCoursesActual(STEPS_TYPE_DANCE_SINGLE,COURSE_DIFFICULTY_DIFFICULT)
                self:settext( string.format( '%5.2f', ( possible - actual ) ) ..'%' )
            end"
            />

        <Layer
            Font="_sui generis"
            Text="Highest Score"
            OnCommand="x,-140;y,145;zoom,0.6;shadowlength,1;horizalign,left"
            />

            <Layer
            Font="_score"
            Text="0"
            OnCommand="x,130;y,168;zoom,0.9;shadowlength,1;diffuse,0,1,1,1;horizalign,right;sleep,0.05;queuecommand,TotalSongCheck"
            TotalSongCheckCommand="%function(self)
            local Pr = PROFILEMAN:GetMachineProfile():GetSaved()
            if not Pr.DWIHighestScoreNonstopP2 then
                self:settext( string.format('% 9d','0') )
                Pr.DWIHighestScoreNonstopP2 = 0
                PROFILEMAN:SaveMachineProfile()
            else
                self:settext( string.format('% 9d', Pr.DWIHighestScoreNonstopP2 ) )
            end
            end"
            />

        <Layer
            Font="_sui generis"
            Text="Longest Time"
            OnCommand="x,-140;y,190;zoom,0.6;shadowlength,1;horizalign,left"
            />

            <Layer
            Font="_score"
            Text="0"
            OnCommand="x,130;y,210;zoom,0.7;shadowlength,1;diffuse,0,1,1,1;horizalign,right;sleep,0.05;queuecommand,TotalSongCheck"
            TotalSongCheckCommand="%function(self)
            local Pr = PROFILEMAN:GetMachineProfile():GetSaved()
            if not Pr.DWILongestTimeNonstopP2 then
                self:settext( SecondsToHHMMSS(0) )
                Pr.DWILongestTimeNonstopP2 = 0
                PROFILEMAN:SaveMachineProfile()
            else
                self:settext( SecondsToHHMMSS( Pr.DWILongestTimeNonstopP2 ) )
            end
            end"
            />

        <Layer
            Font="_sui generis"
            Text="Highest Combo"
            OnCommand="x,-140;y,228;zoom,0.6;shadowlength,1;horizalign,left"
            />

            <Layer
        File="@ThemeFile('Combo label')"
        OnCommand="x,110;y,247;zoom,0.65"
        />

        <Layer
            Font="Combo numbers"
            Text="0"
            OnCommand="x,80;y,245;zoom,0.4;shadowlength,1;horizalign,right;sleep,0.05;queuecommand,TotalSongCheck"
            TotalSongCheckCommand="%function(self)
            local Pr = PROFILEMAN:GetMachineProfile():GetSaved()
            if not Pr.DWIHighestComboNonstopP2 then
                self:settext('0')
                Pr.DWIHighestComboNonstopP2 = 0
                PROFILEMAN:SaveMachineProfile()
            else
                self:settext( Pr.DWIHighestComboNonstopP2 )
            end
            end"
            />
    </children></Layer>
</children></ActorFrame>