From 1ffeb4ae148269e0669f901a3fa0849622a94603 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Tue, 26 Sep 2023 20:28:32 +0200 Subject: [PATCH] Add Onion items as possbily discardable --- ARDiscard/ARDiscard.csproj | 2 +- ARDiscard/GameData/InternalConfiguration.cs | 11 +++++++++++ ARDiscard/Windows/ConfigWindow.cs | 3 ++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ARDiscard/ARDiscard.csproj b/ARDiscard/ARDiscard.csproj index b408d80..ed6ae10 100644 --- a/ARDiscard/ARDiscard.csproj +++ b/ARDiscard/ARDiscard.csproj @@ -1,7 +1,7 @@ net7.0-windows - 2.4 + 2.5 11.0 enable true diff --git a/ARDiscard/GameData/InternalConfiguration.cs b/ARDiscard/GameData/InternalConfiguration.cs index 24d3c91..83c9ffd 100644 --- a/ARDiscard/GameData/InternalConfiguration.cs +++ b/ARDiscard/GameData/InternalConfiguration.cs @@ -17,4 +17,15 @@ internal static class InternalConfiguration 36810, // DSR 38951, // TOP }.AsReadOnly(); + + /// + /// Items that are unique/untradeable, but should still be possible to discard. This is moreso because + /// 99% of the unique/untradeable items should NOT be selectable for discard, but these are OK. + /// + public static readonly IReadOnlyList WhitelistedItems = new List + { + 2962, // Onion Doublet + 3279, // Onion Gaskins + 3743, // Onion Patterns + }.AsReadOnly(); } diff --git a/ARDiscard/Windows/ConfigWindow.cs b/ARDiscard/Windows/ConfigWindow.cs index 319ae25..96afaf6 100644 --- a/ARDiscard/Windows/ConfigWindow.cs +++ b/ARDiscard/Windows/ConfigWindow.cs @@ -354,7 +354,8 @@ internal sealed class ConfigWindow : Window if (_allItems == null) { _allItems = _itemCache.AllItems - .Where(x => x is { IsUnique: false, IsUntradable: false, IsIndisposable: false }) + .Where(x => InternalConfiguration.WhitelistedItems.Contains(x.ItemId) || + x is { IsUnique: false, IsUntradable: false, IsIndisposable: false }) .Where(x => x.UiCategory != UiCategories.Currency && x.UiCategory != UiCategories.Crystals && x.UiCategory != UiCategories.Unobtainable) .Select(x => (x.ItemId, x.Name.ToString()))