Retain the difficulty specified in extra1/extra2.crs.
This has a side-effect: with "pick extra stage" on, you're stuck with the difficulty of the song specified, even if you pick a different stage.
This commit is contained in:
@@ -768,6 +768,30 @@ void ScreenSelectMusic::AfterNotesChange( PlayerNumber pn )
|
|||||||
m_MusicWheel.NotesChanged( pn );
|
m_MusicWheel.NotesChanged( pn );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScreenSelectMusic::SwitchToPreferredDifficulty()
|
||||||
|
{
|
||||||
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||||
|
{
|
||||||
|
if( !GAMESTATE->IsHumanPlayer( PlayerNumber(p) ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* Find the closest match to the user's preferred difficulty. */
|
||||||
|
int CurDifference = -1;
|
||||||
|
for( unsigned i=0; i<m_arrayNotes[p].size(); i++ )
|
||||||
|
{
|
||||||
|
int Diff = abs(m_arrayNotes[p][i]->GetDifficulty() - GAMESTATE->m_PreferredDifficulty[p]);
|
||||||
|
|
||||||
|
if( CurDifference == -1 || Diff < CurDifference )
|
||||||
|
{
|
||||||
|
m_iSelection[p] = i;
|
||||||
|
CurDifference = Diff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_iSelection[p] = clamp( m_iSelection[p], 0, int(m_arrayNotes[p].size()) ) ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ScreenSelectMusic::AfterMusicChange()
|
void ScreenSelectMusic::AfterMusicChange()
|
||||||
{
|
{
|
||||||
m_Menu.m_MenuTimer.Stall();
|
m_Menu.m_MenuTimer.Stall();
|
||||||
@@ -849,26 +873,8 @@ void ScreenSelectMusic::AfterMusicChange()
|
|||||||
|
|
||||||
m_DifficultyDisplay.SetDifficulties( pSong, GAMESTATE->GetCurrentStyleDef()->m_NotesType );
|
m_DifficultyDisplay.SetDifficulties( pSong, GAMESTATE->GetCurrentStyleDef()->m_NotesType );
|
||||||
|
|
||||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
if( !GAMESTATE->IsExtraStage() && !GAMESTATE->IsExtraStage2() )
|
||||||
{
|
SwitchToPreferredDifficulty();
|
||||||
if( !GAMESTATE->IsHumanPlayer( PlayerNumber(p) ) )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* Find the closest match to the user's preferred difficulty. */
|
|
||||||
int CurDifference = -1;
|
|
||||||
for( unsigned i=0; i<m_arrayNotes[p].size(); i++ )
|
|
||||||
{
|
|
||||||
int Diff = abs(m_arrayNotes[p][i]->GetDifficulty() - GAMESTATE->m_PreferredDifficulty[p]);
|
|
||||||
|
|
||||||
if( CurDifference == -1 || Diff < CurDifference )
|
|
||||||
{
|
|
||||||
m_iSelection[p] = i;
|
|
||||||
CurDifference = Diff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_iSelection[p] = clamp( m_iSelection[p], 0, int(m_arrayNotes[p].size()) ) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Short delay before actually showing these, so they don't show
|
/* Short delay before actually showing these, so they don't show
|
||||||
* up when scrolling fast. It'll still show up in "slow" scrolling,
|
* up when scrolling fast. It'll still show up in "slow" scrolling,
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ protected:
|
|||||||
void HarderDifficulty( PlayerNumber pn );
|
void HarderDifficulty( PlayerNumber pn );
|
||||||
|
|
||||||
void AfterNotesChange( PlayerNumber pn );
|
void AfterNotesChange( PlayerNumber pn );
|
||||||
|
void SwitchToPreferredDifficulty();
|
||||||
void AfterMusicChange();
|
void AfterMusicChange();
|
||||||
void SortOrderChanged();
|
void SortOrderChanged();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user