use RString for ScreenMessage for easier debugging

This commit is contained in:
Chris Danford
2008-07-21 12:02:13 +00:00
parent f36f6618fa
commit 568659cfa9
2 changed files with 14 additions and 8 deletions
+12 -7
View File
@@ -4,7 +4,7 @@
#include "RageUtil.h" #include "RageUtil.h"
#include "ScreenManager.h" #include "ScreenManager.h"
AutoScreenMessage( SM_PrepScreen ) AutoScreenMessage( SM_PrepNextScreen )
REGISTER_SCREEN_CLASS( ScreenSplash ); REGISTER_SCREEN_CLASS( ScreenSplash );
@@ -12,18 +12,23 @@ REGISTER_SCREEN_CLASS( ScreenSplash );
void ScreenSplash::Init() void ScreenSplash::Init()
{ {
ALLOW_START_TO_SKIP.Load( m_sName, "AllowStartToSkip" ); ALLOW_START_TO_SKIP.Load( m_sName, "AllowStartToSkip" );
MINIMUM_LOAD_DELAY_SECONDS.Load( m_sName, "MinimumLoadDelaySeconds" ); MINIMUM_SCREEN_PREPARE_DELAY_SECONDS.Load( m_sName, "MinimumScreenPrepareDelaySeconds" );
PREPARE_SCREEN.Load( m_sName, "PrepareScreen" ); PREPARE_SCREEN.Load( m_sName, "PrepareScreen" );
ScreenWithMenuElements::Init(); ScreenWithMenuElements::Init();
}
void ScreenSplash::BeginScreen()
{
ScreenWithMenuElements::BeginScreen();
/* Prep the new screen once m_sprOverlay is complete. */ /* Prep the new screen once m_sprOverlay is complete. */
this->PostScreenMessage( SM_PrepScreen, m_In.GetTweenTimeLeft() ); this->PostScreenMessage( SM_PrepNextScreen, m_In.GetTweenTimeLeft() );
} }
void ScreenSplash::HandleScreenMessage( const ScreenMessage SM ) void ScreenSplash::HandleScreenMessage( const ScreenMessage SM )
{ {
if( SM == SM_PrepScreen ) if( SM == SM_PrepNextScreen )
{ {
RageTimer length; RageTimer length;
if( PREPARE_SCREEN ) if( PREPARE_SCREEN )
@@ -32,7 +37,7 @@ void ScreenSplash::HandleScreenMessage( const ScreenMessage SM )
/* The screen load took fScreenLoadSeconds. Move on to the next screen after /* The screen load took fScreenLoadSeconds. Move on to the next screen after
* no less than MINIMUM_DELAY seconds. */ * no less than MINIMUM_DELAY seconds. */
this->PostScreenMessage( SM_GoToNextScreen, max( 0, MINIMUM_LOAD_DELAY_SECONDS-fScreenLoadSeconds) ); this->PostScreenMessage( SM_BeginFadingOut, max( 0, MINIMUM_SCREEN_PREPARE_DELAY_SECONDS-fScreenLoadSeconds) );
return; return;
} }
else if( SM == SM_BeginFadingOut ) else if( SM == SM_BeginFadingOut )
@@ -57,8 +62,8 @@ void ScreenSplash::MenuStart( const InputEventPlus &input )
return; return;
if( !ALLOW_START_TO_SKIP ) if( !ALLOW_START_TO_SKIP )
return; return;
this->ClearMessageQueue( SM_PrepScreen ); this->ClearMessageQueue( SM_PrepNextScreen );
HandleScreenMessage( SM_PrepScreen ); HandleScreenMessage( SM_PrepNextScreen );
} }
/* /*
+2 -1
View File
@@ -10,6 +10,7 @@ class ScreenSplash : public ScreenWithMenuElements
{ {
public: public:
virtual void Init(); virtual void Init();
virtual void BeginScreen();
virtual void HandleScreenMessage( const ScreenMessage SM ); virtual void HandleScreenMessage( const ScreenMessage SM );
virtual void MenuBack( const InputEventPlus &input ); virtual void MenuBack( const InputEventPlus &input );
@@ -17,7 +18,7 @@ public:
protected: protected:
ThemeMetric<bool> ALLOW_START_TO_SKIP; ThemeMetric<bool> ALLOW_START_TO_SKIP;
ThemeMetric<float> MINIMUM_LOAD_DELAY_SECONDS; ThemeMetric<float> MINIMUM_SCREEN_PREPARE_DELAY_SECONDS;
ThemeMetric<bool> PREPARE_SCREEN; ThemeMetric<bool> PREPARE_SCREEN;
}; };