]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/preferences.cpp
do not remember game was switched when selected at startup, <3 @Garux
[xonotic/netradiant.git] / radiant / preferences.cpp
index 732a7401338fef4210f98d240deff67d22efc338..3794e954bc425b2ad43bf719ecae909c043e21bc 100644 (file)
@@ -285,8 +285,15 @@ void CGameDialog::GameFileImport( int value ){
 
        if ( ( *iGame )->mGameFile != m_sGameFile ) {
                m_sGameFile = ( *iGame )->mGameFile;
-               PreferencesDialog_restartRequired( "Selected Game" );
+
+               // do not trigger radiant restart when switching game on startup using Global Preferences dialog
+               if ( !onStartup ) {
+                       PreferencesDialog_restartRequired( "Selected Game" );
+               }
        }
+
+       // onStartup can only be true once, when Global Preferences are displayed at startup
+       onStartup = false;
 }
 
 void CGameDialog::GameFileExport( const Callback<void(int)> & importCallback ) const {
@@ -451,12 +458,16 @@ void CGameDialog::Init(){
        }
 
        if ( gamePrompt || !currentGameDescription ) {
+               onStartup = true;
                Create();
                DoGameDialog();
                // use m_nComboSelect to identify the game to run as and set the globals
                currentGameDescription = GameDescriptionForComboItem();
                ASSERT_NOTNULL( currentGameDescription );
        }
+       else {
+               onStartup = false;
+       }
 
        g_pGameDescription = currentGameDescription;