local StepsType = ...;
assert(StepsType);
local extra_credit = scale(GetTotalStarComplete(StepsType),1.0,GetMaxStarComplete(),0,17);
local t = Def.ActorFrame {
	children = {
		Def.ActorFrame {
			InitCommand=cmd(x,-30;y,scale(1,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10););
			children = {
				Def.BitmapText {
					Font="_eurostile normal";
					InitCommand=cmd(shadowlength,2;settext,ScreenString('Actual');zoom,0.5;x,scale(1,1,3,SCREEN_LEFT+300,SCREEN_RIGHT-100));
				};
				Def.BitmapText {
					Font="_eurostile normal";
					InitCommand=cmd(shadowlength,2;settext,ScreenString('Possible');zoom,0.5;x,scale(2,1,3,SCREEN_LEFT+300,SCREEN_RIGHT-100));
				};
				Def.BitmapText {
					Font="_eurostile normal";
					InitCommand=cmd(shadowlength,2;settext,ScreenString('Star Complete');zoom,0.5;x,scale(3,1,3,SCREEN_LEFT+300,SCREEN_RIGHT-100));
				};
			};
		};
		Def.ActorFrame {
			InitCommand=cmd(x,SCREEN_LEFT+110);
			children = {
				LoadActor(THEME:GetPathG('ScreenRanking','Difficulty easy')) .. {
					InitCommand=cmd(y,scale(2,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10););
				};
				LoadActor(THEME:GetPathG('ScreenRanking','Difficulty medium')) .. {
					InitCommand=cmd(y,scale(3,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10););
				};
				LoadActor(THEME:GetPathG('ScreenRanking','Difficulty hard')) .. {
					InitCommand=cmd(y,scale(4,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10););
				};
				LoadActor(THEME:GetPathG('ScreenRanking','Difficulty challenge')) .. {
					InitCommand=cmd(y,scale(5,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10););
				};
				LoadActor(THEME:GetPathG('ScreenRanking','CourseDifficulty regular')) .. {
					InitCommand=cmd(y,scale(6,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10););
				};
				LoadActor(THEME:GetPathG('ScreenRanking','CourseDifficulty difficult')) .. {
					InitCommand=cmd(y,scale(7,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10););
				};
			};
		};
		Def.ActorFrame {
			InitCommand=cmd(x,scale(1,1,3,SCREEN_LEFT+300,SCREEN_RIGHT-100););
			children = {
				Def.BitmapText {
					Font="_eurostile normal";
					Text=string.format( '%5.2f', PROFILEMAN:GetMachineProfile():GetSongsActual(StepsType,DIFFICULTY_EASY) );
					InitCommand=cmd(shadowlength,2;zoom,0.6;horizalign,right;y,scale(2,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10););
				};
				Def.BitmapText {
					Font="_eurostile normal";
					Text=string.format( '%5.2f', PROFILEMAN:GetMachineProfile():GetSongsActual(StepsType,DIFFICULTY_MEDIUM) );
					InitCommand=cmd(shadowlength,2;zoom,0.6;horizalign,right;y,scale(3,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10););
				};
				Def.BitmapText {
					Font="_eurostile normal";
					Text=string.format( '%5.2f', PROFILEMAN:GetMachineProfile():GetSongsActual(StepsType,DIFFICULTY_HARD) );
					InitCommand=cmd(shadowlength,2;zoom,0.6;horizalign,right;y,scale(4,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10););
				};
				Def.BitmapText {
					Font="_eurostile normal";
					Text=string.format( '%5.2f', PROFILEMAN:GetMachineProfile():GetSongsActual(StepsType,DIFFICULTY_CHALLENGE) );
					InitCommand=cmd(shadowlength,2;zoom,0.6;horizalign,right;y,scale(5,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10););
				};
				Def.BitmapText {
					Font="_eurostile normal";
					Text=string.format( '%5.2f', PROFILEMAN:GetMachineProfile():GetCoursesActual(StepsType,COURSE_DIFFICULTY_REGULAR) );
					InitCommand=cmd(shadowlength,2;zoom,0.6;horizalign,right;y,scale(6,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10););
				};
				Def.BitmapText {
					Font="_eurostile normal";
					Text=string.format( '%5.2f', PROFILEMAN:GetMachineProfile():GetCoursesActual(StepsType,COURSE_DIFFICULTY_DIFFICULT) );
					InitCommand=cmd(shadowlength,2;zoom,0.6;horizalign,right;y,scale(7,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10););
				};
			};
		};
		Def.ActorFrame {
			InitCommand=cmd(x,scale(2,1,3,SCREEN_LEFT+300,SCREEN_RIGHT-100););
			children = {
				Def.BitmapText {
					Font="_eurostile normal";
					Text=string.format( '%5.2f', PROFILEMAN:GetMachineProfile():GetSongsPossible(StepsType,DIFFICULTY_EASY) );
					InitCommand=cmd(shadowlength,2;zoom,0.6;horizalign,right;y,scale(2,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10););
				};
				Def.BitmapText {
					Font="_eurostile normal";
					Text=string.format( '%5.2f', PROFILEMAN:GetMachineProfile():GetSongsPossible(StepsType,DIFFICULTY_MEDIUM) );
					InitCommand=cmd(shadowlength,2;zoom,0.6;horizalign,right;y,scale(3,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10););
				};
				Def.BitmapText {
					Font="_eurostile normal";
					Text=string.format( '%5.2f', PROFILEMAN:GetMachineProfile():GetSongsPossible(StepsType,DIFFICULTY_HARD) );
					InitCommand=cmd(shadowlength,2;zoom,0.6;horizalign,right;y,scale(4,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10););
				};
				Def.BitmapText {
					Font="_eurostile normal";
					Text=string.format( '%5.2f', PROFILEMAN:GetMachineProfile():GetSongsPossible(StepsType,DIFFICULTY_CHALLENGE) );
					InitCommand=cmd(shadowlength,2;zoom,0.6;horizalign,right;y,scale(5,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10););
				};
				Def.BitmapText {
					Font="_eurostile normal";
					Text=string.format( '%5.2f', PROFILEMAN:GetMachineProfile():GetCoursesPossible(StepsType,COURSE_DIFFICULTY_REGULAR) );
					InitCommand=cmd(shadowlength,2;zoom,0.6;horizalign,right;y,scale(6,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10););
				};
				Def.BitmapText {
					Font="_eurostile normal";
					Text=string.format( '%5.2f', PROFILEMAN:GetMachineProfile():GetCoursesPossible(StepsType,COURSE_DIFFICULTY_DIFFICULT) );
					InitCommand=cmd(shadowlength,2;zoom,0.6;horizalign,right;y,scale(7,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10););
				};
			};
		};
		Def.ActorFrame {
			InitCommand=cmd(x,scale(3,1,3,SCREEN_LEFT+300,SCREEN_RIGHT-100););
			children = {
				Def.BitmapText {
					Font="_eurostile normal";
					Text=FormatPercentScore( GetSongsStarComplete(StepsType,DIFFICULTY_EASY) );
					InitCommand=cmd(shadowlength,2;zoom,0.6;horizalign,right;y,scale(2,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10);playcommand,'Init2';effectcolor1,0.5,0.7,1,1);
					Init2Command=function(self)
						if GetSongsStarComplete(StepsType, DIFFICULTY_EASY) >= 1 then 
							self:diffuseshift();
						end;
					end;
				};
				Def.BitmapText {
					Font="_eurostile normal";
					Text=FormatPercentScore( GetSongsStarComplete(StepsType,DIFFICULTY_MEDIUM) );
					InitCommand=cmd(shadowlength,2;zoom,0.6;horizalign,right;y,scale(3,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10);playcommand,'Init2';effectcolor1,0.5,0.7,1,1);
					Init2Command=function(self)
						if GetSongsStarComplete(StepsType, DIFFICULTY_MEDIUM) >= 1 then 
							self:diffuseshift();
						end;
					end;
				};
				Def.BitmapText {
					Font="_eurostile normal";
					Text=FormatPercentScore( GetSongsStarComplete(StepsType,DIFFICULTY_HARD) );
					InitCommand=cmd(shadowlength,2;zoom,0.6;horizalign,right;y,scale(4,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10);playcommand,'Init2';effectcolor1,0.5,0.7,1,1);
					Init2Command=function(self)
						if GetSongsStarComplete(StepsType, DIFFICULTY_HARD) >= 1 then 
							self:diffuseshift();
						end;
					end;
				};
				Def.BitmapText {
					Font="_eurostile normal";
					Text=FormatPercentScore( GetSongsStarComplete(StepsType,DIFFICULTY_CHALLENGE) );
					InitCommand=cmd(shadowlength,2;zoom,0.6;horizalign,right;y,scale(5,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10);playcommand,'Init2';effectcolor1,0.5,0.7,1,1);
					Init2Command=function(self)
						if GetSongsStarComplete(StepsType, DIFFICULTY_CHALLENGE) >= 1 then 
							self:diffuseshift();
						end;
					end;
				};
				Def.BitmapText {
					Font="_eurostile normal";
					Text=FormatPercentScore( GetCoursesStarComplete(StepsType,COURSE_DIFFICULTY_REGULAR) );
					InitCommand=cmd(shadowlength,2;zoom,0.6;horizalign,right;y,scale(6,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10);playcommand,'Init2';effectcolor1,0.5,0.7,1,1);
					Init2Command=function(self)
						if GetCoursesStarComplete(StepsType, COURSE_DIFFICULTY_MEDIUM) >= 1 then 
							self:diffuseshift();
						end;
					end;
				};
				Def.BitmapText {
					Font="_eurostile normal";
					Text=FormatPercentScore( GetCoursesStarComplete(StepsType,COURSE_DIFFICULTY_DIFFICULT) );
					InitCommand=cmd(shadowlength,2;zoom,0.6;horizalign,right;y,scale(7,1,7,SCREEN_CENTER_Y-150,SCREEN_CENTER_Y+10);playcommand,'Init2';effectcolor1,0.5,0.7,1,1);
					Init2Command=function(self)
						if GetCoursesStarComplete(StepsType, COURSE_DIFFICULTY_HARD) >= 1 then 
							self:diffuseshift();
						end;
					end;
				};
			};
		};
		Def.ActorFrame {
			InitCommand=cmd(y,SCREEN_CENTER_Y+70);
			children = {
				Def.BitmapText {
					Font="_eurostile normal";
					InitCommand=cmd(shadowlength,2;settext,ScreenString('Total Actual');horizalign,left;x,SCREEN_CENTER_X-260;y,-24;zoom,0.6);
				};
				Def.BitmapText {
					Font="_futurist numbers metallic";
					Text=string.format( '%5.2f',      PROFILEMAN:GetMachineProfile():GetSongsActual(StepsType,DIFFICULTY_EASY)+     PROFILEMAN:GetMachineProfile():GetSongsActual(StepsType,DIFFICULTY_MEDIUM)+     PROFILEMAN:GetMachineProfile():GetSongsActual(StepsType,DIFFICULTY_HARD)+     PROFILEMAN:GetMachineProfile():GetSongsActual(StepsType,DIFFICULTY_CHALLENGE)+     PROFILEMAN:GetMachineProfile():GetCoursesActual(StepsType,COURSE_DIFFICULTY_REGULAR)+     PROFILEMAN:GetMachineProfile():GetCoursesActual(StepsType,COURSE_DIFFICULTY_DIFFICULT)     );
					InitCommand=cmd(horizalign,right;x,SCREEN_CENTER_X+106;y,-24;zoom,0.7);
				};
				Def.BitmapText {
					Font="_eurostile normal";
					InitCommand=cmd(shadowlength,2;settext,ScreenString('Total Possible');horizalign,left;x,SCREEN_CENTER_X-260;y,-4;zoom,0.6);
				};
				Def.BitmapText {
					Font="_futurist numbers metallic";
					Text=string.format( '%5.2f',      PROFILEMAN:GetMachineProfile():GetSongsPossible(StepsType,DIFFICULTY_EASY)+     PROFILEMAN:GetMachineProfile():GetSongsPossible(StepsType,DIFFICULTY_MEDIUM)+     PROFILEMAN:GetMachineProfile():GetSongsPossible(StepsType,DIFFICULTY_HARD)+     PROFILEMAN:GetMachineProfile():GetSongsPossible(StepsType,DIFFICULTY_CHALLENGE)+     PROFILEMAN:GetMachineProfile():GetCoursesPossible(StepsType,COURSE_DIFFICULTY_REGULAR)+     PROFILEMAN:GetMachineProfile():GetCoursesPossible(StepsType,COURSE_DIFFICULTY_DIFFICULT)     );
					InitCommand=cmd(horizalign,right;x,SCREEN_CENTER_X+106;y,-4;zoom,0.7);
				};
				Def.BitmapText {
					Font="_eurostile normal";
					InitCommand=cmd(shadowlength,2;settext,ScreenString('Star Complete');horizalign,left;x,SCREEN_CENTER_X-260;y,20;zoom,0.8);
				};
				Def.BitmapText {
					Font="_futurist numbers metallic";
					Text=FormatPercentScore( GetTotalStarComplete(StepsType));
					InitCommand=cmd(horizalign,right;x,SCREEN_CENTER_X+136;y,20;zoom,1;applystarcompleteeffect,StepsType);
				};
				LoadActor(THEME:GetPathG('', '_grade models/' .. GetGradeFromPercent(GetTotalStarComplete(StepsType)))) .. {
					InitCommand=cmd(x,SCREEN_CENTER_X+200;y,0;zoom,0.9);
				};
			};
		};
		Def.ActorFrame {
			Condition=GetTotalStarComplete(StepsType) > 1;
			InitCommand=cmd(y,SCREEN_CENTER_Y+138);
			children = {
				Def.BitmapText {
					Font="_eurostile normal";
					Text=THEME:GetString('ScreenSummary','Extra Credit');
					InitCommand=cmd(zoom,0.6;horizalign,left;x,SCREEN_CENTER_X-260;y,-24;diffuseshift;effectcolor1,0.2,0.2,0.2,1);
				};
				Def.BitmapText {
					Font="_futurist numbers metallic";
					Text=string.format( '%5.2f', math.max(0,GetExtraCredit(StepsType)) );
					InitCommand=cmd(zoom,0.7;horizalign,right;x,SCREEN_CENTER_X+106;y,-24;diffuseshift;effectcolor1,0.2,0.2,0.2,1);
				};
				Def.ActorScroller {
					SecondsPerItem=0;
					NumItemsToDraw=20;
					TransformFunction=function(self,offset,itemIndex,numItems) 
						self:x(offset*34);
						self:zoom(0.3); 
					end;
					InitCommand=function(self)
						self:x(SCREEN_CENTER_X);
						self:y(16);
						self:SetCurrentAndDestinationItem((self:GetNumChildren()-1)/2);
					end;
					children = {
						LoadActor(THEME:GetPathG('','_award models/ribbon pink')) .. {
							Condition=extra_credit >= 1;
						};
						LoadActor(THEME:GetPathG('','_award models/ribbon purple')) .. {
							Condition=extra_credit >= 2;
						};
						LoadActor(THEME:GetPathG('','_award models/ribbon red')) .. {
							Condition=extra_credit >= 3;
						};
						LoadActor(THEME:GetPathG('','_award models/ribbon orange')) .. {
							Condition=extra_credit >= 4;
						};
						LoadActor(THEME:GetPathG('','_award models/ribbon green')) .. {
							Condition=extra_credit >= 5;
						};
						LoadActor(THEME:GetPathG('','_award models/ribbon blue')) .. {
							Condition=extra_credit >= 6;
						};
						LoadActor(THEME:GetPathG('','_award models/plaque green')) .. {
							Condition=extra_credit >= 7;
						};
						LoadActor(THEME:GetPathG('','_award models/plaque bronze')) .. {
							Condition=extra_credit >= 8;
						};
						LoadActor(THEME:GetPathG('','_award models/plaque silver')) .. {
							Condition=extra_credit >= 9;
						};
						LoadActor(THEME:GetPathG('','_award models/plaque gold')) .. {
							Condition=extra_credit >= 10;
						};
						LoadActor(THEME:GetPathG('','_award models/trophy green')) .. {
							Condition=extra_credit >= 11;
						};
						LoadActor(THEME:GetPathG('','_award models/trophy bronze')) .. {
							Condition=extra_credit >= 12;
						};
						LoadActor(THEME:GetPathG('','_award models/trophy silver')) .. {
							Condition=extra_credit >= 13;
						};
						LoadActor(THEME:GetPathG('','_award models/trophy gold')) .. {
							Condition=extra_credit >= 14;
						};
						LoadActor(THEME:GetPathG('','_award models/itg silver')) .. {
							Condition=extra_credit >= 15;
						};
						LoadActor(THEME:GetPathG('','_award models/itg gold')) .. {
							Condition=extra_credit >= 16;
						};
						LoadActor(THEME:GetPathG('','_award models/itg blue')) .. {
							Condition=extra_credit >= 17;
						};
					};
				};
			};
		};
	};
};

return t;
