From 3bd6b6fbca06f6eb89d2068862ab515d5b28d29c Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Sat, 9 Nov 2024 12:05:29 +0100 Subject: [PATCH] Remove Red Onion Helm from internal blacklist --- ARDiscard/AutoDiscardPlogon.cs | 10 +++++++++- ARDiscard/Configuration.cs | 10 +++++++++- ARDiscard/GameData/ListManager.cs | 2 -- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ARDiscard/AutoDiscardPlogon.cs b/ARDiscard/AutoDiscardPlogon.cs index ba684e2..35007b6 100644 --- a/ARDiscard/AutoDiscardPlogon.cs +++ b/ARDiscard/AutoDiscardPlogon.cs @@ -54,7 +54,7 @@ public sealed class AutoDiscardPlogon : IDalamudPlugin ArgumentNullException.ThrowIfNull(dataManager); _pluginInterface = pluginInterface; - _configuration = (Configuration?)_pluginInterface.GetPluginConfig() ?? new Configuration(); + _configuration = (Configuration?)_pluginInterface.GetPluginConfig() ?? Configuration.CreateNew(); MigrateConfiguration(_configuration); _chatGui = chatGui; _clientState = clientState; @@ -124,6 +124,14 @@ public sealed class AutoDiscardPlogon : IDalamudPlugin configuration.Version = 2; _pluginInterface.SavePluginConfig(configuration); } + + if (configuration.Version == 2) + { + if (!configuration.BlacklistedItems.Contains(2820)) + configuration.BlacklistedItems.Add(2820); + configuration.Version = 3; + _pluginInterface.SavePluginConfig(configuration); + } } private void CheckRetainerPostProcess(string retainerName) => diff --git a/ARDiscard/Configuration.cs b/ARDiscard/Configuration.cs index ab77923..749f9e6 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; } = 2; + public int Version { get; set; } = 3; public bool RunAfterVenture { get; set; } public bool RunBeforeLogout { get; set; } public List DiscardingItems { get; set; } = new(); @@ -45,4 +45,12 @@ internal sealed class Configuration : IPluginConfiguration public bool GroupByCategory { get; set; } = true; public bool ShowIcons { get; set; } = true; } + + public static Configuration CreateNew() + { + return new Configuration + { + BlacklistedItems = [2820] + }; + } } diff --git a/ARDiscard/GameData/ListManager.cs b/ARDiscard/GameData/ListManager.cs index 184df32..0ae9293 100644 --- a/ARDiscard/GameData/ListManager.cs +++ b/ARDiscard/GameData/ListManager.cs @@ -11,8 +11,6 @@ internal sealed class ListManager : IListManager /// private ISet _blacklistedItems = new List { - 2820, // red onion helm - 16039, // ala mhigan earrings 24589, // aetheryte earrings 33648, // menphina's earrings