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
This commit is contained in:
Glenn Maynard
2004-12-07 01:47:32 +00:00
parent ba929b8e71
commit a663219b8a
2 changed files with 7 additions and 6 deletions
+3 -1
View File
@@ -12,6 +12,8 @@ StepManiaLanServer::StepManiaLanServer() { }
StepManiaLanServer::~StepManiaLanServer() { } StepManiaLanServer::~StepManiaLanServer() { }
#else #else
static Preference<float> g_fStartWait( Options, "ServerWaitSeconds", 2 );
LanPlayer::LanPlayer() LanPlayer::LanPlayer()
{ {
score = 0; score = 0;
@@ -295,7 +297,7 @@ void StepManiaLanServer::CheckReady()
//that will not use a lot of CPU. //that will not use a lot of CPU.
//When you try playing the music as soon as it's loaded //When you try playing the music as soon as it's loaded
//it will not always play ... immediately //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 //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 //during the actual loop that starts the clients. This is in an atempt
+4 -5
View File
@@ -32,6 +32,8 @@ OptionRowData g_NetworkOptionsLines[NUM_NETWORK_OPTIONS_LINES] = {
const ScreenMessage SM_DoneConnecting = ScreenMessage(SM_User+1); const ScreenMessage SM_DoneConnecting = ScreenMessage(SM_User+1);
const ScreenMessage SM_ServerNameEnter = ScreenMessage(SM_User+2); const ScreenMessage SM_ServerNameEnter = ScreenMessage(SM_User+2);
static Preference<CString> g_sLastServer( Options, "LastConnectedServer", "" );
REGISTER_SCREEN_CLASS( ScreenNetworkOptions ); REGISTER_SCREEN_CLASS( ScreenNetworkOptions );
ScreenNetworkOptions::ScreenNetworkOptions( CString sClassName ) : ScreenOptions( sClassName ) ScreenNetworkOptions::ScreenNetworkOptions( CString sClassName ) : ScreenOptions( sClassName )
{ {
@@ -79,10 +81,7 @@ void ScreenNetworkOptions::HandleScreenMessage( const ScreenMessage SM )
NSMAN->PostStartUp(sNewName); NSMAN->PostStartUp(sNewName);
NSMAN->DisplayStartupStatus(); NSMAN->DisplayStartupStatus();
UpdateConnectStatus( ); UpdateConnectStatus( );
#if defined( WITHOUT_NETWORKING ) g_sLastServer = ScreenTextEntry::s_sLastAnswer;
#else
PREFSMAN->m_sLastServer = ScreenTextEntry::s_sLastAnswer;
#endif
} }
break; break;
case SM_ServerNameEnter: case SM_ServerNameEnter:
@@ -115,7 +114,7 @@ void ScreenNetworkOptions::MenuStart( PlayerNumber pn, const InputEventType type
if ( !NSMAN->useSMserver ) if ( !NSMAN->useSMserver )
{ {
VIRTUALKB.Reset(VKMODE_IP); 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 { else {
NSMAN->CloseConnection(); NSMAN->CloseConnection();