mirror of
https://github.com/seriocomedy/ShiftOS-C-.git
synced 2025-01-22 10:50:27 -05:00
Fix issue with game settings breaking new saves.
This commit is contained in:
parent
b2b7d4c442
commit
73ec1f27ba
1 changed files with 11 additions and 11 deletions
|
@ -54,17 +54,6 @@ static void Main(string[] args)
|
||||||
poolThread.Start();
|
poolThread.Start();
|
||||||
//Start the Windows Forms backend
|
//Start the Windows Forms backend
|
||||||
Paths.RegisterPaths(); //Sets ShiftOS path variables based on the current OS.
|
Paths.RegisterPaths(); //Sets ShiftOS path variables based on the current OS.
|
||||||
if (File.Exists(Paths.SystemDir + "settings.json"))
|
|
||||||
{
|
|
||||||
API.LoadedSettings = JsonConvert.DeserializeObject<Settings>(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.
|
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 there isn't a save folder at the directory specified by ShiftOS.Paths.SaveRoot, create a new save.
|
||||||
//If not, load that save.
|
//If not, load that save.
|
||||||
|
@ -76,6 +65,17 @@ static void Main(string[] args)
|
||||||
{
|
{
|
||||||
SaveSystem.Utilities.NewGame();
|
SaveSystem.Utilities.NewGame();
|
||||||
}
|
}
|
||||||
|
if (File.Exists(Paths.SystemDir + "settings.json"))
|
||||||
|
{
|
||||||
|
API.LoadedSettings = JsonConvert.DeserializeObject<Settings>(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
|
//Load ShiftOS skin
|
||||||
Skinning.Utilities.loadskin();
|
Skinning.Utilities.loadskin();
|
||||||
SaveSystem.ShiftoriumRegistry.UpdateShiftorium();
|
SaveSystem.ShiftoriumRegistry.UpdateShiftorium();
|
||||||
|
|
Loading…
Reference in a new issue