CustomDiffiuclty cleanup, now takes CourseType as a parameter

DifficultyList -> StepsDisplayList
Course editor screen cleanup
Change GameManager back to singleton for consistency with other classes
This commit is contained in:
Chris Danford
2009-08-09 02:59:32 +00:00
parent 204f7edac0
commit cd139430f5
72 changed files with 537 additions and 447 deletions
+2 -2
View File
@@ -847,9 +847,9 @@
Blanks the DifficultyIcon. Blanks the DifficultyIcon.
</Function> </Function>
</Class> </Class>
<Class name='DifficultyList'> <Class name='StepsDisplayList'>
<Function name='setfromgamestate' return='void' arguments=''> <Function name='setfromgamestate' return='void' arguments=''>
Sets the DifficultyList from the GameState. Sets the StepsDisplayList from the GameState.
</Function> </Function>
</Class> </Class>
<Class name='Game'> <Class name='Game'>
@@ -16,9 +16,10 @@ for i=1,NumColumns do
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 dc = THEME:GetMetric(Var "LoadingScreen","ColumnDifficulty" .. i);
local s = GetCustomDifficulty( st, dc ); local ct = nil;
local s = GetCustomDifficulty( st, dc, ct );
t[#t+1] = LoadFont("_venacti Bold 13px") .. { t[#t+1] = LoadFont("_venacti Bold 13px") .. {
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;); InitCommand=cmd(uppercase,true;settext,CustomDifficultyToLocalizedString(s);diffuse,CustomDifficultyToColor(s);x,SCREEN_CENTER_X-60 + 80 * (i-1);y,SCREEN_CENTER_Y-158;shadowlength,0;);
}; };
end end
@@ -1,3 +0,0 @@
return LoadActor("DifficultyList cursor p1") .. {
InitCommand=cmd(zoomx,-1;);
};
@@ -0,0 +1,3 @@
return LoadActor("StepsDisplayList cursor p1") .. {
InitCommand=cmd(zoomx,-1;);
};
@@ -315,7 +315,7 @@ t[#t+1] = Def.CourseContentsList {
DifficultyChangedCommand=function(self, params) DifficultyChangedCommand=function(self, params)
if params.PlayerNumber ~= GAMESTATE:GetMasterPlayerNumber() then return end if params.PlayerNumber ~= GAMESTATE:GetMasterPlayerNumber() then return end
self:settext( params.Meter ); self:settext( params.Meter );
self:diffuse( CourseDifficutlyToColor(params.Difficulty) ); self:diffuse( StepsOrTrailToColor(params.Trail) );
end; end;
}; };
@@ -328,7 +328,7 @@ t[#t+1] = Def.CourseContentsList {
OnCommand=cmd(x,SCREEN_CENTER_X-254;y,1;shadowlength,0;settext,"1"); OnCommand=cmd(x,SCREEN_CENTER_X-254;y,1;shadowlength,0;settext,"1");
DifficultyChangedCommand=function(self, params) DifficultyChangedCommand=function(self, params)
if params.PlayerNumber ~= GAMESTATE:GetMasterPlayerNumber() then return end if params.PlayerNumber ~= GAMESTATE:GetMasterPlayerNumber() then return end
self:diffuse( CourseDifficutlyToColor(params.Difficulty) ); self:diffuse( StepsOrTrailToColor(params.Trail) );
end; end;
}; };
}; };
@@ -392,8 +392,8 @@ t[#t+1] = Def.ActorFrame{
}; };
if not GAMESTATE:IsCourseMode() then if not GAMESTATE:IsCourseMode() then
t[#t+1] = Def.DifficultyList { t[#t+1] = Def.StepsDisplayList {
Name="DifficultyList"; Name="StepsDisplayList";
InitCommand=cmd(x,SCREEN_CENTER_X+166;y,SCREEN_CENTER_Y+20); InitCommand=cmd(x,SCREEN_CENTER_X+166;y,SCREEN_CENTER_Y+20);
CursorP1 = Def.ActorFrame { CursorP1 = Def.ActorFrame {
BeginCommand=cmd(visible,true); BeginCommand=cmd(visible,true);
@@ -402,7 +402,7 @@ if not GAMESTATE:IsCourseMode() then
self:visible(false); self:visible(false);
end; end;
children={ children={
LoadActor( "DifficultyList highlight" ) .. { LoadActor( "StepsDisplayList highlight" ) .. {
InitCommand=cmd(addx,-10;diffusealpha,0.3); InitCommand=cmd(addx,-10;diffusealpha,0.3);
BeginCommand=cmd(player,"PlayerNumber_P1"); BeginCommand=cmd(player,"PlayerNumber_P1");
OnCommand=cmd(playcommand,"UpdateAlpha"); OnCommand=cmd(playcommand,"UpdateAlpha");
@@ -428,7 +428,7 @@ if not GAMESTATE:IsCourseMode() then
Def.ActorFrame { Def.ActorFrame {
InitCommand=cmd(x,-150;bounce;effectmagnitude,-12,0,0;effectperiod,1.0;effectoffset,0.0;effectclock,"bgm"); InitCommand=cmd(x,-150;bounce;effectmagnitude,-12,0,0;effectperiod,1.0;effectoffset,0.0;effectclock,"bgm");
children={ children={
LoadActor( "DifficultyList cursor p1" ) .. { LoadActor( "StepsDisplayList cursor p1" ) .. {
BeginCommand=cmd(player,"PlayerNumber_P1";); BeginCommand=cmd(player,"PlayerNumber_P1";);
PlayerJoinedMessageCommand=function(self,param ) PlayerJoinedMessageCommand=function(self,param )
if param.Player ~= "PlayerNumber_P1" then return end; if param.Player ~= "PlayerNumber_P1" then return end;
@@ -454,7 +454,7 @@ if not GAMESTATE:IsCourseMode() then
self:visible(false); self:visible(false);
end; end;
children={ children={
LoadActor( "DifficultyList highlight" ) .. { LoadActor( "StepsDisplayList highlight" ) .. {
InitCommand=cmd(addx,-10;zoomx,-1;diffusealpha,0.3); InitCommand=cmd(addx,-10;zoomx,-1;diffusealpha,0.3);
BeginCommand=cmd(player,"PlayerNumber_P2"); BeginCommand=cmd(player,"PlayerNumber_P2");
OnCommand=cmd(playcommand,"UpdateAlpha"); OnCommand=cmd(playcommand,"UpdateAlpha");
@@ -480,7 +480,7 @@ if not GAMESTATE:IsCourseMode() then
Def.ActorFrame { Def.ActorFrame {
InitCommand=cmd(x,130;bounce;effectmagnitude,12,0,0;effectperiod,1.0;effectoffset,0.0;effectclock,"bgm"); InitCommand=cmd(x,130;bounce;effectmagnitude,12,0,0;effectperiod,1.0;effectoffset,0.0;effectclock,"bgm");
children={ children={
LoadActor( "DifficultyList cursor p2" ) .. { LoadActor( "StepsDisplayList cursor p2" ) .. {
BeginCommand=cmd(player,"PlayerNumber_P2";); BeginCommand=cmd(player,"PlayerNumber_P2";);
PlayerJoinedMessageCommand=function(self,param ) PlayerJoinedMessageCommand=function(self,param )
if param.Player ~= "PlayerNumber_P2" then return end; if param.Player ~= "PlayerNumber_P2" then return end;
+34 -7
View File
@@ -387,6 +387,7 @@ ScoreDisplay=ScoreDisplay
Scoreboard=Enables scoreboard Scoreboard=Enables scoreboard
ScoringType=Defines which scoring method to use. ScoringType=Defines which scoring method to use.
Scroll=Scroll Scroll=Scroll
Select Course=Choose this course.
Select Profile=Choose a profile Select Profile=Choose a profile
Server=Start Local Server Server=Start Local Server
Servers=Servers Servers=Servers
@@ -426,6 +427,17 @@ WideScreen16_9=Enable widescreen display.
WideScreen16_10=Enable widescreen display. WideScreen16_10=Enable widescreen display.
Windowed=Choose whether you would like to run full screen, or to display in a window on your desktop. Windowed=Choose whether you would like to run full screen, or to display in a window on your desktop.
#ScreenOptionsEditCourse
Max Minutes=Choose the maximum number of minutes that the course can run.
Choose Song=Choose a song for this slot.
Choose Steps=Choose a steps for this slot.
#ScreenOptionsCourseOverview
Play=Play this course.
Edit Course=Edit the songs and steps in this course.
Shuffle=Shuffle the song order of this course.
Save=Save changes to this course.
[OptionNames] [OptionNames]
0=0 0=0
0.25x=0.25x 0.25x=0.25x
@@ -751,6 +763,7 @@ DisplayColorDepth=Display Color
DisplayResolution=Display Resolution DisplayResolution=Display Resolution
Duration seconds=Duration seconds Duration seconds=Duration seconds
EasterEggs=Easter Eggs EasterEggs=Easter Eggs
Edit=Edit
Edit Songs/Steps=Edit Songs/Steps Edit Songs/Steps=Edit Songs/Steps
Edit Courses=Edit Courses Edit Courses=Edit Courses
Edit BPM change=Edit BPM change Edit BPM change=Edit BPM change
@@ -935,6 +948,14 @@ WideScreen16_9=Widescreen
WideScreen16_10=Widescreen WideScreen16_10=Widescreen
Windowed=Display Mode Windowed=Display Mode
#ScreenOptionsEditCourse
Max Minutes=Max Minutes
#ScreenOptionsCourseOverview
Play=Play
Edit Course=Edit Course
Shuffle=Shuffle
[PaneDisplay] [PaneDisplay]
Steps=Steps Steps=Steps
Holds=Holds Holds=Holds
@@ -1225,6 +1246,8 @@ HeaderSubText=Configure networked gameplay
[ScreenOptionsEditCourse] [ScreenOptionsEditCourse]
The maximum number of entries per course is %d. This course already has %d entries.=The maximum number of entries per course is %d. This course already has %d entries. The maximum number of entries per course is %d. This course already has %d entries.=The maximum number of entries per course is %d. This course already has %d entries.
You cannot delete the last entry in a course.=You can not delete the last entry in a course. You cannot delete the last entry in a course.=You can not delete the last entry in a course.
HeaderText=Edit Course
%d songs, %.1f minutes=%d songs, %.1f minutes
[ScreenOptionsManageCourses] [ScreenOptionsManageCourses]
Error renaming file.=Error renameing file. Error renaming file.=Error renameing file.
@@ -1234,6 +1257,8 @@ This course will be lost permanently.=This course will be lost permanently.
You have %d, the maximum number allowed.=You have %d, the maximum number allowed. You have %d, the maximum number allowed.=You have %d, the maximum number allowed.
You must delete an existing before creating a new.=You must delete an existing before creating a new. You must delete an existing before creating a new.=You must delete an existing before creating a new.
Error deleting the file '%s'.=Error deleting the file "%s". Error deleting the file '%s'.=Error deleting the file "%s".
HeaderText=Manage Courses
HeaderSubText=Edit your courses here
[ScreenOptionsManageEditSteps] [ScreenOptionsManageEditSteps]
Continue with delete?=Continue with delete? Continue with delete?=Continue with delete?
@@ -1243,9 +1268,11 @@ You have %d step edits, the maximum number allowed.=You have %d step edits, the
You must delete an existing steps edit before creating a new steps edit.=You must delete an existing steps edit before creating a new steps edit. You must delete an existing steps edit before creating a new steps edit.=You must delete an existing steps edit before creating a new steps edit.
[ScreenOptionsCourseOverview] [ScreenOptionsCourseOverview]
Error saving workout.=Error saving workout. HeaderText=Course Overview
Workout saved successfully.=Workout saved successfully. HeaderSubText=Here's your course. Now what?
Enter a name for the workout.=Enter a name for the workout. Error saving course.=Error saving course.
Course saved successfully.=Course saved successfully.
Enter a name for the course.=Enter a name for the course.
[NotesWriterSM] [NotesWriterSM]
Error renaming file. Destination file '%s' already exists.=Error renaming file. Destination file '%s' already exists. Error renaming file. Destination file '%s' already exists.=Error renaming file. Destination file '%s' already exists.
@@ -1541,10 +1568,10 @@ W5=Boo
[ThemeManager] [ThemeManager]
Reloaded metrics=Reloaded metrics Reloaded metrics=Reloaded metrics
[WorkoutManager] [CourseUtil]
You must supply a name for your workout.=You must supply a name for your workout. You must supply a name for your course.=You must supply a name for your course.
The name you chose conflicts with another workout. Please use a different name.=The name you chose conflicts with another workout. Please use a different name. The name you chose conflicts with another course. Please use a different name.=The name you chose conflicts with another course. Please use a different name.
The workout name cannot contain any of the following characters: %s=The workout name cannot contain any of the following characters: %s The course name cannot contain any of the following characters: %s=The course name cannot contain any of the following characters: %s
%d/%d songs enabled=%d/%d songs enabled %d/%d songs enabled=%d/%d songs enabled
[Dialog-Add A Comment] [Dialog-Add A Comment]
+10 -6
View File
@@ -10,12 +10,16 @@ function PlayerScoreColor( pn )
return color("1,1,1,1") return color("1,1,1,1")
end end
local CustomDifficultyColors = { -- let driving themes override just this table
local GameCustomDifficultyColors = {
Beginner = color("#ff32f8"), Beginner = color("#ff32f8"),
Easy = color("#2cff00"), Easy = color("#2cff00"),
Medium = color("#fee600"), Medium = color("#fee600"),
Hard = color("#ff2f39"), Hard = color("#ff2f39"),
Challenge = color("#1cd8ff"), Challenge = color("#1cd8ff"),
};
local CommonCustomDifficultyColors = {
Edit = color("0.8,0.8,0.8,1"), -- gray Edit = color("0.8,0.8,0.8,1"), -- gray
Couple = color("#ff9a00"), -- orange Couple = color("#ff9a00"), -- orange
Routine = color("#ff9a00"), -- orange Routine = color("#ff9a00"), -- orange
@@ -30,7 +34,9 @@ local CourseDifficultyColors = {
}; };
function CustomDifficultyToColor( sCustomDifficulty ) function CustomDifficultyToColor( sCustomDifficulty )
local c = CustomDifficultyColors[sCustomDifficulty] local c = GameCustomDifficultyColors[sCustomDifficulty]
if c then return c end
c = CommonCustomDifficultyColors[sCustomDifficulty]
if c then return c end if c then return c end
return color("#000000"); return color("#000000");
end end
@@ -45,10 +51,8 @@ function CustomDifficultyToLightColor( sCustomDifficulty )
return { scale(c[1],0,1,0.5,1), scale(c[2],0,1,0.5,1), scale(c[3],0,1,0.5,1), c[4] }; return { scale(c[1],0,1,0.5,1), scale(c[2],0,1,0.5,1), scale(c[3],0,1,0.5,1), c[4] };
end end
function CourseDifficutlyToColor( cd ) function StepsOrTrailToColor(StepsOrTrail)
local c = CourseDifficultyColors[cd] CustomDifficultyToColor( StepsOrTrailToCustomDifficulty(stepsOrTrail) );
if c then return c end
return color("#000000");
end end
+30 -48
View File
@@ -3949,6 +3949,18 @@ ColorNotSelected=color("1,1,1,1")
ColorDisabled=color("0.5,0.5,0.5,1") ColorDisabled=color("0.5,0.5,0.5,1")
TweenSeconds=0 TweenSeconds=0
[ScreenMiniMenuContext]
Fallback="ScreenMiniMenu"
NumRowsShown=10
RowPositionTransformFunction=function(self,offsetFromCenter,itemIndex,numItems) self:y(24*(offsetFromCenter-(numItems-1)/2)) end
LineHighlightX=0
ShowHelp=false
OptionRowNormalMetricsGroup="OptionRowMiniMenuContext"
[OptionRowMiniMenuContext]
Fallback="OptionRowMiniMenu"
TitleX=-54
[ScreenMiniMenuEditHelp] [ScreenMiniMenuEditHelp]
Fallback="ScreenMiniMenu" Fallback="ScreenMiniMenu"
ColorDisabled=color("1,1,1,1") ColorDisabled=color("1,1,1,1")
@@ -4059,22 +4071,6 @@ CategoryRecordFeats=true
MinDifficultyForExtra="Difficulty_Hard" MinDifficultyForExtra="Difficulty_Hard"
LockExtraStageSelection=true LockExtraStageSelection=true
[ScreenMiniMenuContext]
Fallback="ScreenMiniMenu"
NumRowsShown=10
RowPositionTransformFunction=function(self,offsetFromCenter,itemIndex,numItems) self:y(24*(offsetFromCenter-(numItems-1)/2)) end
ItemsLongRowSharedX=0
TitleX=0
TitleX=-54
TitleOnCommand=zoom,0.7;horizalign,left;shadowlength,2
TitleGainFocusCommand=diffuseshift;effectcolor1,0.3,0.3,0.3,1;effectcolor2,1.3,1.3,1.3,1
TitleLoseFocusCommand=stopeffect
ItemsStartX=0
LineHighlightX=0
ColorSelected=color("1,1,1,1")
ColorNotSelected=color("0.7,0.7,0.7,1")
ShowHelp=false
[ScreenOptionsManage] [ScreenOptionsManage]
Fallback="ScreenOptionsSimple" Fallback="ScreenOptionsSimple"
TimerSeconds=-1 TimerSeconds=-1
@@ -4091,37 +4087,31 @@ PrepareScreens="ScreenMiniMenuContext"
GroupedScreens="ScreenMiniMenuContext" GroupedScreens="ScreenMiniMenuContext"
PersistScreens="ScreenMiniMenuContext" PersistScreens="ScreenMiniMenuContext"
[ScreenOptionsEditCoursesSimple]
Fallback="ScreenOptions"
EditMode="EditMode_Full"
PrepareScreens="ScreenMiniMenuContext"
GroupedScreens="ScreenMiniMenuContext"
PersistScreens="ScreenMiniMenuContext"
TimerSeconds=-1
ShowExplanations=false
AllowRepeatingChangeValueInput=true
WrapValueInRow=false
NavigationMode="menu"
ForceAllPlayers=true
InputMode="together"
ShowHelp=false
[ScreenOptionsManageCourses] [ScreenOptionsManageCourses]
Class="ScreenOptionsManageCourses" Class="ScreenOptionsManageCourses"
Fallback="ScreenOptionsEditCoursesSimple" Fallback="ScreenOptionsManage"
PrevScreen=ScreenTitleBranch() PrevScreen=ScreenTitleBranch()
NextScreen="ScreenOptionsEditCourse" NextScreen="ScreenOptionsEditCourse"
TitleX=SCREEN_LEFT+32 TitleX=SCREEN_LEFT+32
GroupedScreens="ScreenOptionsManageCourses,ScreenOptionsEditCourse,ScreenTextEntry,ScreenPrompt,ScreenOptionsEditCourseMods" GroupedScreens="ScreenOptionsManageCourses,ScreenTextEntry,ScreenPrompt,ScreenOptionsEditCourseMods"
PersistScreens="ScreenOptionsManageCourses,ScreenOptionsEditCourse,ScreenTextEntry,ScreenPrompt" PersistScreens="ScreenOptionsManageCourses,ScreenTextEntry,ScreenPrompt"
PrepareScreens="ScreenOptionsEditCourse,ScreenTextEntry,ScreenPrompt" PrepareScreens="ScreenTextEntry,ScreenPrompt"
CreateNewScreen="" CreateNewScreen="ScreenOptionsEditCourse"
EditMode=Full
[ScreenOptionsEditCourse] [ScreenOptionsEditCourse]
Class="ScreenOptionsEditCourse" Class="ScreenOptionsEditCourse"
Fallback="ScreenOptionsEditCoursesSimple" Fallback="ScreenOptionsSimple"
PrevScreen="ScreenOptionsCourseOverview"
NextScreen="ScreenOptionsCourseOverview"
[ScreenOptionsCourseOverview]
Class="ScreenOptionsCourseOverview"
Fallback="ScreenOptionsSimple"
PrevScreen="ScreenOptionsManageCourses" PrevScreen="ScreenOptionsManageCourses"
NextScreen="ScreenOptionsManageCourses" NextScreen="ScreenOptionsManageCourses"
PlayScreen="ScreenJoinMultiplayer"
EditScreen="ScreenOptionsEditCourse"
[ScreenEditCourseMods] [ScreenEditCourseMods]
Class="ScreenEdit" Class="ScreenEdit"
@@ -4347,7 +4337,7 @@ PropertyMin=7/8
PropertyCenter=1.0 PropertyCenter=1.0
PropertyMax=9/8 PropertyMax=9/8
[DifficultyList] [StepsDisplayList]
ItemsSpacingY=20 ItemsSpacingY=20
NumShownItems=7 NumShownItems=7
CapitalizeDifficultyNames=1 CapitalizeDifficultyNames=1
@@ -4451,16 +4441,8 @@ PointsHoldHeld=+1000
PointsHoldLetGo=-500 PointsHoldLetGo=-500
[CustomDifficulty] [CustomDifficulty]
Names="1,2,3" #See pump theme for an example
1StepsType="StepsType_dance_single" Names=""
1Difficulty="Difficulty_Easy"
1String="Easy"
2StepsType="StepsType_pump_single"
2Difficulty="Difficulty_Hard"
2String="Crazy"
3StepsType="StepsType_pump_halfdouble"
3Difficulty="Difficulty_Invalid"
3String="HalfDouble"
[ScreenOptionsEdit] [ScreenOptionsEdit]
Class="ScreenOptionsMaster" Class="ScreenOptionsMaster"
+8 -32
View File
@@ -1,38 +1,14 @@
local CustomDifficultyColors = { local GameCustomDifficultyColors = {
Novice = color("#ff32f8"), Easy = color("#04fe04"),
Normal = color("#2cff00"), Normal = color("#fefb04"),
Hard = color("#fee600"), Hard = color("#fe7704"),
Crazy = color("#ff2f39"), Crazy = color("#fe0a04"),
HalfDouble = color("#33ff33"), -- greenish HalfDouble = color("#04feba"),
Freestyle = color("#A020A0"), -- purplish Freestyle = color("#fe04f5"),
Nightmare = color("#1cd8ff"), Nightmare = color("#04c6fe"),
Edit = color("0.8,0.8,0.8,1"), -- gray
}; };
function CustomDifficultyToColor( sCustomDifficulty )
local c = CustomDifficultyColors[sCustomDifficulty]
if c then return c end
return color("#000000");
end
function CustomDifficultyToDarkColor( sCustomDifficulty )
local c = CustomDifficultyToColor(sCustomDifficulty);
return { c[1]/2, c[2]/2, c[3]/2, c[4] };
end
function CustomDifficultyToLightColor( sCustomDifficulty )
local c = CustomDifficultyToColor(sCustomDifficulty);
return { scale(c[1],0,1,0.5,1), scale(c[2],0,1,0.5,1), scale(c[3],0,1,0.5,1), c[4] };
end
function CourseDifficutlyToColor( cd )
local c = CourseDifficultyColors[cd]
if c then return c end
return color("#000000");
end
-- (c) 2009 Chris Danford, Jason Felds -- (c) 2009 Chris Danford, Jason Felds
+14 -3
View File
@@ -71,28 +71,39 @@ ScoreboardC3P2Y=-9999
CheckpointsWithJudgments=true CheckpointsWithJudgments=true
[CustomDifficulty] [CustomDifficulty]
Names="1,2,3,4,5,6,7" Names="1,2,3,4,5,6,7,8"
1StepsType="StepsType_pump_single" 1StepsType="StepsType_pump_single"
1Difficulty="Difficulty_Beginner" 1Difficulty="Difficulty_Beginner"
1String="Novice" 1CourseType=nil
1String="Easy"
2StepsType="StepsType_pump_single" 2StepsType="StepsType_pump_single"
2Difficulty="Difficulty_Easy" 2Difficulty="Difficulty_Easy"
2CourseType=nil
2String="Normal" 2String="Normal"
3StepsType="StepsType_pump_single" 3StepsType="StepsType_pump_single"
3Difficulty="Difficulty_Medium" 3Difficulty="Difficulty_Medium"
3CourseType=nil
3String="Hard" 3String="Hard"
4StepsType="StepsType_pump_single" 4StepsType="StepsType_pump_single"
4Difficulty="Difficulty_Hard" 4Difficulty="Difficulty_Hard"
4CourseType=nil
4String="Crazy" 4String="Crazy"
5StepsType="StepsType_pump_halfdouble" 5StepsType="StepsType_pump_halfdouble"
5Difficulty="Difficulty_Invalid" 5Difficulty="Difficulty_Medium"
5CourseType=nil
5String="HalfDouble" 5String="HalfDouble"
6StepsType="StepsType_pump_double" 6StepsType="StepsType_pump_double"
6Difficulty="Difficulty_Medium" 6Difficulty="Difficulty_Medium"
6CourseType=nil
6String="Freestyle" 6String="Freestyle"
7StepsType="StepsType_pump_double" 7StepsType="StepsType_pump_double"
7Difficulty="Difficulty_Hard" 7Difficulty="Difficulty_Hard"
7CourseType=nil
7String="Nightmare" 7String="Nightmare"
8StepsType=nil
8Difficulty=nil
8CourseType="CourseType_Nonstop"
8String="Progressive"
[ScreenSelectMusic] [ScreenSelectMusic]
TwoPartSelection=true TwoPartSelection=true
+7 -7
View File
@@ -83,7 +83,7 @@ void CatalogXml::Save( LoadingWindow *loading_window )
FOREACH_CONST( StepsType, vStepsTypesToShow, st ) FOREACH_CONST( StepsType, vStepsTypesToShow, st )
{ {
XNode* p3 = p2->AppendChild( "StepsType" ); XNode* p3 = p2->AppendChild( "StepsType" );
p3->AppendAttr( "StepsType", GameManager::GetStepsTypeInfo(*st).szName ); p3->AppendAttr( "StepsType", GAMEMAN->GetStepsTypeInfo(*st).szName );
int iNumStepsInGroupAndStepsType[NUM_Difficulty]; int iNumStepsInGroupAndStepsType[NUM_Difficulty];
ZERO( iNumStepsInGroupAndStepsType ); ZERO( iNumStepsInGroupAndStepsType );
@@ -280,8 +280,8 @@ void CatalogXml::Save( LoadingWindow *loading_window )
FOREACH_CONST( Difficulty, vDifficultiesToShow, iter ) FOREACH_CONST( Difficulty, vDifficultiesToShow, iter )
{ {
XNode* pNode3 = pNode2->AppendChild( "Difficulty", DifficultyToString(*iter) ); XNode* pNode3 = pNode2->AppendChild( "Difficulty", DifficultyToString(*iter) );
StepsType st = GameManager::GetHowToPlayStyleForGame( GAMESTATE->m_pCurGame )->m_StepsType; // TODO: Is this the best thing we can do here? StepsType st = GAMEMAN->GetHowToPlayStyleForGame( GAMESTATE->m_pCurGame )->m_StepsType; // TODO: Is this the best thing we can do here?
pNode3->AppendAttr( "DisplayAs", GetLocalizedCustomDifficulty( st, *iter ) ); // TODO: Fix use of Single pNode3->AppendAttr( "DisplayAs", CustomDifficultyToLocalizedString( GetCustomDifficulty( st, *iter, CourseType_Invalid) ) ); // TODO: Fix use of Single, Fix use of CourseType_Invalid
} }
} }
@@ -298,8 +298,8 @@ void CatalogXml::Save( LoadingWindow *loading_window )
XNode* pNode2 = pNode->AppendChild( "StepsType" ); XNode* pNode2 = pNode->AppendChild( "StepsType" );
FOREACH_CONST( StepsType, vStepsTypesToShow, iter ) FOREACH_CONST( StepsType, vStepsTypesToShow, iter )
{ {
XNode* pNode3 = pNode2->AppendChild( "StepsType", GameManager::GetStepsTypeInfo(*iter).szName ); XNode* pNode3 = pNode2->AppendChild( "StepsType", GAMEMAN->GetStepsTypeInfo(*iter).szName );
pNode3->AppendAttr( "DisplayAs", GameManager::GetStepsTypeInfo(*iter).GetLocalizedString() ); pNode3->AppendAttr( "DisplayAs", GAMEMAN->GetStepsTypeInfo(*iter).GetLocalizedString() );
} }
} }
@@ -317,7 +317,7 @@ void CatalogXml::Save( LoadingWindow *loading_window )
{ {
XNode* pNode2 = pNode->AppendChild( "Style" ); XNode* pNode2 = pNode->AppendChild( "Style" );
vector<const Style*> vpStyle; vector<const Style*> vpStyle;
GameManager::GetStylesForGame( GAMESTATE->m_pCurGame, vpStyle ); GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, vpStyle );
FOREACH( const Style*, vpStyle, pStyle ) FOREACH( const Style*, vpStyle, pStyle )
{ {
if( !SHOW_STYLE(*pStyle) ) if( !SHOW_STYLE(*pStyle) )
@@ -325,7 +325,7 @@ void CatalogXml::Save( LoadingWindow *loading_window )
StyleID sID; StyleID sID;
sID.FromStyle( (*pStyle) ); sID.FromStyle( (*pStyle) );
XNode* pNode3 = pNode2->AppendChild( sID.CreateNode() ); XNode* pNode3 = pNode2->AppendChild( sID.CreateNode() );
pNode3->AppendAttr( "DisplayAs", GameManager::StyleToLocalizedString(*pStyle) ); pNode3->AppendAttr( "DisplayAs", GAMEMAN->StyleToLocalizedString(*pStyle) );
} }
} }
+2 -2
View File
@@ -93,7 +93,7 @@ static void RemoveStepsTypes( vector<StepsType>& inout, RString sStepsTypesToRem
// subtract StepsTypes // subtract StepsTypes
FOREACH_CONST( RString, v, i ) FOREACH_CONST( RString, v, i )
{ {
StepsType st = GameManager::StringToStepsType(*i); StepsType st = GAMEMAN->StringToStepsType(*i);
if( st == StepsType_Invalid ) if( st == StepsType_Invalid )
{ {
LOG->Warn( "Invalid StepsType value '%s' in '%s'", i->c_str(), sStepsTypesToRemove.c_str() ); LOG->Warn( "Invalid StepsType value '%s' in '%s'", i->c_str(), sStepsTypesToRemove.c_str() );
@@ -119,7 +119,7 @@ void ThemeMetricStepsTypesToShow::Read()
ThemeMetric<RString>::Read(); ThemeMetric<RString>::Read();
m_v.clear(); m_v.clear();
GameManager::GetStepsTypesForGame( GAMESTATE->m_pCurGame, m_v ); GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, m_v );
RemoveStepsTypes( m_v, ThemeMetric<RString>::GetValue() ); RemoveStepsTypes( m_v, ThemeMetric<RString>::GetValue() );
} }
+3 -14
View File
@@ -21,18 +21,6 @@
static Preference<int> MAX_SONGS_IN_EDIT_COURSE( "MaxSongsInEditCourse", -1 ); static Preference<int> MAX_SONGS_IN_EDIT_COURSE( "MaxSongsInEditCourse", -1 );
static const char *CourseTypeNames[] = {
"Nonstop",
"Oni",
"Endless",
"Survival",
};
XToString( CourseType );
XToLocalizedString( CourseType );
LuaXType( CourseType );
LuaFunction( CourseTypeToLocalizedString, CourseTypeToLocalizedString( Enum::Check<CourseType>( L, 1 ) ) );
static const char *SongSortNames[] = { static const char *SongSortNames[] = {
"Randomize", "Randomize",
"MostPlays", "MostPlays",
@@ -486,6 +474,7 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail )
vector<Song*> AllSongsShuffled; vector<Song*> AllSongsShuffled;
trail.m_StepsType = st; trail.m_StepsType = st;
trail.m_CourseType = GetCourseType();
trail.m_CourseDifficulty = cd; trail.m_CourseDifficulty = cd;
/* Set to true if CourseDifficulty is able to change something. */ /* Set to true if CourseDifficulty is able to change something. */
@@ -687,7 +676,7 @@ void Course::GetTrails( vector<Trail*> &AddTo, StepsType st ) const
void Course::GetAllTrails( vector<Trail*> &AddTo ) const void Course::GetAllTrails( vector<Trail*> &AddTo ) const
{ {
vector<StepsType> vStepsTypesToShow; vector<StepsType> vStepsTypesToShow;
GameManager::GetStepsTypesForGame( GAMESTATE->m_pCurGame, vStepsTypesToShow ); GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, vStepsTypesToShow );
FOREACH( StepsType, vStepsTypesToShow, st ) FOREACH( StepsType, vStepsTypesToShow, st )
{ {
GetTrails( AddTo, *st ); GetTrails( AddTo, *st );
@@ -739,7 +728,7 @@ bool Course::AllSongsAreFixed() const
const Style *Course::GetCourseStyle( const Game *pGame, int iNumPlayers ) const const Style *Course::GetCourseStyle( const Game *pGame, int iNumPlayers ) const
{ {
vector<const Style*> vpStyles; vector<const Style*> vpStyles;
GameManager::GetCompatibleStyles( pGame, iNumPlayers, vpStyles ); GAMEMAN->GetCompatibleStyles( pGame, iNumPlayers, vpStyles );
for( int s=0; s < (int) vpStyles.size(); ++s ) for( int s=0; s < (int) vpStyles.size(); ++s )
{ {
-14
View File
@@ -20,20 +20,6 @@ class Game;
const int MAX_EDIT_COURSE_TITLE_LENGTH = 12; const int MAX_EDIT_COURSE_TITLE_LENGTH = 12;
enum CourseType
{
COURSE_TYPE_NONSTOP, // if life meter type is BAR
COURSE_TYPE_ONI, // if life meter type is BATTERY
COURSE_TYPE_ENDLESS, // if set to REPEAT
COURSE_TYPE_SURVIVAL, // if life meter type is TIME
NUM_CourseType,
CourseType_Invalid
};
#define FOREACH_CourseType( i ) FOREACH_ENUM( CourseType, i )
const RString& CourseTypeToString( CourseType i );
const RString& CourseTypeToLocalizedString( CourseType i );
LuaDeclareType( CourseType );
inline PlayMode CourseTypeToPlayMode( CourseType ct ) { return (PlayMode)(PLAY_MODE_NONSTOP+ct); } inline PlayMode CourseTypeToPlayMode( CourseType ct ) { return (PlayMode)(PLAY_MODE_NONSTOP+ct); }
inline CourseType PlayModeToCourseType( PlayMode pm ) { return (CourseType)(pm-PLAY_MODE_NONSTOP); } inline CourseType PlayModeToCourseType( PlayMode pm ) { return (CourseType)(pm-PLAY_MODE_NONSTOP); }
+7 -5
View File
@@ -377,9 +377,9 @@ bool EditCourseUtil::RemoveAndDeleteFile( Course *pCourse )
return true; return true;
} }
static LocalizedString YOU_MUST_SUPPLY_NAME ( "WorkoutManager", "You must supply a name for your workout." ); static LocalizedString YOU_MUST_SUPPLY_NAME ( "CourseUtil", "You must supply a name for your course." );
static LocalizedString EDIT_NAME_CONFLICTS ( "WorkoutManager", "The name you chose conflicts with another workout. Please use a different name." ); static LocalizedString EDIT_NAME_CONFLICTS ( "CourseUtil", "The name you chose conflicts with another course. Please use a different name." );
static LocalizedString EDIT_NAME_CANNOT_CONTAIN ( "WorkoutManager", "The workout name cannot contain any of the following characters: %s" ); static LocalizedString EDIT_NAME_CANNOT_CONTAIN ( "CourseUtil", "The course name cannot contain any of the following characters: %s" );
bool EditCourseUtil::ValidateEditCourseName( const RString &sAnswer, RString &sErrorOut ) bool EditCourseUtil::ValidateEditCourseName( const RString &sAnswer, RString &sErrorOut )
{ {
if( sAnswer.empty() ) if( sAnswer.empty() )
@@ -415,9 +415,11 @@ bool EditCourseUtil::ValidateEditCourseName( const RString &sAnswer, RString &sE
void EditCourseUtil::UpdateAndSetTrail() void EditCourseUtil::UpdateAndSetTrail()
{ {
ASSERT( GAMESTATE->m_pCurStyle );
StepsType st = GAMESTATE->m_pCurStyle->m_StepsType; StepsType st = GAMESTATE->m_pCurStyle->m_StepsType;
Trail *pTrail = GAMESTATE->m_pCurCourse->GetTrailForceRegenCache( st ); Trail *pTrail = NULL;
ASSERT( pTrail ); if( GAMESTATE->m_pCurCourse )
GAMESTATE->m_pCurCourse->GetTrailForceRegenCache( st );
GAMESTATE->m_pCurTrail[PLAYER_1].Set( pTrail ); GAMESTATE->m_pCurTrail[PLAYER_1].Set( pTrail );
} }
+44 -5
View File
@@ -6,6 +6,8 @@
#include "LocalizedString.h" #include "LocalizedString.h"
#include "GameConstantsAndTypes.h" #include "GameConstantsAndTypes.h"
#include "GameManager.h" #include "GameManager.h"
#include "Steps.h"
#include "Trail.h"
static const char *DifficultyNames[] = { static const char *DifficultyNames[] = {
"Beginner", "Beginner",
@@ -78,9 +80,9 @@ CourseDifficulty GetNextShownCourseDifficulty( CourseDifficulty cd )
static ThemeMetric<RString> NAMES("CustomDifficulty","Names"); static ThemeMetric<RString> NAMES("CustomDifficulty","Names");
RString GetCustomDifficulty( StepsType st, Difficulty dc ) RString GetCustomDifficulty( StepsType st, Difficulty dc, CourseType ct )
{ {
const StepsTypeInfo &sti = GameManager::GetStepsTypeInfo( st ); const StepsTypeInfo &sti = GAMEMAN->GetStepsTypeInfo( st );
switch( sti.m_StepsTypeCategory ) switch( sti.m_StepsTypeCategory )
{ {
@@ -103,12 +105,17 @@ RString GetCustomDifficulty( StepsType st, Difficulty dc )
{ {
ThemeMetric<Difficulty> DIFFICULTY("CustomDifficulty",(*sName)+"Difficulty"); ThemeMetric<Difficulty> DIFFICULTY("CustomDifficulty",(*sName)+"Difficulty");
if( DIFFICULTY == Difficulty_Invalid || dc == DIFFICULTY ) // match if( DIFFICULTY == Difficulty_Invalid || dc == DIFFICULTY ) // match
{
ThemeMetric<CourseType> COURSE_TYPE("CustomDifficulty",(*sName)+"CourseType");
if( COURSE_TYPE == CourseType_Invalid || ct == COURSE_TYPE ) // match
{ {
ThemeMetric<RString> STRING("CustomDifficulty",(*sName)+"String"); ThemeMetric<RString> STRING("CustomDifficulty",(*sName)+"String");
return STRING.GetValue(); return STRING.GetValue();
} }
} }
} }
}
// no matching CustomDifficulty, so use a regular difficulty name
return DifficultyToString( dc ); return DifficultyToString( dc );
} }
case StepsTypeCategory_Couple: case StepsTypeCategory_Couple:
@@ -118,16 +125,48 @@ RString GetCustomDifficulty( StepsType st, Difficulty dc )
} }
} }
LuaFunction( GetCustomDifficulty, GetCustomDifficulty(Enum::Check<StepsType>(L,1),Enum::Check<Difficulty>(L, 2)) ); LuaFunction( GetCustomDifficulty, GetCustomDifficulty(Enum::Check<StepsType>(L,1), Enum::Check<Difficulty>(L, 2), Enum::Check<CourseType>(L, 3)) );
RString GetLocalizedCustomDifficulty( const RString &sCustomDifficulty ) RString CustomDifficultyToLocalizedString( const RString &sCustomDifficulty )
{ {
return THEME->GetString( "CustomDifficulty", sCustomDifficulty ); return THEME->GetString( "CustomDifficulty", sCustomDifficulty );
} }
LuaFunction( GetLocalizedCustomDifficulty, GetLocalizedCustomDifficulty(SArg(1)) ); LuaFunction( CustomDifficultyToLocalizedString, CustomDifficultyToLocalizedString(SArg(1)) );
RString StepsToCustomDifficulty( const Steps *pSteps )
{
return GetCustomDifficulty( pSteps->m_StepsType, pSteps->GetDifficulty(), CourseType_Invalid );
}
RString TrailToCustomDifficulty( const Trail *pTrail )
{
return GetCustomDifficulty( pTrail->m_StepsType, pTrail->m_CourseDifficulty, pTrail->m_CourseType );
}
#include "LuaBinding.h"
static int StepsOrTrailToCustomDifficulty( lua_State *L )
{
Steps *pSteps = Luna<Steps>::check(L, 1);
if( pSteps )
{
lua_pushstring(L, StepsToCustomDifficulty( pSteps ));
return 1;
}
Trail *pTrail = Luna<Trail>::check(L, 1);
if( pTrail )
{
lua_pushstring(L, TrailToCustomDifficulty( pTrail ));
return 1;
}
return 0;
}
LuaFunction2( StepsOrTrailToCustomDifficulty );
/* /*
* (c) 2001-2004 Chris Danford * (c) 2001-2004 Chris Danford
* All rights reserved. * All rights reserved.
+7 -4
View File
@@ -3,6 +3,8 @@
#include "EnumHelper.h" #include "EnumHelper.h"
#include "GameConstantsAndTypes.h" #include "GameConstantsAndTypes.h"
class Steps;
class Trail;
// //
// Player number stuff // Player number stuff
@@ -33,11 +35,12 @@ const RString& CourseDifficultyToLocalizedString( Difficulty dc );
Difficulty GetNextShownCourseDifficulty( Difficulty pn ); Difficulty GetNextShownCourseDifficulty( Difficulty pn );
// CustomDifficulty is a themeable difficulty name based on Difficulty, string matching on StepsType, and bCourse. // CustomDifficulty is a themeable difficulty name based on Difficulty, string matching on StepsType, and CourseType.
// It is used to look up localized strings and look up colors. // It is used to look up localized strings and look up colors.
RString GetCustomDifficulty( StepsType st, Difficulty dc ); RString GetCustomDifficulty( StepsType st, Difficulty dc, CourseType ct );
RString GetLocalizedCustomDifficulty( const RString &sCustomDifficulty ); RString CustomDifficultyToLocalizedString( const RString &sCustomDifficulty );
static inline RString GetLocalizedCustomDifficulty( StepsType st, Difficulty dc ) { return GetLocalizedCustomDifficulty( GetCustomDifficulty(st,dc) ); } RString StepsToCustomDifficulty( const Steps *pSteps );
RString TrailToCustomDifficulty( const Trail *pTrail );
#endif #endif
+20 -20
View File
@@ -13,9 +13,9 @@
#define MAX_METERS NUM_Difficulty + MAX_EDITS_PER_SONG #define MAX_METERS NUM_Difficulty + MAX_EDITS_PER_SONG
REGISTER_ACTOR_CLASS( DifficultyList ) REGISTER_ACTOR_CLASS( StepsDisplayList )
DifficultyList::DifficultyList() StepsDisplayList::StepsDisplayList()
{ {
m_bShown = true; m_bShown = true;
@@ -26,15 +26,15 @@ DifficultyList::DifficultyList()
} }
} }
DifficultyList::~DifficultyList() StepsDisplayList::~StepsDisplayList()
{ {
} }
void DifficultyList::LoadFromNode( const XNode* pNode ) void StepsDisplayList::LoadFromNode( const XNode* pNode )
{ {
ActorFrame::LoadFromNode( pNode ); ActorFrame::LoadFromNode( pNode );
ASSERT_M( !m_sName.empty(), "DifficultyList must have a Name" ); ASSERT_M( !m_sName.empty(), "StepsDisplayList must have a Name" );
ITEMS_SPACING_Y.Load( m_sName, "ItemsSpacingY" ); ITEMS_SPACING_Y.Load( m_sName, "ItemsSpacingY" );
NUM_SHOWN_ITEMS.Load( m_sName, "NumShownItems" ); NUM_SHOWN_ITEMS.Load( m_sName, "NumShownItems" );
@@ -48,7 +48,7 @@ void DifficultyList::LoadFromNode( const XNode* pNode )
{ {
const XNode *pChild = pNode->GetChild( ssprintf("CursorP%i",pn+1) ); const XNode *pChild = pNode->GetChild( ssprintf("CursorP%i",pn+1) );
if( pChild == NULL ) if( pChild == NULL )
RageException::Throw( "%s: DifficultyList: missing the node \"CursorP%d\"", ActorUtil::GetWhere(pNode).c_str(), pn+1 ); RageException::Throw( "%s: StepsDisplayList: missing the node \"CursorP%d\"", ActorUtil::GetWhere(pNode).c_str(), pn+1 );
m_Cursors[pn].LoadActorFromNode( pChild, this ); m_Cursors[pn].LoadActorFromNode( pChild, this );
/* Hack: we need to tween cursors both up to down (cursor motion) and visible to /* Hack: we need to tween cursors both up to down (cursor motion) and visible to
@@ -59,7 +59,7 @@ void DifficultyList::LoadFromNode( const XNode* pNode )
* colors; I think we do need a diffuse color stack ... */ * colors; I think we do need a diffuse color stack ... */
pChild = pNode->GetChild( ssprintf("CursorP%iFrame",pn+1) ); pChild = pNode->GetChild( ssprintf("CursorP%iFrame",pn+1) );
if( pChild == NULL ) if( pChild == NULL )
RageException::Throw( "%s: DifficultyList: missing the node \"CursorP%dFrame\"", ActorUtil::GetWhere(pNode).c_str(), pn+1 ); RageException::Throw( "%s: StepsDisplayList: missing the node \"CursorP%dFrame\"", ActorUtil::GetWhere(pNode).c_str(), pn+1 );
m_CursorFrames[pn].LoadFromNode( pChild ); m_CursorFrames[pn].LoadFromNode( pChild );
m_CursorFrames[pn].AddChild( m_Cursors[pn] ); m_CursorFrames[pn].AddChild( m_Cursors[pn] );
this->AddChild( &m_CursorFrames[pn] ); this->AddChild( &m_CursorFrames[pn] );
@@ -76,7 +76,7 @@ void DifficultyList::LoadFromNode( const XNode* pNode )
PositionItems(); PositionItems();
} }
int DifficultyList::GetCurrentRowIndex( PlayerNumber pn ) const int StepsDisplayList::GetCurrentRowIndex( PlayerNumber pn ) const
{ {
Difficulty ClosestDifficulty = GAMESTATE->GetClosestShownDifficulty(pn); Difficulty ClosestDifficulty = GAMESTATE->GetClosestShownDifficulty(pn);
@@ -100,7 +100,7 @@ int DifficultyList::GetCurrentRowIndex( PlayerNumber pn ) const
} }
/* Update m_fY and m_bHidden[]. */ /* Update m_fY and m_bHidden[]. */
void DifficultyList::UpdatePositions() void StepsDisplayList::UpdatePositions()
{ {
int iCurrentRow[NUM_PLAYERS]; int iCurrentRow[NUM_PLAYERS];
FOREACH_HumanPlayer( p ) FOREACH_HumanPlayer( p )
@@ -193,7 +193,7 @@ void DifficultyList::UpdatePositions()
} }
void DifficultyList::PositionItems() void StepsDisplayList::PositionItems()
{ {
for( int i = 0; i < MAX_METERS; ++i ) for( int i = 0; i < MAX_METERS; ++i )
{ {
@@ -244,7 +244,7 @@ void DifficultyList::PositionItems()
} }
} }
void DifficultyList::SetFromGameState() void StepsDisplayList::SetFromGameState()
{ {
const Song *pSong = GAMESTATE->m_pCurSong; const Song *pSong = GAMESTATE->m_pCurSong;
unsigned i = 0; unsigned i = 0;
@@ -287,7 +287,7 @@ void DifficultyList::SetFromGameState()
m_Lines[m].m_Meter.FinishTweening(); m_Lines[m].m_Meter.FinishTweening();
} }
void DifficultyList::HideRows() void StepsDisplayList::HideRows()
{ {
for( unsigned m = 0; m < m_Rows.size(); ++m ) for( unsigned m = 0; m < m_Rows.size(); ++m )
{ {
@@ -298,7 +298,7 @@ void DifficultyList::HideRows()
} }
} }
void DifficultyList::TweenOnScreen() void StepsDisplayList::TweenOnScreen()
{ {
FOREACH_HumanPlayer( pn ) FOREACH_HumanPlayer( pn )
ON_COMMAND( m_Cursors[pn] ); ON_COMMAND( m_Cursors[pn] );
@@ -322,12 +322,12 @@ void DifficultyList::TweenOnScreen()
COMMAND( m_Cursors[pn], "TweenOn" ); COMMAND( m_Cursors[pn], "TweenOn" );
} }
void DifficultyList::TweenOffScreen() void StepsDisplayList::TweenOffScreen()
{ {
} }
void DifficultyList::Show() void StepsDisplayList::Show()
{ {
m_bShown = true; m_bShown = true;
@@ -340,7 +340,7 @@ void DifficultyList::Show()
COMMAND( m_Cursors[pn], "Show" ); COMMAND( m_Cursors[pn], "Show" );
} }
void DifficultyList::Hide() void StepsDisplayList::Hide()
{ {
m_bShown = false; m_bShown = false;
PositionItems(); PositionItems();
@@ -349,7 +349,7 @@ void DifficultyList::Hide()
COMMAND( m_Cursors[pn], "Hide" ); COMMAND( m_Cursors[pn], "Hide" );
} }
void DifficultyList::HandleMessage( const Message &msg ) void StepsDisplayList::HandleMessage( const Message &msg )
{ {
FOREACH_ENUM( PlayerNumber, pn ) FOREACH_ENUM( PlayerNumber, pn )
{ {
@@ -365,18 +365,18 @@ void DifficultyList::HandleMessage( const Message &msg )
// lua start // lua start
#include "LuaBinding.h" #include "LuaBinding.h"
class LunaDifficultyList: public Luna<DifficultyList> class LunaStepsDisplayList: public Luna<StepsDisplayList>
{ {
public: public:
static int setfromgamestate( T* p, lua_State *L ) { p->SetFromGameState(); return 0; } static int setfromgamestate( T* p, lua_State *L ) { p->SetFromGameState(); return 0; }
LunaDifficultyList() LunaStepsDisplayList()
{ {
ADD_METHOD( setfromgamestate ); ADD_METHOD( setfromgamestate );
} }
}; };
LUA_REGISTER_DERIVED_CLASS( DifficultyList, ActorFrame ) LUA_REGISTER_DERIVED_CLASS( StepsDisplayList, ActorFrame )
// lua end // lua end
/* /*
+4 -4
View File
@@ -9,12 +9,12 @@
class Song; class Song;
class Steps; class Steps;
class DifficultyList: public ActorFrame class StepsDisplayList: public ActorFrame
{ {
public: public:
DifficultyList(); StepsDisplayList();
virtual ~DifficultyList(); virtual ~StepsDisplayList();
virtual DifficultyList *Copy() const; virtual StepsDisplayList *Copy() const;
virtual void LoadFromNode( const XNode* pNode ); virtual void LoadFromNode( const XNode* pNode );
void HandleMessage( const Message &msg ); void HandleMessage( const Message &msg );
+4 -4
View File
@@ -387,7 +387,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
// fall through // fall through
case ROW_STEPS_TYPE: case ROW_STEPS_TYPE:
m_textValue[ROW_STEPS_TYPE].SetText( GameManager::GetStepsTypeInfo(GetSelectedStepsType()).GetLocalizedString() ); m_textValue[ROW_STEPS_TYPE].SetText( GAMEMAN->GetStepsTypeInfo(GetSelectedStepsType()).GetLocalizedString() );
{ {
Difficulty dcOld = Difficulty_Invalid; Difficulty dcOld = Difficulty_Invalid;
@@ -476,7 +476,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
// fall through // fall through
case ROW_STEPS: case ROW_STEPS:
{ {
RString s = GetLocalizedCustomDifficulty( GetSelectedStepsType(), GetSelectedDifficulty() ); RString s = CustomDifficultyToLocalizedString( GetCustomDifficulty( GetSelectedStepsType(), GetSelectedDifficulty(), CourseType_Invalid ) );
m_textValue[ROW_STEPS].SetText( s ); m_textValue[ROW_STEPS].SetText( s );
} }
@@ -488,7 +488,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
case ROW_SOURCE_STEPS_TYPE: case ROW_SOURCE_STEPS_TYPE:
m_textLabel[ROW_SOURCE_STEPS_TYPE].SetVisible( GetSelectedSteps() ? false : true ); m_textLabel[ROW_SOURCE_STEPS_TYPE].SetVisible( GetSelectedSteps() ? false : true );
m_textValue[ROW_SOURCE_STEPS_TYPE].SetVisible( GetSelectedSteps() ? false : true ); m_textValue[ROW_SOURCE_STEPS_TYPE].SetVisible( GetSelectedSteps() ? false : true );
m_textValue[ROW_SOURCE_STEPS_TYPE].SetText( GameManager::GetStepsTypeInfo(GetSelectedSourceStepsType()).GetLocalizedString() ); m_textValue[ROW_SOURCE_STEPS_TYPE].SetText( GAMEMAN->GetStepsTypeInfo(GetSelectedSourceStepsType()).GetLocalizedString() );
m_vpSourceSteps.clear(); m_vpSourceSteps.clear();
m_vpSourceSteps.push_back( StepsAndDifficulty(NULL,Difficulty_Invalid) ); // "blank" m_vpSourceSteps.push_back( StepsAndDifficulty(NULL,Difficulty_Invalid) ); // "blank"
@@ -525,7 +525,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
} }
else else
{ {
s = GetLocalizedCustomDifficulty( GetSelectedSourceStepsType(), GetSelectedSourceDifficulty() ); s = CustomDifficultyToLocalizedString( GetCustomDifficulty( GetSelectedSourceStepsType(), GetSelectedSourceDifficulty(), CourseType_Invalid ) );
} }
m_textValue[ROW_SOURCE_STEPS].SetText( s ); m_textValue[ROW_SOURCE_STEPS].SetText( s );
} }
+1 -1
View File
@@ -174,7 +174,7 @@ void GameCommand::LoadOne( const Command& cmd )
if( sName == "style" ) if( sName == "style" )
{ {
const Style* style = GameManager::GameAndStringToStyle( GAMESTATE->m_pCurGame, sValue ); const Style* style = GAMEMAN->GameAndStringToStyle( GAMESTATE->m_pCurGame, sValue );
if( style ) if( style )
m_pStyle = style; m_pStyle = style;
else else
+13 -1
View File
@@ -45,7 +45,7 @@ LuaXType( RadarCategory );
RString StepsTypeToString( StepsType st ) RString StepsTypeToString( StepsType st )
{ {
RString s = GameManager::GetStepsTypeInfo( st ).szName; // "dance-single" RString s = GAMEMAN->GetStepsTypeInfo( st ).szName; // "dance-single"
/* foo-bar -> Foo_Bar */ /* foo-bar -> Foo_Bar */
s.Replace('-','_'); s.Replace('-','_');
return s; return s;
@@ -421,6 +421,18 @@ static const char *MultiPlayerStatusNames[] = {
XToString( MultiPlayerStatus ); XToString( MultiPlayerStatus );
static const char *CourseTypeNames[] = {
"Nonstop",
"Oni",
"Endless",
"Survival",
};
XToString( CourseType );
XToLocalizedString( CourseType );
LuaXType( CourseType );
LuaFunction( CourseTypeToLocalizedString, CourseTypeToLocalizedString( Enum::Check<CourseType>( L, 1 ) ) );
/* /*
* (c) 2001-2004 Chris Danford * (c) 2001-2004 Chris Danford
* All rights reserved. * All rights reserved.
+15
View File
@@ -517,6 +517,21 @@ enum MultiPlayerStatus
const RString& MultiPlayerStatusToString( MultiPlayerStatus i ); const RString& MultiPlayerStatusToString( MultiPlayerStatus i );
enum CourseType
{
COURSE_TYPE_NONSTOP, // if life meter type is BAR
COURSE_TYPE_ONI, // if life meter type is BATTERY
COURSE_TYPE_ENDLESS, // if set to REPEAT
COURSE_TYPE_SURVIVAL, // if life meter type is TIME
NUM_CourseType,
CourseType_Invalid
};
#define FOREACH_CourseType( i ) FOREACH_ENUM( CourseType, i )
const RString& CourseTypeToString( CourseType i );
const RString& CourseTypeToLocalizedString( CourseType i );
LuaDeclareType( CourseType );
#endif #endif
/* /*
+30 -11
View File
@@ -12,6 +12,8 @@
#include "Style.h" #include "Style.h"
#include "Foreach.h" #include "Foreach.h"
GameManager* GAMEMAN = NULL; // global and accessable from anywhere in our program
enum enum
{ {
TRACK_1 = 0, TRACK_1 = 0,
@@ -2603,6 +2605,24 @@ static const Game *g_Games[] =
&g_Game_Lights, &g_Game_Lights,
}; };
GameManager::GameManager()
{
// Register with Lua.
{
Lua *L = LUA->Get();
lua_pushstring( L, "GAMEMAN" );
this->PushSelf( L );
lua_settable( L, LUA_GLOBALSINDEX );
LUA->Release( L );
}
}
GameManager::~GameManager()
{
// Unregister with Lua.
LUA->UnsetGlobal( "GAMEMAN" );
}
void GameManager::GetStylesForGame( const Game *pGame, vector<const Style*>& aStylesAddTo, bool editor ) void GameManager::GetStylesForGame( const Game *pGame, vector<const Style*>& aStylesAddTo, bool editor )
{ {
for( int s=0; pGame->m_apStyles[s]; ++s ) for( int s=0; pGame->m_apStyles[s]; ++s )
@@ -2855,31 +2875,30 @@ const Style* GameManager::GameAndStringToStyle( const Game *game, RString sStyle
// lua start // lua start
#include "LuaBinding.h" #include "LuaBinding.h"
namespace class LunaGameManager: public Luna<GameManager>
{ {
public:
int StepsTypeToLocalizedString( lua_State *L ) { lua_pushstring(L, GameManager::GetStepsTypeInfo(Enum::Check<StepsType>(L, 1)).GetLocalizedString() ); return 1; } static int StepsTypeToLocalizedString( T* p, lua_State *L ) { lua_pushstring(L, p->GetStepsTypeInfo(Enum::Check<StepsType>(L, 1)).GetLocalizedString() ); return 1; }
int GetFirstStepsTypeForGame( lua_State *L ) static int GetFirstStepsTypeForGame( T* p, lua_State *L )
{ {
Game *pGame = Luna<Game>::check( L, 1 ); Game *pGame = Luna<Game>::check( L, 1 );
vector<StepsType> vstAddTo; vector<StepsType> vstAddTo;
GameManager::GetStepsTypesForGame( pGame, vstAddTo ); p->GetStepsTypesForGame( pGame, vstAddTo );
ASSERT( !vstAddTo.empty() ); ASSERT( !vstAddTo.empty() );
StepsType st = vstAddTo[0]; StepsType st = vstAddTo[0];
LuaHelpers::Push( L, st ); LuaHelpers::Push( L, st );
return 1; return 1;
} }
const luaL_Reg GameManagerTable[] = LunaGameManager()
{ {
LIST_METHOD( StepsTypeToLocalizedString ), ADD_METHOD( StepsTypeToLocalizedString );
LIST_METHOD( GetFirstStepsTypeForGame ), ADD_METHOD( GetFirstStepsTypeForGame );
{ NULL, NULL } }
};
}; };
LUA_REGISTER_NAMESPACE( GameManager ) LUA_REGISTER_CLASS( GameManager )
// lua end // lua end
+11 -2
View File
@@ -19,8 +19,12 @@ struct StepsTypeInfo
RString GetLocalizedString() const; RString GetLocalizedString() const;
}; };
namespace GameManager class GameManager
{ {
public:
GameManager();
~GameManager();
void GetStylesForGame( const Game* pGame, vector<const Style*>& aStylesAddTo, bool editor=false ); void GetStylesForGame( const Game* pGame, vector<const Style*>& aStylesAddTo, bool editor=false );
const Game *GetGameForStyle( const Style *pStyle ); const Game *GetGameForStyle( const Style *pStyle );
void GetStepsTypesForGame( const Game* pGame, vector<StepsType>& aStepsTypeAddTo ); void GetStepsTypesForGame( const Game* pGame, vector<StepsType>& aStepsTypeAddTo );
@@ -41,7 +45,12 @@ namespace GameManager
const Game* StringToGame( RString sGame ); const Game* StringToGame( RString sGame );
const Style* GameAndStringToStyle( const Game* pGame, RString sStyle ); const Style* GameAndStringToStyle( const Game* pGame, RString sStyle );
RString StyleToLocalizedString( const Style* s ); RString StyleToLocalizedString( const Style* s );
}
// Lua
void PushSelf( lua_State *L );
};
extern GameManager* GAMEMAN; // global and accessable from anywhere in our program
#endif #endif
+5 -5
View File
@@ -360,9 +360,9 @@ void GameState::JoinPlayer( PlayerNumber pn )
// only use one player for StyleType_OnePlayerTwoSides. // only use one player for StyleType_OnePlayerTwoSides.
// XXX: still shows non master player's "Insert Card" -aj // XXX: still shows non master player's "Insert Card" -aj
if( m_pCurStyle->m_StyleType == StyleType_OnePlayerTwoSides ) if( m_pCurStyle->m_StyleType == StyleType_OnePlayerTwoSides )
pStyle = GameManager::GetFirstCompatibleStyle( m_pCurGame, 1, m_pCurStyle->m_StepsType ); pStyle = GAMEMAN->GetFirstCompatibleStyle( m_pCurGame, 1, m_pCurStyle->m_StepsType );
else else
pStyle = GameManager::GetFirstCompatibleStyle( m_pCurGame, GetNumSidesJoined(), m_pCurStyle->m_StepsType ); pStyle = GAMEMAN->GetFirstCompatibleStyle( m_pCurGame, GetNumSidesJoined(), m_pCurStyle->m_StepsType );
// use SetCurrentStyle in case of StyleType_OnePlayerTwoSides // use SetCurrentStyle in case of StyleType_OnePlayerTwoSides
SetCurrentStyle( pStyle ); SetCurrentStyle( pStyle );
@@ -629,7 +629,7 @@ int GameState::GetNumStagesForCurrentSongAndStepsOrCourse() const
{ {
/* If a style isn't set, use the style of the selected steps. */ /* If a style isn't set, use the style of the selected steps. */
StepsType st = pSteps->m_StepsType; StepsType st = pSteps->m_StepsType;
pStyle = GameManager::GetFirstCompatibleStyle( m_pCurGame, GetNumSidesJoined(), st ); pStyle = GAMEMAN->GetFirstCompatibleStyle( m_pCurGame, GetNumSidesJoined(), st );
} }
else else
{ {
@@ -637,7 +637,7 @@ int GameState::GetNumStagesForCurrentSongAndStepsOrCourse() const
* joined players, or one player if no players are joined. */ * joined players, or one player if no players are joined. */
vector<const Style*> vpStyles; vector<const Style*> vpStyles;
int iJoined = max( GetNumSidesJoined(), 1 ); int iJoined = max( GetNumSidesJoined(), 1 );
GameManager::GetCompatibleStyles( m_pCurGame, iJoined, vpStyles ); GAMEMAN->GetCompatibleStyles( m_pCurGame, iJoined, vpStyles );
ASSERT( !vpStyles.empty() ); ASSERT( !vpStyles.empty() );
pStyle = vpStyles[0]; pStyle = vpStyles[0];
} }
@@ -2331,7 +2331,7 @@ public:
for( unsigned i=0; i<vpStepsToShow.size(); i++ ) for( unsigned i=0; i<vpStepsToShow.size(); i++ )
{ {
const Steps* pSteps = vpStepsToShow[i]; const Steps* pSteps = vpStepsToShow[i];
RString sDifficulty = GetLocalizedCustomDifficulty( pSteps->m_StepsType, pSteps->GetDifficulty() ); RString sDifficulty = CustomDifficultyToLocalizedString( GetCustomDifficulty( pSteps->m_StepsType, pSteps->GetDifficulty(), CourseType_Invalid ) );
lua_pushstring( L, sDifficulty ); lua_pushstring( L, sDifficulty );
lua_pushstring( L, pSteps->GetDescription() ); lua_pushstring( L, pSteps->GetDescription() );
+1 -1
View File
@@ -70,7 +70,7 @@ static void GetUsedGameInputs( vector<GameInput> &vGameInputsOut )
set<GameInput> vGIs; set<GameInput> vGIs;
vector<const Style*> vStyles; vector<const Style*> vStyles;
GameManager::GetStylesForGame( GAMESTATE->m_pCurGame, vStyles ); GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, vStyles );
FOREACH( const Style*, vStyles, style ) FOREACH( const Style*, vStyles, style )
{ {
bool bFound = find( CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue().begin(), CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue().end(), (*style)->m_StepsType ) != CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue().end(); bool bFound = find( CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue().begin(), CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue().end(), (*style)->m_StepsType ) != CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue().end();
+4
View File
@@ -214,6 +214,10 @@ int LuaFunc_##func( lua_State *L ) { \
void LuaFunc_Register_##func( lua_State *L ) { lua_register( L, #func, LuaFunc_##func ); } \ void LuaFunc_Register_##func( lua_State *L ) { lua_register( L, #func, LuaFunc_##func ); } \
REGISTER_WITH_LUA_FUNCTION( LuaFunc_Register_##func ); REGISTER_WITH_LUA_FUNCTION( LuaFunc_Register_##func );
#define LuaFunction2( func ) \
void LuaFunc_Register_##func( lua_State *L ) { lua_register( L, #func, func ); } \
REGISTER_WITH_LUA_FUNCTION( LuaFunc_Register_##func );
#endif #endif
/* /*
+1 -1
View File
@@ -1025,7 +1025,7 @@ void MusicWheel::SetOpenSection( RString group )
vector<const Style*> vpPossibleStyles; vector<const Style*> vpPossibleStyles;
if( CommonMetrics::AUTO_SET_STYLE ) if( CommonMetrics::AUTO_SET_STYLE )
GameManager::GetCompatibleStyles( GAMESTATE->m_pCurGame, GAMESTATE->GetNumPlayersEnabled(), vpPossibleStyles ); GAMEMAN->GetCompatibleStyles( GAMESTATE->m_pCurGame, GAMESTATE->GetNumPlayersEnabled(), vpPossibleStyles );
m_CurWheelItemData.clear(); m_CurWheelItemData.clear();
vector<MusicWheelItemData *> &from = m_WheelItemDatas[GAMESTATE->m_SortOrder]; vector<MusicWheelItemData *> &from = m_WheelItemDatas[GAMESTATE->m_SortOrder];
+2 -2
View File
@@ -662,8 +662,8 @@ void NetworkSyncManager::ProcessInput()
GameName = m_packet.ReadNT(); GameName = m_packet.ReadNT();
StyleName = m_packet.ReadNT(); StyleName = m_packet.ReadNT();
GAMESTATE->SetCurGame( GameManager::StringToGame(GameName) ); GAMESTATE->SetCurGame( GAMEMAN->StringToGame(GameName) );
GAMESTATE->SetCurrentStyle( GameManager::GameAndStringToStyle(GAMESTATE->m_pCurGame,StyleName) ); GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle(GAMESTATE->m_pCurGame,StyleName) );
SCREENMAN->SetNewScreen( "ScreenNetSelectMusic" ); //Should this be metric'd out? SCREENMAN->SetNewScreen( "ScreenNetSelectMusic" ); //Should this be metric'd out?
} }
+1 -1
View File
@@ -613,7 +613,7 @@ static bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameTo
} }
int iNumNewTracks = GameManager::GetStepsTypeInfo( out.m_StepsType ).iNumTracks; int iNumNewTracks = GAMEMAN->GetStepsTypeInfo( out.m_StepsType ).iNumTracks;
vector<int> iTransformNewToOld; vector<int> iTransformNewToOld;
iTransformNewToOld.resize( iNumNewTracks, -1 ); iTransformNewToOld.resize( iNumNewTracks, -1 );
+1 -1
View File
@@ -32,7 +32,7 @@ static void LoadFromSMTokens(
// LOG->Trace( "Steps::LoadFromSMTokens()" ); // LOG->Trace( "Steps::LoadFromSMTokens()" );
out.m_StepsType = GameManager::StringToStepsType( sStepsType ); out.m_StepsType = GAMEMAN->StringToStepsType( sStepsType );
out.SetDescription( sDescription ); out.SetDescription( sDescription );
out.SetDifficulty( DwiCompatibleStringToDifficulty(sDifficulty) ); out.SetDifficulty( DwiCompatibleStringToDifficulty(sDifficulty) );
+2 -2
View File
@@ -201,9 +201,9 @@ static RString GetSMNotesTag( const Song &song, const Steps &in, bool bSavingCac
lines.push_back( "" ); lines.push_back( "" );
// Escape to prevent some clown from making a comment of "\r\n;" // Escape to prevent some clown from making a comment of "\r\n;"
lines.push_back( ssprintf("//---------------%s - %s----------------", lines.push_back( ssprintf("//---------------%s - %s----------------",
GameManager::GetStepsTypeInfo(in.m_StepsType).szName, SmEscape(in.GetDescription()).c_str()) ); GAMEMAN->GetStepsTypeInfo(in.m_StepsType).szName, SmEscape(in.GetDescription()).c_str()) );
lines.push_back( song.m_vsKeysoundFile.empty() ? "#NOTES:" : "#NOTES2:" ); lines.push_back( song.m_vsKeysoundFile.empty() ? "#NOTES:" : "#NOTES2:" );
lines.push_back( ssprintf( " %s:", GameManager::GetStepsTypeInfo(in.m_StepsType).szName ) ); lines.push_back( ssprintf( " %s:", GAMEMAN->GetStepsTypeInfo(in.m_StepsType).szName ) );
lines.push_back( ssprintf( " %s:", SmEscape(in.GetDescription()).c_str() ) ); lines.push_back( ssprintf( " %s:", SmEscape(in.GetDescription()).c_str() ) );
lines.push_back( ssprintf( " %s:", DifficultyToString(in.GetDifficulty()).c_str() ) ); lines.push_back( ssprintf( " %s:", DifficultyToString(in.GetDifficulty()).c_str() ) );
lines.push_back( ssprintf( " %d:", in.GetMeter() ) ); lines.push_back( ssprintf( " %d:", in.GetMeter() ) );
+7 -7
View File
@@ -447,7 +447,7 @@ class OptionRowHandlerListSteps : public OptionRowHandlerList
if( pSteps->IsAnEdit() ) if( pSteps->IsAnEdit() )
s = pSteps->GetDescription(); s = pSteps->GetDescription();
else else
s = GetLocalizedCustomDifficulty( pSteps->m_StepsType, pSteps->GetDifficulty() ); s = CustomDifficultyToLocalizedString( GetCustomDifficulty( pSteps->m_StepsType, pSteps->GetDifficulty(), CourseType_Invalid ) );
} }
s += ssprintf( " %d", pSteps->GetMeter() ); s += ssprintf( " %d", pSteps->GetMeter() );
m_Def.m_vsChoices.push_back( s ); m_Def.m_vsChoices.push_back( s );
@@ -560,7 +560,7 @@ public:
} }
else else
{ {
s = GetLocalizedCustomDifficulty( GAMESTATE->m_stEdit, dc ); s = CustomDifficultyToLocalizedString( GetCustomDifficulty( GAMESTATE->m_stEdit, dc, CourseType_Invalid ) );
} }
m_Def.m_vsChoices.push_back( s ); m_Def.m_vsChoices.push_back( s );
} }
@@ -674,11 +674,11 @@ class OptionRowHandlerListStyles: public OptionRowHandlerList
m_Def.m_bAllowThemeItems = false; // we theme the text ourself m_Def.m_bAllowThemeItems = false; // we theme the text ourself
vector<const Style*> vStyles; vector<const Style*> vStyles;
GameManager::GetStylesForGame( GAMESTATE->m_pCurGame, vStyles ); GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, vStyles );
ASSERT( vStyles.size() ); ASSERT( vStyles.size() );
FOREACH_CONST( const Style*, vStyles, s ) FOREACH_CONST( const Style*, vStyles, s )
{ {
m_Def.m_vsChoices.push_back( GameManager::StyleToLocalizedString(*s) ); m_Def.m_vsChoices.push_back( GAMEMAN->StyleToLocalizedString(*s) );
GameCommand mc; GameCommand mc;
mc.m_pStyle = *s; mc.m_pStyle = *s;
m_aListEntries.push_back( mc ); m_aListEntries.push_back( mc );
@@ -736,8 +736,8 @@ class OptionRowHandlerListDifficulties: public OptionRowHandlerList
FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), d ) FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), d )
{ {
StepsType st = GameManager::GetHowToPlayStyleForGame( GAMESTATE->m_pCurGame )->m_StepsType; // TODO: Is this the best thing we can do here? StepsType st = GAMEMAN->GetHowToPlayStyleForGame( GAMESTATE->m_pCurGame )->m_StepsType; // TODO: Is this the best thing we can do here?
RString s = GetLocalizedCustomDifficulty( st, *d ); RString s = CustomDifficultyToLocalizedString( GetCustomDifficulty(st, *d, CourseType_Invalid) );
m_Def.m_vsChoices.push_back( s ); m_Def.m_vsChoices.push_back( s );
GameCommand mc; GameCommand mc;
@@ -1205,7 +1205,7 @@ public:
m_Def.m_vsChoices.clear(); m_Def.m_vsChoices.clear();
FOREACH_CONST( StepsType, m_vStepsTypesToShow, st ) FOREACH_CONST( StepsType, m_vStepsTypesToShow, st )
{ {
RString s = GameManager::GetStepsTypeInfo( *st ).GetLocalizedString(); RString s = GAMEMAN->GetStepsTypeInfo( *st ).GetLocalizedString();
m_Def.m_vsChoices.push_back( s ); m_Def.m_vsChoices.push_back( s );
} }
+4 -4
View File
@@ -1053,7 +1053,7 @@ XNode* Profile::SaveGeneralDataCreateNode() const
pGeneralDataNode->AppendChild( "LastDifficulty", DifficultyToString(m_LastDifficulty) ); pGeneralDataNode->AppendChild( "LastDifficulty", DifficultyToString(m_LastDifficulty) );
pGeneralDataNode->AppendChild( "LastCourseDifficulty", DifficultyToString(m_LastCourseDifficulty) ); pGeneralDataNode->AppendChild( "LastCourseDifficulty", DifficultyToString(m_LastCourseDifficulty) );
if( m_LastStepsType != StepsType_Invalid ) if( m_LastStepsType != StepsType_Invalid )
pGeneralDataNode->AppendChild( "LastStepsType", GameManager::GetStepsTypeInfo(m_LastStepsType).szName ); pGeneralDataNode->AppendChild( "LastStepsType", GAMEMAN->GetStepsTypeInfo(m_LastStepsType).szName );
pGeneralDataNode->AppendChild( m_lastSong.CreateNode() ); pGeneralDataNode->AppendChild( m_lastSong.CreateNode() );
pGeneralDataNode->AppendChild( m_lastCourse.CreateNode() ); pGeneralDataNode->AppendChild( m_lastCourse.CreateNode() );
pGeneralDataNode->AppendChild( "TotalSessions", m_iTotalSessions ); pGeneralDataNode->AppendChild( "TotalSessions", m_iTotalSessions );
@@ -1224,7 +1224,7 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode )
pNode->GetChildValue( "SortOrder", s ); m_SortOrder = StringToSortOrder( s ); pNode->GetChildValue( "SortOrder", s ); m_SortOrder = StringToSortOrder( s );
pNode->GetChildValue( "LastDifficulty", s ); m_LastDifficulty = StringToDifficulty( s ); pNode->GetChildValue( "LastDifficulty", s ); m_LastDifficulty = StringToDifficulty( s );
pNode->GetChildValue( "LastCourseDifficulty", s ); m_LastCourseDifficulty = StringToDifficulty( s ); pNode->GetChildValue( "LastCourseDifficulty", s ); m_LastCourseDifficulty = StringToDifficulty( s );
pNode->GetChildValue( "LastStepsType", s ); m_LastStepsType = GameManager::StringToStepsType( s ); pNode->GetChildValue( "LastStepsType", s ); m_LastStepsType = GAMEMAN->StringToStepsType( s );
pTemp = pNode->GetChild( "Song" ); if( pTemp ) m_lastSong.LoadFromNode( pTemp ); pTemp = pNode->GetChild( "Song" ); if( pTemp ) m_lastSong.LoadFromNode( pTemp );
pTemp = pNode->GetChild( "Course" ); if( pTemp ) m_lastCourse.LoadFromNode( pTemp ); pTemp = pNode->GetChild( "Course" ); if( pTemp ) m_lastCourse.LoadFromNode( pTemp );
pNode->GetChildValue( "TotalSessions", m_iTotalSessions ); pNode->GetChildValue( "TotalSessions", m_iTotalSessions );
@@ -1564,7 +1564,7 @@ XNode* Profile::SaveCategoryScoresCreateNode() const
continue; continue;
XNode* pStepsTypeNode = pNode->AppendChild( "StepsType" ); XNode* pStepsTypeNode = pNode->AppendChild( "StepsType" );
pStepsTypeNode->AppendAttr( "Type", GameManager::GetStepsTypeInfo(st).szName ); pStepsTypeNode->AppendAttr( "Type", GAMEMAN->GetStepsTypeInfo(st).szName );
FOREACH_ENUM( RankingCategory,rc ) FOREACH_ENUM( RankingCategory,rc )
{ {
@@ -1598,7 +1598,7 @@ void Profile::LoadCategoryScoresFromNode( const XNode* pCategoryScores )
RString str; RString str;
if( !pStepsType->GetAttrValue( "Type", str ) ) if( !pStepsType->GetAttrValue( "Type", str ) )
WARN_AND_CONTINUE; WARN_AND_CONTINUE;
StepsType st = GameManager::StringToStepsType( str ); StepsType st = GAMEMAN->StringToStepsType( str );
if( st == StepsType_Invalid ) if( st == StepsType_Invalid )
WARN_AND_CONTINUE_M( str ); WARN_AND_CONTINUE_M( str );
+1 -1
View File
@@ -40,7 +40,7 @@ void ScreenDemonstration::Init()
} }
vector<const Style*> vStylePossible; vector<const Style*> vStylePossible;
GameManager::GetDemonstrationStylesForGame( GAMESTATE->m_pCurGame, vStylePossible ); GAMEMAN->GetDemonstrationStylesForGame( GAMESTATE->m_pCurGame, vStylePossible );
for( int i=(int)(vStylePossible.size())-1; i>=0; i-- ) for( int i=(int)(vStylePossible.size())-1; i>=0; i-- )
{ {
bool bAllowThis = find( vStyleTypeAllow.begin(), vStyleTypeAllow.end(), vStylePossible[i]->m_StyleType ) != vStyleTypeAllow.end(); bool bAllowThis = find( vStyleTypeAllow.begin(), vStyleTypeAllow.end(), vStylePossible[i]->m_StyleType ) != vStyleTypeAllow.end();
+2 -2
View File
@@ -1504,7 +1504,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
RString s = ssprintf( RString s = ssprintf(
SWITCHED_TO.GetValue() + " %s %s '%s' (%d of %d)", SWITCHED_TO.GetValue() + " %s %s '%s' (%d of %d)",
GameManager::GetStepsTypeInfo( pSteps->m_StepsType ).szName, GAMEMAN->GetStepsTypeInfo( pSteps->m_StepsType ).szName,
DifficultyToString( pSteps->GetDifficulty() ).c_str(), DifficultyToString( pSteps->GetDifficulty() ).c_str(),
pSteps->GetDescription().c_str(), pSteps->GetDescription().c_str(),
it - vSteps.begin() + 1, it - vSteps.begin() + 1,
@@ -2903,7 +2903,7 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector<int> &iAns
g_StepsInformation.rows[difficulty].choices.clear(); g_StepsInformation.rows[difficulty].choices.clear();
FOREACH_ENUM( Difficulty, dc ) FOREACH_ENUM( Difficulty, dc )
{ {
g_StepsInformation.rows[difficulty].choices.push_back( "|" + GetLocalizedCustomDifficulty( pSteps->m_StepsType, dc ) ); g_StepsInformation.rows[difficulty].choices.push_back( "|" + CustomDifficultyToLocalizedString( GetCustomDifficulty(pSteps->m_StepsType, dc, CourseType_Invalid) ) );
} }
g_StepsInformation.rows[difficulty].iDefaultChoice = pSteps->GetDifficulty(); g_StepsInformation.rows[difficulty].iDefaultChoice = pSteps->GetDifficulty();
g_StepsInformation.rows[difficulty].bEnabled = (EDIT_MODE.GetValue() >= EditMode_Full); g_StepsInformation.rows[difficulty].bEnabled = (EDIT_MODE.GetValue() >= EditMode_Full);
+1 -1
View File
@@ -183,7 +183,7 @@ void ScreenEditMenu::MenuStart( const InputEventPlus &input )
GAMESTATE->m_pCurSong.Set( pSong ); GAMESTATE->m_pCurSong.Set( pSong );
GAMESTATE->m_pCurCourse.Set( NULL ); GAMESTATE->m_pCurCourse.Set( NULL );
GAMESTATE->SetCurrentStyle( GameManager::GetEditorStyleForStepsType(st) ); GAMESTATE->SetCurrentStyle( GAMEMAN->GetEditorStyleForStepsType(st) );
GAMESTATE->m_pCurSteps[PLAYER_1].Set( pSteps ); GAMESTATE->m_pCurSteps[PLAYER_1].Set( pSteps );
// //
+1 -1
View File
@@ -30,7 +30,7 @@ ScreenEnding::ScreenEnding()
PROFILEMAN->LoadFirstAvailableProfile(PLAYER_2); PROFILEMAN->LoadFirstAvailableProfile(PLAYER_2);
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR ); GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
GAMESTATE->SetCurrentStyle( GameManager::GameAndStringToStyle( GameManager::GetDefaultGame(),"versus") ); GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle( GAMEMAN->GetDefaultGame(),"versus") );
GAMESTATE->JoinPlayer( PLAYER_1 ); GAMESTATE->JoinPlayer( PLAYER_1 );
GAMESTATE->JoinPlayer( PLAYER_2 ); GAMESTATE->JoinPlayer( PLAYER_2 );
GAMESTATE->m_pCurSong.Set( SONGMAN->GetRandomSong() ); GAMESTATE->m_pCurSong.Set( SONGMAN->GetRandomSong() );
+1 -1
View File
@@ -96,7 +96,7 @@ void ScreenEvaluation::Init()
StageStats &ss = STATSMAN->m_vPlayedStageStats.back(); StageStats &ss = STATSMAN->m_vPlayedStageStats.back();
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR ); GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
GAMESTATE->SetCurrentStyle( GameManager::GameAndStringToStyle(GameManager::GetDefaultGame(),"versus") ); GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle(GAMEMAN->GetDefaultGame(),"versus") );
ss.m_playMode = GAMESTATE->m_PlayMode; ss.m_playMode = GAMESTATE->m_PlayMode;
ss.m_pStyle = GAMESTATE->GetCurrentStyle(); ss.m_pStyle = GAMESTATE->GetCurrentStyle();
ss.m_Stage = Stage_1st; ss.m_Stage = Stage_1st;
+2 -2
View File
@@ -1311,7 +1311,7 @@ void ScreenGameplay::LoadLights()
split( sDifficulty, ",", asDifficulties ); split( sDifficulty, ",", asDifficulties );
// Always use the steps from the primary steps type so that lights are consistent over single and double styles. // Always use the steps from the primary steps type so that lights are consistent over single and double styles.
StepsType st = GameManager::GetHowToPlayStyleForGame( GAMESTATE->m_pCurGame )->m_StepsType; StepsType st = GAMEMAN->GetHowToPlayStyleForGame( GAMESTATE->m_pCurGame )->m_StepsType;
Difficulty d1 = Difficulty_Invalid; Difficulty d1 = Difficulty_Invalid;
if( asDifficulties.size() > 0 ) if( asDifficulties.size() > 0 )
@@ -1381,7 +1381,7 @@ void ScreenGameplay::LoadLights()
/* fall through */ /* fall through */
} }
NoteDataUtil::LoadTransformedLights( TapNoteData1, m_CabinetLightsNoteData, GameManager::GetStepsTypeInfo(StepsType_lights_cabinet).iNumTracks ); NoteDataUtil::LoadTransformedLights( TapNoteData1, m_CabinetLightsNoteData, GAMEMAN->GetStepsTypeInfo(StepsType_lights_cabinet).iNumTracks );
} }
void ScreenGameplay::StartPlayingSong( float fMinTimeToNotes, float fMinTimeToMusic ) void ScreenGameplay::StartPlayingSong( float fMinTimeToNotes, float fMinTimeToMusic )
+1 -1
View File
@@ -15,7 +15,7 @@ REGISTER_SCREEN_CLASS( ScreenGameplaySyncMachine );
void ScreenGameplaySyncMachine::Init() void ScreenGameplaySyncMachine::Init()
{ {
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR ); GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
GAMESTATE->SetCurrentStyle( GameManager::GetHowToPlayStyleForGame(GAMESTATE->m_pCurGame) ); GAMESTATE->SetCurrentStyle( GAMEMAN->GetHowToPlayStyleForGame(GAMESTATE->m_pCurGame) );
AdjustSync::ResetOriginalSyncData(); AdjustSync::ResetOriginalSyncData();
RString sFile = THEME->GetPathO("ScreenGameplaySyncMachine","music.sm"); RString sFile = THEME->GetPathO("ScreenGameplaySyncMachine","music.sm");
+1 -1
View File
@@ -116,7 +116,7 @@ void ScreenHowToPlay::Init()
} }
} }
GAMESTATE->SetCurrentStyle( GameManager::GetHowToPlayStyleForGame(GAMESTATE->m_pCurGame) ); GAMESTATE->SetCurrentStyle( GAMEMAN->GetHowToPlayStyleForGame(GAMESTATE->m_pCurGame) );
if( USE_PLAYER ) if( USE_PLAYER )
{ {
+3 -3
View File
@@ -125,7 +125,7 @@ ScreenNameEntry::ScreenNameEntry()
GAMESTATE->m_bSideIsJoined[PLAYER_2] = true; GAMESTATE->m_bSideIsJoined[PLAYER_2] = true;
GAMESTATE->m_MasterPlayerNumber = PLAYER_1; GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR ); GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
GAMESTATE->SetCurrentStyle( GameManager::GameAndStringToStyle( GameManager::GetDefaultGame(),"versus") ); GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle( GAMEMAN->GetDefaultGame(),"versus") );
StageStats ss; StageStats ss;
for( int z = 0; z < 3; ++z ) for( int z = 0; z < 3; ++z )
{ {
@@ -172,8 +172,8 @@ void ScreenNameEntry::Init()
{ {
#if 0 #if 0
// DEBUGGING STUFF // DEBUGGING STUFF
GAMESTATE->m_pCurGame.Set( GameManager::GetDefaultGame() ); GAMESTATE->m_pCurGame.Set( GAMEMAN->GetDefaultGame() );
GAMESTATE->m_pCurStyle.Set( GameManager::GetHowToPlayStyleForGame(GAMESTATE->m_pCurGame) ); GAMESTATE->m_pCurStyle.Set( GAMEMAN->GetHowToPlayStyleForGame(GAMESTATE->m_pCurGame) );
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR ); GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
GAMESTATE->m_bSideIsJoined[PLAYER_1] = true; GAMESTATE->m_bSideIsJoined[PLAYER_1] = true;
GAMESTATE->m_MasterPlayerNumber = PLAYER_1; GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
+1 -1
View File
@@ -24,7 +24,7 @@ void ScreenNameEntryTraditional::Init()
GAMESTATE->m_bSideIsJoined[PLAYER_2] = true; GAMESTATE->m_bSideIsJoined[PLAYER_2] = true;
GAMESTATE->m_MasterPlayerNumber = PLAYER_1; GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR ); GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
GAMESTATE->SetCurrentStyle( GameManager::GameAndStringToStyle( GameManager::GetDefaultGame(),"versus") ); GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle( GAMEMAN->GetDefaultGame(),"versus") );
for( int z = 0; z < 3; ++z ) for( int z = 0; z < 3; ++z )
{ {
StageStats ss; StageStats ss;
+21 -21
View File
@@ -18,19 +18,19 @@
#include "Style.h" #include "Style.h"
#include "PrefsManager.h" #include "PrefsManager.h"
enum ReviewWorkoutRow enum CourseOverviewRow
{ {
ReviewWorkoutRow_Play, CourseOverviewRow_Play,
ReviewWorkoutRow_Edit, CourseOverviewRow_Edit,
ReviewWorkoutRow_Shuffle, CourseOverviewRow_Shuffle,
ReviewWorkoutRow_Save, CourseOverviewRow_Save,
NUM_ReviewWorkoutRow NUM_CourseOverviewRow
}; };
static const MenuRowDef g_MenuRows[] = static const MenuRowDef g_MenuRows[] =
{ {
MenuRowDef( -1, "Play", true, EditMode_Practice, true, false, 0, NULL ), MenuRowDef( -1, "Play", true, EditMode_Practice, true, false, 0, NULL ),
MenuRowDef( -1, "Edit Workout", true, EditMode_Practice, true, false, 0, NULL ), MenuRowDef( -1, "Edit Course", true, EditMode_Practice, true, false, 0, NULL ),
MenuRowDef( -1, "Shuffle", true, EditMode_Practice, true, false, 0, NULL ), MenuRowDef( -1, "Shuffle", true, EditMode_Practice, true, false, 0, NULL ),
MenuRowDef( -1, "Save", true, EditMode_Practice, true, false, 0, NULL ), MenuRowDef( -1, "Save", true, EditMode_Practice, true, false, 0, NULL ),
}; };
@@ -54,7 +54,7 @@ void ScreenOptionsCourseOverview::Init()
void ScreenOptionsCourseOverview::BeginScreen() void ScreenOptionsCourseOverview::BeginScreen()
{ {
vector<OptionRowHandler*> vHands; vector<OptionRowHandler*> vHands;
FOREACH_ENUM( ReviewWorkoutRow, rowIndex ) FOREACH_ENUM( CourseOverviewRow, rowIndex )
{ {
const MenuRowDef &mr = g_MenuRows[rowIndex]; const MenuRowDef &mr = g_MenuRows[rowIndex];
OptionRowHandler *pHand = OptionRowHandlerUtil::MakeSimple( mr ); OptionRowHandler *pHand = OptionRowHandlerUtil::MakeSimple( mr );
@@ -88,8 +88,8 @@ void ScreenOptionsCourseOverview::ExportOptions( int iRow, const vector<PlayerNu
sValue = row.GetRowDef().m_vsChoices[ iIndex ]; sValue = row.GetRowDef().m_vsChoices[ iIndex ];
} }
static LocalizedString ERROR_SAVING_WORKOUT ( "ScreenOptionsCourseOverview", "Error saving workout." ); static LocalizedString ERROR_SAVING_COURSE ( "ScreenOptionsCourseOverview", "Error saving course." );
static LocalizedString WORKOUT_SAVED ( "ScreenOptionsCourseOverview", "Workout saved successfully." ); static LocalizedString COURSE_SAVED ( "ScreenOptionsCourseOverview", "Course saved successfully." );
void ScreenOptionsCourseOverview::HandleScreenMessage( const ScreenMessage SM ) void ScreenOptionsCourseOverview::HandleScreenMessage( const ScreenMessage SM )
{ {
if( SM == SM_GoToNextScreen ) if( SM == SM_GoToNextScreen )
@@ -97,11 +97,11 @@ void ScreenOptionsCourseOverview::HandleScreenMessage( const ScreenMessage SM )
int iRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber];
switch( iRow ) switch( iRow )
{ {
case ReviewWorkoutRow_Play: case CourseOverviewRow_Play:
EditCourseUtil::PrepareForPlay(); EditCourseUtil::PrepareForPlay();
SCREENMAN->SetNewScreen( PLAY_SCREEN ); SCREENMAN->SetNewScreen( PLAY_SCREEN );
return; // handled return; // handled
case ReviewWorkoutRow_Edit: case CourseOverviewRow_Edit:
SCREENMAN->SetNewScreen( EDIT_SCREEN ); SCREENMAN->SetNewScreen( EDIT_SCREEN );
return; // handled return; // handled
} }
@@ -115,7 +115,7 @@ void ScreenOptionsCourseOverview::HandleScreenMessage( const ScreenMessage SM )
if( EditCourseUtil::RenameAndSave( GAMESTATE->m_pCurCourse, ScreenTextEntry::s_sLastAnswer ) ) if( EditCourseUtil::RenameAndSave( GAMESTATE->m_pCurCourse, ScreenTextEntry::s_sLastAnswer ) )
{ {
m_soundSave.Play(); m_soundSave.Play();
SCREENMAN->SystemMessage( WORKOUT_SAVED ); SCREENMAN->SystemMessage( COURSE_SAVED );
} }
} }
} }
@@ -129,7 +129,7 @@ void ScreenOptionsCourseOverview::AfterChangeValueInRow( int iRow, PlayerNumber
} }
static LocalizedString ENTER_WORKOUT_NAME ( "ScreenOptionsCourseOverview", "Enter a name for the workout." ); static LocalizedString ENTER_COURSE_NAME ( "ScreenOptionsCourseOverview", "Enter a name for the course." );
void ScreenOptionsCourseOverview::ProcessMenuStart( const InputEventPlus &input ) void ScreenOptionsCourseOverview::ProcessMenuStart( const InputEventPlus &input )
{ {
if( IsTransitioning() ) if( IsTransitioning() )
@@ -138,12 +138,12 @@ void ScreenOptionsCourseOverview::ProcessMenuStart( const InputEventPlus &input
int iRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber];
switch( iRow ) switch( iRow )
{ {
case ReviewWorkoutRow_Play: case CourseOverviewRow_Play:
case ReviewWorkoutRow_Edit: case CourseOverviewRow_Edit:
SCREENMAN->PlayStartSound(); SCREENMAN->PlayStartSound();
this->BeginFadingOut(); this->BeginFadingOut();
return; // handled return; // handled
case ReviewWorkoutRow_Shuffle: case CourseOverviewRow_Shuffle:
{ {
Course *pCourse = GAMESTATE->m_pCurCourse; Course *pCourse = GAMESTATE->m_pCurCourse;
random_shuffle( pCourse->m_vEntries.begin(), pCourse->m_vEntries.end() ); random_shuffle( pCourse->m_vEntries.begin(), pCourse->m_vEntries.end() );
@@ -153,14 +153,14 @@ void ScreenOptionsCourseOverview::ProcessMenuStart( const InputEventPlus &input
MESSAGEMAN->Broadcast("CurrentCourseChanged"); MESSAGEMAN->Broadcast("CurrentCourseChanged");
} }
return; // handled return; // handled
case ReviewWorkoutRow_Save: case CourseOverviewRow_Save:
{ {
bool bPromptForName = EditCourseUtil::s_bNewCourseNeedsName; bool bPromptForName = EditCourseUtil::s_bNewCourseNeedsName;
if( bPromptForName ) if( bPromptForName )
{ {
ScreenTextEntry::TextEntry( ScreenTextEntry::TextEntry(
SM_BackFromEnterName, SM_BackFromEnterName,
ENTER_WORKOUT_NAME, ENTER_COURSE_NAME,
GAMESTATE->m_pCurCourse->GetDisplayFullTitle(), GAMESTATE->m_pCurCourse->GetDisplayFullTitle(),
EditCourseUtil::MAX_NAME_LENGTH, EditCourseUtil::MAX_NAME_LENGTH,
EditCourseUtil::ValidateEditCourseName ); EditCourseUtil::ValidateEditCourseName );
@@ -170,12 +170,12 @@ void ScreenOptionsCourseOverview::ProcessMenuStart( const InputEventPlus &input
if( EditCourseUtil::Save( GAMESTATE->m_pCurCourse ) ) if( EditCourseUtil::Save( GAMESTATE->m_pCurCourse ) )
{ {
m_soundSave.Play(); m_soundSave.Play();
SCREENMAN->SystemMessage( WORKOUT_SAVED ); SCREENMAN->SystemMessage( COURSE_SAVED );
} }
else else
{ {
SCREENMAN->PlayInvalidSound(); SCREENMAN->PlayInvalidSound();
SCREENMAN->SystemMessage( ERROR_SAVING_WORKOUT ); SCREENMAN->SystemMessage( ERROR_SAVING_COURSE );
} }
} }
} }
+19 -16
View File
@@ -45,7 +45,7 @@ public:
if( (*steps)->GetDifficulty() == Difficulty_Edit ) if( (*steps)->GetDifficulty() == Difficulty_Edit )
s = (*steps)->GetDescription(); s = (*steps)->GetDescription();
else else
s = GetLocalizedCustomDifficulty( (*steps)->m_StepsType, (*steps)->GetDifficulty() ); s = CustomDifficultyToLocalizedString( StepsToCustomDifficulty(*steps) );
s += ssprintf( " %d", (*steps)->GetMeter() ); s += ssprintf( " %d", (*steps)->GetMeter() );
m_Def.m_vsChoices.push_back( s ); m_Def.m_vsChoices.push_back( s );
} }
@@ -66,8 +66,11 @@ public:
{ {
Trail *pTrail = GAMESTATE->m_pCurTrail[PLAYER_1]; Trail *pTrail = GAMESTATE->m_pCurTrail[PLAYER_1];
Steps *pSteps; Steps *pSteps;
if( pTrail )
{
if( m_iEntryIndex < (int)pTrail->m_vEntries.size() ) if( m_iEntryIndex < (int)pTrail->m_vEntries.size() )
pSteps = pTrail->m_vEntries[ m_iEntryIndex ].pSteps; pSteps = pTrail->m_vEntries[ m_iEntryIndex ].pSteps;
}
vector<Steps*>::const_iterator iter = find( m_vpSteps.begin(), m_vpSteps.end(), pSteps ); vector<Steps*>::const_iterator iter = find( m_vpSteps.begin(), m_vpSteps.end(), pSteps );
if( iter == m_vpSteps.end() ) if( iter == m_vpSteps.end() )
@@ -101,10 +104,10 @@ const int NUM_SONG_ROWS = 20;
REGISTER_SCREEN_CLASS( ScreenOptionsEditCourse ); REGISTER_SCREEN_CLASS( ScreenOptionsEditCourse );
enum WorkoutDetailsRow enum EditCourseRow
{ {
WorkoutDetailsRow_Minutes, EditCourseRow_Minutes,
NUM_WorkoutDetailsRow NUM_EditCourseRow
}; };
enum RowType enum RowType
@@ -116,20 +119,20 @@ enum RowType
}; };
static int RowToEntryIndex( int iRow ) static int RowToEntryIndex( int iRow )
{ {
if( iRow < NUM_WorkoutDetailsRow ) if( iRow < NUM_EditCourseRow )
return -1; return -1;
return (iRow-NUM_WorkoutDetailsRow)/NUM_RowType; return (iRow-NUM_EditCourseRow)/NUM_RowType;
} }
static RowType RowToRowType( int iRow ) static RowType RowToRowType( int iRow )
{ {
if( iRow < NUM_WorkoutDetailsRow ) if( iRow < NUM_EditCourseRow )
return RowType_Invalid; return RowType_Invalid;
return (RowType)((iRow-NUM_WorkoutDetailsRow) % NUM_RowType); return (RowType)((iRow-NUM_EditCourseRow) % NUM_RowType);
} }
static int EntryIndexAndRowTypeToRow( int iEntryIndex, RowType rowType ) static int EntryIndexAndRowTypeToRow( int iEntryIndex, RowType rowType )
{ {
return NUM_WorkoutDetailsRow + iEntryIndex*NUM_RowType + rowType; return NUM_EditCourseRow + iEntryIndex*NUM_RowType + rowType;
} }
void ScreenOptionsEditCourse::Init() void ScreenOptionsEditCourse::Init()
@@ -141,7 +144,7 @@ void ScreenOptionsEditCourse::Init()
const MenuRowDef g_MenuRows[] = const MenuRowDef g_MenuRows[] =
{ {
MenuRowDef( -1, "Workout Minutes", true, EditMode_Practice, true, false, 0, NULL ), MenuRowDef( -1, "Max Minutes", true, EditMode_Practice, true, false, 0, NULL ),
}; };
static LocalizedString EMPTY ("ScreenOptionsEditCourse","-Empty-"); static LocalizedString EMPTY ("ScreenOptionsEditCourse","-Empty-");
@@ -160,7 +163,7 @@ void ScreenOptionsEditCourse::BeginScreen()
{ {
vector<OptionRowHandler*> vHands; vector<OptionRowHandler*> vHands;
FOREACH_ENUM( WorkoutDetailsRow, rowIndex ) FOREACH_ENUM( EditCourseRow, rowIndex )
{ {
const MenuRowDef &mr = g_MenuRows[rowIndex]; const MenuRowDef &mr = g_MenuRows[rowIndex];
OptionRowHandler *pHand = OptionRowHandlerUtil::MakeSimple( mr ); OptionRowHandler *pHand = OptionRowHandlerUtil::MakeSimple( mr );
@@ -171,7 +174,7 @@ void ScreenOptionsEditCourse::BeginScreen()
switch( rowIndex ) switch( rowIndex )
{ {
DEFAULT_FAIL(rowIndex); DEFAULT_FAIL(rowIndex);
case WorkoutDetailsRow_Minutes: case EditCourseRow_Minutes:
pHand->m_Def.m_vsChoices.push_back( MakeMinutesString(0) ); pHand->m_Def.m_vsChoices.push_back( MakeMinutesString(0) );
for( int i=EditCourseUtil::MIN_WORKOUT_MINUTES; i<=20; i+=2 ) for( int i=EditCourseUtil::MIN_WORKOUT_MINUTES; i<=20; i+=2 )
pHand->m_Def.m_vsChoices.push_back( MakeMinutesString(i) ); pHand->m_Def.m_vsChoices.push_back( MakeMinutesString(i) );
@@ -249,7 +252,7 @@ void ScreenOptionsEditCourse::ImportOptions( int iRow, const vector<PlayerNumber
switch( iRow ) switch( iRow )
{ {
case WorkoutDetailsRow_Minutes: case EditCourseRow_Minutes:
row.SetOneSharedSelection( 0 ); row.SetOneSharedSelection( 0 );
row.SetOneSharedSelectionIfPresent( MakeMinutesString(GAMESTATE->m_pCurCourse->m_fGoalSeconds/60) ); row.SetOneSharedSelectionIfPresent( MakeMinutesString(GAMESTATE->m_pCurCourse->m_fGoalSeconds/60) );
break; break;
@@ -285,7 +288,7 @@ void ScreenOptionsEditCourse::ImportOptions( int iRow, const vector<PlayerNumber
void ScreenOptionsEditCourse::ExportOptions( int iRow, const vector<PlayerNumber> &vpns ) void ScreenOptionsEditCourse::ExportOptions( int iRow, const vector<PlayerNumber> &vpns )
{ {
FOREACH_ENUM( WorkoutDetailsRow, i ) FOREACH_ENUM( EditCourseRow, i )
{ {
OptionRow &row = *m_pRows[i]; OptionRow &row = *m_pRows[i];
int iIndex = row.GetOneSharedSelection( true ); int iIndex = row.GetOneSharedSelection( true );
@@ -296,7 +299,7 @@ void ScreenOptionsEditCourse::ExportOptions( int iRow, const vector<PlayerNumber
switch( i ) switch( i )
{ {
DEFAULT_FAIL(i); DEFAULT_FAIL(i);
case WorkoutDetailsRow_Minutes: case EditCourseRow_Minutes:
GAMESTATE->m_pCurCourse->m_fGoalSeconds = 0; GAMESTATE->m_pCurCourse->m_fGoalSeconds = 0;
int mins; int mins;
if( sscanf( sValue, "%d", &mins ) == 1 ) if( sscanf( sValue, "%d", &mins ) == 1 )
@@ -307,7 +310,7 @@ void ScreenOptionsEditCourse::ExportOptions( int iRow, const vector<PlayerNumber
GAMESTATE->m_pCurCourse->m_vEntries.clear(); GAMESTATE->m_pCurCourse->m_vEntries.clear();
for( int i=NUM_WorkoutDetailsRow; i<(int)m_pRows.size(); i++ ) for( int i=NUM_EditCourseRow; i<(int)m_pRows.size(); i++ )
{ {
OptionRow &row = *m_pRows[i]; OptionRow &row = *m_pRows[i];
if( row.GetRowType() == OptionRow::RowType_Exit ) if( row.GetRowType() == OptionRow::RowType_Exit )
+7 -6
View File
@@ -74,7 +74,7 @@ static void SetNextCombination()
GAMESTATE->m_stEdit.Set( curVal.st ); GAMESTATE->m_stEdit.Set( curVal.st );
GAMESTATE->m_cdEdit.Set( curVal.cd ); GAMESTATE->m_cdEdit.Set( curVal.cd );
// XXX Testing. // XXX Testing.
SCREENMAN->SystemMessage( ssprintf("%s, %s", GameManager::GetStepsTypeInfo(curVal.st).szName, DifficultyToString(curVal.cd).c_str()) ); SCREENMAN->SystemMessage( ssprintf("%s, %s", GAMEMAN->GetStepsTypeInfo(curVal.st).szName, DifficultyToString(curVal.cd).c_str()) );
EditCourseUtil::UpdateAndSetTrail(); EditCourseUtil::UpdateAndSetTrail();
} }
@@ -93,17 +93,18 @@ void ScreenOptionsManageCourses::Init()
void ScreenOptionsManageCourses::BeginScreen() void ScreenOptionsManageCourses::BeginScreen()
{ {
vector<const Style*> vpStyles;
GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, vpStyles );
const Style *pStyle = vpStyles[0];
GAMESTATE->SetCurrentStyle( pStyle );
if( GAMESTATE->m_stEdit == StepsType_Invalid || if( GAMESTATE->m_stEdit == StepsType_Invalid ||
GAMESTATE->m_cdEdit == Difficulty_Invalid ) GAMESTATE->m_cdEdit == Difficulty_Invalid )
{ {
SetNextCombination(); SetNextCombination();
} }
vector<const Style*> vpStyles;
GameManager::GetStylesForGame( GAMESTATE->m_pCurGame, vpStyles );
const Style *pStyle = vpStyles[0];
GAMESTATE->SetCurrentStyle( pStyle );
// Remember the current course. All Course pointers will be invalidated when we load the machine profile below. // Remember the current course. All Course pointers will be invalidated when we load the machine profile below.
CourseID cidLast; CourseID cidLast;
@@ -93,7 +93,7 @@ void ScreenOptionsManageEditSteps::BeginScreen()
def.m_sExplanationName = "Select Edit Steps"; def.m_sExplanationName = "Select Edit Steps";
def.m_vsChoices.clear(); def.m_vsChoices.clear();
StepsType st = (*s)->m_StepsType; StepsType st = (*s)->m_StepsType;
RString sType = GameManager::GetStepsTypeInfo(st).GetLocalizedString(); RString sType = GAMEMAN->GetStepsTypeInfo(st).GetLocalizedString();
def.m_vsChoices.push_back( sType ); def.m_vsChoices.push_back( sType );
def.m_bAllowThemeItems = false; // already themed def.m_bAllowThemeItems = false; // already themed
iIndex++; iIndex++;
@@ -140,7 +140,7 @@ void ScreenOptionsManageEditSteps::HandleScreenMessage( const ScreenMessage SM )
{ {
Steps *pSteps = GAMESTATE->m_pCurSteps[PLAYER_1]; Steps *pSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
ASSERT( pSteps ); ASSERT( pSteps );
const Style *pStyle = GameManager::GetEditorStyleForStepsType( pSteps->m_StepsType ); const Style *pStyle = GAMEMAN->GetEditorStyleForStepsType( pSteps->m_StepsType );
GAMESTATE->SetCurrentStyle( pStyle ); GAMESTATE->SetCurrentStyle( pStyle );
// do base behavior // do base behavior
} }
+2 -2
View File
@@ -156,7 +156,7 @@ static void MoveNop( int &iSel, bool bToSel, const ConfOption *pConfOption )
static void GameChoices( vector<RString> &out ) static void GameChoices( vector<RString> &out )
{ {
vector<const Game*> aGames; vector<const Game*> aGames;
GameManager::GetEnabledGames( aGames ); GAMEMAN->GetEnabledGames( aGames );
FOREACH( const Game*, aGames, g ) FOREACH( const Game*, aGames, g )
{ {
RString sGameName = (*g)->m_szName; RString sGameName = (*g)->m_szName;
@@ -179,7 +179,7 @@ static void GameSel( int &sel, bool ToSel, const ConfOption *pConfOption )
sel = i; sel = i;
} else { } else {
vector<const Game*> aGames; vector<const Game*> aGames;
GameManager::GetEnabledGames( aGames ); GAMEMAN->GetEnabledGames( aGames );
StepMania::ChangeCurrentGame( aGames[sel] ); StepMania::ChangeCurrentGame( aGames[sel] );
} }
} }
+1 -1
View File
@@ -206,7 +206,7 @@ float ScreenRanking::SetPage( const PageToShow &pts )
// init page // init page
// //
StepsType st = pts.aTypes.front().second; StepsType st = pts.aTypes.front().second;
m_textStepsType.SetText( GameManager::GetStepsTypeInfo(st).GetLocalizedString() ); m_textStepsType.SetText( GAMEMAN->GetStepsTypeInfo(st).GetLocalizedString() );
bool bShowScores = false; bool bShowScores = false;
+5 -5
View File
@@ -64,7 +64,7 @@ void ScreenSelectMusic::Init()
if( PREFSMAN->m_sTestInitialScreen.Get() == m_sName ) if( PREFSMAN->m_sTestInitialScreen.Get() == m_sName )
{ {
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR ); GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
GAMESTATE->SetCurrentStyle( GameManager::GameAndStringToStyle(GameManager::GetDefaultGame(),"versus") ); GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle(GAMEMAN->GetDefaultGame(),"versus") );
GAMESTATE->JoinPlayer( PLAYER_1 ); GAMESTATE->JoinPlayer( PLAYER_1 );
GAMESTATE->m_MasterPlayerNumber = PLAYER_1; GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
} }
@@ -193,8 +193,8 @@ void ScreenSelectMusic::BeginScreen()
if( CommonMetrics::AUTO_SET_STYLE ) if( CommonMetrics::AUTO_SET_STYLE )
{ {
vector<StepsType> vst; vector<StepsType> vst;
GameManager::GetStepsTypesForGame( GAMESTATE->m_pCurGame, vst ); GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, vst );
const Style *pStyle = GameManager::GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined(), vst[0] ); const Style *pStyle = GAMEMAN->GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined(), vst[0] );
GAMESTATE->SetCurrentStyle( pStyle ); GAMESTATE->SetCurrentStyle( pStyle );
} }
@@ -769,7 +769,7 @@ void ScreenSelectMusic::HandleMessage( const Message &msg )
// selected, they are no longer playable now that P2 has joined. // selected, they are no longer playable now that P2 has joined.
// TODO: Invalidate the CurSteps only if they are no longer playable. That way, // TODO: Invalidate the CurSteps only if they are no longer playable. That way,
// after music change will clamp to the nearest in the DifficultyList. // after music change will clamp to the nearest in the StepsDisplayList.
GAMESTATE->m_pCurSteps[GAMESTATE->m_MasterPlayerNumber].SetWithoutBroadcast( NULL ); GAMESTATE->m_pCurSteps[GAMESTATE->m_MasterPlayerNumber].SetWithoutBroadcast( NULL );
FOREACH_ENUM( PlayerNumber, p ) FOREACH_ENUM( PlayerNumber, p )
GAMESTATE->m_pCurSteps[p].SetWithoutBroadcast( NULL ); GAMESTATE->m_pCurSteps[p].SetWithoutBroadcast( NULL );
@@ -1068,7 +1068,7 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input )
stCurrent = GAMESTATE->m_pCurSteps[pn]->m_StepsType; stCurrent = GAMESTATE->m_pCurSteps[pn]->m_StepsType;
} }
vector<StepsType> vst; vector<StepsType> vst;
pStyle = GameManager::GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined(), stCurrent ); pStyle = GAMEMAN->GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined(), stCurrent );
} }
GAMESTATE->SetCurrentStyle( pStyle ); GAMESTATE->SetCurrentStyle( pStyle );
} }
+4 -4
View File
@@ -917,11 +917,11 @@ void Song::AddAutoGenNotes()
/* If m_bAutogenSteps is disabled, only autogen lights. */ /* If m_bAutogenSteps is disabled, only autogen lights. */
if( !PREFSMAN->m_bAutogenSteps && stMissing != StepsType_lights_cabinet ) if( !PREFSMAN->m_bAutogenSteps && stMissing != StepsType_lights_cabinet )
continue; continue;
if( !GameManager::GetStepsTypeInfo(stMissing).bAllowAutogen ) if( !GAMEMAN->GetStepsTypeInfo(stMissing).bAllowAutogen )
continue; continue;
// missing Steps of this type // missing Steps of this type
int iNumTracksOfMissing = GameManager::GetStepsTypeInfo(stMissing).iNumTracks; int iNumTracksOfMissing = GAMEMAN->GetStepsTypeInfo(stMissing).iNumTracks;
// look for closest match // look for closest match
StepsType stBestMatch = StepsType_Invalid; StepsType stBestMatch = StepsType_Invalid;
@@ -933,7 +933,7 @@ void Song::AddAutoGenNotes()
continue; continue;
/* has (non-autogen) Steps of this type */ /* has (non-autogen) Steps of this type */
const int iNumTracks = GameManager::GetStepsTypeInfo(st).iNumTracks; const int iNumTracks = GAMEMAN->GetStepsTypeInfo(st).iNumTracks;
const int iTrackDifference = abs(iNumTracks-iNumTracksOfMissing); const int iTrackDifference = abs(iNumTracks-iNumTracksOfMissing);
if( iTrackDifference < iBestTrackDifference ) if( iTrackDifference < iBestTrackDifference )
{ {
@@ -949,7 +949,7 @@ void Song::AddAutoGenNotes()
void Song::AutoGen( StepsType ntTo, StepsType ntFrom ) void Song::AutoGen( StepsType ntTo, StepsType ntFrom )
{ {
// int iNumTracksOfTo = GameManager::StepsTypeToNumTracks(ntTo); // int iNumTracksOfTo = GAMEMAN->StepsTypeToNumTracks(ntTo);
for( unsigned int j=0; j<m_vpSteps.size(); j++ ) for( unsigned int j=0; j<m_vpSteps.size(); j++ )
{ {
+3 -3
View File
@@ -828,7 +828,7 @@ void SongUtil::GetPlayableStepsTypes( const Song *pSong, set<StepsType> &vOut )
{ {
vector<const Style*> vpPossibleStyles; vector<const Style*> vpPossibleStyles;
if( CommonMetrics::AUTO_SET_STYLE ) if( CommonMetrics::AUTO_SET_STYLE )
GameManager::GetCompatibleStyles( GAMESTATE->m_pCurGame, GAMESTATE->GetNumPlayersEnabled(), vpPossibleStyles ); GAMEMAN->GetCompatibleStyles( GAMESTATE->m_pCurGame, GAMESTATE->GetNumPlayersEnabled(), vpPossibleStyles );
else else
vpPossibleStyles.push_back( GAMESTATE->m_pCurStyle ); vpPossibleStyles.push_back( GAMESTATE->m_pCurStyle );
@@ -866,7 +866,7 @@ void SongUtil::GetPlayableStepsTypes( const Song *pSong, set<StepsType> &vOut )
int iNumPlayers = GAMESTATE->GetNumPlayersEnabled(); int iNumPlayers = GAMESTATE->GetNumPlayersEnabled();
iNumPlayers = max( iNumPlayers, 1 ); iNumPlayers = max( iNumPlayers, 1 );
const Style *pStyle = GameManager::GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, iNumPlayers, *st ); const Style *pStyle = GAMEMAN->GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, iNumPlayers, *st );
bool bEnoughStages = GAMESTATE->IsAnExtraStage() || GAMESTATE->GetSmallestNumStagesLeftForAnyHumanPlayer() >= GAMESTATE->GetNumStagesForSongAndStyleType(pSong, pStyle->m_StyleType); bool bEnoughStages = GAMESTATE->IsAnExtraStage() || GAMESTATE->GetSmallestNumStagesLeftForAnyHumanPlayer() >= GAMESTATE->GetNumStagesForSongAndStyleType(pSong, pStyle->m_StyleType);
if( bShowThisStepsType && bEnoughStages ) if( bShowThisStepsType && bEnoughStages )
@@ -933,7 +933,7 @@ bool SongUtil::GetStepsTypeAndDifficultyFromSortOrder( SortOrder so, StepsType &
case SORT_DOUBLE_CHALLENGE_METER: case SORT_DOUBLE_CHALLENGE_METER:
stOut = GAMESTATE->GetCurrentStyle()->m_StepsType; // in case we don't find any matches below stOut = GAMESTATE->GetCurrentStyle()->m_StepsType; // in case we don't find any matches below
vector<const Style*> vpStyles; vector<const Style*> vpStyles;
GameManager::GetStylesForGame(GAMESTATE->m_pCurGame,vpStyles); GAMEMAN->GetStylesForGame(GAMESTATE->m_pCurGame,vpStyles);
FOREACH_CONST( const Style*, vpStyles, i ) FOREACH_CONST( const Style*, vpStyles, i )
{ {
if( (*i)->m_StyleType == StyleType_OnePlayerTwoSides ) if( (*i)->m_StyleType == StyleType_OnePlayerTwoSides )
+3 -3
View File
@@ -292,7 +292,7 @@
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 &quot;$(intdir)\verstub.obj&quot;" AdditionalOptions="/MACHINE:I386 &quot;$(intdir)\verstub.obj&quot;"
AdditionalDependencies="shell32.lib gdi32.lib user32.lib ole32.lib advapi32.lib" AdditionalDependencies="shell32.lib gdi32.lib user32.lib ole32.lib advapi32.lib"
OutputFile="../Program/StepMania-fastdebug.exe" OutputFile="C:\cvs\piu/Program/StepMania-fastdebug.exe"
LinkIncremental="2" LinkIncremental="2"
SuppressStartupBanner="true" SuppressStartupBanner="true"
AdditionalLibraryDirectories="" AdditionalLibraryDirectories=""
@@ -987,11 +987,11 @@
> >
</File> </File>
<File <File
RelativePath="CatalogXml.cpp" RelativePath=".\CatalogXml.cpp"
> >
</File> </File>
<File <File
RelativePath="CatalogXml.h" RelativePath=".\CatalogXml.h"
> >
</File> </File>
<File <File
+8 -6
View File
@@ -308,6 +308,7 @@ void ShutdownGame()
SAFE_DELETE( SOUND ); /* uses GAMESTATE, PREFSMAN */ SAFE_DELETE( SOUND ); /* uses GAMESTATE, PREFSMAN */
SAFE_DELETE( PREFSMAN ); SAFE_DELETE( PREFSMAN );
SAFE_DELETE( GAMESTATE ); SAFE_DELETE( GAMESTATE );
SAFE_DELETE( GAMEMAN );
SAFE_DELETE( NOTESKIN ); SAFE_DELETE( NOTESKIN );
SAFE_DELETE( THEME ); SAFE_DELETE( THEME );
SAFE_DELETE( ANNOUNCER ); SAFE_DELETE( ANNOUNCER );
@@ -786,20 +787,20 @@ RageDisplay *CreateDisplay()
static void SwitchToLastPlayedGame() static void SwitchToLastPlayedGame()
{ {
const Game *pGame = GameManager::StringToGame( PREFSMAN->GetCurrentGame() ); const Game *pGame = GAMEMAN->StringToGame( PREFSMAN->GetCurrentGame() );
/* If the active game type isn't actually available, revert to the default. */ /* If the active game type isn't actually available, revert to the default. */
if( pGame == NULL ) if( pGame == NULL )
pGame = GameManager::GetDefaultGame(); pGame = GAMEMAN->GetDefaultGame();
if( !GameManager::IsGameEnabled( pGame ) && pGame != GameManager::GetDefaultGame() ) if( !GAMEMAN->IsGameEnabled( pGame ) && pGame != GAMEMAN->GetDefaultGame() )
{ {
pGame = GameManager::GetDefaultGame(); pGame = GAMEMAN->GetDefaultGame();
LOG->Warn( "Default NoteSkin for \"%s\" missing, reverting to \"%s\"", LOG->Warn( "Default NoteSkin for \"%s\" missing, reverting to \"%s\"",
pGame->m_szName, GameManager::GetDefaultGame()->m_szName ); pGame->m_szName, GAMEMAN->GetDefaultGame()->m_szName );
} }
ASSERT( GameManager::IsGameEnabled(pGame) ); ASSERT( GAMEMAN->IsGameEnabled(pGame) );
StepMania::ChangeCurrentGame( pGame ); StepMania::ChangeCurrentGame( pGame );
} }
@@ -1050,6 +1051,7 @@ int main(int argc, char* argv[])
AdjustForChangedSystemCapabilities(); AdjustForChangedSystemCapabilities();
GAMEMAN = new GameManager;
THEME = new ThemeManager; THEME = new ThemeManager;
ANNOUNCER = new AnnouncerManager; ANNOUNCER = new AnnouncerManager;
NOTESKIN = new NoteSkinManager; NOTESKIN = new NoteSkinManager;
+6 -6
View File
@@ -63,7 +63,7 @@ unsigned Steps::GetHash() const
void Steps::SetNoteData( const NoteData& noteDataNew ) void Steps::SetNoteData( const NoteData& noteDataNew )
{ {
ASSERT( noteDataNew.GetNumTracks() == GameManager::GetStepsTypeInfo(m_StepsType).iNumTracks ); ASSERT( noteDataNew.GetNumTracks() == GAMEMAN->GetStepsTypeInfo(m_StepsType).iNumTracks );
DeAutogen( false ); DeAutogen( false );
@@ -86,7 +86,7 @@ void Steps::GetNoteData( NoteData& noteDataOut ) const
else else
{ {
noteDataOut.ClearAll(); noteDataOut.ClearAll();
noteDataOut.SetNumTracks( GameManager::GetStepsTypeInfo(m_StepsType).iNumTracks ); noteDataOut.SetNumTracks( GAMEMAN->GetStepsTypeInfo(m_StepsType).iNumTracks );
} }
} }
@@ -214,7 +214,7 @@ void Steps::Decompress() const
m_bNoteDataIsFilled = true; m_bNoteDataIsFilled = true;
int iNewTracks = GameManager::GetStepsTypeInfo(m_StepsType).iNumTracks; int iNewTracks = GAMEMAN->GetStepsTypeInfo(m_StepsType).iNumTracks;
if( this->m_StepsType == StepsType_lights_cabinet ) if( this->m_StepsType == StepsType_lights_cabinet )
{ {
@@ -267,7 +267,7 @@ void Steps::Decompress() const
// load from compressed // load from compressed
bool bComposite = m_StepsType == StepsType_dance_routine; bool bComposite = m_StepsType == StepsType_dance_routine;
m_bNoteDataIsFilled = true; m_bNoteDataIsFilled = true;
m_pNoteData->SetNumTracks( GameManager::GetStepsTypeInfo(m_StepsType).iNumTracks ); m_pNoteData->SetNumTracks( GAMEMAN->GetStepsTypeInfo(m_StepsType).iNumTracks );
NoteDataUtil::LoadFromSMNoteDataString( *m_pNoteData, m_sNoteDataCompressed, bComposite ); NoteDataUtil::LoadFromSMNoteDataString( *m_pNoteData, m_sNoteDataCompressed, bComposite );
} }
@@ -352,7 +352,7 @@ void Steps::CopyFrom( Steps* pSource, StepsType ntTo, float fMusicLengthSeconds
m_StepsType = ntTo; m_StepsType = ntTo;
NoteData noteData; NoteData noteData;
pSource->GetNoteData( noteData ); pSource->GetNoteData( noteData );
noteData.SetNumTracks( GameManager::GetStepsTypeInfo(ntTo).iNumTracks ); noteData.SetNumTracks( GAMEMAN->GetStepsTypeInfo(ntTo).iNumTracks );
parent = NULL; parent = NULL;
this->SetNoteData( noteData ); this->SetNoteData( noteData );
this->SetDescription( pSource->GetDescription() ); this->SetDescription( pSource->GetDescription() );
@@ -365,7 +365,7 @@ void Steps::CreateBlank( StepsType ntTo )
{ {
m_StepsType = ntTo; m_StepsType = ntTo;
NoteData noteData; NoteData noteData;
noteData.SetNumTracks( GameManager::GetStepsTypeInfo(ntTo).iNumTracks ); noteData.SetNumTracks( GAMEMAN->GetStepsTypeInfo(ntTo).iNumTracks );
this->SetNoteData( noteData ); this->SetNoteData( noteData );
} }
+6 -3
View File
@@ -194,7 +194,10 @@ void StepsDisplay::SetInternal( const SetParams &params )
RString sCustomDifficulty; RString sCustomDifficulty;
if( params.st != StepsType_Invalid ) if( params.st != StepsType_Invalid )
{ {
sCustomDifficulty = GetCustomDifficulty( params.st, params.dc ); if( params.pSteps )
sCustomDifficulty = StepsToCustomDifficulty(params.pSteps);
if( params.pTrail )
sCustomDifficulty = TrailToCustomDifficulty(params.pTrail);
msg.SetParam( "CustomDifficulty", sCustomDifficulty ); msg.SetParam( "CustomDifficulty", sCustomDifficulty );
} }
@@ -238,7 +241,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 if( !sCustomDifficulty.empty() ) else if( !sCustomDifficulty.empty() )
s = GetLocalizedCustomDifficulty( sCustomDifficulty ); s = CustomDifficultyToLocalizedString( sCustomDifficulty );
} }
m_textDescription.SetText( s ); m_textDescription.SetText( s );
@@ -255,7 +258,7 @@ void StepsDisplay::SetInternal( const SetParams &params )
// TODO: Make this an AutoActor, optimize graphic loading // TODO: Make this an AutoActor, optimize graphic loading
if( params.st != StepsType_Invalid ) if( params.st != StepsType_Invalid )
{ {
RString sStepsType = GameManager::GetStepsTypeInfo(params.st).szName; RString sStepsType = GAMEMAN->GetStepsTypeInfo(params.st).szName;
m_sprStepsType.Load( THEME->GetPathG(m_sMetricsGroup,"StepsType "+sStepsType) ); m_sprStepsType.Load( THEME->GetPathG(m_sMetricsGroup,"StepsType "+sStepsType) );
} }
} }
+3 -3
View File
@@ -280,7 +280,7 @@ XNode* StepsID::CreateNode() const
{ {
XNode* pNode = new XNode( "Steps" ); XNode* pNode = new XNode( "Steps" );
pNode->AppendAttr( "StepsType", GameManager::GetStepsTypeInfo(st).szName ); pNode->AppendAttr( "StepsType", GAMEMAN->GetStepsTypeInfo(st).szName );
pNode->AppendAttr( "Difficulty", DifficultyToString(dc) ); pNode->AppendAttr( "Difficulty", DifficultyToString(dc) );
if( dc == Difficulty_Edit ) if( dc == Difficulty_Edit )
{ {
@@ -298,7 +298,7 @@ void StepsID::LoadFromNode( const XNode* pNode )
RString sTemp; RString sTemp;
pNode->GetAttrValue( "StepsType", sTemp ); pNode->GetAttrValue( "StepsType", sTemp );
st = GameManager::StringToStepsType( sTemp ); st = GAMEMAN->StringToStepsType( sTemp );
pNode->GetAttrValue( "Difficulty", sTemp ); pNode->GetAttrValue( "Difficulty", sTemp );
dc = StringToDifficulty( sTemp ); dc = StringToDifficulty( sTemp );
@@ -319,7 +319,7 @@ void StepsID::LoadFromNode( const XNode* pNode )
RString StepsID::ToString() const RString StepsID::ToString() const
{ {
RString s = GameManager::GetStepsTypeInfo( st ).szName; RString s = GAMEMAN->GetStepsTypeInfo( st ).szName;
s += " " + DifficultyToString( dc ); s += " " + DifficultyToString( dc );
if( dc == Difficulty_Edit ) if( dc == Difficulty_Edit )
{ {
+3 -3
View File
@@ -10,7 +10,7 @@ void StyleID::FromStyle( const Style *p )
{ {
if( p ) if( p )
{ {
sGame = GameManager::GetGameForStyle(p)->m_szName; sGame = GAMEMAN->GetGameForStyle(p)->m_szName;
sStyle = p->m_szName; sStyle = p->m_szName;
} }
else else
@@ -22,11 +22,11 @@ void StyleID::FromStyle( const Style *p )
const Style *StyleID::ToStyle() const const Style *StyleID::ToStyle() const
{ {
const Game* pGame = GameManager::StringToGame( sGame ); const Game* pGame = GAMEMAN->StringToGame( sGame );
if( pGame == NULL ) if( pGame == NULL )
return NULL; return NULL;
return GameManager::GameAndStringToStyle( pGame, sStyle ); return GAMEMAN->GameAndStringToStyle( pGame, sStyle );
} }
XNode* StyleID::CreateNode() const XNode* StyleID::CreateNode() const
+1
View File
@@ -45,6 +45,7 @@ class Trail
{ {
public: public:
StepsType m_StepsType; StepsType m_StepsType;
CourseType m_CourseType;
CourseDifficulty m_CourseDifficulty; CourseDifficulty m_CourseDifficulty;
vector<TrailEntry> m_vEntries; vector<TrailEntry> m_vEntries;
int m_iSpecifiedMeter; // == -1 if no meter specified int m_iSpecifiedMeter; // == -1 if no meter specified
+3 -3
View File
@@ -59,7 +59,7 @@ XNode* TrailID::CreateNode() const
{ {
XNode* pNode = new XNode( "Trail" ); XNode* pNode = new XNode( "Trail" );
pNode->AppendAttr( "StepsType", GameManager::GetStepsTypeInfo(st).szName ); pNode->AppendAttr( "StepsType", GAMEMAN->GetStepsTypeInfo(st).szName );
pNode->AppendAttr( "CourseDifficulty", DifficultyToString(cd) ); pNode->AppendAttr( "CourseDifficulty", DifficultyToString(cd) );
return pNode; return pNode;
@@ -72,7 +72,7 @@ void TrailID::LoadFromNode( const XNode* pNode )
RString sTemp; RString sTemp;
pNode->GetAttrValue( "StepsType", sTemp ); pNode->GetAttrValue( "StepsType", sTemp );
st = GameManager::StringToStepsType( sTemp ); st = GAMEMAN->StringToStepsType( sTemp );
pNode->GetAttrValue( "CourseDifficulty", sTemp ); pNode->GetAttrValue( "CourseDifficulty", sTemp );
cd = StringToDifficulty( sTemp ); cd = StringToDifficulty( sTemp );
@@ -81,7 +81,7 @@ void TrailID::LoadFromNode( const XNode* pNode )
RString TrailID::ToString() const RString TrailID::ToString() const
{ {
RString s = GameManager::GetStepsTypeInfo(st).szName; RString s = GAMEMAN->GetStepsTypeInfo(st).szName;
s += " " + DifficultyToString( cd ); s += " " + DifficultyToString( cd );
return s; return s;
} }
+2 -2
View File
@@ -362,8 +362,8 @@ RString UnlockEntry::GetDescription() const
return pSong ? pSong->GetDisplayFullTitle() : ""; return pSong ? pSong->GetDisplayFullTitle() : "";
case UnlockRewardType_Steps: case UnlockRewardType_Steps:
{ {
StepsType st = GameManager::GetHowToPlayStyleForGame( GAMESTATE->m_pCurGame )->m_StepsType; // TODO: Is this the best thing we can do here? StepsType st = GAMEMAN->GetHowToPlayStyleForGame( GAMESTATE->m_pCurGame )->m_StepsType; // TODO: Is this the best thing we can do here?
return (pSong ? pSong->GetDisplayFullTitle() : "") + ", " + GetLocalizedCustomDifficulty( st, m_dc ); return (pSong ? pSong->GetDisplayFullTitle() : "") + ", " + CustomDifficultyToLocalizedString( GetCustomDifficulty(st, m_dc, CourseType_Invalid) );
} }
case UnlockRewardType_Course: case UnlockRewardType_Course:
return m_Course.IsValid() ? m_Course.ToCourse()->GetDisplayFullTitle() : ""; return m_Course.IsValid() ? m_Course.ToCourse()->GetDisplayFullTitle() : "";
+4 -2
View File
@@ -50,8 +50,6 @@ void WorkoutGraph::SetInternal( int iMinSongsPlayed )
{ {
Course *pCourse = GAMESTATE->m_pCurCourse; Course *pCourse = GAMESTATE->m_pCurCourse;
ASSERT( pCourse ); ASSERT( pCourse );
Trail *pTrail = GAMESTATE->m_pCurTrail[PLAYER_1];
ASSERT( pTrail );
FOREACH( Sprite*, m_vpBars, p ) FOREACH( Sprite*, m_vpBars, p )
{ {
@@ -60,6 +58,10 @@ void WorkoutGraph::SetInternal( int iMinSongsPlayed )
} }
m_vpBars.clear(); m_vpBars.clear();
Trail *pTrail = GAMESTATE->m_pCurTrail[PLAYER_1];
if( pTrail == NULL )
return;
vector<int> viMeters; vector<int> viMeters;
FOREACH_CONST( TrailEntry, pTrail->m_vEntries, e ) FOREACH_CONST( TrailEntry, pTrail->m_vEntries, e )
{ {