diff --git a/Source/Core/General/General.cs b/Source/Core/General/General.cs index 4ac7ee6dafdf9177a325fc394c1e68ff34fcef79..528c98445567ea111856540dc4ed1180f3812885 100755 --- a/Source/Core/General/General.cs +++ b/Source/Core/General/General.cs @@ -560,6 +560,25 @@ namespace CodeImp.DoomBuilder // Cannot find that nodebuilder return null; } + + /// <summary> + /// Saves the program's configuration + /// </summary> + internal static void SaveSettings() + { + // Save settings configuration + if (!General.NoSettings) + General.Settings.Save(Path.Combine(settingspath, SETTINGS_FILE)); + } + + /// <summary> + /// Saves the game configuration settings, like engine, resources etc. + /// </summary> + internal static void SaveGameSettings() + { + // Save game configuration settings + if (configs != null) foreach (ConfigurationInfo ci in configs) ci.SaveSettings(); + } #endregion @@ -1002,13 +1021,12 @@ namespace CodeImp.DoomBuilder // Save action controls actions.SaveSettings(); - - // Save game configuration settings - if(configs != null) foreach(ConfigurationInfo ci in configs) ci.SaveSettings(); - - // Save settings configuration - if(!General.NoSettings) - settings.Save(Path.Combine(settingspath, SETTINGS_FILE)); + + // Save game settings + SaveGameSettings(); + + // Save program configuration + SaveSettings(); // Clean up if(map != null) { map.Dispose(); map = null; } diff --git a/Source/Core/Windows/ConfigForm.cs b/Source/Core/Windows/ConfigForm.cs index 9beeb28328ed6add0d5e46e642b4c506f0930107..2c272c2eb817628a67086e9aa282b488982be588 100755 --- a/Source/Core/Windows/ConfigForm.cs +++ b/Source/Core/Windows/ConfigForm.cs @@ -415,6 +415,8 @@ namespace CodeImp.DoomBuilder.Windows General.Configs[i].Enabled = ci.Enabled; if(ci.Changed) General.Configs[i].Apply(ci); } + + General.SaveGameSettings(); // Close this.DialogResult = DialogResult.OK; diff --git a/Source/Core/Windows/MainForm.cs b/Source/Core/Windows/MainForm.cs index 8185f6542cd41beab3f5daea5e261f8bbd954537..62644d825c8d1714d7f85d6a55a52bf875a6ebdf 100755 --- a/Source/Core/Windows/MainForm.cs +++ b/Source/Core/Windows/MainForm.cs @@ -2661,6 +2661,9 @@ namespace CodeImp.DoomBuilder.Windows General.Settings.WriteSetting("recentfiles.file" + i, recentitems[i].Tag.ToString()); } } + + // Save program configuration + General.SaveSettings(); } // This adds a recent file to the list @@ -2703,6 +2706,8 @@ namespace CodeImp.DoomBuilder.Windows // Hide the no recent item itemnorecent.Visible = false; + + SaveRecentFiles(); } //mxd @@ -2711,7 +2716,7 @@ namespace CodeImp.DoomBuilder.Windows foreach(ToolStripMenuItem item in recentitems) menufile.DropDownItems.Remove(item); - SaveRecentFiles(); + //SaveRecentFiles(); CreateRecentFiles(); } @@ -3429,9 +3434,12 @@ namespace CodeImp.DoomBuilder.Windows UpdateInterface(); General.Editing.UpdateCurrentEditModes(); General.Plugins.ProgramReconfigure(); - + + // Save program configuration + General.SaveSettings(); + // Reload resources if a map is open - if((General.Map != null) && cfgform.ReloadResources) General.Actions.InvokeAction("builder_reloadresources"); + if ((General.Map != null) && cfgform.ReloadResources) General.Actions.InvokeAction("builder_reloadresources"); // Redraw display RedrawDisplay(); @@ -3455,6 +3463,9 @@ namespace CodeImp.DoomBuilder.Windows ApplyShortcutKeys(); General.Colors.CreateCorrectionTable(); General.Plugins.ProgramReconfigure(); + + // Save program configuration + General.SaveSettings(); // Map opened? if(General.Map != null)