diff --git a/ARDiscard/ARDiscard.csproj b/ARDiscard/ARDiscard.csproj index d2deb5b..dd3a902 100644 --- a/ARDiscard/ARDiscard.csproj +++ b/ARDiscard/ARDiscard.csproj @@ -1,7 +1,7 @@ net7.0-windows - 4.3 + 4.4 11.0 enable true diff --git a/ARDiscard/AutoDiscardPlogon.cs b/ARDiscard/AutoDiscardPlogon.cs index 3005616..5e3bebd 100644 --- a/ARDiscard/AutoDiscardPlogon.cs +++ b/ARDiscard/AutoDiscardPlogon.cs @@ -50,6 +50,7 @@ public class AutoDiscardPlogon : IDalamudPlugin _pluginInterface = pluginInterface; _configuration = (Configuration?)_pluginInterface.GetPluginConfig() ?? new Configuration(); + MigrateConfiguration(_configuration); _chatGui = chatGui; _clientState = clientState; _pluginLog = pluginLog; @@ -99,6 +100,17 @@ public class AutoDiscardPlogon : IDalamudPlugin _autoRetainerApi.OnCharacterReadyToPostProcess += DoCharacterPostProcess; } + private void MigrateConfiguration(Configuration configuration) + { + if (configuration.Version == 1) + { + configuration.ContextMenu.Enabled = true; + configuration.ContextMenu.OnlyWhenConfigIsOpen = false; + configuration.Version = 2; + _pluginInterface.SavePluginConfig(configuration); + } + } + private void CheckRetainerPostProcess(string retainerName) => CheckPostProcessInternal(PostProcessType.Retainer, retainerName, _configuration.RunAfterVenture); diff --git a/ARDiscard/Configuration.cs b/ARDiscard/Configuration.cs index 5371652..b7f49b8 100644 --- a/ARDiscard/Configuration.cs +++ b/ARDiscard/Configuration.cs @@ -5,7 +5,7 @@ namespace ARDiscard; internal sealed class Configuration : IPluginConfiguration { - public int Version { get; set; } = 1; + public int Version { get; set; } = 2; public bool RunAfterVenture { get; set; } public bool RunBeforeLogout { get; set; } public List DiscardingItems { get; set; } = new(); @@ -34,8 +34,8 @@ internal sealed class Configuration : IPluginConfiguration public sealed class ContextMenuConfiguration { - public bool Enabled { get; set; } = false; - public bool OnlyWhenConfigIsOpen { get; set; } = true; + public bool Enabled { get; set; } = true; + public bool OnlyWhenConfigIsOpen { get; set; } = false; } public sealed class PreviewConfiguration