Cleanup.
This commit is contained in:
@@ -153,28 +153,28 @@ void ScreenOptionsEditCourse::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
ScreenOptions::BeginFadingOut();
|
ScreenOptions::BeginFadingOut();
|
||||||
break;
|
break;
|
||||||
case CourseEntryAction_InsertEntry:
|
case CourseEntryAction_InsertEntry:
|
||||||
{
|
{
|
||||||
if( AreEntriesFull() )
|
if( AreEntriesFull() )
|
||||||
return;
|
return;
|
||||||
CourseEntry ce;
|
CourseEntry ce;
|
||||||
CourseUtil::MakeDefaultEditCourseEntry( ce );
|
CourseUtil::MakeDefaultEditCourseEntry( ce );
|
||||||
pCourse->m_vEntries.insert( pCourse->m_vEntries.begin() + GetCourseEntryIndexWithFocus(), ce );
|
pCourse->m_vEntries.insert( pCourse->m_vEntries.begin() + GetCourseEntryIndexWithFocus(), ce );
|
||||||
SCREENMAN->SetNewScreen( this->m_sName ); // reload
|
SCREENMAN->SetNewScreen( this->m_sName ); // reload
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case CourseEntryAction_Delete:
|
case CourseEntryAction_Delete:
|
||||||
|
{
|
||||||
|
if( pCourse->m_vEntries.size() == 1 )
|
||||||
{
|
{
|
||||||
if( pCourse->m_vEntries.size() == 1 )
|
ScreenPrompt::Prompt( SM_None, CANNOT_DELETE_LAST_ENTRY );
|
||||||
{
|
return;
|
||||||
ScreenPrompt::Prompt( SM_None, CANNOT_DELETE_LAST_ENTRY );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
pCourse->m_vEntries.erase( pCourse->m_vEntries.begin() + GetCourseEntryIndexWithFocus() );
|
|
||||||
GAMESTATE->m_iEditCourseEntryIndex.Set( GAMESTATE->m_iEditCourseEntryIndex );
|
|
||||||
SCREENMAN->SetNewScreen( this->m_sName ); // reload
|
|
||||||
}
|
}
|
||||||
|
pCourse->m_vEntries.erase( pCourse->m_vEntries.begin() + GetCourseEntryIndexWithFocus() );
|
||||||
|
GAMESTATE->m_iEditCourseEntryIndex.Set( GAMESTATE->m_iEditCourseEntryIndex );
|
||||||
|
SCREENMAN->SetNewScreen( this->m_sName ); // reload
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,15 +215,15 @@ void ScreenOptionsEditCourse::ImportOptions( int iRow, const vector<PlayerNumber
|
|||||||
row.SetOneSharedSelection( pCourse->GetCourseType() );
|
row.SetOneSharedSelection( pCourse->GetCourseType() );
|
||||||
break;
|
break;
|
||||||
case EditCourseRow_Meter:
|
case EditCourseRow_Meter:
|
||||||
{
|
{
|
||||||
int iMeter = pCourse->m_iCustomMeter[DIFFICULTY_MEDIUM];
|
int iMeter = pCourse->m_iCustomMeter[DIFFICULTY_MEDIUM];
|
||||||
if( iMeter == -1 )
|
if( iMeter == -1 )
|
||||||
row.SetOneSharedSelection( 0 );
|
row.SetOneSharedSelection( 0 );
|
||||||
else
|
else
|
||||||
row.SetOneSharedSelection( iMeter + 1 - MIN_METER );
|
row.SetOneSharedSelection( iMeter + 1 - MIN_METER );
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenOptionsEditCourse::ExportOptions( int iRow, const vector<PlayerNumber> &vpns )
|
void ScreenOptionsEditCourse::ExportOptions( int iRow, const vector<PlayerNumber> &vpns )
|
||||||
@@ -234,21 +234,21 @@ void ScreenOptionsEditCourse::ExportOptions( int iRow, const vector<PlayerNumber
|
|||||||
switch( iRow )
|
switch( iRow )
|
||||||
{
|
{
|
||||||
case EditCourseRow_Type:
|
case EditCourseRow_Type:
|
||||||
{
|
{
|
||||||
CourseType ct = (CourseType)row.GetOneSharedSelection();
|
CourseType ct = (CourseType)row.GetOneSharedSelection();
|
||||||
pCourse->SetCourseType( ct );
|
pCourse->SetCourseType( ct );
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case EditCourseRow_Meter:
|
case EditCourseRow_Meter:
|
||||||
{
|
{
|
||||||
int iSel = row.GetOneSharedSelection();
|
int iSel = row.GetOneSharedSelection();
|
||||||
if( iSel == 0 ) // "auto"
|
if( iSel == 0 ) // "auto"
|
||||||
pCourse->m_iCustomMeter[DIFFICULTY_MEDIUM] = -1;
|
pCourse->m_iCustomMeter[DIFFICULTY_MEDIUM] = -1;
|
||||||
else
|
else
|
||||||
pCourse->m_iCustomMeter[DIFFICULTY_MEDIUM] = iSel - 1 + MIN_METER;
|
pCourse->m_iCustomMeter[DIFFICULTY_MEDIUM] = iSel - 1 + MIN_METER;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenOptionsEditCourse::ProcessMenuStart( const InputEventPlus &input )
|
void ScreenOptionsEditCourse::ProcessMenuStart( const InputEventPlus &input )
|
||||||
|
|||||||
Reference in New Issue
Block a user