Add roulette and random music on ScreenSelectMusic
This commit is contained in:
@@ -0,0 +1 @@
|
||||
_common menu music.ogg
|
||||
@@ -0,0 +1 @@
|
||||
_common menu music.ogg
|
||||
@@ -56,7 +56,7 @@ void BPMDisplay::Update( float fDeltaTime )
|
||||
if( m_fTimeLeftInState < 0 )
|
||||
{
|
||||
// XXX: the numbers font doesn't have "?".
|
||||
m_textBPM.SetText( (RandomFloat(0,1)>0.90) ? "???" : ssprintf("%03.0f",RandomFloat(0,600)) );
|
||||
m_textBPM.SetText( (RandomFloat(0,1)>0.90) ? "%%%" : ssprintf("%03.0f",RandomFloat(0,600)) );
|
||||
m_fTimeLeftInState = 0.2f; // reset timer
|
||||
}
|
||||
}
|
||||
|
||||
@@ -761,6 +761,10 @@ void ScreenEvaluation::MenuStart( PlayerNumber pn )
|
||||
{
|
||||
TweenOffScreen();
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
m_Grades[p].SettleImmediately();
|
||||
|
||||
|
||||
if( PREFSMAN->m_bEventMode )
|
||||
{
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
|
||||
@@ -351,7 +351,17 @@ void ScreenSelectMusic::Update( float fDeltaTime )
|
||||
/* Make sure we don't start the sample when rouletting is
|
||||
* spinning down. */
|
||||
if( m_fPlaySampleCountdown <= 0 && !m_MusicWheel.IsRouletting() )
|
||||
this->PlayMusicSample();
|
||||
{
|
||||
if( !m_sSampleMusicToPlay.empty() )
|
||||
{
|
||||
SOUNDMAN->PlayMusic(
|
||||
m_sSampleMusicToPlay,
|
||||
true,
|
||||
m_fSampleStartSeconds,
|
||||
m_fSampleLengthSeconds,
|
||||
1.5f); /* fade out for 1.5 seconds */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float fNewRotation = m_sprCDTitle.GetRotationY()+PI*fDeltaTime/2;
|
||||
@@ -809,8 +819,12 @@ void ScreenSelectMusic::AfterMusicChange()
|
||||
{
|
||||
SOUNDMAN->StopMusic();
|
||||
m_fPlaySampleCountdown = SAMPLE_MUSIC_DELAY;
|
||||
m_sSampleMusicToPlay = pSong->GetMusicPath();
|
||||
m_fSampleStartSeconds = pSong->m_fMusicSampleStartSeconds;
|
||||
m_fSampleLengthSeconds = pSong->m_fMusicSampleLengthSeconds;
|
||||
|
||||
for( int pn = 0; pn < NUM_PLAYERS; ++pn) {
|
||||
for( int pn = 0; pn < NUM_PLAYERS; ++pn)
|
||||
{
|
||||
pSong->GetNotes( m_arrayNotes[pn], GAMESTATE->GetCurrentStyleDef()->m_NotesType );
|
||||
SortNotesArrayByDifficulty( m_arrayNotes[pn] );
|
||||
}
|
||||
@@ -866,12 +880,25 @@ void ScreenSelectMusic::AfterMusicChange()
|
||||
m_Banner.LoadRoulette();
|
||||
m_BPMDisplay.SetBPMRange( 0, 0 );
|
||||
m_sprCDTitle.UnloadTexture();
|
||||
|
||||
SOUNDMAN->StopMusic();
|
||||
m_fPlaySampleCountdown = SAMPLE_MUSIC_DELAY;
|
||||
m_sSampleMusicToPlay = THEME->GetPathTo("Sounds","ScreenSelectMusic roulette music");
|
||||
m_fSampleStartSeconds = -1;
|
||||
m_fSampleLengthSeconds = -1;
|
||||
|
||||
break;
|
||||
case TYPE_RANDOM:
|
||||
if(!no_banner_change)
|
||||
m_Banner.LoadRandom();
|
||||
m_BPMDisplay.SetBPMRange( 0, 0 );
|
||||
m_sprCDTitle.UnloadTexture();
|
||||
|
||||
SOUNDMAN->StopMusic();
|
||||
m_fPlaySampleCountdown = SAMPLE_MUSIC_DELAY;
|
||||
m_sSampleMusicToPlay = THEME->GetPathTo("Sounds","ScreenSelectMusic random music");
|
||||
m_fSampleStartSeconds = -1;
|
||||
m_fSampleLengthSeconds = -1;
|
||||
break;
|
||||
default:
|
||||
ASSERT(0);
|
||||
@@ -887,21 +914,6 @@ void ScreenSelectMusic::AfterMusicChange()
|
||||
m_fPlaySampleCountdown = 0;
|
||||
}
|
||||
|
||||
void ScreenSelectMusic::PlayMusicSample()
|
||||
{
|
||||
//LOG->Trace( "ScreenSelectSong::PlayMusicSample()" );
|
||||
|
||||
Song* pSong = m_MusicWheel.GetSelectedSong();
|
||||
if( pSong && pSong->HasMusic() )
|
||||
{
|
||||
SOUNDMAN->PlayMusic(pSong->GetMusicPath(), true,
|
||||
pSong->m_fMusicSampleStartSeconds,
|
||||
pSong->m_fMusicSampleLengthSeconds,
|
||||
1.5f); /* fade out for 1.5 seconds */
|
||||
}
|
||||
// else
|
||||
// SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","ScreenSelectMusic music") );
|
||||
}
|
||||
|
||||
void ScreenSelectMusic::UpdateOptionsDisplays()
|
||||
{
|
||||
|
||||
@@ -49,7 +49,6 @@ protected:
|
||||
|
||||
void AfterNotesChange( PlayerNumber pn );
|
||||
void AfterMusicChange();
|
||||
void PlayMusicSample();
|
||||
void SortOrderChanged();
|
||||
|
||||
void UpdateOptionsDisplays();
|
||||
@@ -84,6 +83,8 @@ protected:
|
||||
bool m_bGoToOptions;
|
||||
Sprite m_sprOptionsMessage;
|
||||
float m_fPlaySampleCountdown;
|
||||
CString m_sSampleMusicToPlay;
|
||||
float m_fSampleStartSeconds, m_fSampleLengthSeconds;
|
||||
bool m_bAllowOptionsMenu, m_bAllowOptionsMenuRepeat;
|
||||
|
||||
RageSound m_soundSelect;
|
||||
|
||||
Reference in New Issue
Block a user