Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: make SettingsBools saveable.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 15, 2023
1 parent 92e20db commit 1665ac3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions RotationSolver.Basic/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Dalamud.Configuration;
using Dalamud.Game.ClientState.GamePad;
using Dalamud.Logging;

namespace RotationSolver.Basic.Configuration;

Expand All @@ -22,6 +23,7 @@ public class PluginConfiguration : IPluginConfiguration
public Dictionary<uint, byte> TargetToHostileTypes { get; set; } =
new Dictionary<uint, byte>();

[JsonProperty]
private Dictionary<SettingsCommand, bool> SettingsBools { get; set; } = new Dictionary<SettingsCommand, bool>();
public bool GetValue(SettingsCommand command) => Service.Config.SettingsBools.TryGetValue(command, out var value) ? value : command.GetDefault();
public void SetValue(SettingsCommand command, bool value) => Service.Config.SettingsBools[command] = value;
Expand Down

0 comments on commit 1665ac3

Please sign in to comment.