CustomDiffiuclty cleanup, now takes CourseType as a parameter
DifficultyList -> StepsDisplayList Course editor screen cleanup Change GameManager back to singleton for consistency with other classes
This commit is contained in:
@@ -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<OptionRowHandler*> 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 vector<PlayerNu
|
||||
sValue = row.GetRowDef().m_vsChoices[ iIndex ];
|
||||
}
|
||||
|
||||
static LocalizedString ERROR_SAVING_WORKOUT ( "ScreenOptionsCourseOverview", "Error saving workout." );
|
||||
static LocalizedString WORKOUT_SAVED ( "ScreenOptionsCourseOverview", "Workout saved successfully." );
|
||||
static LocalizedString ERROR_SAVING_COURSE ( "ScreenOptionsCourseOverview", "Error saving course." );
|
||||
static LocalizedString COURSE_SAVED ( "ScreenOptionsCourseOverview", "Course saved successfully." );
|
||||
void ScreenOptionsCourseOverview::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
if( SM == SM_GoToNextScreen )
|
||||
@@ -97,11 +97,11 @@ void ScreenOptionsCourseOverview::HandleScreenMessage( const ScreenMessage SM )
|
||||
int iRow = m_iCurrentRow[GAMESTATE->m_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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user