Transition away from Screen(sName).

This commit is contained in:
Glenn Maynard
2006-01-15 18:54:03 +00:00
parent edb6479aff
commit 470c909ec6
28 changed files with 46 additions and 81 deletions
+1 -4
View File
@@ -10,10 +10,7 @@
#include "LocalizedString.h" #include "LocalizedString.h"
REGISTER_SCREEN_CLASS( ScreenBookkeeping ); REGISTER_SCREEN_CLASS_NEW( ScreenBookkeeping );
ScreenBookkeeping::ScreenBookkeeping( CString sClassName ) : ScreenWithMenuElements( sClassName )
{
}
void ScreenBookkeeping::Init() void ScreenBookkeeping::Init()
{ {
-1
View File
@@ -11,7 +11,6 @@ const int NUM_BOOKKEEPING_COLS = 4;
class ScreenBookkeeping : public ScreenWithMenuElements class ScreenBookkeeping : public ScreenWithMenuElements
{ {
public: public:
ScreenBookkeeping( CString sName );
virtual void Init(); virtual void Init();
virtual ~ScreenBookkeeping(); virtual ~ScreenBookkeeping();
+3 -5
View File
@@ -13,14 +13,12 @@
static ThemeMetric<bool> ALLOW_RESIZE("ScreenCenterImage","AllowResize"); static ThemeMetric<bool> ALLOW_RESIZE("ScreenCenterImage","AllowResize");
REGISTER_SCREEN_CLASS( ScreenCenterImage ); REGISTER_SCREEN_CLASS_NEW( ScreenCenterImage );
ScreenCenterImage::ScreenCenterImage( CString sClassName ) : ScreenWithMenuElements( sClassName )
{
ZERO( m_fScale );
}
void ScreenCenterImage::Init() void ScreenCenterImage::Init()
{ {
ZERO( m_fScale );
ScreenWithMenuElements::Init(); ScreenWithMenuElements::Init();
#if defined(XBOX) #if defined(XBOX)
-1
View File
@@ -10,7 +10,6 @@
class ScreenCenterImage : public ScreenWithMenuElements class ScreenCenterImage : public ScreenWithMenuElements
{ {
public: public:
ScreenCenterImage( CString sName );
void Init(); void Init();
virtual ~ScreenCenterImage(); virtual ~ScreenCenterImage();
+4 -6
View File
@@ -612,15 +612,13 @@ static int g_iLastInsertTapAttackTrack = -1;
static float g_fLastInsertAttackDurationSeconds = -1; static float g_fLastInsertAttackDurationSeconds = -1;
static BackgroundLayer g_CurrentBGChangeLayer = BACKGROUND_LAYER_INVALID; static BackgroundLayer g_CurrentBGChangeLayer = BACKGROUND_LAYER_INVALID;
REGISTER_SCREEN_CLASS( ScreenEdit ); REGISTER_SCREEN_CLASS_NEW( ScreenEdit );
ScreenEdit::ScreenEdit( CString sName ) : ScreenWithMenuElements( sName )
{
ASSERT( GAMESTATE->m_pCurSong );
ASSERT( GAMESTATE->m_pCurSteps[0] );
}
void ScreenEdit::Init() void ScreenEdit::Init()
{ {
ASSERT( GAMESTATE->m_pCurSong );
ASSERT( GAMESTATE->m_pCurSteps[0] );
EDIT_MODE.Load(m_sName,"EditMode"); EDIT_MODE.Load(m_sName,"EditMode");
ScreenWithMenuElements::Init(); ScreenWithMenuElements::Init();
-1
View File
@@ -148,7 +148,6 @@ struct MapEditToDI
class ScreenEdit : public ScreenWithMenuElements class ScreenEdit : public ScreenWithMenuElements
{ {
public: public:
ScreenEdit( CString sName );
virtual void Init(); virtual void Init();
virtual ~ScreenEdit(); virtual ~ScreenEdit();
virtual void Update( float fDeltaTime ); virtual void Update( float fDeltaTime );
+1 -4
View File
@@ -2,10 +2,7 @@
#include "ScreenEditCourseMods.h" #include "ScreenEditCourseMods.h"
#include "RageLog.h" #include "RageLog.h"
REGISTER_SCREEN_CLASS( ScreenEditCourseMods ); REGISTER_SCREEN_CLASS_NEW( ScreenEditCourseMods );
ScreenEditCourseMods::ScreenEditCourseMods( CString sName ) : ScreenEdit( sName )
{
}
void ScreenEditCourseMods::Init() void ScreenEditCourseMods::Init()
{ {
-2
View File
@@ -6,8 +6,6 @@
class ScreenEditCourseMods : public ScreenEdit class ScreenEditCourseMods : public ScreenEdit
{ {
public: public:
ScreenEditCourseMods( CString sName );
void Init(); void Init();
protected: protected:
+3 -5
View File
@@ -22,16 +22,14 @@
AutoScreenMessage( SM_RefreshSelector ) AutoScreenMessage( SM_RefreshSelector )
AutoScreenMessage( SM_BackFromEditDescription ) AutoScreenMessage( SM_BackFromEditDescription )
REGISTER_SCREEN_CLASS( ScreenEditMenu ); REGISTER_SCREEN_CLASS_NEW( ScreenEditMenu );
ScreenEditMenu::ScreenEditMenu( CString sName ) : ScreenWithMenuElements( sName )
void ScreenEditMenu::Init()
{ {
/* Enable all players. */ /* Enable all players. */
FOREACH_PlayerNumber( pn ) FOREACH_PlayerNumber( pn )
GAMESTATE->m_bSideIsJoined[pn] = true; GAMESTATE->m_bSideIsJoined[pn] = true;
}
void ScreenEditMenu::Init()
{
ScreenWithMenuElements::Init(); ScreenWithMenuElements::Init();
m_Selector.SetName( "EditMenu" ); m_Selector.SetName( "EditMenu" );
-1
View File
@@ -8,7 +8,6 @@
class ScreenEditMenu : public ScreenWithMenuElements class ScreenEditMenu : public ScreenWithMenuElements
{ {
public: public:
ScreenEditMenu( CString sName );
virtual void Init(); virtual void Init();
virtual void HandleScreenMessage( const ScreenMessage SM ); virtual void HandleScreenMessage( const ScreenMessage SM );
+2 -2
View File
@@ -81,8 +81,8 @@ static const int NUM_SHOWN_RADAR_CATEGORIES = 5;
AutoScreenMessage( SM_PlayCheer ) AutoScreenMessage( SM_PlayCheer )
AutoScreenMessage( SM_AddBonus ) AutoScreenMessage( SM_AddBonus )
REGISTER_SCREEN_CLASS( ScreenEvaluation ); REGISTER_SCREEN_CLASS_NEW( ScreenEvaluation );
ScreenEvaluation::ScreenEvaluation( CString sClassName ) : ScreenWithMenuElements(sClassName) ScreenEvaluation::ScreenEvaluation()
{ {
// //
// debugging // debugging
+1 -1
View File
@@ -42,7 +42,7 @@ enum StatLine
class ScreenEvaluation : public ScreenWithMenuElements class ScreenEvaluation : public ScreenWithMenuElements
{ {
public: public:
ScreenEvaluation( CString sClassName ); ScreenEvaluation();
virtual void Init(); virtual void Init();
virtual void Input( const InputEventPlus &input ); virtual void Input( const InputEventPlus &input );
virtual void HandleScreenMessage( const ScreenMessage SM ); virtual void HandleScreenMessage( const ScreenMessage SM );
@@ -106,8 +106,8 @@ public:
}; };
REGISTER_SCREEN_CLASS( ScreenEvaluationMultiplayer ); REGISTER_SCREEN_CLASS_NEW( ScreenEvaluationMultiplayer );
ScreenEvaluationMultiplayer::ScreenEvaluationMultiplayer( CString sClassName ) : ScreenWithMenuElements( sClassName ) ScreenEvaluationMultiplayer::ScreenEvaluationMultiplayer()
{ {
// //
// debugging // debugging
+1 -1
View File
@@ -21,7 +21,7 @@ enum MultiplayerJudgeLine
class ScreenEvaluationMultiplayer : public ScreenWithMenuElements class ScreenEvaluationMultiplayer : public ScreenWithMenuElements
{ {
public: public:
ScreenEvaluationMultiplayer( CString sName ); ScreenEvaluationMultiplayer();
~ScreenEvaluationMultiplayer(); ~ScreenEvaluationMultiplayer();
virtual void Init(); virtual void Init();
+4 -6
View File
@@ -69,15 +69,13 @@ const float TWEEN_TIME = 0.5f;
AutoScreenMessage( SM_NoSongs ) AutoScreenMessage( SM_NoSongs )
REGISTER_SCREEN_CLASS( ScreenEz2SelectMusic ); REGISTER_SCREEN_CLASS_NEW( ScreenEz2SelectMusic );
ScreenEz2SelectMusic::ScreenEz2SelectMusic( CString sName ) : ScreenWithMenuElements( sName )
{
/* Finish any previous stage. It's OK to call this when we havn't played a stage yet. */
GAMESTATE->FinishStage();
}
void ScreenEz2SelectMusic::Init() void ScreenEz2SelectMusic::Init()
{ {
/* Finish any previous stage. It's OK to call this when we havn't played a stage yet. */
GAMESTATE->FinishStage();
ScreenWithMenuElements::Init(); ScreenWithMenuElements::Init();
i_SkipAheadOffset = 0; i_SkipAheadOffset = 0;
-1
View File
@@ -15,7 +15,6 @@
class ScreenEz2SelectMusic : public ScreenWithMenuElements class ScreenEz2SelectMusic : public ScreenWithMenuElements
{ {
public: public:
ScreenEz2SelectMusic( CString sName );
virtual void Init(); virtual void Init();
virtual void Update( float fDeltaTime ); virtual void Update( float fDeltaTime );
+5 -14
View File
@@ -27,23 +27,14 @@
const float TWEEN_TIME = 0.35f; const float TWEEN_TIME = 0.35f;
/************************************ REGISTER_SCREEN_CLASS_NEW( ScreenEz2SelectPlayer );
ScreenEz2SelectPlayer (Constructor)
Desc: Sets up the screen display
************************************/
REGISTER_SCREEN_CLASS( ScreenEz2SelectPlayer );
ScreenEz2SelectPlayer::ScreenEz2SelectPlayer( CString sName ) : ScreenWithMenuElements( sName )
{
// Unjoin the players, then let them join back in on this screen
// GAMESTATE->m_bPlayersCanJoin = true;
FOREACH_PlayerNumber( p )
GAMESTATE->m_bSideIsJoined[p] = false;
}
void ScreenEz2SelectPlayer::Init() void ScreenEz2SelectPlayer::Init()
{ {
// Unjoin the players, then let them join back in on this screen
FOREACH_PlayerNumber( p )
GAMESTATE->m_bSideIsJoined[p] = false;
ScreenWithMenuElements::Init(); ScreenWithMenuElements::Init();
FOREACH_PlayerNumber( p ) FOREACH_PlayerNumber( p )
-1
View File
@@ -10,7 +10,6 @@
class ScreenEz2SelectPlayer : public ScreenWithMenuElements class ScreenEz2SelectPlayer : public ScreenWithMenuElements
{ {
public: public:
ScreenEz2SelectPlayer( CString sName );
virtual void Init(); virtual void Init();
virtual ~ScreenEz2SelectPlayer(); virtual ~ScreenEz2SelectPlayer();
+1 -4
View File
@@ -2,10 +2,7 @@
#include "ScreenInstructions.h" #include "ScreenInstructions.h"
REGISTER_SCREEN_CLASS( ScreenInstructions ); REGISTER_SCREEN_CLASS_NEW( ScreenInstructions );
ScreenInstructions::ScreenInstructions( CString sName ) : ScreenWithMenuElements( sName )
{
}
void ScreenInstructions::Init() void ScreenInstructions::Init()
{ {
-1
View File
@@ -6,7 +6,6 @@
class ScreenInstructions : public ScreenWithMenuElements class ScreenInstructions : public ScreenWithMenuElements
{ {
public: public:
ScreenInstructions( CString sName );
virtual void Init(); virtual void Init();
virtual void Input( const InputEventPlus &input ); virtual void Input( const InputEventPlus &input );
+2 -2
View File
@@ -24,8 +24,8 @@ static const char *MultiPlayerStatusNames[] = {
XToString( MultiPlayerStatus, NUM_MultiPlayerStatus ); XToString( MultiPlayerStatus, NUM_MultiPlayerStatus );
REGISTER_SCREEN_CLASS( ScreenJoinMultiplayer ); REGISTER_SCREEN_CLASS_NEW( ScreenJoinMultiplayer );
ScreenJoinMultiplayer::ScreenJoinMultiplayer( CString sClassName ) : ScreenWithMenuElements( sClassName ) ScreenJoinMultiplayer::ScreenJoinMultiplayer()
{ {
FOREACH_MultiPlayer( p ) FOREACH_MultiPlayer( p )
{ {
+1 -1
View File
@@ -20,7 +20,7 @@ const CString& MultiPlayerStatusToString( MultiPlayerStatus i );
class ScreenJoinMultiplayer : public ScreenWithMenuElements class ScreenJoinMultiplayer : public ScreenWithMenuElements
{ {
public: public:
ScreenJoinMultiplayer( CString sName ); ScreenJoinMultiplayer();
virtual void Init(); virtual void Init();
virtual void Input( const InputEventPlus &input ); virtual void Input( const InputEventPlus &input );
+1 -4
View File
@@ -23,10 +23,7 @@ static const float g_fSecondsToWaitForInput = 0.05f;
// reserve the 3rd slot for hard-coded keys // reserve the 3rd slot for hard-coded keys
static const int NUM_CHANGABLE_SLOTS = NUM_SHOWN_GAME_TO_DEVICE_SLOTS-1; static const int NUM_CHANGABLE_SLOTS = NUM_SHOWN_GAME_TO_DEVICE_SLOTS-1;
REGISTER_SCREEN_CLASS( ScreenMapControllers ); REGISTER_SCREEN_CLASS_NEW( ScreenMapControllers );
ScreenMapControllers::ScreenMapControllers( CString sClassName ) : ScreenWithMenuElements( sClassName )
{
}
void ScreenMapControllers::Init() void ScreenMapControllers::Init()
{ {
-1
View File
@@ -14,7 +14,6 @@ enum { NUM_SHOWN_GAME_TO_DEVICE_SLOTS = 3 };
class ScreenMapControllers : public ScreenWithMenuElements class ScreenMapControllers : public ScreenWithMenuElements
{ {
public: public:
ScreenMapControllers( CString sName );
virtual void Init(); virtual void Init();
virtual void BeginScreen(); virtual void BeginScreen();
+1 -4
View File
@@ -19,10 +19,7 @@ const int NUM_SCORE_DIGITS = 9;
AutoScreenMessage( SM_GotEval ) AutoScreenMessage( SM_GotEval )
REGISTER_SCREEN_CLASS( ScreenNetEvaluation ); REGISTER_SCREEN_CLASS_NEW( ScreenNetEvaluation );
ScreenNetEvaluation::ScreenNetEvaluation (const CString & sClassName) : ScreenEvaluation( sClassName )
{
}
void ScreenNetEvaluation::Init() void ScreenNetEvaluation::Init()
{ {
-1
View File
@@ -7,7 +7,6 @@
class ScreenNetEvaluation: public ScreenEvaluation class ScreenNetEvaluation: public ScreenEvaluation
{ {
public: public:
ScreenNetEvaluation (const CString& sClassName);
virtual void Init(); virtual void Init();
protected: protected:
+12 -5
View File
@@ -21,6 +21,15 @@
#define WAIT_FOR_CHILDREN_BEFORE_TWEENING_OUT THEME->GetMetricB(m_sName,"WaitForChildrenBeforeTweeningOut") #define WAIT_FOR_CHILDREN_BEFORE_TWEENING_OUT THEME->GetMetricB(m_sName,"WaitForChildrenBeforeTweeningOut")
//REGISTER_SCREEN_CLASS( ScreenWithMenuElements ); //REGISTER_SCREEN_CLASS( ScreenWithMenuElements );
ScreenWithMenuElements::ScreenWithMenuElements()
{
m_MenuTimer = NULL;
m_textHelp = new HelpDisplay;
FOREACH_PlayerNumber( p )
m_MemoryCardDisplay[p] = NULL;
m_MenuTimer = NULL;
}
ScreenWithMenuElements::ScreenWithMenuElements( CString sClassName ) : Screen( sClassName ) ScreenWithMenuElements::ScreenWithMenuElements( CString sClassName ) : Screen( sClassName )
{ {
m_MenuTimer = NULL; m_MenuTimer = NULL;
@@ -28,17 +37,15 @@ ScreenWithMenuElements::ScreenWithMenuElements( CString sClassName ) : Screen( s
FOREACH_PlayerNumber( p ) FOREACH_PlayerNumber( p )
m_MemoryCardDisplay[p] = NULL; m_MemoryCardDisplay[p] = NULL;
m_MenuTimer = NULL; m_MenuTimer = NULL;
// Needs to be in the constructor in case a derivitive decides to skip
// itself and sends SM_GoToNextScreen to ScreenAttract.
PLAY_MUSIC .Load( m_sName, "PlayMusic" );
TIMER_SECONDS .Load( m_sName, "TimerSeconds" );
} }
void ScreenWithMenuElements::Init() void ScreenWithMenuElements::Init()
{ {
LOG->Trace( "ScreenWithMenuElements::Init()" ); LOG->Trace( "ScreenWithMenuElements::Init()" );
PLAY_MUSIC.Load( m_sName, "PlayMusic" );
TIMER_SECONDS.Load( m_sName, "TimerSeconds" );
Screen::Init(); Screen::Init();
ASSERT( this->m_SubActors.empty() ); // don't call Init twice! ASSERT( this->m_SubActors.empty() ); // don't call Init twice!
+1
View File
@@ -15,6 +15,7 @@ class MemoryCardDisplay;
class ScreenWithMenuElements : public Screen class ScreenWithMenuElements : public Screen
{ {
public: public:
ScreenWithMenuElements();
ScreenWithMenuElements( CString sName ); ScreenWithMenuElements( CString sName );
virtual void Init(); virtual void Init();
virtual void BeginScreen(); virtual void BeginScreen();