using CurrencyAlert.Enum; using Dalamud.Configuration; using Dalamud.Plugin; using System; using System.Collections.Generic; namespace CurrencyAlert { [Serializable] public class Configuration : IPluginConfiguration { public int Version { get; set; } = 5; public Dictionary AlertEnabled { get; set; } = new Dictionary(); public Dictionary Threshold { get; set; } = new Dictionary(); [NonSerialized] private DalamudPluginInterface? pluginInterface; public Configuration() { EnumHelper.Each(currency => { this.AlertEnabled[currency] = true; var defaultValue = EnumHelper.GetAttributeOfType(currency); this.Threshold[currency] = defaultValue.Value; }); } public void Initialize(DalamudPluginInterface pluginInterface) { this.pluginInterface = pluginInterface; } public void Save() { this.pluginInterface!.SavePluginConfig(this); } } }