From 0c07ba4f1eedde999f4d15df6c6e34b17f01cbbb Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Sun, 12 Jan 2025 21:37:29 +0100 Subject: [PATCH] DoWM retainers no longer check if you've gathered an item as MIN/BTN --- ARControl/ARControl.csproj | 2 +- ARControl/GameData/EVentureCategoryType.cs | 10 ++++++++++ ARControl/GameData/Venture.cs | 10 +++++----- ARControl/GameData/VentureResolver.cs | 15 +++++++++------ ARControl/Windows/Config/LockedItemsTab.cs | 2 +- ARControl/Windows/Config/VentureListTab.cs | 4 ++-- 6 files changed, 28 insertions(+), 15 deletions(-) create mode 100644 ARControl/GameData/EVentureCategoryType.cs diff --git a/ARControl/ARControl.csproj b/ARControl/ARControl.csproj index 33ca1e2..394b84c 100644 --- a/ARControl/ARControl.csproj +++ b/ARControl/ARControl.csproj @@ -1,6 +1,6 @@ - 6.0 + 6.1 dist diff --git a/ARControl/GameData/EVentureCategoryType.cs b/ARControl/GameData/EVentureCategoryType.cs new file mode 100644 index 0000000..7288f3c --- /dev/null +++ b/ARControl/GameData/EVentureCategoryType.cs @@ -0,0 +1,10 @@ +namespace ARControl.GameData; + +public enum EVentureCategoryType +{ + None, + MIN, + BTN, + FSH, + DoWM, +} diff --git a/ARControl/GameData/Venture.cs b/ARControl/GameData/Venture.cs index 08a50f1..c9053cb 100644 --- a/ARControl/GameData/Venture.cs +++ b/ARControl/GameData/Venture.cs @@ -63,16 +63,16 @@ internal sealed class Venture public uint RowId { get; } public ClassJobCategory Category { get; } - public string? CategoryName + public EVentureCategoryType CategoryType { get { return Category.RowId switch { - 17 => "MIN", - 18 => "BTN", - 19 => "FSH", - _ => "DoWM", + 17 => EVentureCategoryType.MIN, + 18 => EVentureCategoryType.BTN, + 19 => EVentureCategoryType.FSH, + _ => EVentureCategoryType.DoWM, }; } } diff --git a/ARControl/GameData/VentureResolver.cs b/ARControl/GameData/VentureResolver.cs index c16e7e0..aef70b6 100644 --- a/ARControl/GameData/VentureResolver.cs +++ b/ARControl/GameData/VentureResolver.cs @@ -26,23 +26,26 @@ internal sealed class VentureResolver return (null, null); } - var itemToGather = _gameCache.ItemsToGather.FirstOrDefault(x => x.ItemId == itemId); - if (itemToGather != null && !character.GatheredItems.Contains(itemToGather.GatheredItemId)) + if (venture.CategoryType != EVentureCategoryType.DoWM) { - _pluginLog.Information($"Character hasn't gathered {venture.Name} yet"); - return (null, null); + var itemToGather = _gameCache.ItemsToGather.FirstOrDefault(x => x.ItemId == itemId); + if (itemToGather != null && !character.GatheredItems.Contains(itemToGather.GatheredItemId)) + { + _pluginLog.Information($"Character hasn't gathered {venture.Name} yet"); + return (null, null); + } } _pluginLog.Debug( $"Found venture {venture.Name}, row = {venture.RowId}, checking if we have high enough stats"); VentureReward? reward = null; - if (venture.CategoryName is "MIN" or "BTN") + if (venture.CategoryType is EVentureCategoryType.MIN or EVentureCategoryType.BTN) { if (retainer.Gathering >= venture.RequiredGathering) reward = venture.Rewards.Last( x => retainer.Perception >= x.PerceptionMinerBotanist); } - else if (venture.CategoryName == "FSH") + else if (venture.CategoryType == EVentureCategoryType.FSH) { if (retainer.Gathering >= venture.RequiredGathering) reward = venture.Rewards.Last( diff --git a/ARControl/Windows/Config/LockedItemsTab.cs b/ARControl/Windows/Config/LockedItemsTab.cs index 7fa45fd..77ef86f 100644 --- a/ARControl/Windows/Config/LockedItemsTab.cs +++ b/ARControl/Windows/Config/LockedItemsTab.cs @@ -241,7 +241,7 @@ internal sealed class LockedItemsTab : ITab } // check if we are the correct job - bool enabled = character.Retainers.Any(x => item.Ventures.Any(v => v.MatchesJob(x.Job))); + bool enabled = character.Retainers.Any(x => item.Ventures.Any(v => v.CategoryType != EVentureCategoryType.DoWM && v.MatchesJob(x.Job))); if (enabled) { // do we have it gathered on this char? diff --git a/ARControl/Windows/Config/VentureListTab.cs b/ARControl/Windows/Config/VentureListTab.cs index 00e47bf..2d912f9 100644 --- a/ARControl/Windows/Config/VentureListTab.cs +++ b/ARControl/Windows/Config/VentureListTab.cs @@ -226,7 +226,7 @@ internal sealed class VentureListTab : ITab ImGui.SetNextItemWidth(130 * ImGuiHelpers.GlobalScale); int quantity = item.RemainingQuantity; - if (ImGui.InputInt($"{venture.Name} ({string.Join(" ", ventures.Select(x => x.CategoryName))})", + if (ImGui.InputInt($"{venture.Name} ({string.Join(" ", ventures.Select(x => x.CategoryType.ToString()))})", ref quantity, 100)) { item.RemainingQuantity = quantity; @@ -452,7 +452,7 @@ internal sealed class VentureListTab : ITab .Select(x => new { Venture = x.First(), - CategoryNames = x.Select(y => y.CategoryName) + CategoryNames = x.Select(y => y.CategoryType.ToString()) })) { IDalamudTextureWrap? icon = _iconCache.GetIcon(filtered.Venture.IconId);