split ScreenHighScores from ScreenRanking. These two things lived in the same file and shared enums, but shared almost no code

This commit is contained in:
Chris Danford
2008-11-27 03:01:01 +00:00
parent 88d8c9bcd7
commit 11989f0e70
13 changed files with 133 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

@@ -0,0 +1,3 @@
return LoadActor( "bg" ) .. {
InitCommand = cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;)
}
@@ -0,0 +1,25 @@
local t = Def.ActorFrame {
LoadActor("mockup") .. {
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;diffusealpha,0.2;);
};
Def.ActorFrame {
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y-200;);
LoadActor("difficulty pill") .. {
InitCommand=cmd(x,-100;);
};
LoadActor("difficulty pill") .. {
InitCommand=cmd(x,-50;);
};
LoadActor("difficulty pill") .. {
InitCommand=cmd(x,0;);
};
LoadActor("difficulty pill") .. {
InitCommand=cmd(x,50;);
};
LoadActor("difficulty pill") .. {
InitCommand=cmd(x,100;);
};
};
}
return t;
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

@@ -0,0 +1,4 @@
return LoadFont("common normal") .. {
Text = "Best Ranking",
InitCommand = cmd(horizalign,'HorizAlign_Left';x,SCREEN_LEFT+48;y,SCREEN_TOP+32;shadowlength,0)
}
@@ -0,0 +1 @@
_terminator two 18px
@@ -0,0 +1 @@
_terminator two 18px
@@ -0,0 +1 @@
common normal
@@ -0,0 +1,98 @@
local t = Def.ActorFrame {
InitCommand=cmd(runcommandsonleaves,cmd(ztest,true));
};
--t[#t+1] = LoadActor("frame") .. {
--};
t[#t+1] = Def.TextBanner {
InitCommand=cmd(x,-224;y,0;Load,"TextBanner";);
SetCommand=function(self, params)
if params.Song then
self:SetFromSong( params.Song );
else
self:SetFromString( params.Course:GetTitle() );
end
end;
};
local NumColumns = THEME:GetMetric(Var "LoadingScreen", "NumColumns");
local c;
local Scores = Def.ActorFrame {
InitCommand = function(self)
c = self:GetChildren();
end;
};
t[#t+1] = Scores;
for idx=1,NumColumns do
local x_pos = -60 + 80 * (idx-1);
Scores[#Scores+1] = LoadFont(Var "LoadingScreen","Name") .. {
Name = idx .. "Name";
InitCommand=cmd(x,x_pos;y,6;shadowlengthx,0;shadowlengthy,2;shadowcolor,color("#000000");maxwidth,68;);
};
Scores[#Scores+1] = LoadFont(Var "LoadingScreen","Score") .. {
Name = idx .. "Score";
InitCommand=cmd(x,x_pos;y,-10;shadowlengthx,0;shadowlengthy,2;shadowcolor,color("#000000");maxwidth,68;);
};
Scores[#Scores+1] = LoadActor("filled") .. {
Name = idx .. "Filled";
InitCommand=cmd(x,x_pos;);
};
Scores[#Scores+1] = LoadActor("empty") .. {
Name = idx .. "Empty";
InitCommand=cmd(x,x_pos;);
};
end
local sNoScoreName = THEME:GetMetric("Common", "NoScoreName");
Scores.SetCommand=function(self, params)
local pProfile = PROFILEMAN:GetMachineProfile();
for name, child in pairs(c) do
child:visible(false);
end
--for idx=1,NumColumns do
-- c[idx .. "Empty"]:visible(true);
--end
local Current = params.Song or params.Course;
if Current then
for idx, CurrentItem in pairs(params.Entries) do
if CurrentItem then
local hsl = pProfile:GetHighScoreList(Current, CurrentItem);
local hs = hsl and hsl:GetHighScores();
--[[Warn( tostring(CurrentItem:GetStepsType()) .. ", " ..
tostring(CurrentItem:GetDifficulty()) .. ": " ..
tostring(hsl) .. ", " ..
tostring(#hs) );]]
local name = c[idx .. "Name"];
local score = c[idx .. "Score"];
local filled = c[idx .. "Filled"];
local empty = c[idx .. "Empty"];
--assert( c[sNameType], sNameType );
--assert( c[sScoreType], sScoreType );
if hs and #hs > 0 then
name:visible( true );
score:visible( true );
filled:visible( true );
empty:visible( false );
name:settext( hs[1]:GetName() );
score:settext( FormatPercentScore( hs[1]:GetPercentDP() ) );
else
empty:visible( true );
--name:settext( sNoScoreName );
--score:settext( FormatPercentScore( 0 ) );
end
end
end;
end
end;
return t;
Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1005 B