add StopCourseEarly for use in workout

This commit is contained in:
Chris Danford
2005-04-09 11:32:10 +00:00
parent e63d5762b5
commit 1adbcaa69f
2 changed files with 82 additions and 73 deletions
+1
View File
@@ -1187,6 +1187,7 @@ PlayerP1TwoPlayersTwoSidesX=SCREEN_CENTER_X-160
PlayerP2TwoPlayersTwoSidesX=SCREEN_CENTER_X+160
PlayerP1OnePlayerTwoSidesX=SCREEN_CENTER_X
PlayerP2OnePlayerTwoSidesX=SCREEN_CENTER_X
StopCourseEarly=0
[ScreenGameplayExtra]
Class=ScreenGameplay
+18 -10
View File
@@ -58,6 +58,7 @@
#define SHOW_SCORE_IN_RAVE THEME->GetMetricB(m_sName,"ShowScoreInRave")
#define SONG_POSITION_METER_WIDTH THEME->GetMetricF(m_sName,"SongPositionMeterWidth")
#define PLAYER_X( p, styleType ) THEME->GetMetricF(m_sName,ssprintf("PlayerP%d%sX",p+1,StyleTypeToString(styleType).c_str()))
#define STOP_COURSE_EARLY THEME->GetMetricB(m_sName,"StopCourseEarly") // evaluate this every time it's used
static ThemeMetric<float> INITIAL_BACKGROUND_BRIGHTNESS ("ScreenGameplay","InitialBackgroundBrightness");
static ThemeMetric<float> SECONDS_BETWEEN_COMMENTS ("ScreenGameplay","SecondsBetweenComments");
@@ -2120,19 +2121,14 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
/* If all players have *really* failed (bFailed, not the life meter or
* bFailedEarlier): */
const bool bAllReallyFailed = STATSMAN->m_CurStageStats.AllFailed();
const bool bStopCourseEarly = STOP_COURSE_EARLY;
const bool bIsLastSong = IsLastSong();
LOG->Trace( "bAllReallyFailed = %d, bStopCourseEarly = %d, bIsLastSong = %d", bAllReallyFailed, bStopCourseEarly, bIsLastSong );
if( !bAllReallyFailed && !IsLastSong() )
if( bStopCourseEarly || bAllReallyFailed || bIsLastSong )
{
/* Load the next course song. First, fade out and stop the music. */
float fFadeLengthSeconds = MUSIC_FADE_OUT_SECONDS;
RageSoundParams p = m_pSoundMusic->GetParams();
p.m_FadeLength = fFadeLengthSeconds;
p.m_LengthSeconds = GAMESTATE->m_fMusicSeconds + fFadeLengthSeconds;
m_pSoundMusic->SetParams(p);
SCREENMAN->PostMessageToTopScreen( SM_StartLoadingNextSong, fFadeLengthSeconds );
return;
}
// Time to leave from ScreenGameplay
// update dancing characters for win / lose
DancingCharacters *Dancers = m_SongBackground.GetDancingCharacters();
@@ -2205,6 +2201,18 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
SOUND->PlayOnceFromAnnouncer( "gameplay cleared" );
}
}
else
{
/* Load the next song in the course. First, fade out and stop the music. */
float fFadeLengthSeconds = MUSIC_FADE_OUT_SECONDS;
RageSoundParams p = m_pSoundMusic->GetParams();
p.m_FadeLength = fFadeLengthSeconds;
p.m_LengthSeconds = GAMESTATE->m_fMusicSeconds + fFadeLengthSeconds;
m_pSoundMusic->SetParams(p);
SCREENMAN->PostMessageToTopScreen( SM_StartLoadingNextSong, fFadeLengthSeconds );
return;
}
}
else if( SM == SM_StartLoadingNextSong )
{
m_pSoundMusic->Stop();