From a663219b8a5c481ad7d436c5d6453cd17e9954e0 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 7 Dec 2004 01:47:32 +0000 Subject: [PATCH] move a couple preferences out of PrefsManager - eventually, this will reduce the gargantuan PrefsManager - adding prefs doesn't require modifying PrefsManager.h and recompiling a lot - starting with these options because they aren't in ScreenOptionsMaster --- stepmania/src/NetworkSyncServer.cpp | 4 +++- stepmania/src/ScreenNetworkOptions.cpp | 9 ++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/stepmania/src/NetworkSyncServer.cpp b/stepmania/src/NetworkSyncServer.cpp index 29045afe49..cd7a8f43fb 100644 --- a/stepmania/src/NetworkSyncServer.cpp +++ b/stepmania/src/NetworkSyncServer.cpp @@ -12,6 +12,8 @@ StepManiaLanServer::StepManiaLanServer() { } StepManiaLanServer::~StepManiaLanServer() { } #else +static Preference g_fStartWait( Options, "ServerWaitSeconds", 2 ); + LanPlayer::LanPlayer() { score = 0; @@ -295,7 +297,7 @@ void StepManiaLanServer::CheckReady() //that will not use a lot of CPU. //When you try playing the music as soon as it's loaded //it will not always play ... immediately - usleep ( int( PREFSMAN->m_fStartWait * 1000000.0 ) ); + usleep( int( g_fStartWait * 1000000.0 ) ); //The next three loops are seperate because we want to minimize what is done //during the actual loop that starts the clients. This is in an atempt diff --git a/stepmania/src/ScreenNetworkOptions.cpp b/stepmania/src/ScreenNetworkOptions.cpp index 15d01ef54f..fd969c936a 100644 --- a/stepmania/src/ScreenNetworkOptions.cpp +++ b/stepmania/src/ScreenNetworkOptions.cpp @@ -32,6 +32,8 @@ OptionRowData g_NetworkOptionsLines[NUM_NETWORK_OPTIONS_LINES] = { const ScreenMessage SM_DoneConnecting = ScreenMessage(SM_User+1); const ScreenMessage SM_ServerNameEnter = ScreenMessage(SM_User+2); +static Preference g_sLastServer( Options, "LastConnectedServer", "" ); + REGISTER_SCREEN_CLASS( ScreenNetworkOptions ); ScreenNetworkOptions::ScreenNetworkOptions( CString sClassName ) : ScreenOptions( sClassName ) { @@ -79,10 +81,7 @@ void ScreenNetworkOptions::HandleScreenMessage( const ScreenMessage SM ) NSMAN->PostStartUp(sNewName); NSMAN->DisplayStartupStatus(); UpdateConnectStatus( ); -#if defined( WITHOUT_NETWORKING ) -#else - PREFSMAN->m_sLastServer = ScreenTextEntry::s_sLastAnswer; -#endif + g_sLastServer = ScreenTextEntry::s_sLastAnswer; } break; case SM_ServerNameEnter: @@ -115,7 +114,7 @@ void ScreenNetworkOptions::MenuStart( PlayerNumber pn, const InputEventType type if ( !NSMAN->useSMserver ) { VIRTUALKB.Reset(VKMODE_IP); - SCREENMAN->TextEntry( SM_DoneConnecting, "Enter a Network Address\n127.0.0.1 to connect to yourself", PREFSMAN->m_sLastServer ); + SCREENMAN->TextEntry( SM_DoneConnecting, "Enter a Network Address\n127.0.0.1 to connect to yourself", g_sLastServer ); } else { NSMAN->CloseConnection();