add TestInitialScreen, remove ScreenTestMode. It's more convenient to enable/disable testing with one Prefrence than having to change 1 Preference + 1 metric
This commit is contained in:
@@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
static RString PLAYER_COLOR_NAME( size_t p ) { return ssprintf("ColorP%dCommand",int(p+1)); }
|
static RString PLAYER_COLOR_NAME( size_t p ) { return ssprintf("ColorP%dCommand",int(p+1)); }
|
||||||
|
|
||||||
ThemeMetric<RString> CommonMetrics::INITIAL_SCREEN ("Common","InitialScreen");
|
|
||||||
ThemeMetric<RString> CommonMetrics::FIRST_ATTRACT_SCREEN ("Common","FirstAttractScreen");
|
ThemeMetric<RString> CommonMetrics::FIRST_ATTRACT_SCREEN ("Common","FirstAttractScreen");
|
||||||
ThemeMetric<RString> CommonMetrics::DEFAULT_MODIFIERS ("Common","DefaultModifiers" );
|
ThemeMetric<RString> CommonMetrics::DEFAULT_MODIFIERS ("Common","DefaultModifiers" );
|
||||||
ThemeMetric1D<apActorCommands> CommonMetrics::PLAYER_COLOR ("Common",PLAYER_COLOR_NAME,NUM_PLAYERS);
|
ThemeMetric1D<apActorCommands> CommonMetrics::PLAYER_COLOR ("Common",PLAYER_COLOR_NAME,NUM_PLAYERS);
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ private:
|
|||||||
//
|
//
|
||||||
namespace CommonMetrics
|
namespace CommonMetrics
|
||||||
{
|
{
|
||||||
extern ThemeMetric<RString> INITIAL_SCREEN;
|
|
||||||
extern ThemeMetric<RString> FIRST_ATTRACT_SCREEN;
|
extern ThemeMetric<RString> FIRST_ATTRACT_SCREEN;
|
||||||
extern ThemeMetric<RString> DEFAULT_MODIFIERS;
|
extern ThemeMetric<RString> DEFAULT_MODIFIERS;
|
||||||
extern ThemeMetric1D<apActorCommands> PLAYER_COLOR; // TODO: Remove this and do all coloring in Lua
|
extern ThemeMetric1D<apActorCommands> PLAYER_COLOR; // TODO: Remove this and do all coloring in Lua
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ PrefsManager::PrefsManager() :
|
|||||||
m_bAllowUnacceleratedRenderer ( "AllowUnacceleratedRenderer", false ),
|
m_bAllowUnacceleratedRenderer ( "AllowUnacceleratedRenderer", false ),
|
||||||
m_bThreadedInput ( "ThreadedInput", true ),
|
m_bThreadedInput ( "ThreadedInput", true ),
|
||||||
m_bThreadedMovieDecode ( "ThreadedMovieDecode", true ),
|
m_bThreadedMovieDecode ( "ThreadedMovieDecode", true ),
|
||||||
m_bScreenTestMode ( "ScreenTestMode", false ),
|
m_sTestInitialScreen ( "TestInitialScreen", "" ),
|
||||||
m_bDebugLights ( "DebugLights", false ),
|
m_bDebugLights ( "DebugLights", false ),
|
||||||
m_bMonkeyInput ( "MonkeyInput", false ),
|
m_bMonkeyInput ( "MonkeyInput", false ),
|
||||||
m_sMachineName ( "MachineName", "" ),
|
m_sMachineName ( "MachineName", "" ),
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ public:
|
|||||||
Preference<bool> m_bAllowUnacceleratedRenderer;
|
Preference<bool> m_bAllowUnacceleratedRenderer;
|
||||||
Preference<bool> m_bThreadedInput;
|
Preference<bool> m_bThreadedInput;
|
||||||
Preference<bool> m_bThreadedMovieDecode;
|
Preference<bool> m_bThreadedMovieDecode;
|
||||||
Preference<bool> m_bScreenTestMode;
|
Preference<RString> m_sTestInitialScreen;
|
||||||
Preference<bool> m_bDebugLights;
|
Preference<bool> m_bDebugLights;
|
||||||
Preference<bool> m_bMonkeyInput;
|
Preference<bool> m_bMonkeyInput;
|
||||||
Preference<RString> m_sMachineName;
|
Preference<RString> m_sMachineName;
|
||||||
|
|||||||
@@ -706,18 +706,6 @@ class DebugLineAllowMultitexture : public IDebugLine
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class DebugLineScreenTestMode : public IDebugLine
|
|
||||||
{
|
|
||||||
virtual RString GetDisplayTitle() { return SCREEN_TEST_MODE.GetValue(); }
|
|
||||||
virtual bool IsEnabled() { return PREFSMAN->m_bScreenTestMode.Get(); }
|
|
||||||
virtual RString GetPageName() const { return "Theme"; }
|
|
||||||
virtual void DoAndMakeSystemMessage( RString &sMessageOut )
|
|
||||||
{
|
|
||||||
PREFSMAN->m_bScreenTestMode.Set( !PREFSMAN->m_bScreenTestMode );
|
|
||||||
IDebugLine::DoAndMakeSystemMessage( sMessageOut );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class DebugLineShowMasks : public IDebugLine
|
class DebugLineShowMasks : public IDebugLine
|
||||||
{
|
{
|
||||||
virtual RString GetDisplayTitle() { return SCREEN_SHOW_MASKS.GetValue(); }
|
virtual RString GetDisplayTitle() { return SCREEN_SHOW_MASKS.GetValue(); }
|
||||||
@@ -1146,7 +1134,6 @@ DECLARE_ONE( DebugLineMonkeyInput );
|
|||||||
DECLARE_ONE( DebugLineStats );
|
DECLARE_ONE( DebugLineStats );
|
||||||
DECLARE_ONE( DebugLineVsync );
|
DECLARE_ONE( DebugLineVsync );
|
||||||
DECLARE_ONE( DebugLineAllowMultitexture );
|
DECLARE_ONE( DebugLineAllowMultitexture );
|
||||||
DECLARE_ONE( DebugLineScreenTestMode );
|
|
||||||
DECLARE_ONE( DebugLineShowMasks );
|
DECLARE_ONE( DebugLineShowMasks );
|
||||||
DECLARE_ONE( DebugLineProfileSlot );
|
DECLARE_ONE( DebugLineProfileSlot );
|
||||||
DECLARE_ONE( DebugLineClearProfileStats );
|
DECLARE_ONE( DebugLineClearProfileStats );
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
REGISTER_SCREEN_CLASS( ScreenEnding );
|
REGISTER_SCREEN_CLASS( ScreenEnding );
|
||||||
ScreenEnding::ScreenEnding()
|
ScreenEnding::ScreenEnding()
|
||||||
{
|
{
|
||||||
if( PREFSMAN->m_bScreenTestMode )
|
if( PREFSMAN->m_sTestInitialScreen.Get() != "" )
|
||||||
{
|
{
|
||||||
PROFILEMAN->LoadFirstAvailableProfile(PLAYER_1);
|
PROFILEMAN->LoadFirstAvailableProfile(PLAYER_1);
|
||||||
PROFILEMAN->LoadFirstAvailableProfile(PLAYER_2);
|
PROFILEMAN->LoadFirstAvailableProfile(PLAYER_2);
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ void ScreenEvaluation::Init()
|
|||||||
// debugging
|
// debugging
|
||||||
//
|
//
|
||||||
|
|
||||||
if( PREFSMAN->m_bScreenTestMode && CommonMetrics::INITIAL_SCREEN == m_sName ) // Only fill StageStats with fake info if we're the InitialScreen (i.e. StageStats not already filled)
|
if( PREFSMAN->m_sTestInitialScreen.Get() == m_sName ) // Only fill StageStats with fake info if we're the InitialScreen (i.e. StageStats not already filled)
|
||||||
{
|
{
|
||||||
PROFILEMAN->LoadFirstAvailableProfile(PLAYER_1);
|
PROFILEMAN->LoadFirstAvailableProfile(PLAYER_1);
|
||||||
PROFILEMAN->LoadFirstAvailableProfile(PLAYER_2);
|
PROFILEMAN->LoadFirstAvailableProfile(PLAYER_2);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#include "InputEventPlus.h"
|
#include "InputEventPlus.h"
|
||||||
#include "InputMapper.h"
|
#include "InputMapper.h"
|
||||||
|
|
||||||
// used in ScreenTestMode section
|
// used in TestScreen section
|
||||||
#include "SongManager.h"
|
#include "SongManager.h"
|
||||||
#include "Song.h"
|
#include "Song.h"
|
||||||
#include "StatsManager.h"
|
#include "StatsManager.h"
|
||||||
@@ -119,7 +119,7 @@ float ScreenNameEntry::ScrollingText::GetClosestCharYOffset( float fFakeBeat ) c
|
|||||||
REGISTER_SCREEN_CLASS( ScreenNameEntry );
|
REGISTER_SCREEN_CLASS( ScreenNameEntry );
|
||||||
ScreenNameEntry::ScreenNameEntry()
|
ScreenNameEntry::ScreenNameEntry()
|
||||||
{
|
{
|
||||||
if( PREFSMAN->m_bScreenTestMode )
|
if( PREFSMAN->m_sTestInitialScreen.Get() != "" )
|
||||||
{
|
{
|
||||||
GAMESTATE->m_bSideIsJoined[PLAYER_1] = true;
|
GAMESTATE->m_bSideIsJoined[PLAYER_1] = true;
|
||||||
GAMESTATE->m_bSideIsJoined[PLAYER_2] = true;
|
GAMESTATE->m_bSideIsJoined[PLAYER_2] = true;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ REGISTER_SCREEN_CLASS( ScreenNameEntryTraditional );
|
|||||||
|
|
||||||
void ScreenNameEntryTraditional::Init()
|
void ScreenNameEntryTraditional::Init()
|
||||||
{
|
{
|
||||||
if( PREFSMAN->m_bScreenTestMode && CommonMetrics::INITIAL_SCREEN == m_sName )
|
if( PREFSMAN->m_sTestInitialScreen.Get() == m_sName )
|
||||||
{
|
{
|
||||||
GAMESTATE->m_bSideIsJoined[PLAYER_1] = true;
|
GAMESTATE->m_bSideIsJoined[PLAYER_1] = true;
|
||||||
GAMESTATE->m_bSideIsJoined[PLAYER_2] = true;
|
GAMESTATE->m_bSideIsJoined[PLAYER_2] = true;
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ void ScreenOptionsMaster::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
if( m_iChangeMask & OPT_RESET_GAME )
|
if( m_iChangeMask & OPT_RESET_GAME )
|
||||||
{
|
{
|
||||||
StepMania::ResetGame();
|
StepMania::ResetGame();
|
||||||
m_sNextScreen = CommonMetrics::INITIAL_SCREEN;
|
m_sNextScreen = StepMania::GetInitialScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_iChangeMask & OPT_APPLY_SOUND )
|
if( m_iChangeMask & OPT_APPLY_SOUND )
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ static RageTimer g_StartedLoadingAt(RageZeroTimer);
|
|||||||
REGISTER_SCREEN_CLASS( ScreenSelectMusic );
|
REGISTER_SCREEN_CLASS( ScreenSelectMusic );
|
||||||
void ScreenSelectMusic::Init()
|
void ScreenSelectMusic::Init()
|
||||||
{
|
{
|
||||||
if( PREFSMAN->m_bScreenTestMode && CommonMetrics::INITIAL_SCREEN == m_sName )
|
if( PREFSMAN->m_sTestInitialScreen.Get() == m_sName )
|
||||||
{
|
{
|
||||||
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
|
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
|
||||||
GAMESTATE->SetCurrentStyle( GameManager::GameAndStringToStyle(GameManager::GetDefaultGame(),"versus") );
|
GAMESTATE->SetCurrentStyle( GameManager::GameAndStringToStyle(GameManager::GetDefaultGame(),"versus") );
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ void StageStats::CommitScores( bool bSummary )
|
|||||||
return; /* don't save scores in battle */
|
return; /* don't save scores in battle */
|
||||||
}
|
}
|
||||||
|
|
||||||
if( PREFSMAN->m_bScreenTestMode )
|
if( PREFSMAN->m_sTestInitialScreen.Get() != "" )
|
||||||
{
|
{
|
||||||
FOREACH_PlayerNumber( pn )
|
FOREACH_PlayerNumber( pn )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -313,6 +313,14 @@ void StepMania::ResetGame()
|
|||||||
PREFSMAN->SavePrefsToDisk();
|
PREFSMAN->SavePrefsToDisk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ThemeMetric<RString> INITIAL_SCREEN ("Common","InitialScreen");
|
||||||
|
RString StepMania::GetInitialScreen()
|
||||||
|
{
|
||||||
|
if( PREFSMAN->m_sTestInitialScreen.Get() != "" )
|
||||||
|
return PREFSMAN->m_sTestInitialScreen;
|
||||||
|
return INITIAL_SCREEN;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
static Preference<int> g_iLastSeenMemory( "LastSeenMemory", 0 );
|
static Preference<int> g_iLastSeenMemory( "LastSeenMemory", 0 );
|
||||||
#endif
|
#endif
|
||||||
@@ -1079,7 +1087,7 @@ int main(int argc, char* argv[])
|
|||||||
/* Now that GAMESTATE is reset, tell SCREENMAN to update the theme (load
|
/* Now that GAMESTATE is reset, tell SCREENMAN to update the theme (load
|
||||||
* overlay screens and global sounds), and load the initial screen. */
|
* overlay screens and global sounds), and load the initial screen. */
|
||||||
SCREENMAN->ThemeChanged();
|
SCREENMAN->ThemeChanged();
|
||||||
SCREENMAN->SetNewScreen( CommonMetrics::INITIAL_SCREEN );
|
SCREENMAN->SetNewScreen( StepMania::GetInitialScreen() );
|
||||||
|
|
||||||
// Do this after ThemeChanged so that we can show a system message
|
// Do this after ThemeChanged so that we can show a system message
|
||||||
RString sMessage;
|
RString sMessage;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ namespace StepMania
|
|||||||
void ApplyGraphicOptions();
|
void ApplyGraphicOptions();
|
||||||
void ResetPreferences();
|
void ResetPreferences();
|
||||||
void ResetGame();
|
void ResetGame();
|
||||||
|
RString GetInitialScreen();
|
||||||
void ChangeCurrentGame( const Game* g );
|
void ChangeCurrentGame( const Game* g );
|
||||||
|
|
||||||
// If successful, return filename of screenshot in sDir, else return ""
|
// If successful, return filename of screenshot in sDir, else return ""
|
||||||
|
|||||||
Reference in New Issue
Block a user