Fixed multiple file glitch for settings.

This commit is contained in:
2017-06-07 12:15:24 -07:00
parent d3aab3661a
commit d05198cd56
3 changed files with 4 additions and 2 deletions

View File

@ -37,7 +37,7 @@ namespace Revitalize
/// Get Time lapse code working so that machines propperly work though the night since I technically remove them. /// Get Time lapse code working so that machines propperly work though the night since I technically remove them.
/// Art. Lots of Art. /// Art. Lots of Art.
/// Clean up the freaking code. Geeze it's messy. /// Clean up the freaking code. Geeze it's messy.
/// /// Make a cleaner serializer and parser function to be used with the settings class.
/// </summary> /// </summary>

View File

@ -12,7 +12,7 @@ namespace Revitalize.Settings
{ {
class MachineSettings : SettingsInterface class MachineSettings : SettingsInterface
{ {
public static bool doMachinesConsumePower; public bool doMachinesConsumePower;
public MachineSettings() public MachineSettings()
{ {
@ -47,6 +47,7 @@ namespace Revitalize.Settings
/// </summary> /// </summary>
public void SaveSettings() public void SaveSettings()
{ {
if (File.Exists(Path.Combine(Serialize.SettingsPath, "MachineSettings" + ".json"))) File.Delete(Path.Combine(Serialize.SettingsPath, "MachineSettings" + ".json"));
Serialize.WriteToJsonFile(Path.Combine(Serialize.SettingsPath, "MachineSettings" + ".json"), (MachineSettings)SettingsManager.machineSettings); Serialize.WriteToJsonFile(Path.Combine(Serialize.SettingsPath, "MachineSettings" + ".json"), (MachineSettings)SettingsManager.machineSettings);
} }
} }

View File

@ -8,6 +8,7 @@ using System.Threading.Tasks;
namespace Revitalize.Settings namespace Revitalize.Settings
{ {
class SettingsManager class SettingsManager
{ {