From 1b76d66c7b62d5eb4a40634a7dedc7dcfe4cb2f0 Mon Sep 17 00:00:00 2001 From: Cara Date: Tue, 5 May 2020 18:13:48 +0930 Subject: [PATCH 1/2] Use ItemUICategory for ItemSearch Matches in game display better, misses less items that are missed by ItemSearchCategory filter --- Dalamud/Interface/ItemSearchWindow.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Dalamud/Interface/ItemSearchWindow.cs b/Dalamud/Interface/ItemSearchWindow.cs index 63ce5f19f..3849037bb 100644 --- a/Dalamud/Interface/ItemSearchWindow.cs +++ b/Dalamud/Interface/ItemSearchWindow.cs @@ -87,7 +87,13 @@ namespace Dalamud.Interface ImGui.InputText("##searchbox", ref this.searchText, 32); var kinds = new List {Loc.Localize("DalamudItemSelectAll", "All")}; - kinds.AddRange(this.data.GetExcelSheet().GetRows().Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name)); + kinds.AddRange(this.data.GetExcelSheet().GetRows().Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name)); + + // Fix (hack) display of hyphen in UI Category names + for(int i = 0; i < kinds.Count; i++){ + kinds[i] = kinds[i].Replace("\u0002\u001F\u0001\u0003", "-"); + } + ImGui.Text(Loc.Localize("DalamudItemSelectCategory", "Category: ")); ImGui.SameLine(); ImGui.Combo("##kindbox", ref this.currentKind, kinds.ToArray(), @@ -125,7 +131,7 @@ namespace Dalamud.Interface if (this.currentKind != 0) { Log.Debug("Searching for C" + this.currentKind); - asyncEnum = asyncEnum.Where(x => x.ItemSearchCategory == this.currentKind); + asyncEnum = asyncEnum.Where(x => x.ItemUICategory == this.currentKind); } this.selectedItemIndex = -1; From f626b12d280757f26239de64c731882af29ef9e5 Mon Sep 17 00:00:00 2001 From: Cara Date: Wed, 6 May 2020 04:11:32 +0930 Subject: [PATCH 2/2] Perform Replace with Select --- Dalamud/Interface/ItemSearchWindow.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Dalamud/Interface/ItemSearchWindow.cs b/Dalamud/Interface/ItemSearchWindow.cs index 3849037bb..96dea4d93 100644 --- a/Dalamud/Interface/ItemSearchWindow.cs +++ b/Dalamud/Interface/ItemSearchWindow.cs @@ -87,12 +87,7 @@ namespace Dalamud.Interface ImGui.InputText("##searchbox", ref this.searchText, 32); var kinds = new List {Loc.Localize("DalamudItemSelectAll", "All")}; - kinds.AddRange(this.data.GetExcelSheet().GetRows().Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name)); - - // Fix (hack) display of hyphen in UI Category names - for(int i = 0; i < kinds.Count; i++){ - kinds[i] = kinds[i].Replace("\u0002\u001F\u0001\u0003", "-"); - } + kinds.AddRange(this.data.GetExcelSheet().GetRows().Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name.Replace("\u0002\u001F\u0001\u0003", "-"))); ImGui.Text(Loc.Localize("DalamudItemSelectCategory", "Category: ")); ImGui.SameLine();