add StopCourseEarly for use in workout
This commit is contained in:
@@ -1187,6 +1187,7 @@ PlayerP1TwoPlayersTwoSidesX=SCREEN_CENTER_X-160
|
|||||||
PlayerP2TwoPlayersTwoSidesX=SCREEN_CENTER_X+160
|
PlayerP2TwoPlayersTwoSidesX=SCREEN_CENTER_X+160
|
||||||
PlayerP1OnePlayerTwoSidesX=SCREEN_CENTER_X
|
PlayerP1OnePlayerTwoSidesX=SCREEN_CENTER_X
|
||||||
PlayerP2OnePlayerTwoSidesX=SCREEN_CENTER_X
|
PlayerP2OnePlayerTwoSidesX=SCREEN_CENTER_X
|
||||||
|
StopCourseEarly=0
|
||||||
|
|
||||||
[ScreenGameplayExtra]
|
[ScreenGameplayExtra]
|
||||||
Class=ScreenGameplay
|
Class=ScreenGameplay
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
#define SHOW_SCORE_IN_RAVE THEME->GetMetricB(m_sName,"ShowScoreInRave")
|
#define SHOW_SCORE_IN_RAVE THEME->GetMetricB(m_sName,"ShowScoreInRave")
|
||||||
#define SONG_POSITION_METER_WIDTH THEME->GetMetricF(m_sName,"SongPositionMeterWidth")
|
#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 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> INITIAL_BACKGROUND_BRIGHTNESS ("ScreenGameplay","InitialBackgroundBrightness");
|
||||||
static ThemeMetric<float> SECONDS_BETWEEN_COMMENTS ("ScreenGameplay","SecondsBetweenComments");
|
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
|
/* If all players have *really* failed (bFailed, not the life meter or
|
||||||
* bFailedEarlier): */
|
* bFailedEarlier): */
|
||||||
const bool bAllReallyFailed = STATSMAN->m_CurStageStats.AllFailed();
|
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. */
|
// Time to leave from ScreenGameplay
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
// update dancing characters for win / lose
|
// update dancing characters for win / lose
|
||||||
DancingCharacters *Dancers = m_SongBackground.GetDancingCharacters();
|
DancingCharacters *Dancers = m_SongBackground.GetDancingCharacters();
|
||||||
@@ -2205,6 +2201,18 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
SOUND->PlayOnceFromAnnouncer( "gameplay cleared" );
|
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 )
|
else if( SM == SM_StartLoadingNextSong )
|
||||||
{
|
{
|
||||||
m_pSoundMusic->Stop();
|
m_pSoundMusic->Stop();
|
||||||
|
|||||||
Reference in New Issue
Block a user