fix difficulties jump around when switching StepsType
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user