move sprStage into ScreenWithMenu elemnts

This commit is contained in:
Chris Danford
2005-05-06 12:29:38 +00:00
parent d07c68cf26
commit 2870644190
6 changed files with 34 additions and 28 deletions
+29
View File
@@ -14,6 +14,7 @@
#define TIMER_SECONDS THEME->GetMetricF(m_sName,"TimerSeconds")
#define TIMER_STEALTH THEME->GetMetricB(m_sName,"TimerStealth")
#define STYLE_ICON THEME->GetMetricB(m_sName,"StyleIcon")
#define SHOW_STAGE THEME->GetMetricB(m_sName,"ShowStage")
#define MEMORY_CARD_ICONS THEME->GetMetricB(m_sName,"MemoryCardIcons")
#define FORCE_TIMER THEME->GetMetricB(m_sName,"ForceTimer")
#define STOP_MUSIC_ON_BACK THEME->GetMetricB(m_sName,"StopMusicOnBack")
@@ -54,6 +55,20 @@ void ScreenWithMenuElements::Init()
this->AddChild( &m_sprStyleIcon );
}
if( SHOW_STAGE && GAMESTATE->m_pCurStyle )
{
vector<Stage> vStages;
GAMESTATE->GetPossibleStages( vStages );
FOREACH_CONST( Stage, vStages, s )
{
m_sprStage[*s].Load( THEME->GetPathG(m_sName,"stage "+StageToString(*s)) );
m_sprStage[*s]->SetName( "Stage" );
SET_XY_AND_ON_COMMAND( m_sprStage[*s] );
this->AddChild( m_sprStage[*s] );
}
UpdateStage();
}
if( MEMORY_CARD_ICONS )
{
FOREACH_PlayerNumber( p )
@@ -199,6 +214,7 @@ void ScreenWithMenuElements::TweenOffScreen()
ActorUtil::OffCommand( m_autoHeader, m_sName );
ActorUtil::OffCommand( m_sprStyleIcon, m_sName );
OFF_COMMAND( m_sprStage[GAMESTATE->GetCurrentStage()] );
FOREACH_PlayerNumber( p )
ActorUtil::OffCommand( m_MemoryCardDisplay[p], m_sName );
ActorUtil::OffCommand( m_autoFooter, m_sName );
@@ -232,6 +248,19 @@ void ScreenWithMenuElements::StopTimer()
m_MenuTimer->Stop();
}
void ScreenWithMenuElements::HandleMessage( const CString& sMessage )
{
if( sMessage == MessageToString(MESSAGE_CURRENT_SONG_CHANGED) )
UpdateStage();
}
void ScreenWithMenuElements::UpdateStage()
{
// update stage counter display (long versions/marathons)
FOREACH_Stage( s )
m_sprStage[s]->SetHidden( s != GAMESTATE->GetCurrentStage() );
}
/*
* (c) 2004 Chris Danford
* All rights reserved.