From 73ec1f27baf9441cbb4bba83599c4d9c467bf6a9 Mon Sep 17 00:00:00 2001 From: MichaelTheShifter Date: Tue, 5 Jul 2016 19:30:28 -0400 Subject: [PATCH] Fix issue with game settings breaking new saves. --- source/WindowsFormsApplication1/Program.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/source/WindowsFormsApplication1/Program.cs b/source/WindowsFormsApplication1/Program.cs index 555ed9c..0cb9096 100644 --- a/source/WindowsFormsApplication1/Program.cs +++ b/source/WindowsFormsApplication1/Program.cs @@ -54,17 +54,6 @@ static void Main(string[] args) poolThread.Start(); //Start the Windows Forms backend Paths.RegisterPaths(); //Sets ShiftOS path variables based on the current OS. - if (File.Exists(Paths.SystemDir + "settings.json")) - { - API.LoadedSettings = JsonConvert.DeserializeObject(File.ReadAllText(Paths.SystemDir + "settings.json")); - } - else - { - API.LoadedSettings = new Settings(); - API.LoadedSettings.MusicVolume = 50; - File.WriteAllText(Paths.SystemDir + "settings.json", JsonConvert.SerializeObject(API.LoadedSettings)); - } - Audio.LoadAudioData(); SaveSystem.Utilities.CheckForOlderSaves(); //Backs up C:\ShiftOS on Windows systems if it exists and doesn't contain a _engineInfo.txt file telling ShiftOS what engine created it. //If there isn't a save folder at the directory specified by ShiftOS.Paths.SaveRoot, create a new save. //If not, load that save. @@ -76,6 +65,17 @@ static void Main(string[] args) { SaveSystem.Utilities.NewGame(); } + if (File.Exists(Paths.SystemDir + "settings.json")) + { + API.LoadedSettings = JsonConvert.DeserializeObject(File.ReadAllText(Paths.SystemDir + "settings.json")); + } + else + { + API.LoadedSettings = new Settings(); + API.LoadedSettings.MusicVolume = 50; + File.WriteAllText(Paths.SystemDir + "settings.json", JsonConvert.SerializeObject(API.LoadedSettings)); + } + Audio.LoadAudioData(); //Load ShiftOS skin Skinning.Utilities.loadskin(); SaveSystem.ShiftoriumRegistry.UpdateShiftorium();