diff --git a/stepmania/Docs/LuaDocumentation.xml b/stepmania/Docs/LuaDocumentation.xml index c153031575..6e4c13237a 100644 --- a/stepmania/Docs/LuaDocumentation.xml +++ b/stepmania/Docs/LuaDocumentation.xml @@ -847,9 +847,9 @@ Blanks the DifficultyIcon. - + - Sets the DifficultyList from the GameState. + Sets the StepsDisplayList from the GameState. diff --git a/stepmania/Themes/default/BGAnimations/ScreenHighScores decorations/default.lua b/stepmania/Themes/default/BGAnimations/ScreenHighScores decorations/default.lua index d9ced2f5e2..229de1ccec 100644 --- a/stepmania/Themes/default/BGAnimations/ScreenHighScores decorations/default.lua +++ b/stepmania/Themes/default/BGAnimations/ScreenHighScores decorations/default.lua @@ -16,9 +16,10 @@ for i=1,NumColumns do local st = THEME:GetMetric(Var "LoadingScreen","ColumnStepsType" .. 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") .. { - 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 diff --git a/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/DifficultyList cursor p2.lua b/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/DifficultyList cursor p2.lua deleted file mode 100644 index a7720a45c3..0000000000 --- a/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/DifficultyList cursor p2.lua +++ /dev/null @@ -1,3 +0,0 @@ -return LoadActor("DifficultyList cursor p1") .. { - InitCommand=cmd(zoomx,-1;); -}; \ No newline at end of file diff --git a/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/DifficultyList cursor p1 (doubleres).png b/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/StepsDisplayList cursor p1 (doubleres).png similarity index 100% rename from stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/DifficultyList cursor p1 (doubleres).png rename to stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/StepsDisplayList cursor p1 (doubleres).png diff --git a/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/StepsDisplayList cursor p2.lua b/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/StepsDisplayList cursor p2.lua new file mode 100644 index 0000000000..c60bfc8e2b --- /dev/null +++ b/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/StepsDisplayList cursor p2.lua @@ -0,0 +1,3 @@ +return LoadActor("StepsDisplayList cursor p1") .. { + InitCommand=cmd(zoomx,-1;); +}; \ No newline at end of file diff --git a/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/DifficultyList highlight (doubleres).png b/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/StepsDisplayList highlight (doubleres).png similarity index 100% rename from stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/DifficultyList highlight (doubleres).png rename to stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/StepsDisplayList highlight (doubleres).png diff --git a/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/DifficultyList more (doubleres).png b/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/StepsDisplayList more (doubleres).png similarity index 100% rename from stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/DifficultyList more (doubleres).png rename to stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/StepsDisplayList more (doubleres).png diff --git a/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/DifficultyList pill empty (doublres).png b/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/StepsDisplayList pill empty (doublres).png similarity index 100% rename from stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/DifficultyList pill empty (doublres).png rename to stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/StepsDisplayList pill empty (doublres).png diff --git a/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/DifficultyList pill filled color (doubleres).png b/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/StepsDisplayList pill filled color (doubleres).png similarity index 100% rename from stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/DifficultyList pill filled color (doubleres).png rename to stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/StepsDisplayList pill filled color (doubleres).png diff --git a/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/DifficultyList pill filled shadow (doubleres).png b/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/StepsDisplayList pill filled shadow (doubleres).png similarity index 100% rename from stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/DifficultyList pill filled shadow (doubleres).png rename to stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/StepsDisplayList pill filled shadow (doubleres).png diff --git a/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/default.lua b/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/default.lua index ac429a8907..a04afc40c6 100644 --- a/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/default.lua +++ b/stepmania/Themes/default/BGAnimations/ScreenSelectMusic decorations/default.lua @@ -315,7 +315,7 @@ t[#t+1] = Def.CourseContentsList { DifficultyChangedCommand=function(self, params) if params.PlayerNumber ~= GAMESTATE:GetMasterPlayerNumber() then return end self:settext( params.Meter ); - self:diffuse( CourseDifficutlyToColor(params.Difficulty) ); + self:diffuse( StepsOrTrailToColor(params.Trail) ); end; }; @@ -328,7 +328,7 @@ t[#t+1] = Def.CourseContentsList { OnCommand=cmd(x,SCREEN_CENTER_X-254;y,1;shadowlength,0;settext,"1"); DifficultyChangedCommand=function(self, params) if params.PlayerNumber ~= GAMESTATE:GetMasterPlayerNumber() then return end - self:diffuse( CourseDifficutlyToColor(params.Difficulty) ); + self:diffuse( StepsOrTrailToColor(params.Trail) ); end; }; }; @@ -392,8 +392,8 @@ t[#t+1] = Def.ActorFrame{ }; if not GAMESTATE:IsCourseMode() then - t[#t+1] = Def.DifficultyList { - Name="DifficultyList"; + t[#t+1] = Def.StepsDisplayList { + Name="StepsDisplayList"; InitCommand=cmd(x,SCREEN_CENTER_X+166;y,SCREEN_CENTER_Y+20); CursorP1 = Def.ActorFrame { BeginCommand=cmd(visible,true); @@ -402,7 +402,7 @@ if not GAMESTATE:IsCourseMode() then self:visible(false); end; children={ - LoadActor( "DifficultyList highlight" ) .. { + LoadActor( "StepsDisplayList highlight" ) .. { InitCommand=cmd(addx,-10;diffusealpha,0.3); BeginCommand=cmd(player,"PlayerNumber_P1"); OnCommand=cmd(playcommand,"UpdateAlpha"); @@ -428,7 +428,7 @@ if not GAMESTATE:IsCourseMode() then Def.ActorFrame { InitCommand=cmd(x,-150;bounce;effectmagnitude,-12,0,0;effectperiod,1.0;effectoffset,0.0;effectclock,"bgm"); children={ - LoadActor( "DifficultyList cursor p1" ) .. { + LoadActor( "StepsDisplayList cursor p1" ) .. { BeginCommand=cmd(player,"PlayerNumber_P1";); PlayerJoinedMessageCommand=function(self,param ) if param.Player ~= "PlayerNumber_P1" then return end; @@ -454,7 +454,7 @@ if not GAMESTATE:IsCourseMode() then self:visible(false); end; children={ - LoadActor( "DifficultyList highlight" ) .. { + LoadActor( "StepsDisplayList highlight" ) .. { InitCommand=cmd(addx,-10;zoomx,-1;diffusealpha,0.3); BeginCommand=cmd(player,"PlayerNumber_P2"); OnCommand=cmd(playcommand,"UpdateAlpha"); @@ -480,7 +480,7 @@ if not GAMESTATE:IsCourseMode() then Def.ActorFrame { InitCommand=cmd(x,130;bounce;effectmagnitude,12,0,0;effectperiod,1.0;effectoffset,0.0;effectclock,"bgm"); children={ - LoadActor( "DifficultyList cursor p2" ) .. { + LoadActor( "StepsDisplayList cursor p2" ) .. { BeginCommand=cmd(player,"PlayerNumber_P2";); PlayerJoinedMessageCommand=function(self,param ) if param.Player ~= "PlayerNumber_P2" then return end; diff --git a/stepmania/Themes/default/Graphics/ScreenOptionsManageCourses header.redir b/stepmania/Themes/default/Graphics/ScreenOptionsManageCourses header.redir deleted file mode 100644 index 04b2ead777..0000000000 --- a/stepmania/Themes/default/Graphics/ScreenOptionsManageCourses header.redir +++ /dev/null @@ -1 +0,0 @@ -_blank \ No newline at end of file diff --git a/stepmania/Themes/default/Languages/en.ini b/stepmania/Themes/default/Languages/en.ini index b0d5582782..c93705307d 100644 --- a/stepmania/Themes/default/Languages/en.ini +++ b/stepmania/Themes/default/Languages/en.ini @@ -387,6 +387,7 @@ ScoreDisplay=ScoreDisplay Scoreboard=Enables scoreboard ScoringType=Defines which scoring method to use. Scroll=Scroll +Select Course=Choose this course. Select Profile=Choose a profile Server=Start Local Server Servers=Servers @@ -426,6 +427,17 @@ WideScreen16_9=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. +#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] 0=0 0.25x=0.25x @@ -751,6 +763,7 @@ DisplayColorDepth=Display Color DisplayResolution=Display Resolution Duration seconds=Duration seconds EasterEggs=Easter Eggs +Edit=Edit Edit Songs/Steps=Edit Songs/Steps Edit Courses=Edit Courses Edit BPM change=Edit BPM change @@ -935,6 +948,14 @@ WideScreen16_9=Widescreen WideScreen16_10=Widescreen Windowed=Display Mode +#ScreenOptionsEditCourse +Max Minutes=Max Minutes + +#ScreenOptionsCourseOverview +Play=Play +Edit Course=Edit Course +Shuffle=Shuffle + [PaneDisplay] Steps=Steps Holds=Holds @@ -1225,6 +1246,8 @@ HeaderSubText=Configure networked gameplay [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. 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] 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 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". +HeaderText=Manage Courses +HeaderSubText=Edit your courses here [ScreenOptionsManageEditSteps] 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. [ScreenOptionsCourseOverview] -Error saving workout.=Error saving workout. -Workout saved successfully.=Workout saved successfully. -Enter a name for the workout.=Enter a name for the workout. +HeaderText=Course Overview +HeaderSubText=Here's your course. Now what? +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] Error renaming file. Destination file '%s' already exists.=Error renaming file. Destination file '%s' already exists. @@ -1541,10 +1568,10 @@ W5=Boo [ThemeManager] Reloaded metrics=Reloaded metrics -[WorkoutManager] -You must supply a name for your workout.=You must supply a name for your workout. -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 workout name cannot contain any of the following characters: %s=The workout name cannot contain any of the following characters: %s +[CourseUtil] +You must supply a name for your course.=You must supply a name for your course. +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 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 [Dialog-Add A Comment] diff --git a/stepmania/Themes/default/Scripts/Colors.lua b/stepmania/Themes/default/Scripts/Colors.lua index aed23ad6c6..9763477648 100644 --- a/stepmania/Themes/default/Scripts/Colors.lua +++ b/stepmania/Themes/default/Scripts/Colors.lua @@ -10,12 +10,16 @@ function PlayerScoreColor( pn ) return color("1,1,1,1") end -local CustomDifficultyColors = { +-- let driving themes override just this table +local GameCustomDifficultyColors = { Beginner = color("#ff32f8"), Easy = color("#2cff00"), Medium = color("#fee600"), Hard = color("#ff2f39"), Challenge = color("#1cd8ff"), +}; + +local CommonCustomDifficultyColors = { Edit = color("0.8,0.8,0.8,1"), -- gray Couple = color("#ff9a00"), -- orange Routine = color("#ff9a00"), -- orange @@ -30,7 +34,9 @@ local CourseDifficultyColors = { }; 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 return color("#000000"); 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] }; end -function CourseDifficutlyToColor( cd ) - local c = CourseDifficultyColors[cd] - if c then return c end - return color("#000000"); +function StepsOrTrailToColor(StepsOrTrail) + CustomDifficultyToColor( StepsOrTrailToCustomDifficulty(stepsOrTrail) ); end diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index e4e8490826..ce4e0d1d77 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -3949,6 +3949,18 @@ ColorNotSelected=color("1,1,1,1") ColorDisabled=color("0.5,0.5,0.5,1") 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] Fallback="ScreenMiniMenu" ColorDisabled=color("1,1,1,1") @@ -4059,22 +4071,6 @@ CategoryRecordFeats=true MinDifficultyForExtra="Difficulty_Hard" 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] Fallback="ScreenOptionsSimple" TimerSeconds=-1 @@ -4091,37 +4087,31 @@ PrepareScreens="ScreenMiniMenuContext" GroupedScreens="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] Class="ScreenOptionsManageCourses" -Fallback="ScreenOptionsEditCoursesSimple" +Fallback="ScreenOptionsManage" PrevScreen=ScreenTitleBranch() NextScreen="ScreenOptionsEditCourse" TitleX=SCREEN_LEFT+32 -GroupedScreens="ScreenOptionsManageCourses,ScreenOptionsEditCourse,ScreenTextEntry,ScreenPrompt,ScreenOptionsEditCourseMods" -PersistScreens="ScreenOptionsManageCourses,ScreenOptionsEditCourse,ScreenTextEntry,ScreenPrompt" -PrepareScreens="ScreenOptionsEditCourse,ScreenTextEntry,ScreenPrompt" -CreateNewScreen="" +GroupedScreens="ScreenOptionsManageCourses,ScreenTextEntry,ScreenPrompt,ScreenOptionsEditCourseMods" +PersistScreens="ScreenOptionsManageCourses,ScreenTextEntry,ScreenPrompt" +PrepareScreens="ScreenTextEntry,ScreenPrompt" +CreateNewScreen="ScreenOptionsEditCourse" +EditMode=Full [ScreenOptionsEditCourse] Class="ScreenOptionsEditCourse" -Fallback="ScreenOptionsEditCoursesSimple" +Fallback="ScreenOptionsSimple" +PrevScreen="ScreenOptionsCourseOverview" +NextScreen="ScreenOptionsCourseOverview" + +[ScreenOptionsCourseOverview] +Class="ScreenOptionsCourseOverview" +Fallback="ScreenOptionsSimple" PrevScreen="ScreenOptionsManageCourses" NextScreen="ScreenOptionsManageCourses" +PlayScreen="ScreenJoinMultiplayer" +EditScreen="ScreenOptionsEditCourse" [ScreenEditCourseMods] Class="ScreenEdit" @@ -4347,7 +4337,7 @@ PropertyMin=7/8 PropertyCenter=1.0 PropertyMax=9/8 -[DifficultyList] +[StepsDisplayList] ItemsSpacingY=20 NumShownItems=7 CapitalizeDifficultyNames=1 @@ -4451,16 +4441,8 @@ PointsHoldHeld=+1000 PointsHoldLetGo=-500 [CustomDifficulty] -Names="1,2,3" -1StepsType="StepsType_dance_single" -1Difficulty="Difficulty_Easy" -1String="Easy" -2StepsType="StepsType_pump_single" -2Difficulty="Difficulty_Hard" -2String="Crazy" -3StepsType="StepsType_pump_halfdouble" -3Difficulty="Difficulty_Invalid" -3String="HalfDouble" +#See pump theme for an example +Names="" [ScreenOptionsEdit] Class="ScreenOptionsMaster" diff --git a/stepmania/Themes/pump/Scripts/Colors.lua b/stepmania/Themes/pump/Scripts/Colors.lua index 20d560504a..fa29b1ea54 100644 --- a/stepmania/Themes/pump/Scripts/Colors.lua +++ b/stepmania/Themes/pump/Scripts/Colors.lua @@ -1,38 +1,14 @@ -local CustomDifficultyColors = { - Novice = color("#ff32f8"), - Normal = color("#2cff00"), - Hard = color("#fee600"), - Crazy = color("#ff2f39"), - HalfDouble = color("#33ff33"), -- greenish - Freestyle = color("#A020A0"), -- purplish - Nightmare = color("#1cd8ff"), - Edit = color("0.8,0.8,0.8,1"), -- gray +local GameCustomDifficultyColors = { + Easy = color("#04fe04"), + Normal = color("#fefb04"), + Hard = color("#fe7704"), + Crazy = color("#fe0a04"), + HalfDouble = color("#04feba"), + Freestyle = color("#fe04f5"), + Nightmare = color("#04c6fe"), }; -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 diff --git a/stepmania/Themes/pump/metrics.ini b/stepmania/Themes/pump/metrics.ini index 9a2b356ab8..73e77e509c 100644 --- a/stepmania/Themes/pump/metrics.ini +++ b/stepmania/Themes/pump/metrics.ini @@ -1,108 +1,119 @@ -[Global] -IsBaseTheme=0 - -[Gameplay] -ComboIsPerRow=true -MinScoreToContinueCombo="TapNoteScore_W3" -MinScoreToMaintainCombo="TapNoteScore_W4" - -[HoldJudgment] -HoldJudgmentLetGoCommand= -HoldJudgmentHeldCommand= - -[Combo] -ShowComboAt=4 -ShowMissesAt=4 - -[Player] -JudgeHoldNotesOnSameRowTogether=true -HoldCheckpoints=true -RequireStepOnHoldHeads=false -CheckpointsUseTimeSignatures=true -ImmediateHoldLetGo=false -RollBodyIncrementsCombo=false -InitialHoldLife=0.05 -CheckpointsTapsSeparateJudgment=false - -[ScreenSelectMusic] -WrapChangeSteps=true - -[ScreenGameplay] -FailOnMissCombo=51 -LyricDisplaySetNoReverseCommand=x,SCREEN_CENTER_X+SCREEN_RIGHT;y,SCREEN_CENTER_X+SCREEN_BOTTOM -LyricDisplaySetReverseCommand=x,SCREEN_CENTER_X+SCREEN_RIGHT;y,SCREEN_CENTER_X+SCREEN_BOTTOM -LyricDisplaySetOneReverseCommand=x,SCREEN_CENTER_X+SCREEN_RIGHT;y,SCREEN_CENTER_X+SCREEN_BOTTOM -LyricDisplayDefaultColor= -ShowModIconRows=false -LeftFrameX=-9999 -LeftFrameY=SCREEN_CENTER_Y -RightFrameX=-9999 -RightFrameY=SCREEN_CENTER_Y -StepsDisplayP1X=-9999 -StepsDisplayP2X=-9999 -ScoreFrameX=-9999 -ScoreFrameY=-9999 -ScoreP1X=-9999 -ScoreP1Y=-9999 -ScoreP2X=-9999 -ScoreP2Y=-9999 -SecondaryScoreP1X=-9999 -SecondaryScoreP1Y=-9999 -SecondaryScoreP2X=-9999 -SecondaryScoreP2Y=-9999 -PlayerOptionsP1X=-9999 -PlayerOptionsP1Y=-9999 -PlayerOptionsP2X=-9999 -PlayerOptionsP2Y=-9999 -ScoreboardC1P1X=-9999 -ScoreboardC1P1Y=-9999 -ScoreboardC2P1X=-9999 -ScoreboardC2P1Y=-9999 -ScoreboardC3P1X=-9999 -ScoreboardC3P1Y=-9999 -ScoreboardC1P2X=-9999 -ScoreboardC1P2Y=-9999 -ScoreboardC2P2X=-9999 -ScoreboardC2P2Y=-9999 -ScoreboardC3P2X=-9999 -ScoreboardC3P2Y=-9999 - -[ScreenEvaluation] -CheckpointsWithJudgments=true - -[CustomDifficulty] -Names="1,2,3,4,5,6,7" -1StepsType="StepsType_pump_single" -1Difficulty="Difficulty_Beginner" -1String="Novice" -2StepsType="StepsType_pump_single" -2Difficulty="Difficulty_Easy" -2String="Normal" -3StepsType="StepsType_pump_single" -3Difficulty="Difficulty_Medium" -3String="Hard" -4StepsType="StepsType_pump_single" -4Difficulty="Difficulty_Hard" -4String="Crazy" -5StepsType="StepsType_pump_halfdouble" -5Difficulty="Difficulty_Invalid" -5String="HalfDouble" -6StepsType="StepsType_pump_double" -6Difficulty="Difficulty_Medium" -6String="Freestyle" -7StepsType="StepsType_pump_double" -7Difficulty="Difficulty_Hard" -7String="Nightmare" - -[ScreenSelectMusic] -TwoPartSelection=true - -[CodeDetector] -Mirror="DownRight,DownLeft,UpRight,UpLeft,DownRight,DownLeft,UpRight,UpLeft,Center" -SuperShuffle="UpLeft,UpRight,UpLeft,UpRight,DownLeft,DownRight,DownLeft,DownRight,Center" -NextTransform="" -NextScrollSpeed="UpLeft,UpRight,UpLeft,UpRight,Center" -PreviousScrollSpeed="UpRight,UpLeft,UpRight,UpLeft,Center" -NextAppearance="UpLeft,UpRight,DownLeft,DownRight,Center" -CancelAll="DownLeft,DownRight,DownLeft,DownRight,DownLeft,DownRight" -SaveScreenshot1="MenuLeft-MenuRight" +[Global] +IsBaseTheme=0 + +[Gameplay] +ComboIsPerRow=true +MinScoreToContinueCombo="TapNoteScore_W3" +MinScoreToMaintainCombo="TapNoteScore_W4" + +[HoldJudgment] +HoldJudgmentLetGoCommand= +HoldJudgmentHeldCommand= + +[Combo] +ShowComboAt=4 +ShowMissesAt=4 + +[Player] +JudgeHoldNotesOnSameRowTogether=true +HoldCheckpoints=true +RequireStepOnHoldHeads=false +CheckpointsUseTimeSignatures=true +ImmediateHoldLetGo=false +RollBodyIncrementsCombo=false +InitialHoldLife=0.05 +CheckpointsTapsSeparateJudgment=false + +[ScreenSelectMusic] +WrapChangeSteps=true + +[ScreenGameplay] +FailOnMissCombo=51 +LyricDisplaySetNoReverseCommand=x,SCREEN_CENTER_X+SCREEN_RIGHT;y,SCREEN_CENTER_X+SCREEN_BOTTOM +LyricDisplaySetReverseCommand=x,SCREEN_CENTER_X+SCREEN_RIGHT;y,SCREEN_CENTER_X+SCREEN_BOTTOM +LyricDisplaySetOneReverseCommand=x,SCREEN_CENTER_X+SCREEN_RIGHT;y,SCREEN_CENTER_X+SCREEN_BOTTOM +LyricDisplayDefaultColor= +ShowModIconRows=false +LeftFrameX=-9999 +LeftFrameY=SCREEN_CENTER_Y +RightFrameX=-9999 +RightFrameY=SCREEN_CENTER_Y +StepsDisplayP1X=-9999 +StepsDisplayP2X=-9999 +ScoreFrameX=-9999 +ScoreFrameY=-9999 +ScoreP1X=-9999 +ScoreP1Y=-9999 +ScoreP2X=-9999 +ScoreP2Y=-9999 +SecondaryScoreP1X=-9999 +SecondaryScoreP1Y=-9999 +SecondaryScoreP2X=-9999 +SecondaryScoreP2Y=-9999 +PlayerOptionsP1X=-9999 +PlayerOptionsP1Y=-9999 +PlayerOptionsP2X=-9999 +PlayerOptionsP2Y=-9999 +ScoreboardC1P1X=-9999 +ScoreboardC1P1Y=-9999 +ScoreboardC2P1X=-9999 +ScoreboardC2P1Y=-9999 +ScoreboardC3P1X=-9999 +ScoreboardC3P1Y=-9999 +ScoreboardC1P2X=-9999 +ScoreboardC1P2Y=-9999 +ScoreboardC2P2X=-9999 +ScoreboardC2P2Y=-9999 +ScoreboardC3P2X=-9999 +ScoreboardC3P2Y=-9999 + +[ScreenEvaluation] +CheckpointsWithJudgments=true + +[CustomDifficulty] +Names="1,2,3,4,5,6,7,8" +1StepsType="StepsType_pump_single" +1Difficulty="Difficulty_Beginner" +1CourseType=nil +1String="Easy" +2StepsType="StepsType_pump_single" +2Difficulty="Difficulty_Easy" +2CourseType=nil +2String="Normal" +3StepsType="StepsType_pump_single" +3Difficulty="Difficulty_Medium" +3CourseType=nil +3String="Hard" +4StepsType="StepsType_pump_single" +4Difficulty="Difficulty_Hard" +4CourseType=nil +4String="Crazy" +5StepsType="StepsType_pump_halfdouble" +5Difficulty="Difficulty_Medium" +5CourseType=nil +5String="HalfDouble" +6StepsType="StepsType_pump_double" +6Difficulty="Difficulty_Medium" +6CourseType=nil +6String="Freestyle" +7StepsType="StepsType_pump_double" +7Difficulty="Difficulty_Hard" +7CourseType=nil +7String="Nightmare" +8StepsType=nil +8Difficulty=nil +8CourseType="CourseType_Nonstop" +8String="Progressive" + +[ScreenSelectMusic] +TwoPartSelection=true + +[CodeDetector] +Mirror="DownRight,DownLeft,UpRight,UpLeft,DownRight,DownLeft,UpRight,UpLeft,Center" +SuperShuffle="UpLeft,UpRight,UpLeft,UpRight,DownLeft,DownRight,DownLeft,DownRight,Center" +NextTransform="" +NextScrollSpeed="UpLeft,UpRight,UpLeft,UpRight,Center" +PreviousScrollSpeed="UpRight,UpLeft,UpRight,UpLeft,Center" +NextAppearance="UpLeft,UpRight,DownLeft,DownRight,Center" +CancelAll="DownLeft,DownRight,DownLeft,DownRight,DownLeft,DownRight" +SaveScreenshot1="MenuLeft-MenuRight" diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 5a6ea91d37..4407155e2d 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -1176,7 +1176,7 @@ void Actor::AddCommand( const RString &sCmdName, apActorCommands apac ) if( GetMessageNameFromCommandName(sCmdName, sMessage) ) { SubscribeToMessage( sMessage ); - m_mapNameToCommands[sMessage] = apac; // sCmdName w/o "Message" at the end + m_mapNameToCommands[sMessage] = apac; // sCmdName w/o "Message" at the end } else { diff --git a/stepmania/src/CatalogXml.cpp b/stepmania/src/CatalogXml.cpp index 5a15d4f13f..99a1196e89 100644 --- a/stepmania/src/CatalogXml.cpp +++ b/stepmania/src/CatalogXml.cpp @@ -83,7 +83,7 @@ void CatalogXml::Save( LoadingWindow *loading_window ) FOREACH_CONST( StepsType, vStepsTypesToShow, st ) { XNode* p3 = p2->AppendChild( "StepsType" ); - p3->AppendAttr( "StepsType", GameManager::GetStepsTypeInfo(*st).szName ); + p3->AppendAttr( "StepsType", GAMEMAN->GetStepsTypeInfo(*st).szName ); int iNumStepsInGroupAndStepsType[NUM_Difficulty]; ZERO( iNumStepsInGroupAndStepsType ); @@ -280,8 +280,8 @@ void CatalogXml::Save( LoadingWindow *loading_window ) FOREACH_CONST( Difficulty, vDifficultiesToShow, 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? - pNode3->AppendAttr( "DisplayAs", GetLocalizedCustomDifficulty( st, *iter ) ); // TODO: Fix use of Single + StepsType st = GAMEMAN->GetHowToPlayStyleForGame( GAMESTATE->m_pCurGame )->m_StepsType; // TODO: Is this the best thing we can do here? + 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" ); FOREACH_CONST( StepsType, vStepsTypesToShow, iter ) { - XNode* pNode3 = pNode2->AppendChild( "StepsType", GameManager::GetStepsTypeInfo(*iter).szName ); - pNode3->AppendAttr( "DisplayAs", GameManager::GetStepsTypeInfo(*iter).GetLocalizedString() ); + XNode* pNode3 = pNode2->AppendChild( "StepsType", GAMEMAN->GetStepsTypeInfo(*iter).szName ); + pNode3->AppendAttr( "DisplayAs", GAMEMAN->GetStepsTypeInfo(*iter).GetLocalizedString() ); } } @@ -317,7 +317,7 @@ void CatalogXml::Save( LoadingWindow *loading_window ) { XNode* pNode2 = pNode->AppendChild( "Style" ); vector vpStyle; - GameManager::GetStylesForGame( GAMESTATE->m_pCurGame, vpStyle ); + GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, vpStyle ); FOREACH( const Style*, vpStyle, pStyle ) { if( !SHOW_STYLE(*pStyle) ) @@ -325,7 +325,7 @@ void CatalogXml::Save( LoadingWindow *loading_window ) StyleID sID; sID.FromStyle( (*pStyle) ); XNode* pNode3 = pNode2->AppendChild( sID.CreateNode() ); - pNode3->AppendAttr( "DisplayAs", GameManager::StyleToLocalizedString(*pStyle) ); + pNode3->AppendAttr( "DisplayAs", GAMEMAN->StyleToLocalizedString(*pStyle) ); } } diff --git a/stepmania/src/CommonMetrics.cpp b/stepmania/src/CommonMetrics.cpp index e9441d27fe..9e17d3a4bb 100644 --- a/stepmania/src/CommonMetrics.cpp +++ b/stepmania/src/CommonMetrics.cpp @@ -93,7 +93,7 @@ static void RemoveStepsTypes( vector& inout, RString sStepsTypesToRem // subtract StepsTypes FOREACH_CONST( RString, v, i ) { - StepsType st = GameManager::StringToStepsType(*i); + StepsType st = GAMEMAN->StringToStepsType(*i); if( st == StepsType_Invalid ) { LOG->Warn( "Invalid StepsType value '%s' in '%s'", i->c_str(), sStepsTypesToRemove.c_str() ); @@ -119,7 +119,7 @@ void ThemeMetricStepsTypesToShow::Read() ThemeMetric::Read(); m_v.clear(); - GameManager::GetStepsTypesForGame( GAMESTATE->m_pCurGame, m_v ); + GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, m_v ); RemoveStepsTypes( m_v, ThemeMetric::GetValue() ); } diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index f0f2d0ccef..613132c176 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -21,18 +21,6 @@ static Preference 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( L, 1 ) ) ); - - static const char *SongSortNames[] = { "Randomize", "MostPlays", @@ -486,6 +474,7 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) vector AllSongsShuffled; trail.m_StepsType = st; + trail.m_CourseType = GetCourseType(); trail.m_CourseDifficulty = cd; /* Set to true if CourseDifficulty is able to change something. */ @@ -687,7 +676,7 @@ void Course::GetTrails( vector &AddTo, StepsType st ) const void Course::GetAllTrails( vector &AddTo ) const { vector vStepsTypesToShow; - GameManager::GetStepsTypesForGame( GAMESTATE->m_pCurGame, vStepsTypesToShow ); + GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, vStepsTypesToShow ); FOREACH( StepsType, vStepsTypesToShow, st ) { GetTrails( AddTo, *st ); @@ -739,7 +728,7 @@ bool Course::AllSongsAreFixed() const const Style *Course::GetCourseStyle( const Game *pGame, int iNumPlayers ) const { vector vpStyles; - GameManager::GetCompatibleStyles( pGame, iNumPlayers, vpStyles ); + GAMEMAN->GetCompatibleStyles( pGame, iNumPlayers, vpStyles ); for( int s=0; s < (int) vpStyles.size(); ++s ) { diff --git a/stepmania/src/Course.h b/stepmania/src/Course.h index d15801095d..2044582b00 100644 --- a/stepmania/src/Course.h +++ b/stepmania/src/Course.h @@ -20,20 +20,6 @@ class Game; 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 CourseType PlayModeToCourseType( PlayMode pm ) { return (CourseType)(pm-PLAY_MODE_NONSTOP); } diff --git a/stepmania/src/CourseUtil.cpp b/stepmania/src/CourseUtil.cpp index 5e97ba211b..23f52bb562 100644 --- a/stepmania/src/CourseUtil.cpp +++ b/stepmania/src/CourseUtil.cpp @@ -377,9 +377,9 @@ bool EditCourseUtil::RemoveAndDeleteFile( Course *pCourse ) return true; } -static LocalizedString YOU_MUST_SUPPLY_NAME ( "WorkoutManager", "You must supply a name for your workout." ); -static LocalizedString EDIT_NAME_CONFLICTS ( "WorkoutManager", "The name you chose conflicts with another workout. 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 YOU_MUST_SUPPLY_NAME ( "CourseUtil", "You must supply a name for your course." ); +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 ( "CourseUtil", "The course name cannot contain any of the following characters: %s" ); bool EditCourseUtil::ValidateEditCourseName( const RString &sAnswer, RString &sErrorOut ) { if( sAnswer.empty() ) @@ -415,9 +415,11 @@ bool EditCourseUtil::ValidateEditCourseName( const RString &sAnswer, RString &sE void EditCourseUtil::UpdateAndSetTrail() { + ASSERT( GAMESTATE->m_pCurStyle ); StepsType st = GAMESTATE->m_pCurStyle->m_StepsType; - Trail *pTrail = GAMESTATE->m_pCurCourse->GetTrailForceRegenCache( st ); - ASSERT( pTrail ); + Trail *pTrail = NULL; + if( GAMESTATE->m_pCurCourse ) + GAMESTATE->m_pCurCourse->GetTrailForceRegenCache( st ); GAMESTATE->m_pCurTrail[PLAYER_1].Set( pTrail ); } diff --git a/stepmania/src/Difficulty.cpp b/stepmania/src/Difficulty.cpp index 5872a6a4bc..de1a9913bc 100644 --- a/stepmania/src/Difficulty.cpp +++ b/stepmania/src/Difficulty.cpp @@ -6,6 +6,8 @@ #include "LocalizedString.h" #include "GameConstantsAndTypes.h" #include "GameManager.h" +#include "Steps.h" +#include "Trail.h" static const char *DifficultyNames[] = { "Beginner", @@ -78,9 +80,9 @@ CourseDifficulty GetNextShownCourseDifficulty( CourseDifficulty cd ) static ThemeMetric 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 ) { @@ -104,11 +106,16 @@ RString GetCustomDifficulty( StepsType st, Difficulty dc ) ThemeMetric DIFFICULTY("CustomDifficulty",(*sName)+"Difficulty"); if( DIFFICULTY == Difficulty_Invalid || dc == DIFFICULTY ) // match { - ThemeMetric STRING("CustomDifficulty",(*sName)+"String"); - return STRING.GetValue(); + ThemeMetric COURSE_TYPE("CustomDifficulty",(*sName)+"CourseType"); + if( COURSE_TYPE == CourseType_Invalid || ct == COURSE_TYPE ) // match + { + ThemeMetric STRING("CustomDifficulty",(*sName)+"String"); + return STRING.GetValue(); + } } } } + // no matching CustomDifficulty, so use a regular difficulty name return DifficultyToString( dc ); } case StepsTypeCategory_Couple: @@ -118,16 +125,48 @@ RString GetCustomDifficulty( StepsType st, Difficulty dc ) } } -LuaFunction( GetCustomDifficulty, GetCustomDifficulty(Enum::Check(L,1),Enum::Check(L, 2)) ); +LuaFunction( GetCustomDifficulty, GetCustomDifficulty(Enum::Check(L,1), Enum::Check(L, 2), Enum::Check(L, 3)) ); -RString GetLocalizedCustomDifficulty( const RString &sCustomDifficulty ) +RString CustomDifficultyToLocalizedString( const RString &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::check(L, 1); + if( pSteps ) + { + lua_pushstring(L, StepsToCustomDifficulty( pSteps )); + return 1; + } + Trail *pTrail = Luna::check(L, 1); + if( pTrail ) + { + lua_pushstring(L, TrailToCustomDifficulty( pTrail )); + return 1; + } + return 0; +} + +LuaFunction2( StepsOrTrailToCustomDifficulty ); + /* * (c) 2001-2004 Chris Danford * All rights reserved. diff --git a/stepmania/src/Difficulty.h b/stepmania/src/Difficulty.h index 17bd83a77d..cb05374132 100644 --- a/stepmania/src/Difficulty.h +++ b/stepmania/src/Difficulty.h @@ -3,6 +3,8 @@ #include "EnumHelper.h" #include "GameConstantsAndTypes.h" +class Steps; +class Trail; // // Player number stuff @@ -33,11 +35,12 @@ const RString& CourseDifficultyToLocalizedString( Difficulty dc ); 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. -RString GetCustomDifficulty( StepsType st, Difficulty dc ); -RString GetLocalizedCustomDifficulty( const RString &sCustomDifficulty ); -static inline RString GetLocalizedCustomDifficulty( StepsType st, Difficulty dc ) { return GetLocalizedCustomDifficulty( GetCustomDifficulty(st,dc) ); } +RString GetCustomDifficulty( StepsType st, Difficulty dc, CourseType ct ); +RString CustomDifficultyToLocalizedString( const RString &sCustomDifficulty ); +RString StepsToCustomDifficulty( const Steps *pSteps ); +RString TrailToCustomDifficulty( const Trail *pTrail ); #endif diff --git a/stepmania/src/DifficultyList.cpp b/stepmania/src/DifficultyList.cpp index 3675b71a7d..092c007e31 100644 --- a/stepmania/src/DifficultyList.cpp +++ b/stepmania/src/DifficultyList.cpp @@ -13,9 +13,9 @@ #define MAX_METERS NUM_Difficulty + MAX_EDITS_PER_SONG -REGISTER_ACTOR_CLASS( DifficultyList ) +REGISTER_ACTOR_CLASS( StepsDisplayList ) -DifficultyList::DifficultyList() +StepsDisplayList::StepsDisplayList() { 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 ); - 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" ); 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) ); 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 ); /* 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 ... */ pChild = pNode->GetChild( ssprintf("CursorP%iFrame",pn+1) ); 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].AddChild( m_Cursors[pn] ); this->AddChild( &m_CursorFrames[pn] ); @@ -76,7 +76,7 @@ void DifficultyList::LoadFromNode( const XNode* pNode ) PositionItems(); } -int DifficultyList::GetCurrentRowIndex( PlayerNumber pn ) const +int StepsDisplayList::GetCurrentRowIndex( PlayerNumber pn ) const { Difficulty ClosestDifficulty = GAMESTATE->GetClosestShownDifficulty(pn); @@ -100,7 +100,7 @@ int DifficultyList::GetCurrentRowIndex( PlayerNumber pn ) const } /* Update m_fY and m_bHidden[]. */ -void DifficultyList::UpdatePositions() +void StepsDisplayList::UpdatePositions() { int iCurrentRow[NUM_PLAYERS]; FOREACH_HumanPlayer( p ) @@ -193,7 +193,7 @@ void DifficultyList::UpdatePositions() } -void DifficultyList::PositionItems() +void StepsDisplayList::PositionItems() { 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; unsigned i = 0; @@ -287,7 +287,7 @@ void DifficultyList::SetFromGameState() m_Lines[m].m_Meter.FinishTweening(); } -void DifficultyList::HideRows() +void StepsDisplayList::HideRows() { 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 ) ON_COMMAND( m_Cursors[pn] ); @@ -322,12 +322,12 @@ void DifficultyList::TweenOnScreen() COMMAND( m_Cursors[pn], "TweenOn" ); } -void DifficultyList::TweenOffScreen() +void StepsDisplayList::TweenOffScreen() { } -void DifficultyList::Show() +void StepsDisplayList::Show() { m_bShown = true; @@ -340,7 +340,7 @@ void DifficultyList::Show() COMMAND( m_Cursors[pn], "Show" ); } -void DifficultyList::Hide() +void StepsDisplayList::Hide() { m_bShown = false; PositionItems(); @@ -349,7 +349,7 @@ void DifficultyList::Hide() COMMAND( m_Cursors[pn], "Hide" ); } -void DifficultyList::HandleMessage( const Message &msg ) +void StepsDisplayList::HandleMessage( const Message &msg ) { FOREACH_ENUM( PlayerNumber, pn ) { @@ -365,18 +365,18 @@ void DifficultyList::HandleMessage( const Message &msg ) // lua start #include "LuaBinding.h" -class LunaDifficultyList: public Luna +class LunaStepsDisplayList: public Luna { public: static int setfromgamestate( T* p, lua_State *L ) { p->SetFromGameState(); return 0; } - LunaDifficultyList() + LunaStepsDisplayList() { ADD_METHOD( setfromgamestate ); } }; -LUA_REGISTER_DERIVED_CLASS( DifficultyList, ActorFrame ) +LUA_REGISTER_DERIVED_CLASS( StepsDisplayList, ActorFrame ) // lua end /* diff --git a/stepmania/src/DifficultyList.h b/stepmania/src/DifficultyList.h index 92a92d0bf1..18f86782cc 100644 --- a/stepmania/src/DifficultyList.h +++ b/stepmania/src/DifficultyList.h @@ -9,12 +9,12 @@ class Song; class Steps; -class DifficultyList: public ActorFrame +class StepsDisplayList: public ActorFrame { public: - DifficultyList(); - virtual ~DifficultyList(); - virtual DifficultyList *Copy() const; + StepsDisplayList(); + virtual ~StepsDisplayList(); + virtual StepsDisplayList *Copy() const; virtual void LoadFromNode( const XNode* pNode ); void HandleMessage( const Message &msg ); diff --git a/stepmania/src/EditMenu.cpp b/stepmania/src/EditMenu.cpp index ea3ba628c2..efb131f940 100644 --- a/stepmania/src/EditMenu.cpp +++ b/stepmania/src/EditMenu.cpp @@ -387,7 +387,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row ) // fall through 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; @@ -476,7 +476,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row ) // fall through case ROW_STEPS: { - RString s = GetLocalizedCustomDifficulty( GetSelectedStepsType(), GetSelectedDifficulty() ); + RString s = CustomDifficultyToLocalizedString( GetCustomDifficulty( GetSelectedStepsType(), GetSelectedDifficulty(), CourseType_Invalid ) ); m_textValue[ROW_STEPS].SetText( s ); } @@ -488,7 +488,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row ) case ROW_SOURCE_STEPS_TYPE: 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].SetText( GameManager::GetStepsTypeInfo(GetSelectedSourceStepsType()).GetLocalizedString() ); + m_textValue[ROW_SOURCE_STEPS_TYPE].SetText( GAMEMAN->GetStepsTypeInfo(GetSelectedSourceStepsType()).GetLocalizedString() ); m_vpSourceSteps.clear(); m_vpSourceSteps.push_back( StepsAndDifficulty(NULL,Difficulty_Invalid) ); // "blank" @@ -525,7 +525,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row ) } else { - s = GetLocalizedCustomDifficulty( GetSelectedSourceStepsType(), GetSelectedSourceDifficulty() ); + s = CustomDifficultyToLocalizedString( GetCustomDifficulty( GetSelectedSourceStepsType(), GetSelectedSourceDifficulty(), CourseType_Invalid ) ); } m_textValue[ROW_SOURCE_STEPS].SetText( s ); } diff --git a/stepmania/src/GameCommand.cpp b/stepmania/src/GameCommand.cpp index 6e2f6e4dd6..d8d64cbddf 100644 --- a/stepmania/src/GameCommand.cpp +++ b/stepmania/src/GameCommand.cpp @@ -174,7 +174,7 @@ void GameCommand::LoadOne( const Command& cmd ) if( sName == "style" ) { - const Style* style = GameManager::GameAndStringToStyle( GAMESTATE->m_pCurGame, sValue ); + const Style* style = GAMEMAN->GameAndStringToStyle( GAMESTATE->m_pCurGame, sValue ); if( style ) m_pStyle = style; else diff --git a/stepmania/src/GameConstantsAndTypes.cpp b/stepmania/src/GameConstantsAndTypes.cpp index bdd0d0cf3f..09aa61ec0d 100644 --- a/stepmania/src/GameConstantsAndTypes.cpp +++ b/stepmania/src/GameConstantsAndTypes.cpp @@ -45,7 +45,7 @@ LuaXType( RadarCategory ); RString StepsTypeToString( StepsType st ) { - RString s = GameManager::GetStepsTypeInfo( st ).szName; // "dance-single" + RString s = GAMEMAN->GetStepsTypeInfo( st ).szName; // "dance-single" /* foo-bar -> Foo_Bar */ s.Replace('-','_'); return s; @@ -421,6 +421,18 @@ static const char *MultiPlayerStatusNames[] = { XToString( MultiPlayerStatus ); +static const char *CourseTypeNames[] = { + "Nonstop", + "Oni", + "Endless", + "Survival", +}; +XToString( CourseType ); +XToLocalizedString( CourseType ); +LuaXType( CourseType ); +LuaFunction( CourseTypeToLocalizedString, CourseTypeToLocalizedString( Enum::Check( L, 1 ) ) ); + + /* * (c) 2001-2004 Chris Danford * All rights reserved. diff --git a/stepmania/src/GameConstantsAndTypes.h b/stepmania/src/GameConstantsAndTypes.h index 5d22268b45..eecdcf38c8 100644 --- a/stepmania/src/GameConstantsAndTypes.h +++ b/stepmania/src/GameConstantsAndTypes.h @@ -517,6 +517,21 @@ enum MultiPlayerStatus 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 /* diff --git a/stepmania/src/GameManager.cpp b/stepmania/src/GameManager.cpp index 4595f59d1e..f9f006ac30 100644 --- a/stepmania/src/GameManager.cpp +++ b/stepmania/src/GameManager.cpp @@ -12,6 +12,8 @@ #include "Style.h" #include "Foreach.h" +GameManager* GAMEMAN = NULL; // global and accessable from anywhere in our program + enum { TRACK_1 = 0, @@ -2603,6 +2605,24 @@ static const Game *g_Games[] = &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& aStylesAddTo, bool editor ) { for( int s=0; pGame->m_apStyles[s]; ++s ) @@ -2855,31 +2875,30 @@ const Style* GameManager::GameAndStringToStyle( const Game *game, RString sStyle // lua start #include "LuaBinding.h" -namespace +class LunaGameManager: public Luna { - - int StepsTypeToLocalizedString( lua_State *L ) { lua_pushstring(L, GameManager::GetStepsTypeInfo(Enum::Check(L, 1)).GetLocalizedString() ); return 1; } - int GetFirstStepsTypeForGame( lua_State *L ) +public: + static int StepsTypeToLocalizedString( T* p, lua_State *L ) { lua_pushstring(L, p->GetStepsTypeInfo(Enum::Check(L, 1)).GetLocalizedString() ); return 1; } + static int GetFirstStepsTypeForGame( T* p, lua_State *L ) { Game *pGame = Luna::check( L, 1 ); vector vstAddTo; - GameManager::GetStepsTypesForGame( pGame, vstAddTo ); + p->GetStepsTypesForGame( pGame, vstAddTo ); ASSERT( !vstAddTo.empty() ); StepsType st = vstAddTo[0]; LuaHelpers::Push( L, st ); return 1; } - const luaL_Reg GameManagerTable[] = + LunaGameManager() { - LIST_METHOD( StepsTypeToLocalizedString ), - LIST_METHOD( GetFirstStepsTypeForGame ), - { NULL, NULL } - }; + ADD_METHOD( StepsTypeToLocalizedString ); + ADD_METHOD( GetFirstStepsTypeForGame ); + } }; -LUA_REGISTER_NAMESPACE( GameManager ) +LUA_REGISTER_CLASS( GameManager ) // lua end diff --git a/stepmania/src/GameManager.h b/stepmania/src/GameManager.h index 04bf6a626c..3add5c0586 100644 --- a/stepmania/src/GameManager.h +++ b/stepmania/src/GameManager.h @@ -19,8 +19,12 @@ struct StepsTypeInfo RString GetLocalizedString() const; }; -namespace GameManager +class GameManager { +public: + GameManager(); + ~GameManager(); + void GetStylesForGame( const Game* pGame, vector& aStylesAddTo, bool editor=false ); const Game *GetGameForStyle( const Style *pStyle ); void GetStepsTypesForGame( const Game* pGame, vector& aStepsTypeAddTo ); @@ -41,7 +45,12 @@ namespace GameManager const Game* StringToGame( RString sGame ); const Style* GameAndStringToStyle( const Game* pGame, RString sStyle ); RString StyleToLocalizedString( const Style* s ); -} + + // Lua + void PushSelf( lua_State *L ); +}; + +extern GameManager* GAMEMAN; // global and accessable from anywhere in our program #endif diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 27b2ebf070..91f148c139 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -360,9 +360,9 @@ void GameState::JoinPlayer( PlayerNumber pn ) // only use one player for StyleType_OnePlayerTwoSides. // XXX: still shows non master player's "Insert Card" -aj 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 - 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 SetCurrentStyle( pStyle ); @@ -629,7 +629,7 @@ int GameState::GetNumStagesForCurrentSongAndStepsOrCourse() const { /* If a style isn't set, use the style of the selected steps. */ StepsType st = pSteps->m_StepsType; - pStyle = GameManager::GetFirstCompatibleStyle( m_pCurGame, GetNumSidesJoined(), st ); + pStyle = GAMEMAN->GetFirstCompatibleStyle( m_pCurGame, GetNumSidesJoined(), st ); } else { @@ -637,7 +637,7 @@ int GameState::GetNumStagesForCurrentSongAndStepsOrCourse() const * joined players, or one player if no players are joined. */ vector vpStyles; int iJoined = max( GetNumSidesJoined(), 1 ); - GameManager::GetCompatibleStyles( m_pCurGame, iJoined, vpStyles ); + GAMEMAN->GetCompatibleStyles( m_pCurGame, iJoined, vpStyles ); ASSERT( !vpStyles.empty() ); pStyle = vpStyles[0]; } @@ -2331,7 +2331,7 @@ public: for( unsigned i=0; im_StepsType, pSteps->GetDifficulty() ); + RString sDifficulty = CustomDifficultyToLocalizedString( GetCustomDifficulty( pSteps->m_StepsType, pSteps->GetDifficulty(), CourseType_Invalid ) ); lua_pushstring( L, sDifficulty ); lua_pushstring( L, pSteps->GetDescription() ); diff --git a/stepmania/src/LightsManager.cpp b/stepmania/src/LightsManager.cpp index db9d248d8d..e268d1bb35 100644 --- a/stepmania/src/LightsManager.cpp +++ b/stepmania/src/LightsManager.cpp @@ -70,7 +70,7 @@ static void GetUsedGameInputs( vector &vGameInputsOut ) set vGIs; vector vStyles; - GameManager::GetStylesForGame( GAMESTATE->m_pCurGame, vStyles ); + GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, vStyles ); 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(); diff --git a/stepmania/src/LuaManager.h b/stepmania/src/LuaManager.h index 7102f0ebb3..62919b5d98 100644 --- a/stepmania/src/LuaManager.h +++ b/stepmania/src/LuaManager.h @@ -214,6 +214,10 @@ int LuaFunc_##func( lua_State *L ) { \ void LuaFunc_Register_##func( lua_State *L ) { lua_register( L, #func, LuaFunc_##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 /* diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 5163221661..6f94e0c26b 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -1025,7 +1025,7 @@ void MusicWheel::SetOpenSection( RString group ) vector vpPossibleStyles; if( CommonMetrics::AUTO_SET_STYLE ) - GameManager::GetCompatibleStyles( GAMESTATE->m_pCurGame, GAMESTATE->GetNumPlayersEnabled(), vpPossibleStyles ); + GAMEMAN->GetCompatibleStyles( GAMESTATE->m_pCurGame, GAMESTATE->GetNumPlayersEnabled(), vpPossibleStyles ); m_CurWheelItemData.clear(); vector &from = m_WheelItemDatas[GAMESTATE->m_SortOrder]; diff --git a/stepmania/src/NetworkSyncManager.cpp b/stepmania/src/NetworkSyncManager.cpp index 9ae346d1ca..8accb766fa 100644 --- a/stepmania/src/NetworkSyncManager.cpp +++ b/stepmania/src/NetworkSyncManager.cpp @@ -662,8 +662,8 @@ void NetworkSyncManager::ProcessInput() GameName = m_packet.ReadNT(); StyleName = m_packet.ReadNT(); - GAMESTATE->SetCurGame( GameManager::StringToGame(GameName) ); - GAMESTATE->SetCurrentStyle( GameManager::GameAndStringToStyle(GAMESTATE->m_pCurGame,StyleName) ); + GAMESTATE->SetCurGame( GAMEMAN->StringToGame(GameName) ); + GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle(GAMESTATE->m_pCurGame,StyleName) ); SCREENMAN->SetNewScreen( "ScreenNetSelectMusic" ); //Should this be metric'd out? } diff --git a/stepmania/src/NotesLoaderBMS.cpp b/stepmania/src/NotesLoaderBMS.cpp index cab8a647ca..28fd063236 100644 --- a/stepmania/src/NotesLoaderBMS.cpp +++ b/stepmania/src/NotesLoaderBMS.cpp @@ -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 iTransformNewToOld; iTransformNewToOld.resize( iNumNewTracks, -1 ); diff --git a/stepmania/src/NotesLoaderSM.cpp b/stepmania/src/NotesLoaderSM.cpp index 6de22b2306..7bada3b40f 100644 --- a/stepmania/src/NotesLoaderSM.cpp +++ b/stepmania/src/NotesLoaderSM.cpp @@ -32,7 +32,7 @@ static void LoadFromSMTokens( // LOG->Trace( "Steps::LoadFromSMTokens()" ); - out.m_StepsType = GameManager::StringToStepsType( sStepsType ); + out.m_StepsType = GAMEMAN->StringToStepsType( sStepsType ); out.SetDescription( sDescription ); out.SetDifficulty( DwiCompatibleStringToDifficulty(sDifficulty) ); diff --git a/stepmania/src/NotesWriterSM.cpp b/stepmania/src/NotesWriterSM.cpp index d42c59831e..6aa25dbcef 100644 --- a/stepmania/src/NotesWriterSM.cpp +++ b/stepmania/src/NotesWriterSM.cpp @@ -201,9 +201,9 @@ static RString GetSMNotesTag( const Song &song, const Steps &in, bool bSavingCac lines.push_back( "" ); // Escape to prevent some clown from making a comment of "\r\n;" 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( 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:", DifficultyToString(in.GetDifficulty()).c_str() ) ); lines.push_back( ssprintf( " %d:", in.GetMeter() ) ); diff --git a/stepmania/src/OptionRowHandler.cpp b/stepmania/src/OptionRowHandler.cpp index 18afa28e06..a94c9efcee 100644 --- a/stepmania/src/OptionRowHandler.cpp +++ b/stepmania/src/OptionRowHandler.cpp @@ -447,7 +447,7 @@ class OptionRowHandlerListSteps : public OptionRowHandlerList if( pSteps->IsAnEdit() ) s = pSteps->GetDescription(); else - s = GetLocalizedCustomDifficulty( pSteps->m_StepsType, pSteps->GetDifficulty() ); + s = CustomDifficultyToLocalizedString( GetCustomDifficulty( pSteps->m_StepsType, pSteps->GetDifficulty(), CourseType_Invalid ) ); } s += ssprintf( " %d", pSteps->GetMeter() ); m_Def.m_vsChoices.push_back( s ); @@ -560,7 +560,7 @@ public: } else { - s = GetLocalizedCustomDifficulty( GAMESTATE->m_stEdit, dc ); + s = CustomDifficultyToLocalizedString( GetCustomDifficulty( GAMESTATE->m_stEdit, dc, CourseType_Invalid ) ); } 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 vector vStyles; - GameManager::GetStylesForGame( GAMESTATE->m_pCurGame, vStyles ); + GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, vStyles ); ASSERT( vStyles.size() ); 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; mc.m_pStyle = *s; m_aListEntries.push_back( mc ); @@ -736,8 +736,8 @@ class OptionRowHandlerListDifficulties: public OptionRowHandlerList 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? - RString s = GetLocalizedCustomDifficulty( st, *d ); + StepsType st = GAMEMAN->GetHowToPlayStyleForGame( GAMESTATE->m_pCurGame )->m_StepsType; // TODO: Is this the best thing we can do here? + RString s = CustomDifficultyToLocalizedString( GetCustomDifficulty(st, *d, CourseType_Invalid) ); m_Def.m_vsChoices.push_back( s ); GameCommand mc; @@ -1205,7 +1205,7 @@ public: m_Def.m_vsChoices.clear(); 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 ); } diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index b093d14b4a..3dfc592981 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -1053,7 +1053,7 @@ XNode* Profile::SaveGeneralDataCreateNode() const pGeneralDataNode->AppendChild( "LastDifficulty", DifficultyToString(m_LastDifficulty) ); pGeneralDataNode->AppendChild( "LastCourseDifficulty", DifficultyToString(m_LastCourseDifficulty) ); 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_lastCourse.CreateNode() ); 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( "LastDifficulty", s ); m_LastDifficulty = 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( "Course" ); if( pTemp ) m_lastCourse.LoadFromNode( pTemp ); pNode->GetChildValue( "TotalSessions", m_iTotalSessions ); @@ -1564,7 +1564,7 @@ XNode* Profile::SaveCategoryScoresCreateNode() const continue; XNode* pStepsTypeNode = pNode->AppendChild( "StepsType" ); - pStepsTypeNode->AppendAttr( "Type", GameManager::GetStepsTypeInfo(st).szName ); + pStepsTypeNode->AppendAttr( "Type", GAMEMAN->GetStepsTypeInfo(st).szName ); FOREACH_ENUM( RankingCategory,rc ) { @@ -1598,7 +1598,7 @@ void Profile::LoadCategoryScoresFromNode( const XNode* pCategoryScores ) RString str; if( !pStepsType->GetAttrValue( "Type", str ) ) WARN_AND_CONTINUE; - StepsType st = GameManager::StringToStepsType( str ); + StepsType st = GAMEMAN->StringToStepsType( str ); if( st == StepsType_Invalid ) WARN_AND_CONTINUE_M( str ); diff --git a/stepmania/src/ScreenDemonstration.cpp b/stepmania/src/ScreenDemonstration.cpp index 736006c341..db853843fa 100644 --- a/stepmania/src/ScreenDemonstration.cpp +++ b/stepmania/src/ScreenDemonstration.cpp @@ -40,7 +40,7 @@ void ScreenDemonstration::Init() } vector vStylePossible; - GameManager::GetDemonstrationStylesForGame( GAMESTATE->m_pCurGame, vStylePossible ); + GAMEMAN->GetDemonstrationStylesForGame( GAMESTATE->m_pCurGame, vStylePossible ); for( int i=(int)(vStylePossible.size())-1; i>=0; i-- ) { bool bAllowThis = find( vStyleTypeAllow.begin(), vStyleTypeAllow.end(), vStylePossible[i]->m_StyleType ) != vStyleTypeAllow.end(); diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index cdcca94b09..135decd966 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -1504,7 +1504,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) RString s = ssprintf( 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(), pSteps->GetDescription().c_str(), it - vSteps.begin() + 1, @@ -2903,7 +2903,7 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector &iAns g_StepsInformation.rows[difficulty].choices.clear(); 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].bEnabled = (EDIT_MODE.GetValue() >= EditMode_Full); diff --git a/stepmania/src/ScreenEditMenu.cpp b/stepmania/src/ScreenEditMenu.cpp index d37a1b7520..4ebdc52968 100644 --- a/stepmania/src/ScreenEditMenu.cpp +++ b/stepmania/src/ScreenEditMenu.cpp @@ -183,7 +183,7 @@ void ScreenEditMenu::MenuStart( const InputEventPlus &input ) GAMESTATE->m_pCurSong.Set( pSong ); GAMESTATE->m_pCurCourse.Set( NULL ); - GAMESTATE->SetCurrentStyle( GameManager::GetEditorStyleForStepsType(st) ); + GAMESTATE->SetCurrentStyle( GAMEMAN->GetEditorStyleForStepsType(st) ); GAMESTATE->m_pCurSteps[PLAYER_1].Set( pSteps ); // diff --git a/stepmania/src/ScreenEnding.cpp b/stepmania/src/ScreenEnding.cpp index c1348fa3f7..18b37a5ca8 100644 --- a/stepmania/src/ScreenEnding.cpp +++ b/stepmania/src/ScreenEnding.cpp @@ -30,7 +30,7 @@ ScreenEnding::ScreenEnding() PROFILEMAN->LoadFirstAvailableProfile(PLAYER_2); 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_2 ); GAMESTATE->m_pCurSong.Set( SONGMAN->GetRandomSong() ); diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index 77c5f15684..7dca69ea20 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -96,7 +96,7 @@ void ScreenEvaluation::Init() StageStats &ss = STATSMAN->m_vPlayedStageStats.back(); 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_pStyle = GAMESTATE->GetCurrentStyle(); ss.m_Stage = Stage_1st; diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index e02d3aa9d7..d04ab2dcf6 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -1311,7 +1311,7 @@ void ScreenGameplay::LoadLights() split( sDifficulty, ",", asDifficulties ); // 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; if( asDifficulties.size() > 0 ) @@ -1381,7 +1381,7 @@ void ScreenGameplay::LoadLights() /* 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 ) diff --git a/stepmania/src/ScreenGameplaySyncMachine.cpp b/stepmania/src/ScreenGameplaySyncMachine.cpp index eae2563578..dfe3d6d6ab 100644 --- a/stepmania/src/ScreenGameplaySyncMachine.cpp +++ b/stepmania/src/ScreenGameplaySyncMachine.cpp @@ -15,7 +15,7 @@ REGISTER_SCREEN_CLASS( ScreenGameplaySyncMachine ); void ScreenGameplaySyncMachine::Init() { GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR ); - GAMESTATE->SetCurrentStyle( GameManager::GetHowToPlayStyleForGame(GAMESTATE->m_pCurGame) ); + GAMESTATE->SetCurrentStyle( GAMEMAN->GetHowToPlayStyleForGame(GAMESTATE->m_pCurGame) ); AdjustSync::ResetOriginalSyncData(); RString sFile = THEME->GetPathO("ScreenGameplaySyncMachine","music.sm"); diff --git a/stepmania/src/ScreenHowToPlay.cpp b/stepmania/src/ScreenHowToPlay.cpp index edbfd24d5c..de2967753f 100644 --- a/stepmania/src/ScreenHowToPlay.cpp +++ b/stepmania/src/ScreenHowToPlay.cpp @@ -116,7 +116,7 @@ void ScreenHowToPlay::Init() } } - GAMESTATE->SetCurrentStyle( GameManager::GetHowToPlayStyleForGame(GAMESTATE->m_pCurGame) ); + GAMESTATE->SetCurrentStyle( GAMEMAN->GetHowToPlayStyleForGame(GAMESTATE->m_pCurGame) ); if( USE_PLAYER ) { diff --git a/stepmania/src/ScreenNameEntry.cpp b/stepmania/src/ScreenNameEntry.cpp index 0e2ecbc5a0..47cbf6694a 100644 --- a/stepmania/src/ScreenNameEntry.cpp +++ b/stepmania/src/ScreenNameEntry.cpp @@ -125,7 +125,7 @@ ScreenNameEntry::ScreenNameEntry() GAMESTATE->m_bSideIsJoined[PLAYER_2] = true; GAMESTATE->m_MasterPlayerNumber = PLAYER_1; GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR ); - GAMESTATE->SetCurrentStyle( GameManager::GameAndStringToStyle( GameManager::GetDefaultGame(),"versus") ); + GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle( GAMEMAN->GetDefaultGame(),"versus") ); StageStats ss; for( int z = 0; z < 3; ++z ) { @@ -172,8 +172,8 @@ void ScreenNameEntry::Init() { #if 0 // DEBUGGING STUFF - GAMESTATE->m_pCurGame.Set( GameManager::GetDefaultGame() ); - GAMESTATE->m_pCurStyle.Set( GameManager::GetHowToPlayStyleForGame(GAMESTATE->m_pCurGame) ); + GAMESTATE->m_pCurGame.Set( GAMEMAN->GetDefaultGame() ); + GAMESTATE->m_pCurStyle.Set( GAMEMAN->GetHowToPlayStyleForGame(GAMESTATE->m_pCurGame) ); GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR ); GAMESTATE->m_bSideIsJoined[PLAYER_1] = true; GAMESTATE->m_MasterPlayerNumber = PLAYER_1; diff --git a/stepmania/src/ScreenNameEntryTraditional.cpp b/stepmania/src/ScreenNameEntryTraditional.cpp index 0d90e9d9a7..a4b2d598b1 100644 --- a/stepmania/src/ScreenNameEntryTraditional.cpp +++ b/stepmania/src/ScreenNameEntryTraditional.cpp @@ -24,7 +24,7 @@ void ScreenNameEntryTraditional::Init() GAMESTATE->m_bSideIsJoined[PLAYER_2] = true; GAMESTATE->m_MasterPlayerNumber = PLAYER_1; 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 ) { StageStats ss; diff --git a/stepmania/src/ScreenOptionsCourseOverview.cpp b/stepmania/src/ScreenOptionsCourseOverview.cpp index d4e0431f52..1bb9996f90 100644 --- a/stepmania/src/ScreenOptionsCourseOverview.cpp +++ b/stepmania/src/ScreenOptionsCourseOverview.cpp @@ -18,19 +18,19 @@ #include "Style.h" #include "PrefsManager.h" -enum ReviewWorkoutRow +enum CourseOverviewRow { - ReviewWorkoutRow_Play, - ReviewWorkoutRow_Edit, - ReviewWorkoutRow_Shuffle, - ReviewWorkoutRow_Save, - NUM_ReviewWorkoutRow + CourseOverviewRow_Play, + CourseOverviewRow_Edit, + CourseOverviewRow_Shuffle, + CourseOverviewRow_Save, + NUM_CourseOverviewRow }; static const MenuRowDef g_MenuRows[] = { 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, "Save", true, EditMode_Practice, true, false, 0, NULL ), }; @@ -54,7 +54,7 @@ void ScreenOptionsCourseOverview::Init() void ScreenOptionsCourseOverview::BeginScreen() { vector vHands; - FOREACH_ENUM( ReviewWorkoutRow, rowIndex ) + FOREACH_ENUM( CourseOverviewRow, rowIndex ) { const MenuRowDef &mr = g_MenuRows[rowIndex]; OptionRowHandler *pHand = OptionRowHandlerUtil::MakeSimple( mr ); @@ -88,8 +88,8 @@ void ScreenOptionsCourseOverview::ExportOptions( int iRow, const vectorm_MasterPlayerNumber]; switch( iRow ) { - case ReviewWorkoutRow_Play: + case CourseOverviewRow_Play: EditCourseUtil::PrepareForPlay(); SCREENMAN->SetNewScreen( PLAY_SCREEN ); return; // handled - case ReviewWorkoutRow_Edit: + case CourseOverviewRow_Edit: SCREENMAN->SetNewScreen( EDIT_SCREEN ); return; // handled } @@ -115,7 +115,7 @@ void ScreenOptionsCourseOverview::HandleScreenMessage( const ScreenMessage SM ) if( EditCourseUtil::RenameAndSave( GAMESTATE->m_pCurCourse, ScreenTextEntry::s_sLastAnswer ) ) { 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 ) { if( IsTransitioning() ) @@ -138,12 +138,12 @@ void ScreenOptionsCourseOverview::ProcessMenuStart( const InputEventPlus &input int iRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; switch( iRow ) { - case ReviewWorkoutRow_Play: - case ReviewWorkoutRow_Edit: + case CourseOverviewRow_Play: + case CourseOverviewRow_Edit: SCREENMAN->PlayStartSound(); this->BeginFadingOut(); return; // handled - case ReviewWorkoutRow_Shuffle: + case CourseOverviewRow_Shuffle: { Course *pCourse = GAMESTATE->m_pCurCourse; random_shuffle( pCourse->m_vEntries.begin(), pCourse->m_vEntries.end() ); @@ -153,14 +153,14 @@ void ScreenOptionsCourseOverview::ProcessMenuStart( const InputEventPlus &input MESSAGEMAN->Broadcast("CurrentCourseChanged"); } return; // handled - case ReviewWorkoutRow_Save: + case CourseOverviewRow_Save: { bool bPromptForName = EditCourseUtil::s_bNewCourseNeedsName; if( bPromptForName ) { ScreenTextEntry::TextEntry( SM_BackFromEnterName, - ENTER_WORKOUT_NAME, + ENTER_COURSE_NAME, GAMESTATE->m_pCurCourse->GetDisplayFullTitle(), EditCourseUtil::MAX_NAME_LENGTH, EditCourseUtil::ValidateEditCourseName ); @@ -170,12 +170,12 @@ void ScreenOptionsCourseOverview::ProcessMenuStart( const InputEventPlus &input if( EditCourseUtil::Save( GAMESTATE->m_pCurCourse ) ) { m_soundSave.Play(); - SCREENMAN->SystemMessage( WORKOUT_SAVED ); + SCREENMAN->SystemMessage( COURSE_SAVED ); } else { SCREENMAN->PlayInvalidSound(); - SCREENMAN->SystemMessage( ERROR_SAVING_WORKOUT ); + SCREENMAN->SystemMessage( ERROR_SAVING_COURSE ); } } } diff --git a/stepmania/src/ScreenOptionsEditCourse.cpp b/stepmania/src/ScreenOptionsEditCourse.cpp index f157248e2b..45f2f9d012 100644 --- a/stepmania/src/ScreenOptionsEditCourse.cpp +++ b/stepmania/src/ScreenOptionsEditCourse.cpp @@ -45,7 +45,7 @@ public: if( (*steps)->GetDifficulty() == Difficulty_Edit ) s = (*steps)->GetDescription(); else - s = GetLocalizedCustomDifficulty( (*steps)->m_StepsType, (*steps)->GetDifficulty() ); + s = CustomDifficultyToLocalizedString( StepsToCustomDifficulty(*steps) ); s += ssprintf( " %d", (*steps)->GetMeter() ); m_Def.m_vsChoices.push_back( s ); } @@ -66,9 +66,12 @@ public: { Trail *pTrail = GAMESTATE->m_pCurTrail[PLAYER_1]; Steps *pSteps; - if( m_iEntryIndex < (int)pTrail->m_vEntries.size() ) - pSteps = pTrail->m_vEntries[ m_iEntryIndex ].pSteps; - + if( pTrail ) + { + if( m_iEntryIndex < (int)pTrail->m_vEntries.size() ) + pSteps = pTrail->m_vEntries[ m_iEntryIndex ].pSteps; + } + vector::const_iterator iter = find( m_vpSteps.begin(), m_vpSteps.end(), pSteps ); if( iter == m_vpSteps.end() ) { @@ -101,10 +104,10 @@ const int NUM_SONG_ROWS = 20; REGISTER_SCREEN_CLASS( ScreenOptionsEditCourse ); -enum WorkoutDetailsRow +enum EditCourseRow { - WorkoutDetailsRow_Minutes, - NUM_WorkoutDetailsRow + EditCourseRow_Minutes, + NUM_EditCourseRow }; enum RowType @@ -116,20 +119,20 @@ enum RowType }; static int RowToEntryIndex( int iRow ) { - if( iRow < NUM_WorkoutDetailsRow ) + if( iRow < NUM_EditCourseRow ) return -1; - return (iRow-NUM_WorkoutDetailsRow)/NUM_RowType; + return (iRow-NUM_EditCourseRow)/NUM_RowType; } static RowType RowToRowType( int iRow ) { - if( iRow < NUM_WorkoutDetailsRow ) + if( iRow < NUM_EditCourseRow ) return RowType_Invalid; - return (RowType)((iRow-NUM_WorkoutDetailsRow) % NUM_RowType); + return (RowType)((iRow-NUM_EditCourseRow) % NUM_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() @@ -141,7 +144,7 @@ void ScreenOptionsEditCourse::Init() 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-"); @@ -160,7 +163,7 @@ void ScreenOptionsEditCourse::BeginScreen() { vector vHands; - FOREACH_ENUM( WorkoutDetailsRow, rowIndex ) + FOREACH_ENUM( EditCourseRow, rowIndex ) { const MenuRowDef &mr = g_MenuRows[rowIndex]; OptionRowHandler *pHand = OptionRowHandlerUtil::MakeSimple( mr ); @@ -171,7 +174,7 @@ void ScreenOptionsEditCourse::BeginScreen() switch( rowIndex ) { DEFAULT_FAIL(rowIndex); - case WorkoutDetailsRow_Minutes: + case EditCourseRow_Minutes: pHand->m_Def.m_vsChoices.push_back( MakeMinutesString(0) ); for( int i=EditCourseUtil::MIN_WORKOUT_MINUTES; i<=20; i+=2 ) pHand->m_Def.m_vsChoices.push_back( MakeMinutesString(i) ); @@ -249,7 +252,7 @@ void ScreenOptionsEditCourse::ImportOptions( int iRow, const vectorm_pCurCourse->m_fGoalSeconds/60) ); break; @@ -285,7 +288,7 @@ void ScreenOptionsEditCourse::ImportOptions( int iRow, const vector &vpns ) { - FOREACH_ENUM( WorkoutDetailsRow, i ) + FOREACH_ENUM( EditCourseRow, i ) { OptionRow &row = *m_pRows[i]; int iIndex = row.GetOneSharedSelection( true ); @@ -296,7 +299,7 @@ void ScreenOptionsEditCourse::ExportOptions( int iRow, const vectorm_pCurCourse->m_fGoalSeconds = 0; int mins; if( sscanf( sValue, "%d", &mins ) == 1 ) @@ -307,7 +310,7 @@ void ScreenOptionsEditCourse::ExportOptions( int iRow, const vectorm_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]; if( row.GetRowType() == OptionRow::RowType_Exit ) diff --git a/stepmania/src/ScreenOptionsManageCourses.cpp b/stepmania/src/ScreenOptionsManageCourses.cpp index 15fe9efc85..eef0bbc066 100644 --- a/stepmania/src/ScreenOptionsManageCourses.cpp +++ b/stepmania/src/ScreenOptionsManageCourses.cpp @@ -74,7 +74,7 @@ static void SetNextCombination() GAMESTATE->m_stEdit.Set( curVal.st ); GAMESTATE->m_cdEdit.Set( curVal.cd ); // 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(); } @@ -92,17 +92,18 @@ void ScreenOptionsManageCourses::Init() } void ScreenOptionsManageCourses::BeginScreen() -{ +{ + vector vpStyles; + GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, vpStyles ); + const Style *pStyle = vpStyles[0]; + GAMESTATE->SetCurrentStyle( pStyle ); + + if( GAMESTATE->m_stEdit == StepsType_Invalid || GAMESTATE->m_cdEdit == Difficulty_Invalid ) { SetNextCombination(); } - - vector 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. diff --git a/stepmania/src/ScreenOptionsManageEditSteps.cpp b/stepmania/src/ScreenOptionsManageEditSteps.cpp index 1e7154eeb0..8d672db8f4 100644 --- a/stepmania/src/ScreenOptionsManageEditSteps.cpp +++ b/stepmania/src/ScreenOptionsManageEditSteps.cpp @@ -93,7 +93,7 @@ void ScreenOptionsManageEditSteps::BeginScreen() def.m_sExplanationName = "Select Edit Steps"; def.m_vsChoices.clear(); 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_bAllowThemeItems = false; // already themed iIndex++; @@ -140,7 +140,7 @@ void ScreenOptionsManageEditSteps::HandleScreenMessage( const ScreenMessage SM ) { Steps *pSteps = GAMESTATE->m_pCurSteps[PLAYER_1]; ASSERT( pSteps ); - const Style *pStyle = GameManager::GetEditorStyleForStepsType( pSteps->m_StepsType ); + const Style *pStyle = GAMEMAN->GetEditorStyleForStepsType( pSteps->m_StepsType ); GAMESTATE->SetCurrentStyle( pStyle ); // do base behavior } diff --git a/stepmania/src/ScreenOptionsMasterPrefs.cpp b/stepmania/src/ScreenOptionsMasterPrefs.cpp index 152864fe9b..db91b5db30 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.cpp +++ b/stepmania/src/ScreenOptionsMasterPrefs.cpp @@ -156,7 +156,7 @@ static void MoveNop( int &iSel, bool bToSel, const ConfOption *pConfOption ) static void GameChoices( vector &out ) { vector aGames; - GameManager::GetEnabledGames( aGames ); + GAMEMAN->GetEnabledGames( aGames ); FOREACH( const Game*, aGames, g ) { RString sGameName = (*g)->m_szName; @@ -179,7 +179,7 @@ static void GameSel( int &sel, bool ToSel, const ConfOption *pConfOption ) sel = i; } else { vector aGames; - GameManager::GetEnabledGames( aGames ); + GAMEMAN->GetEnabledGames( aGames ); StepMania::ChangeCurrentGame( aGames[sel] ); } } diff --git a/stepmania/src/ScreenRanking.cpp b/stepmania/src/ScreenRanking.cpp index 19e67d7297..d9576babeb 100644 --- a/stepmania/src/ScreenRanking.cpp +++ b/stepmania/src/ScreenRanking.cpp @@ -206,7 +206,7 @@ float ScreenRanking::SetPage( const PageToShow &pts ) // init page // StepsType st = pts.aTypes.front().second; - m_textStepsType.SetText( GameManager::GetStepsTypeInfo(st).GetLocalizedString() ); + m_textStepsType.SetText( GAMEMAN->GetStepsTypeInfo(st).GetLocalizedString() ); bool bShowScores = false; diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 9ba96a2496..0484700051 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -64,7 +64,7 @@ void ScreenSelectMusic::Init() if( PREFSMAN->m_sTestInitialScreen.Get() == m_sName ) { 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->m_MasterPlayerNumber = PLAYER_1; } @@ -193,8 +193,8 @@ void ScreenSelectMusic::BeginScreen() if( CommonMetrics::AUTO_SET_STYLE ) { vector vst; - GameManager::GetStepsTypesForGame( GAMESTATE->m_pCurGame, vst ); - const Style *pStyle = GameManager::GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined(), vst[0] ); + GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, vst ); + const Style *pStyle = GAMEMAN->GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined(), vst[0] ); GAMESTATE->SetCurrentStyle( pStyle ); } @@ -769,7 +769,7 @@ void ScreenSelectMusic::HandleMessage( const Message &msg ) // selected, they are no longer playable now that P2 has joined. // 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 ); FOREACH_ENUM( PlayerNumber, p ) GAMESTATE->m_pCurSteps[p].SetWithoutBroadcast( NULL ); @@ -1068,7 +1068,7 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input ) stCurrent = GAMESTATE->m_pCurSteps[pn]->m_StepsType; } vector vst; - pStyle = GameManager::GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined(), stCurrent ); + pStyle = GAMEMAN->GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined(), stCurrent ); } GAMESTATE->SetCurrentStyle( pStyle ); } diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 80c97e7c94..c65ac7c0d0 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -917,11 +917,11 @@ void Song::AddAutoGenNotes() /* If m_bAutogenSteps is disabled, only autogen lights. */ if( !PREFSMAN->m_bAutogenSteps && stMissing != StepsType_lights_cabinet ) continue; - if( !GameManager::GetStepsTypeInfo(stMissing).bAllowAutogen ) + if( !GAMEMAN->GetStepsTypeInfo(stMissing).bAllowAutogen ) continue; // missing Steps of this type - int iNumTracksOfMissing = GameManager::GetStepsTypeInfo(stMissing).iNumTracks; + int iNumTracksOfMissing = GAMEMAN->GetStepsTypeInfo(stMissing).iNumTracks; // look for closest match StepsType stBestMatch = StepsType_Invalid; @@ -933,7 +933,7 @@ void Song::AddAutoGenNotes() continue; /* 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); if( iTrackDifference < iBestTrackDifference ) { @@ -949,7 +949,7 @@ void Song::AddAutoGenNotes() void Song::AutoGen( StepsType ntTo, StepsType ntFrom ) { -// int iNumTracksOfTo = GameManager::StepsTypeToNumTracks(ntTo); +// int iNumTracksOfTo = GAMEMAN->StepsTypeToNumTracks(ntTo); for( unsigned int j=0; j &vOut ) { vector vpPossibleStyles; if( CommonMetrics::AUTO_SET_STYLE ) - GameManager::GetCompatibleStyles( GAMESTATE->m_pCurGame, GAMESTATE->GetNumPlayersEnabled(), vpPossibleStyles ); + GAMEMAN->GetCompatibleStyles( GAMESTATE->m_pCurGame, GAMESTATE->GetNumPlayersEnabled(), vpPossibleStyles ); else vpPossibleStyles.push_back( GAMESTATE->m_pCurStyle ); @@ -866,7 +866,7 @@ void SongUtil::GetPlayableStepsTypes( const Song *pSong, set &vOut ) int iNumPlayers = GAMESTATE->GetNumPlayersEnabled(); 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); if( bShowThisStepsType && bEnoughStages ) @@ -933,7 +933,7 @@ bool SongUtil::GetStepsTypeAndDifficultyFromSortOrder( SortOrder so, StepsType & case SORT_DOUBLE_CHALLENGE_METER: stOut = GAMESTATE->GetCurrentStyle()->m_StepsType; // in case we don't find any matches below vector vpStyles; - GameManager::GetStylesForGame(GAMESTATE->m_pCurGame,vpStyles); + GAMEMAN->GetStylesForGame(GAMESTATE->m_pCurGame,vpStyles); FOREACH_CONST( const Style*, vpStyles, i ) { if( (*i)->m_StyleType == StyleType_OnePlayerTwoSides ) diff --git a/stepmania/src/StepMania-net2005.vcproj b/stepmania/src/StepMania-net2005.vcproj index 1e56df3dc0..fb002adad2 100644 --- a/stepmania/src/StepMania-net2005.vcproj +++ b/stepmania/src/StepMania-net2005.vcproj @@ -292,7 +292,7 @@ Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386 "$(intdir)\verstub.obj"" 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" SuppressStartupBanner="true" AdditionalLibraryDirectories="" @@ -987,11 +987,11 @@ > GetCurrentGame() ); + const Game *pGame = GAMEMAN->StringToGame( PREFSMAN->GetCurrentGame() ); /* If the active game type isn't actually available, revert to the default. */ 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\"", - 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 ); } @@ -1050,6 +1051,7 @@ int main(int argc, char* argv[]) AdjustForChangedSystemCapabilities(); + GAMEMAN = new GameManager; THEME = new ThemeManager; ANNOUNCER = new AnnouncerManager; NOTESKIN = new NoteSkinManager; diff --git a/stepmania/src/Steps.cpp b/stepmania/src/Steps.cpp index 98ca64c443..23d99f2453 100644 --- a/stepmania/src/Steps.cpp +++ b/stepmania/src/Steps.cpp @@ -63,7 +63,7 @@ unsigned Steps::GetHash() const void Steps::SetNoteData( const NoteData& noteDataNew ) { - ASSERT( noteDataNew.GetNumTracks() == GameManager::GetStepsTypeInfo(m_StepsType).iNumTracks ); + ASSERT( noteDataNew.GetNumTracks() == GAMEMAN->GetStepsTypeInfo(m_StepsType).iNumTracks ); DeAutogen( false ); @@ -86,7 +86,7 @@ void Steps::GetNoteData( NoteData& noteDataOut ) const else { 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; - int iNewTracks = GameManager::GetStepsTypeInfo(m_StepsType).iNumTracks; + int iNewTracks = GAMEMAN->GetStepsTypeInfo(m_StepsType).iNumTracks; if( this->m_StepsType == StepsType_lights_cabinet ) { @@ -267,7 +267,7 @@ void Steps::Decompress() const // load from compressed bool bComposite = m_StepsType == StepsType_dance_routine; 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 ); } @@ -352,7 +352,7 @@ void Steps::CopyFrom( Steps* pSource, StepsType ntTo, float fMusicLengthSeconds m_StepsType = ntTo; NoteData noteData; pSource->GetNoteData( noteData ); - noteData.SetNumTracks( GameManager::GetStepsTypeInfo(ntTo).iNumTracks ); + noteData.SetNumTracks( GAMEMAN->GetStepsTypeInfo(ntTo).iNumTracks ); parent = NULL; this->SetNoteData( noteData ); this->SetDescription( pSource->GetDescription() ); @@ -365,7 +365,7 @@ void Steps::CreateBlank( StepsType ntTo ) { m_StepsType = ntTo; NoteData noteData; - noteData.SetNumTracks( GameManager::GetStepsTypeInfo(ntTo).iNumTracks ); + noteData.SetNumTracks( GAMEMAN->GetStepsTypeInfo(ntTo).iNumTracks ); this->SetNoteData( noteData ); } diff --git a/stepmania/src/StepsDisplay.cpp b/stepmania/src/StepsDisplay.cpp index b784c8cdf6..d5a041fb06 100644 --- a/stepmania/src/StepsDisplay.cpp +++ b/stepmania/src/StepsDisplay.cpp @@ -194,7 +194,10 @@ void StepsDisplay::SetInternal( const SetParams ¶ms ) RString sCustomDifficulty; 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 ); } @@ -238,7 +241,7 @@ void StepsDisplay::SetInternal( const SetParams ¶ms ) if( params.pSteps && params.pSteps->IsAnEdit() ) s = params.sDescription; else if( !sCustomDifficulty.empty() ) - s = GetLocalizedCustomDifficulty( sCustomDifficulty ); + s = CustomDifficultyToLocalizedString( sCustomDifficulty ); } m_textDescription.SetText( s ); @@ -255,7 +258,7 @@ void StepsDisplay::SetInternal( const SetParams ¶ms ) // TODO: Make this an AutoActor, optimize graphic loading 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) ); } } diff --git a/stepmania/src/StepsUtil.cpp b/stepmania/src/StepsUtil.cpp index 536d747907..bb9c751fc0 100644 --- a/stepmania/src/StepsUtil.cpp +++ b/stepmania/src/StepsUtil.cpp @@ -280,7 +280,7 @@ XNode* StepsID::CreateNode() const { XNode* pNode = new XNode( "Steps" ); - pNode->AppendAttr( "StepsType", GameManager::GetStepsTypeInfo(st).szName ); + pNode->AppendAttr( "StepsType", GAMEMAN->GetStepsTypeInfo(st).szName ); pNode->AppendAttr( "Difficulty", DifficultyToString(dc) ); if( dc == Difficulty_Edit ) { @@ -298,7 +298,7 @@ void StepsID::LoadFromNode( const XNode* pNode ) RString sTemp; pNode->GetAttrValue( "StepsType", sTemp ); - st = GameManager::StringToStepsType( sTemp ); + st = GAMEMAN->StringToStepsType( sTemp ); pNode->GetAttrValue( "Difficulty", sTemp ); dc = StringToDifficulty( sTemp ); @@ -319,7 +319,7 @@ void StepsID::LoadFromNode( const XNode* pNode ) RString StepsID::ToString() const { - RString s = GameManager::GetStepsTypeInfo( st ).szName; + RString s = GAMEMAN->GetStepsTypeInfo( st ).szName; s += " " + DifficultyToString( dc ); if( dc == Difficulty_Edit ) { diff --git a/stepmania/src/StyleUtil.cpp b/stepmania/src/StyleUtil.cpp index b9d602e257..114803e8d2 100644 --- a/stepmania/src/StyleUtil.cpp +++ b/stepmania/src/StyleUtil.cpp @@ -10,7 +10,7 @@ void StyleID::FromStyle( const Style *p ) { if( p ) { - sGame = GameManager::GetGameForStyle(p)->m_szName; + sGame = GAMEMAN->GetGameForStyle(p)->m_szName; sStyle = p->m_szName; } else @@ -22,11 +22,11 @@ void StyleID::FromStyle( const Style *p ) const Style *StyleID::ToStyle() const { - const Game* pGame = GameManager::StringToGame( sGame ); + const Game* pGame = GAMEMAN->StringToGame( sGame ); if( pGame == NULL ) return NULL; - return GameManager::GameAndStringToStyle( pGame, sStyle ); + return GAMEMAN->GameAndStringToStyle( pGame, sStyle ); } XNode* StyleID::CreateNode() const diff --git a/stepmania/src/Trail.h b/stepmania/src/Trail.h index 4edc41f40e..4f9dee2b58 100644 --- a/stepmania/src/Trail.h +++ b/stepmania/src/Trail.h @@ -45,6 +45,7 @@ class Trail { public: StepsType m_StepsType; + CourseType m_CourseType; CourseDifficulty m_CourseDifficulty; vector m_vEntries; int m_iSpecifiedMeter; // == -1 if no meter specified diff --git a/stepmania/src/TrailUtil.cpp b/stepmania/src/TrailUtil.cpp index 6d1002ed05..86435510e5 100644 --- a/stepmania/src/TrailUtil.cpp +++ b/stepmania/src/TrailUtil.cpp @@ -59,7 +59,7 @@ XNode* TrailID::CreateNode() const { XNode* pNode = new XNode( "Trail" ); - pNode->AppendAttr( "StepsType", GameManager::GetStepsTypeInfo(st).szName ); + pNode->AppendAttr( "StepsType", GAMEMAN->GetStepsTypeInfo(st).szName ); pNode->AppendAttr( "CourseDifficulty", DifficultyToString(cd) ); return pNode; @@ -72,7 +72,7 @@ void TrailID::LoadFromNode( const XNode* pNode ) RString sTemp; pNode->GetAttrValue( "StepsType", sTemp ); - st = GameManager::StringToStepsType( sTemp ); + st = GAMEMAN->StringToStepsType( sTemp ); pNode->GetAttrValue( "CourseDifficulty", sTemp ); cd = StringToDifficulty( sTemp ); @@ -81,7 +81,7 @@ void TrailID::LoadFromNode( const XNode* pNode ) RString TrailID::ToString() const { - RString s = GameManager::GetStepsTypeInfo(st).szName; + RString s = GAMEMAN->GetStepsTypeInfo(st).szName; s += " " + DifficultyToString( cd ); return s; } diff --git a/stepmania/src/UnlockManager.cpp b/stepmania/src/UnlockManager.cpp index 6d030e219c..fedea1a379 100644 --- a/stepmania/src/UnlockManager.cpp +++ b/stepmania/src/UnlockManager.cpp @@ -362,8 +362,8 @@ RString UnlockEntry::GetDescription() const return pSong ? pSong->GetDisplayFullTitle() : ""; case UnlockRewardType_Steps: { - StepsType st = GameManager::GetHowToPlayStyleForGame( GAMESTATE->m_pCurGame )->m_StepsType; // TODO: Is this the best thing we can do here? - return (pSong ? pSong->GetDisplayFullTitle() : "") + ", " + GetLocalizedCustomDifficulty( st, m_dc ); + StepsType st = GAMEMAN->GetHowToPlayStyleForGame( GAMESTATE->m_pCurGame )->m_StepsType; // TODO: Is this the best thing we can do here? + return (pSong ? pSong->GetDisplayFullTitle() : "") + ", " + CustomDifficultyToLocalizedString( GetCustomDifficulty(st, m_dc, CourseType_Invalid) ); } case UnlockRewardType_Course: return m_Course.IsValid() ? m_Course.ToCourse()->GetDisplayFullTitle() : ""; diff --git a/stepmania/src/WorkoutGraph.cpp b/stepmania/src/WorkoutGraph.cpp index 8bb5699929..f56a76db64 100644 --- a/stepmania/src/WorkoutGraph.cpp +++ b/stepmania/src/WorkoutGraph.cpp @@ -50,8 +50,6 @@ void WorkoutGraph::SetInternal( int iMinSongsPlayed ) { Course *pCourse = GAMESTATE->m_pCurCourse; ASSERT( pCourse ); - Trail *pTrail = GAMESTATE->m_pCurTrail[PLAYER_1]; - ASSERT( pTrail ); FOREACH( Sprite*, m_vpBars, p ) { @@ -60,6 +58,10 @@ void WorkoutGraph::SetInternal( int iMinSongsPlayed ) } m_vpBars.clear(); + Trail *pTrail = GAMESTATE->m_pCurTrail[PLAYER_1]; + if( pTrail == NULL ) + return; + vector viMeters; FOREACH_CONST( TrailEntry, pTrail->m_vEntries, e ) {