diff --git a/PostScriptumMortarCalculator/Models/UserConfigModel.cs b/PostScriptumMortarCalculator/Models/UserConfigModel.cs index 4b60306..3d8dfdd 100644 --- a/PostScriptumMortarCalculator/Models/UserConfigModel.cs +++ b/PostScriptumMortarCalculator/Models/UserConfigModel.cs @@ -4,19 +4,11 @@ namespace PostScriptumMortarCalculator.Models { public class UserConfigModel { - [JsonProperty] public string Theme { get; set; } - [JsonProperty] public string Accent { get; set; } - [JsonProperty] public double IndicatorOpacity { get; set; } - [JsonProperty] public double GridOpacity { get; set; } + [JsonProperty] public string Theme { get; set; } = "Dark"; + [JsonProperty] public string Accent { get; set; } = "Lime"; + [JsonProperty] public double IndicatorOpacity { get; set; } = 0.25d; + [JsonProperty] public double GridOpacity { get; set; } = 0.25d; [JsonProperty] public string LastMapName { get; set; } [JsonProperty] public string LastMortarName { get; set; } - - public static UserConfigModel Default => new UserConfigModel - { - Theme = "Dark", - Accent = "Lime", - IndicatorOpacity = 0.25d, - GridOpacity = 0.25d - }; } } \ No newline at end of file diff --git a/PostScriptumMortarCalculator/Services/ConfigService.cs b/PostScriptumMortarCalculator/Services/ConfigService.cs index f1f8b80..310bc26 100644 --- a/PostScriptumMortarCalculator/Services/ConfigService.cs +++ b/PostScriptumMortarCalculator/Services/ConfigService.cs @@ -25,7 +25,7 @@ public ConfigService() public ConfigService LoadOrDefault() { if (!Directory.Exists(m_configDir) || !File.Exists(m_configFilePath)) - ActiveConfig = UserConfigModel.Default; + ActiveConfig = new UserConfigModel(); else ActiveConfig = JsonConvert.DeserializeObject(File.ReadAllText(m_configFilePath)); return this;