lesson mode polish

This commit is contained in:
Chris Danford
2005-09-12 08:04:47 +00:00
parent e628959ac0
commit f98cae8ae1
4 changed files with 27 additions and 6 deletions
-1
View File
@@ -238,7 +238,6 @@ int PlayerStageStats::GetLessonScoreActual() const
switch( tns )
{
case TNS_AVOIDED_MINE:
case TNS_MISS:
case TNS_BOO:
case TNS_GOOD:
case TNS_GREAT:
+3 -3
View File
@@ -1841,7 +1841,7 @@ void ScreenGameplay::Update( float fDeltaTime )
if( GIVING_UP_GOES_TO_PREV_SCREEN )
{
BackOutFromGameplay();
BeginBackingOutFromGameplay();
}
else if( GIVING_UP_GOES_TO_NEXT_SCREEN )
@@ -2069,7 +2069,7 @@ void ScreenGameplay::SendCrossedMessages()
}
}
void ScreenGameplay::BackOutFromGameplay()
void ScreenGameplay::BeginBackingOutFromGameplay()
{
m_DancingState = STATE_OUTRO;
AbortGiveUp( false );
@@ -2164,7 +2164,7 @@ void ScreenGameplay::Input( const InputEventPlus &input )
(input.DeviceI.device!=DEVICE_KEYBOARD && input.type==IET_FAST_REPEAT)) )
{
LOG->Trace("Player %i went back", input.MenuI.player+1);
BackOutFromGameplay();
BeginBackingOutFromGameplay();
}
else if( PREFSMAN->m_bDelayedBack && input.type==IET_FIRST_PRESS )
{
+1 -1
View File
@@ -144,7 +144,7 @@ protected:
void PlayAnnouncer( CString type, float fSeconds );
void UpdateLights();
void SendCrossedMessages();
void BackOutFromGameplay();
void BeginBackingOutFromGameplay();
void PlayTicks();
void UpdateSongPosition( float fDeltaTime );
+23 -1
View File
@@ -62,6 +62,13 @@ void ScreenGameplayLesson::Init()
}
this->SortByDrawOrder();
// Reset stage number (not relevant in lessons)
GAMESTATE->m_iCurrentStageIndex = 0;
// Autoplay during demonstration
FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi )
pi->GetPlayerState()->m_PlayerController = PC_AUTOPLAY;
}
void ScreenGameplayLesson::Input( const InputEventPlus &input )
@@ -94,13 +101,19 @@ void ScreenGameplayLesson::HandleScreenMessage( const ScreenMessage SM )
else
{
PlayerStageStats &pss = STATSMAN->m_CurStageStats.m_player[PLAYER_1];
bool bCleared = pss.GetLessonScoreActual() >= pss.GetLessonScoreNeeded();
int iActual = pss.GetLessonScoreActual();
int iNeeded = pss.GetLessonScoreNeeded();
bool bCleared = iActual >= iNeeded;
bool bAnyTriesLeft = m_Try + 1 < NUM_Try;
if( bCleared )
{
MESSAGEMAN->Broadcast( Message_LessonCleared );
this->HandleScreenMessage( SM_LeaveGameplay );
// Commit scores here since we don't go through an eval screen.
// Only commit if we've cleared. Don't commit if we've failed all 3 tries.
STATSMAN->m_CurStageStats.CommitScores( false );
}
else if( bAnyTriesLeft )
{
@@ -130,6 +143,11 @@ void ScreenGameplayLesson::MenuStart( PlayerNumber pn )
void ScreenGameplayLesson::MenuBack( PlayerNumber pn )
{
if( m_iCurrentPageIndex == 0 )
{
BeginBackingOutFromGameplay();
return;
}
if( m_iCurrentPageIndex == -1 )
return;
ChangeLessonPage( -1 );
@@ -150,6 +168,10 @@ void ScreenGameplayLesson::ChangeLessonPage( int iDir )
ResetAndRestartCurrentSong();
MESSAGEMAN->Broadcast( (Message)(Message_LessonTry1+m_Try) );
// Change back to the current autoplay setting (in most cases, human controlled).
FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi )
pi->GetPlayerState()->m_PlayerController = PREFSMAN->m_AutoPlay;
}
else
{