fix difficulties jump around when switching StepsType

This commit is contained in:
Chris Danford
2006-03-27 07:51:52 +00:00
parent 52ec9b3737
commit bde1988a30
2 changed files with 72 additions and 54 deletions
+18
View File
@@ -381,6 +381,14 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
case ROW_STEPS_TYPE: case ROW_STEPS_TYPE:
m_textValue[ROW_STEPS_TYPE].SetText( GAMEMAN->StepsTypeToLocalizedString(GetSelectedStepsType()) ); m_textValue[ROW_STEPS_TYPE].SetText( GAMEMAN->StepsTypeToLocalizedString(GetSelectedStepsType()) );
{
Difficulty dcOld = DIFFICULTY_INVALID;
if( !m_vpSteps.empty() )
{
Steps *pSteps = GetSelectedSteps();
dcOld = pSteps->GetDifficulty();
}
m_vpSteps.clear(); m_vpSteps.clear();
FOREACH_Difficulty( dc ) FOREACH_Difficulty( dc )
@@ -447,6 +455,16 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
} }
} }
FOREACH( StepsAndDifficulty, m_vpSteps, s )
{
if( s->pSteps->GetDifficulty() == dcOld )
{
m_iSelection[ROW_STEPS] = s - m_vpSteps.begin();
break;
}
}
}
CLAMP( m_iSelection[ROW_STEPS], 0, m_vpSteps.size()-1 ); CLAMP( m_iSelection[ROW_STEPS], 0, m_vpSteps.size()-1 );
// fall through // fall through