show ScreenNameEntryTraditional even if no high scores were made
This commit is contained in:
@@ -138,9 +138,6 @@ ScreenNameEntryTraditional::ScreenNameEntryTraditional( CString sClassName ) : S
|
||||
{
|
||||
LOG->Trace( "ScreenNameEntryTraditional::ScreenNameEntryTraditional()" );
|
||||
|
||||
ZERO( m_NumFeats );
|
||||
ZERO( m_CurFeat );
|
||||
|
||||
if( PREFSMAN->m_bScreenTestMode )
|
||||
{
|
||||
GAMESTATE->m_bSideIsJoined[PLAYER_1] = true;
|
||||
@@ -185,37 +182,30 @@ ScreenNameEntryTraditional::ScreenNameEntryTraditional( CString sClassName ) : S
|
||||
|
||||
}
|
||||
|
||||
int p;
|
||||
|
||||
|
||||
// Find out if players deserve to enter their name
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
vector<GameState::RankingFeat> aFeats;
|
||||
GAMESTATE->GetRankingFeats( (PlayerNumber)p, aFeats );
|
||||
m_bStillEnteringName[p] = aFeats.size()>0;
|
||||
}
|
||||
|
||||
if( !AnyStillEntering() )
|
||||
{
|
||||
/* Nobody made a high score. */
|
||||
HandleScreenMessage( SM_GoToNextScreen );
|
||||
return;
|
||||
m_NumFeats[p] = g_vPlayedStageStats.size();
|
||||
m_CurFeat[p] = 0;
|
||||
}
|
||||
|
||||
m_Menu.Load( m_sName );
|
||||
this->AddChild( &m_Menu );
|
||||
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
//
|
||||
// init keyboards
|
||||
//
|
||||
{
|
||||
m_NumFeats[p] = g_vPlayedStageStats.size();
|
||||
m_CurFeat[p] = 0;
|
||||
|
||||
FOREACH_HumanPlayer( p )
|
||||
{
|
||||
// don't show keyboard if didn't make any high scores
|
||||
if( !m_bStillEnteringName[p] )
|
||||
continue; // skip
|
||||
|
||||
ASSERT( GAMESTATE->IsHumanPlayer(p) ); // they better be enabled if they made a high score!
|
||||
|
||||
m_sprNameFrame[p].SetName( ssprintf("EntryFrameP%i",p+1) );
|
||||
m_sprNameFrame[p].Load( THEME->GetPathToG( ssprintf("ScreenNameEntryTraditional name frame p%i",p+1) ) );
|
||||
SET_XY_AND_ON_COMMAND( m_sprNameFrame[p] );
|
||||
@@ -301,11 +291,19 @@ ScreenNameEntryTraditional::ScreenNameEntryTraditional( CString sClassName ) : S
|
||||
unsigned i;
|
||||
for( i = 0; i < m_textAlphabet[p].size(); ++i )
|
||||
m_textAlphabet[p][i]->FinishTweening();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// init feat displays
|
||||
//
|
||||
{
|
||||
FOREACH_HumanPlayer( p )
|
||||
{
|
||||
/* Show feat 0, hide others without tweening. Run the ON command for
|
||||
* all actors, even if we're going to hide it anyway, so any style commands
|
||||
* are run. */
|
||||
#define SET_ON( actor ) \
|
||||
#define SET_ON( actor ) \
|
||||
SET_XY_AND_ON_COMMAND( actor ); \
|
||||
if( i != 0 ) \
|
||||
{ \
|
||||
@@ -314,7 +312,7 @@ ScreenNameEntryTraditional::ScreenNameEntryTraditional( CString sClassName ) : S
|
||||
}
|
||||
|
||||
m_FeatDisplay[p].resize( m_NumFeats[p] );
|
||||
for( i = 0; int(i) < m_NumFeats[p]; ++i )
|
||||
for( int i = 0; int(i) < m_NumFeats[p]; ++i )
|
||||
{
|
||||
StageStats &ss = g_vPlayedStageStats[i];
|
||||
Song* pSong = ss.pSong;
|
||||
@@ -384,14 +382,14 @@ ScreenNameEntryTraditional::ScreenNameEntryTraditional( CString sClassName ) : S
|
||||
SET_ON( m_FeatDisplay[p][i].m_textScore );
|
||||
this->AddChild( &m_FeatDisplay[p][i].m_textScore );
|
||||
|
||||
// if( feat.Feat != "" )
|
||||
// {
|
||||
// m_FeatDisplay[p][i].m_textCategory.SetName( ssprintf("CategoryP%i", p+1) );
|
||||
// m_FeatDisplay[p][i].m_textCategory.LoadFromFont( THEME->GetPathToF("ScreenNameEntryTraditional category") );
|
||||
// m_FeatDisplay[p][i].m_textCategory.SetText( feat.Feat );
|
||||
// SET_ON( m_FeatDisplay[p][i].m_textCategory );
|
||||
// this->AddChild( &m_FeatDisplay[p][i].m_textCategory );
|
||||
// }
|
||||
// if( feat.Feat != "" )
|
||||
// {
|
||||
// m_FeatDisplay[p][i].m_textCategory.SetName( ssprintf("CategoryP%i", p+1) );
|
||||
// m_FeatDisplay[p][i].m_textCategory.LoadFromFont( THEME->GetPathToF("ScreenNameEntryTraditional category") );
|
||||
// m_FeatDisplay[p][i].m_textCategory.SetText( feat.Feat );
|
||||
// SET_ON( m_FeatDisplay[p][i].m_textCategory );
|
||||
// this->AddChild( &m_FeatDisplay[p][i].m_textCategory );
|
||||
// }
|
||||
|
||||
/* We always show the banner frame (if any), because fading from a graphic to
|
||||
* itself is ugly. */
|
||||
@@ -400,7 +398,8 @@ ScreenNameEntryTraditional::ScreenNameEntryTraditional( CString sClassName ) : S
|
||||
SET_XY_AND_ON_COMMAND( m_FeatDisplay[p][i].m_sprBannerFrame );
|
||||
this->AddChild( &m_FeatDisplay[p][i].m_sprBannerFrame );
|
||||
}
|
||||
#undef SET_ON
|
||||
#undef SET_ON
|
||||
}
|
||||
}
|
||||
|
||||
this->PostScreenMessage( SM_ChangeDisplayedFeat, FEAT_INTERVAL );
|
||||
@@ -484,6 +483,14 @@ void ScreenNameEntryTraditional::DrawPrimitives()
|
||||
DISPLAY->CameraPopMatrix();
|
||||
}
|
||||
|
||||
void ScreenNameEntryTraditional::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
||||
{
|
||||
if( m_Menu.IsTransitioning() )
|
||||
return;
|
||||
|
||||
Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
|
||||
}
|
||||
|
||||
void ScreenNameEntryTraditional::ChangeDisplayedFeat()
|
||||
{
|
||||
CHECKPOINT;
|
||||
@@ -583,7 +590,7 @@ void ScreenNameEntryTraditional::Finish( PlayerNumber pn )
|
||||
OFF_COMMAND( m_textAlphabet[pn][i] );
|
||||
OFF_COMMAND( m_sprCursor[pn] );
|
||||
|
||||
if( !AnyStillEntering() && !m_Menu.m_Out.IsTransitioning() )
|
||||
if( !AnyStillEntering() )
|
||||
m_Menu.StartTransitioning( SM_GoToNextScreen );
|
||||
}
|
||||
|
||||
@@ -598,9 +605,12 @@ void ScreenNameEntryTraditional::UpdateSelectionText( int pn )
|
||||
|
||||
void ScreenNameEntryTraditional::MenuStart( PlayerNumber pn, const InputEventType type )
|
||||
{
|
||||
if( !m_bStillEnteringName[pn] || m_Menu.IsTransitioning() )
|
||||
return;
|
||||
if( type == IET_RELEASE )
|
||||
if( !AnyStillEntering() )
|
||||
m_Menu.StartTransitioning( SM_GoToNextScreen );
|
||||
|
||||
if( !m_bStillEnteringName[pn] )
|
||||
return; // ignore
|
||||
if( type != IET_FIRST_PRESS )
|
||||
return; // ignore
|
||||
|
||||
const int CurrentSelection = m_SelectedChar[pn];
|
||||
|
||||
@@ -52,6 +52,7 @@ public:
|
||||
void Update( float fDeltaTime );
|
||||
void DrawPrimitives();
|
||||
void HandleScreenMessage( const ScreenMessage SM );
|
||||
void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
|
||||
|
||||
void MenuStart( PlayerNumber pn, const InputEventType type );
|
||||
void MenuLeft( PlayerNumber pn, const InputEventType type );
|
||||
|
||||
Reference in New Issue
Block a user