CustomDifficulty fixup

This commit is contained in:
Chris Danford
2008-12-21 09:18:36 +00:00
parent e3155aec51
commit f3bb67917c
8 changed files with 49 additions and 44 deletions
@@ -14,10 +14,11 @@ for i=1,NumColumns do
InitCommand=cmd(x,SCREEN_CENTER_X-60 + 80 * (i-1);y,SCREEN_CENTER_Y-154;); InitCommand=cmd(x,SCREEN_CENTER_X-60 + 80 * (i-1);y,SCREEN_CENTER_Y-154;);
}; };
local d = THEME:GetMetric(Var "LoadingScreen","ColumnDifficulty" .. i);
local st = THEME:GetMetric(Var "LoadingScreen","ColumnStepsType" .. i); local st = THEME:GetMetric(Var "LoadingScreen","ColumnStepsType" .. i);
local dc = THEME:GetMetric(Var "LoadingScreen","ColumnDifficulty" .. i);
local s = GetCustomDifficulty( st, dc );
t[#t+1] = LoadFont("_venacti Bold 13px") .. { t[#t+1] = LoadFont("_venacti Bold 13px") .. {
InitCommand=cmd(settext,"EASY";diffuse,color("#FFFF00");x,SCREEN_CENTER_X-60 + 80 * (i-1);y,SCREEN_CENTER_Y-158;shadowlength,0;); InitCommand=cmd(uppercase,true;settext,GetLocalizedCustomDifficulty(s);diffuse,CustomDifficultyToColor(s);x,SCREEN_CENTER_X-60 + 80 * (i-1);y,SCREEN_CENTER_Y-158;shadowlength,0;);
}; };
end end
@@ -26,6 +27,6 @@ t[#t+1] = LoadFont("_terminator two 24px") .. {
}; };
t[#t+1] = LoadFont("_terminator two 30px") .. { t[#t+1] = LoadFont("_terminator two 30px") .. {
InitCommand=cmd(settext,"Best Ranking";uppercase,true;diffuse,color("#FFFFFF");x,SCREEN_CENTER_X-130;y,SCREEN_CENTER_Y-206;shadowlength,0;strokecolor,color("#3b009c44");); InitCommand=cmd(settext,"Best Scores";uppercase,true;diffuse,color("#FFFFFF");x,SCREEN_CENTER_X-130;y,SCREEN_CENTER_Y-206;shadowlength,0;strokecolor,color("#3b009c44"););
}; };
return t; return t;
@@ -1,4 +0,0 @@
return LoadFont("common normal") .. {
Text = "Best Ranking",
InitCommand = cmd(horizalign,'HorizAlign_Left';x,SCREEN_LEFT+48;y,SCREEN_TOP+32;shadowlength,0)
}
@@ -32,7 +32,7 @@ end
return Def.ActorFrame { return Def.ActorFrame {
LoadActor("how to play") .. { LoadActor("how to play") .. {
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;diffusealpha,0;zoom,4;sleep,0.0;linear,0.5;diffusealpha,1;zoom,1.5;sleep,1.7;linear,0.5;zoom,1;addx,160;addy,-150;draworder,1;); OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;diffusealpha,0;zoom,4;sleep,0.0;linear,0.3;diffusealpha,1;zoom,1.8;sleep,1.7;linear,0.3;zoom,1;addx,160;addy,-150;draworder,1;);
}; };
ExplanationText( "When the arrows rise to this point, step on the matching panels.", 5, 9 ); ExplanationText( "When the arrows rise to this point, step on the matching panels.", 5, 9 );
@@ -8,7 +8,7 @@ t[#t+1] = LoadActor("frame") .. {
t[#t+1] = Def.TextBanner { t[#t+1] = Def.TextBanner {
InitCommand=cmd(x,-224;y,0;Load,"TextBanner";); InitCommand=cmd(x,-196;y,0;Load,"TextBannerHighScores";);
SetCommand=function(self, params) SetCommand=function(self, params)
if params.Song then if params.Song then
self:SetFromSong( params.Song ); self:SetFromSong( params.Song );
@@ -59,9 +59,9 @@ Scores.SetCommand=function(self, params)
for name, child in pairs(c) do for name, child in pairs(c) do
child:visible(false); child:visible(false);
end end
--for idx=1,NumColumns do for idx=1,NumColumns do
-- c[idx .. "Empty"]:visible(true); c[idx .. "Empty"]:visible(true);
--end end
local Current = params.Song or params.Course; local Current = params.Song or params.Course;
if Current then if Current then
@@ -81,17 +81,16 @@ Scores.SetCommand=function(self, params)
--assert( c[sNameType], sNameType ); --assert( c[sNameType], sNameType );
--assert( c[sScoreType], sScoreType ); --assert( c[sScoreType], sScoreType );
if hs and #hs > 0 then
name:visible( true ); name:visible( true );
score:visible( true ); score:visible( true );
filled:visible( true ); filled:visible( true );
empty:visible( false ); empty:visible( false );
if hs and #hs > 0 then
name:settext( hs[1]:GetName() ); name:settext( hs[1]:GetName() );
score:settext( FormatPercentScore( hs[1]:GetPercentDP() ) ); score:settext( FormatPercentScore( hs[1]:GetPercentDP() ) );
else else
empty:visible( true ); name:settext( sNoScoreName );
--name:settext( sNoScoreName ); score:settext( FormatPercentScore( 0 ) );
--score:settext( FormatPercentScore( 0 ) );
end end
end end
end; end;
+5 -6
View File
@@ -110,16 +110,15 @@ function TextBannerAfterSet(self,param)
local Title=self:GetChild("Title"); local Title=self:GetChild("Title");
local Subtitle=self:GetChild("Subtitle"); local Subtitle=self:GetChild("Subtitle");
--local Artist=self:GetChild("Artist"); --local Artist=self:GetChild("Artist");
local edge_x = 120;
if Subtitle:GetText() == "" then if Subtitle:GetText() == "" then
(cmd(maxwidth,300;x,edge_x;y,0;zoom,1.1;))(Title); (cmd(maxwidth,300;y,0;zoom,1.1;))(Title);
(cmd(visible,false))(Subtitle); (cmd(visible,false))(Subtitle);
--(cmd(zoom,0.66;maxwidth,300;x,edge_x;y,7))(Artist); --(cmd(zoom,0.66;maxwidth,300;y,7))(Artist);
else else
-- subtitle below -- subtitle below
(cmd(zoom,1;x,edge_x;y,-6;zoom,1.0;))(Title); (cmd(zoom,1;y,-6;zoom,1.0;))(Title);
(cmd(visible,true;zoom,0.6;x,edge_x;y,7))(Subtitle); (cmd(visible,true;zoom,0.6;y,7))(Subtitle);
--(cmd(zoom,0.66;maxwidth,300;x,edge_x;y,9))(Artist); --(cmd(zoom,0.66;maxwidth,300;y,9))(Artist);
end end
end end
+17 -12
View File
@@ -903,11 +903,11 @@ ScoreFrameX=SCREEN_CENTER_X
ScoreFrameY=SCREEN_BOTTOM ScoreFrameY=SCREEN_BOTTOM
ScoreFrameOnCommand=vertalign,bottom;addy,100;linear,0.5;addy,-100;draworder,2 ScoreFrameOnCommand=vertalign,bottom;addy,100;linear,0.5;addy,-100;draworder,2
ScoreFrameOffCommand=linear,0.5;addy,100 ScoreFrameOffCommand=linear,0.5;addy,100
ScoreP1X=SCREEN_CENTER_X-226 ScoreP1X=SCREEN_CENTER_X-220
ScoreP1Y=SCREEN_CENTER_Y+200 ScoreP1Y=SCREEN_CENTER_Y+200
ScoreP1OnCommand=addy,100;linear,1;addy,-100;draworder,109; ScoreP1OnCommand=addy,100;linear,1;addy,-100;draworder,109;
ScoreP1OffCommand=linear,1;addy,100; ScoreP1OffCommand=linear,1;addy,100;
ScoreP2X=SCREEN_CENTER_X+226 ScoreP2X=SCREEN_CENTER_X+220
ScoreP2Y=SCREEN_CENTER_Y+200 ScoreP2Y=SCREEN_CENTER_Y+200
ScoreP2OnCommand=addy,100;linear,1;addy,-100;draworder,109; ScoreP2OnCommand=addy,100;linear,1;addy,-100;draworder,109;
ScoreP2OffCommand=linear,1;addy,100; ScoreP2OffCommand=linear,1;addy,100;
@@ -2017,13 +2017,13 @@ FrameX=0
FrameY=0 FrameY=0
FrameOnCommand= FrameOnCommand=
FrameLoadCommand=%function(self,param) local bFlip = param.PlayerState and param.PlayerState:GetPlayerNumber() ~= PLAYER_1; self:zoomx(bFlip and -1 or 1); end FrameLoadCommand=%function(self,param) local bFlip = param.PlayerState and param.PlayerState:GetPlayerNumber() ~= PLAYER_1; self:zoomx(bFlip and -1 or 1); end
FrameSetCommand=%function(self,param) if param.Difficulty then self:diffuse(DifficultyDisplayTypeToColor(param.DifficultyDisplayType)) end end FrameSetCommand=%function(self,param) if param.Difficulty then self:diffuse(CustomDifficultyToColor(param.CustomDifficulty)) end end
NumTicks=10 NumTicks=10
MaxTicks=14 MaxTicks=14
TicksX=0 TicksX=0
TicksY=0 TicksY=0
TicksOnCommand=shadowlength,0;stoke TicksOnCommand=shadowlength,0;stoke
TicksSetCommand=%function(self,param) self:diffuse(DifficultyDisplayTypeToColor(param.DifficultyDisplayType)) if param.Meter > 9 then self:glowshift() else self:stopeffect() end end TicksSetCommand=%function(self,param) self:diffuse(CustomDifficultyToColor(param.CustomDifficulty)) if param.Meter > 9 then self:glowshift() else self:stopeffect() end end
ShowTicks=false ShowTicks=false
ShowMeter=true ShowMeter=true
ZeroMeterString="?" ZeroMeterString="?"
@@ -2063,7 +2063,7 @@ FrameOnCommand=
ShowTicks=true ShowTicks=true
NumTicks=13 NumTicks=13
MaxTicks=13 MaxTicks=13
TicksSetCommand=%function(self,param) self:diffuse(DifficultyDisplayTypeToColor(param.DifficultyDisplayType)); end TicksSetCommand=%function(self,param) self:diffuse(CustomDifficultyToColor(param.CustomDifficulty)); end
TicksX=0 TicksX=0
TicksY=0 TicksY=0
TicksOnCommand=shadowlength,0;shadowcolor,color("#FFFFFF"); TicksOnCommand=shadowlength,0;shadowcolor,color("#FFFFFF");
@@ -2072,15 +2072,15 @@ ZeroMeterString="?"
MeterX=92 MeterX=92
MeterY=-1 MeterY=-1
MeterOnCommand=shadowlengthx,0;shadowlengthy,2;shadowcolor,color("#00000077"); MeterOnCommand=shadowlengthx,0;shadowlengthy,2;shadowcolor,color("#00000077");
MeterSetCommand=%function(self,param) self:diffuse(DifficultyDisplayTypeToColor(param.DifficultyDisplayType)); end MeterSetCommand=%function(self,param) self:diffuse(CustomDifficultyToColor(param.CustomDifficulty)); end
ShowDescription=true ShowDescription=true
DescriptionX=-110 DescriptionX=-110
DescriptionY=-1 DescriptionY=-1
DescriptionOnCommand=uppercase,true;shadowlengthx,0;shadowlengthy,2;shadowcolor,color("#00000077");maxwidth,150; DescriptionOnCommand=uppercase,true;shadowlengthx,0;shadowlengthy,2;shadowcolor,color("#00000077");maxwidth,150;
DescriptionSetCommand=%function(self,param) self:diffuse(DifficultyDisplayTypeToColor(param.DifficultyDisplayType)); end DescriptionSetCommand=%function(self,param) self:diffuse(CustomDifficultyToColor(param.CustomDifficulty)); end
AutogenX=102 AutogenX=102
AutogenOnCommand=shadowlengthx,0;shadowlengthy,2;shadowcolor,color("#00000077"); AutogenOnCommand=shadowlengthx,0;shadowlengthy,2;shadowcolor,color("#00000077");
AutogenSetCommand=%function(self,param) self:diffuse(DifficultyDisplayTypeToColor(param.DifficultyDisplayType)); end AutogenSetCommand=%function(self,param) self:diffuse(CustomDifficultyToColor(param.CustomDifficulty)); end
[StepsDisplayGameplay] [StepsDisplayGameplay]
Fallback="StepsDisplay" Fallback="StepsDisplay"
@@ -2547,8 +2547,8 @@ HoldJudgmentHeldCommand=shadowlength,0;diffusealpha,1;zoom,1.25;linear,0.3;zoomx
[Combo] [Combo]
ShowComboAt=2 ShowComboAt=2
LabelOnCommand=x,SCREEN_CENTER_X-314;y,SCREEN_CENTER_Y-220;shadowlength,0;HorizAlign,left;vertalign,bottom LabelOnCommand=x,SCREEN_CENTER_X-314;y,SCREEN_CENTER_Y-220;shadowlength,0;horizalign,left;vertalign,bottom
NumberOnCommand=y,SCREEN_CENTER_Y-216;shadowlength,0;HorizAlign,right;vertalign,bottom NumberOnCommand=y,SCREEN_CENTER_Y-216;shadowlength,0;horizalign,right;vertalign,bottom
NumberMinZoom=0.5 NumberMinZoom=0.5
NumberMaxZoom=0.8 NumberMaxZoom=0.8
NumberMaxZoomAt=200 NumberMaxZoomAt=200
@@ -3521,12 +3521,17 @@ LineNames="1"
Line1="lua,OptionsRowTest()" Line1="lua,OptionsRowTest()"
[TextBanner] [TextBanner]
TitleOnCommand=shadowlengthx,0;shadowlengthy,2;shadowcolor,color("#000000");horizalign,right TitleOnCommand=shadowlengthx,0;shadowlengthy,2;shadowcolor,color("#000000");horizalign,right;x,120;
SubtitleOnCommand=shadowlengthx,0;shadowlengthy,2;shadowcolor,color("#000000");horizalign,right SubtitleOnCommand=shadowlengthx,0;shadowlengthy,2;shadowcolor,color("#000000");horizalign,right;x,120;
ArtistOnCommand=visible,false ArtistOnCommand=visible,false
ArtistPrependString="/" ArtistPrependString="/"
AfterSetCommand=%TextBannerAfterSet AfterSetCommand=%TextBannerAfterSet
[TextBannerHighScores]
Fallback="TextBanner"
TitleOnCommand=shadowlengthx,0;shadowlengthy,2;shadowcolor,color("#000000");horizalign,center;
SubtitleOnCommand=shadowlengthx,0;shadowlengthy,2;shadowcolor,color("#000000");horizalign,center;
[TextBannerCourseEntry] [TextBannerCourseEntry]
Fallback="TextBanner" Fallback="TextBanner"
TitleX=-90 TitleX=-90
+5 -1
View File
@@ -105,7 +105,7 @@ RString GetCustomDifficulty( StepsType st, Difficulty dc )
if( DIFFICULTY == Difficulty_Invalid || dc == DIFFICULTY ) // match if( DIFFICULTY == Difficulty_Invalid || dc == DIFFICULTY ) // match
{ {
ThemeMetric<RString> STRING("CustomDifficulty",(*sName)+"String"); ThemeMetric<RString> STRING("CustomDifficulty",(*sName)+"String");
return STRING; return STRING.GetValue();
} }
} }
} }
@@ -118,11 +118,15 @@ RString GetCustomDifficulty( StepsType st, Difficulty dc )
} }
} }
LuaFunction( GetCustomDifficulty, GetCustomDifficulty(Enum::Check<StepsType>(L,1),Enum::Check<Difficulty>(L, 2)) );
RString GetLocalizedCustomDifficulty( const RString &sCustomDifficulty ) RString GetLocalizedCustomDifficulty( const RString &sCustomDifficulty )
{ {
return THEME->GetString( "CustomDifficulty", sCustomDifficulty ); return THEME->GetString( "CustomDifficulty", sCustomDifficulty );
} }
LuaFunction( GetLocalizedCustomDifficulty, GetLocalizedCustomDifficulty(SArg(1)) );
/* /*
* (c) 2001-2004 Chris Danford * (c) 2001-2004 Chris Danford
+6 -5
View File
@@ -181,10 +181,6 @@ void StepsDisplay::SetFromStepsTypeAndMeterAndCourseDifficulty( StepsType st, in
void StepsDisplay::SetInternal( const SetParams &params ) void StepsDisplay::SetInternal( const SetParams &params )
{ {
RString sCustomDifficulty ;
if( params.st != StepsType_Invalid )
sCustomDifficulty = GetCustomDifficulty( params.st, params.dc );
Message msg( "Set" ); Message msg( "Set" );
if( params.pSteps ) if( params.pSteps )
msg.SetParam( "Steps", LuaReference::CreateFromPush(*(Steps*)params.pSteps) ); msg.SetParam( "Steps", LuaReference::CreateFromPush(*(Steps*)params.pSteps) );
@@ -195,7 +191,12 @@ void StepsDisplay::SetInternal( const SetParams &params )
msg.SetParam( "Difficulty", params.dc ); msg.SetParam( "Difficulty", params.dc );
msg.SetParam( "IsCourseDifficulty", params.bIsCourseDifficulty ); msg.SetParam( "IsCourseDifficulty", params.bIsCourseDifficulty );
msg.SetParam( "Description", params.sDescription ); msg.SetParam( "Description", params.sDescription );
RString sCustomDifficulty;
if( params.st != StepsType_Invalid )
{
sCustomDifficulty = GetCustomDifficulty( params.st, params.dc );
msg.SetParam( "CustomDifficulty", sCustomDifficulty ); msg.SetParam( "CustomDifficulty", sCustomDifficulty );
}
m_sprFrame->HandleMessage( msg ); m_sprFrame->HandleMessage( msg );
@@ -236,7 +237,7 @@ void StepsDisplay::SetInternal( const SetParams &params )
{ {
if( params.pSteps && params.pSteps->IsAnEdit() ) if( params.pSteps && params.pSteps->IsAnEdit() )
s = params.sDescription; s = params.sDescription;
else else if( !sCustomDifficulty.empty() )
s = GetLocalizedCustomDifficulty( sCustomDifficulty ); s = GetLocalizedCustomDifficulty( sCustomDifficulty );
} }