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 "ScreenManager.h"
AutoScreenMessage( SM_PrepScreen )
AutoScreenMessage( SM_PrepNextScreen )
REGISTER_SCREEN_CLASS( ScreenSplash );
@@ -12,18 +12,23 @@ REGISTER_SCREEN_CLASS( ScreenSplash );
void ScreenSplash::Init()
{
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" );
ScreenWithMenuElements::Init();
}
void ScreenSplash::BeginScreen()
{
ScreenWithMenuElements::BeginScreen();
/* 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 )
{
if( SM == SM_PrepScreen )
if( SM == SM_PrepNextScreen )
{
RageTimer length;
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
* 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;
}
else if( SM == SM_BeginFadingOut )
@@ -57,8 +62,8 @@ void ScreenSplash::MenuStart( const InputEventPlus &input )
return;
if( !ALLOW_START_TO_SKIP )
return;
this->ClearMessageQueue( SM_PrepScreen );
HandleScreenMessage( SM_PrepScreen );
this->ClearMessageQueue( SM_PrepNextScreen );
HandleScreenMessage( SM_PrepNextScreen );
}
/*
+2 -1
View File
@@ -10,6 +10,7 @@ class ScreenSplash : public ScreenWithMenuElements
{
public:
virtual void Init();
virtual void BeginScreen();
virtual void HandleScreenMessage( const ScreenMessage SM );
virtual void MenuBack( const InputEventPlus &input );
@@ -17,7 +18,7 @@ public:
protected:
ThemeMetric<bool> ALLOW_START_TO_SKIP;
ThemeMetric<float> MINIMUM_LOAD_DELAY_SECONDS;
ThemeMetric<float> MINIMUM_SCREEN_PREPARE_DELAY_SECONDS;
ThemeMetric<bool> PREPARE_SCREEN;
};