Fixed multiple file glitch for settings.
This commit is contained in:
parent
d3aab3661a
commit
d05198cd56
|
@ -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>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Revitalize.Settings
|
namespace Revitalize.Settings
|
||||||
{
|
{
|
||||||
|
|
||||||
class SettingsManager
|
class SettingsManager
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue