mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2026-02-20 22:47:45 +01:00
We have config at home.
This commit is contained in:
parent
d10cb3137f
commit
80ab57e96d
13 changed files with 487 additions and 62 deletions
|
|
@ -13,7 +13,15 @@ namespace Glamourer;
|
|||
|
||||
public class Configuration : IPluginConfiguration, ISavable
|
||||
{
|
||||
public bool UseRestrictedGearProtection = true;
|
||||
public bool UseRestrictedGearProtection { get; set; } = true;
|
||||
public MainWindow.TabType SelectedTab { get; set; } = MainWindow.TabType.Settings;
|
||||
|
||||
|
||||
#if DEBUG
|
||||
public bool DebugMode { get; set; } = true;
|
||||
#else
|
||||
public bool DebugMode { get; set; } = false;
|
||||
#endif
|
||||
|
||||
public int Version { get; set; } = Constants.CurrentVersion;
|
||||
|
||||
|
|
@ -30,7 +38,7 @@ public class Configuration : IPluginConfiguration, ISavable
|
|||
}
|
||||
|
||||
public void Save()
|
||||
=> _saveService.QueueSave(this);
|
||||
=> _saveService.DelaySave(this);
|
||||
|
||||
public void Load(ConfigMigrationService migrator)
|
||||
{
|
||||
|
|
@ -68,8 +76,8 @@ public class Configuration : IPluginConfiguration, ISavable
|
|||
|
||||
public void Save(StreamWriter writer)
|
||||
{
|
||||
using var jWriter = new JsonTextWriter(writer) { Formatting = Formatting.Indented };
|
||||
var serializer = new JsonSerializer { Formatting = Formatting.Indented };
|
||||
using var jWriter = new JsonTextWriter(writer) { Formatting = Formatting.Indented };
|
||||
var serializer = new JsonSerializer { Formatting = Formatting.Indented };
|
||||
serializer.Serialize(jWriter, this);
|
||||
}
|
||||
|
||||
|
|
@ -77,4 +85,4 @@ public class Configuration : IPluginConfiguration, ISavable
|
|||
{
|
||||
public const int CurrentVersion = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue