Fix 'Add Item' not being visible when it should be

This commit is contained in:
Liza 2024-08-31 21:11:45 +02:00
parent 4b598ed485
commit 9936205ec1
Signed by: liza
GPG Key ID: 7199F8D727D55F67
2 changed files with 7 additions and 5 deletions

View File

@ -1,6 +1,6 @@
<Project Sdk="Dalamud.NET.Sdk/9.0.2"> <Project Sdk="Dalamud.NET.Sdk/9.0.2">
<PropertyGroup> <PropertyGroup>
<Version>5.4</Version> <Version>5.5</Version>
<OutputPath>dist</OutputPath> <OutputPath>dist</OutputPath>
</PropertyGroup> </PropertyGroup>

View File

@ -416,7 +416,7 @@ internal sealed class TurnInWindow : LWindow, IPersistableWindowConfig
itemsWrapper.Save(); itemsWrapper.Save();
} }
if (_configuration.ItemsToPurchase.Any(x => if (_configuration.ItemsAvailableToPurchase.Any(x =>
itemsWrapper.GetItemsToPurchase().All(y => x.ItemId != y.ItemId))) itemsWrapper.GetItemsToPurchase().All(y => x.ItemId != y.ItemId)))
{ {
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Plus, "Add Item")) if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Plus, "Add Item"))
@ -430,7 +430,8 @@ internal sealed class TurnInWindow : LWindow, IPersistableWindowConfig
{ {
if (ImGui.MenuItem($"{reward.Name}##{purchaseOption.ItemId}")) if (ImGui.MenuItem($"{reward.Name}##{purchaseOption.ItemId}"))
{ {
itemsWrapper.Add(new Configuration.PurchasePriority { ItemId = purchaseOption.ItemId, Limit = 0 }); itemsWrapper.Add(new Configuration.PurchasePriority
{ ItemId = purchaseOption.ItemId, Limit = 0 });
itemsWrapper.Save(); itemsWrapper.Save();
ImGui.CloseCurrentPopup(); ImGui.CloseCurrentPopup();
} }
@ -441,10 +442,11 @@ internal sealed class TurnInWindow : LWindow, IPersistableWindowConfig
} }
ImGui.SameLine(); ImGui.SameLine();
}
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Cog, "Configure available Items")) if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Cog, "Configure available Items"))
_configWindow.IsOpen = true; _configWindow.IsOpen = true;
} }
}
private void DrawItemToBuy(GrandCompany grandCompany, int i, IItemsToPurchase itemsWrapper, private void DrawItemToBuy(GrandCompany grandCompany, int i, IItemsToPurchase itemsWrapper,
List<(GcRewardItem Item, string NameWithoutRetainers, string NameWithRetainers)> comboValues, float width, List<(GcRewardItem Item, string NameWithoutRetainers, string NameWithRetainers)> comboValues, float width,