make Random also prefer Songs that have all preferred difficulties
make Random and Portal ignore Songs with only beginnger Steps (Training)
This commit is contained in:
@@ -1303,6 +1303,8 @@ void MusicWheel::StartRandom()
|
|||||||
m_SpinSpeed *= 20.0f; /* faster! */
|
m_SpinSpeed *= 20.0f; /* faster! */
|
||||||
m_WheelState = STATE_RANDOM_SPINNING;
|
m_WheelState = STATE_RANDOM_SPINNING;
|
||||||
|
|
||||||
|
m_iSelection = GetPreferredSelectionForRandomOrPortal();
|
||||||
|
|
||||||
this->Select();
|
this->Select();
|
||||||
RebuildMusicWheelItems();
|
RebuildMusicWheelItems();
|
||||||
}
|
}
|
||||||
@@ -1508,7 +1510,15 @@ Song* MusicWheel::GetSelectedSong()
|
|||||||
switch( m_CurWheelItemData[m_iSelection]->m_Type )
|
switch( m_CurWheelItemData[m_iSelection]->m_Type )
|
||||||
{
|
{
|
||||||
case TYPE_PORTAL:
|
case TYPE_PORTAL:
|
||||||
{
|
return m_CurWheelItemData[ GetPreferredSelectionForRandomOrPortal() ]->m_pSong;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return m_CurWheelItemData[m_iSelection]->m_pSong;
|
||||||
|
}
|
||||||
|
|
||||||
|
int MusicWheel::GetPreferredSelectionForRandomOrPortal()
|
||||||
|
{
|
||||||
// probe to find a song that has the preferred
|
// probe to find a song that has the preferred
|
||||||
// difficulties of each player
|
// difficulties of each player
|
||||||
vector<Difficulty> vDifficultiesToRequire;
|
vector<Difficulty> vDifficultiesToRequire;
|
||||||
@@ -1517,6 +1527,7 @@ Song* MusicWheel::GetSelectedSong()
|
|||||||
vDifficultiesToRequire.push_back( GAMESTATE->m_PreferredDifficulty[p] );
|
vDifficultiesToRequire.push_back( GAMESTATE->m_PreferredDifficulty[p] );
|
||||||
|
|
||||||
StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
|
StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
|
||||||
|
|
||||||
#define NUM_PROBES 1000
|
#define NUM_PROBES 1000
|
||||||
for( int i=0; i<NUM_PROBES; i++ )
|
for( int i=0; i<NUM_PROBES; i++ )
|
||||||
{
|
{
|
||||||
@@ -1526,17 +1537,21 @@ Song* MusicWheel::GetSelectedSong()
|
|||||||
if( m_CurWheelItemData[iSelection]->m_Type == TYPE_SONG )
|
if( m_CurWheelItemData[iSelection]->m_Type == TYPE_SONG )
|
||||||
{
|
{
|
||||||
Song* pSong = m_CurWheelItemData[iSelection]->m_pSong;
|
Song* pSong = m_CurWheelItemData[iSelection]->m_pSong;
|
||||||
|
|
||||||
|
// HACK: Ignore all Songs with only Beginner steps. It's likely a training song.
|
||||||
|
vector<Steps*> vpSteps;
|
||||||
|
pSong->GetSteps( vpSteps, st );
|
||||||
|
bool bIsTraining = vpSteps.size()==1 && vpSteps[0]->GetDifficulty()==DIFFICULTY_BEGINNER;
|
||||||
|
if( bIsTraining )
|
||||||
|
goto skip_song;
|
||||||
|
|
||||||
FOREACH( Difficulty, vDifficultiesToRequire, d )
|
FOREACH( Difficulty, vDifficultiesToRequire, d )
|
||||||
if( !pSong->HasStepsTypeAndDifficulty(st,*d) )
|
if( !pSong->HasStepsTypeAndDifficulty(st,*d) )
|
||||||
goto skip_song;
|
goto skip_song;
|
||||||
return pSong;
|
return iSelection;
|
||||||
}
|
}
|
||||||
skip_song:
|
skip_song:
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
}
|
return 0;
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_CurWheelItemData[m_iSelection]->m_pSong;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,6 +76,8 @@ public:
|
|||||||
bool WheelIsLocked() { return (m_WheelState == STATE_LOCKED ? true : false); }
|
bool WheelIsLocked() { return (m_WheelState == STATE_LOCKED ? true : false); }
|
||||||
void RebuildMusicWheelItems();
|
void RebuildMusicWheelItems();
|
||||||
|
|
||||||
|
int GetPreferredSelectionForRandomOrPortal();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void GetSongList(vector<Song*> &arraySongs, SortOrder so, CString sPreferredGroup );
|
void GetSongList(vector<Song*> &arraySongs, SortOrder so, CString sPreferredGroup );
|
||||||
void BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItems, SortOrder so );
|
void BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItems, SortOrder so );
|
||||||
|
|||||||
Reference in New Issue
Block a user