lesson mode polish
This commit is contained in:
@@ -238,7 +238,6 @@ int PlayerStageStats::GetLessonScoreActual() const
|
|||||||
switch( tns )
|
switch( tns )
|
||||||
{
|
{
|
||||||
case TNS_AVOIDED_MINE:
|
case TNS_AVOIDED_MINE:
|
||||||
case TNS_MISS:
|
|
||||||
case TNS_BOO:
|
case TNS_BOO:
|
||||||
case TNS_GOOD:
|
case TNS_GOOD:
|
||||||
case TNS_GREAT:
|
case TNS_GREAT:
|
||||||
|
|||||||
@@ -1841,7 +1841,7 @@ void ScreenGameplay::Update( float fDeltaTime )
|
|||||||
|
|
||||||
if( GIVING_UP_GOES_TO_PREV_SCREEN )
|
if( GIVING_UP_GOES_TO_PREV_SCREEN )
|
||||||
{
|
{
|
||||||
BackOutFromGameplay();
|
BeginBackingOutFromGameplay();
|
||||||
|
|
||||||
}
|
}
|
||||||
else if( GIVING_UP_GOES_TO_NEXT_SCREEN )
|
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;
|
m_DancingState = STATE_OUTRO;
|
||||||
AbortGiveUp( false );
|
AbortGiveUp( false );
|
||||||
@@ -2164,7 +2164,7 @@ void ScreenGameplay::Input( const InputEventPlus &input )
|
|||||||
(input.DeviceI.device!=DEVICE_KEYBOARD && input.type==IET_FAST_REPEAT)) )
|
(input.DeviceI.device!=DEVICE_KEYBOARD && input.type==IET_FAST_REPEAT)) )
|
||||||
{
|
{
|
||||||
LOG->Trace("Player %i went back", input.MenuI.player+1);
|
LOG->Trace("Player %i went back", input.MenuI.player+1);
|
||||||
BackOutFromGameplay();
|
BeginBackingOutFromGameplay();
|
||||||
}
|
}
|
||||||
else if( PREFSMAN->m_bDelayedBack && input.type==IET_FIRST_PRESS )
|
else if( PREFSMAN->m_bDelayedBack && input.type==IET_FIRST_PRESS )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ protected:
|
|||||||
void PlayAnnouncer( CString type, float fSeconds );
|
void PlayAnnouncer( CString type, float fSeconds );
|
||||||
void UpdateLights();
|
void UpdateLights();
|
||||||
void SendCrossedMessages();
|
void SendCrossedMessages();
|
||||||
void BackOutFromGameplay();
|
void BeginBackingOutFromGameplay();
|
||||||
|
|
||||||
void PlayTicks();
|
void PlayTicks();
|
||||||
void UpdateSongPosition( float fDeltaTime );
|
void UpdateSongPosition( float fDeltaTime );
|
||||||
|
|||||||
@@ -62,6 +62,13 @@ void ScreenGameplayLesson::Init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
this->SortByDrawOrder();
|
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 )
|
void ScreenGameplayLesson::Input( const InputEventPlus &input )
|
||||||
@@ -94,13 +101,19 @@ void ScreenGameplayLesson::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
PlayerStageStats &pss = STATSMAN->m_CurStageStats.m_player[PLAYER_1];
|
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;
|
bool bAnyTriesLeft = m_Try + 1 < NUM_Try;
|
||||||
|
|
||||||
if( bCleared )
|
if( bCleared )
|
||||||
{
|
{
|
||||||
MESSAGEMAN->Broadcast( Message_LessonCleared );
|
MESSAGEMAN->Broadcast( Message_LessonCleared );
|
||||||
this->HandleScreenMessage( SM_LeaveGameplay );
|
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 )
|
else if( bAnyTriesLeft )
|
||||||
{
|
{
|
||||||
@@ -130,6 +143,11 @@ void ScreenGameplayLesson::MenuStart( PlayerNumber pn )
|
|||||||
|
|
||||||
void ScreenGameplayLesson::MenuBack( PlayerNumber pn )
|
void ScreenGameplayLesson::MenuBack( PlayerNumber pn )
|
||||||
{
|
{
|
||||||
|
if( m_iCurrentPageIndex == 0 )
|
||||||
|
{
|
||||||
|
BeginBackingOutFromGameplay();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if( m_iCurrentPageIndex == -1 )
|
if( m_iCurrentPageIndex == -1 )
|
||||||
return;
|
return;
|
||||||
ChangeLessonPage( -1 );
|
ChangeLessonPage( -1 );
|
||||||
@@ -150,6 +168,10 @@ void ScreenGameplayLesson::ChangeLessonPage( int iDir )
|
|||||||
ResetAndRestartCurrentSong();
|
ResetAndRestartCurrentSong();
|
||||||
|
|
||||||
MESSAGEMAN->Broadcast( (Message)(Message_LessonTry1+m_Try) );
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user