Use ItemUICategory for ItemSearch

Matches in game display better, misses less items that are missed by ItemSearchCategory filter
This commit is contained in:
Cara 2020-05-05 18:13:48 +09:30
parent a086ad47ac
commit 1b76d66c7b

View file

@ -87,7 +87,13 @@ namespace Dalamud.Interface
ImGui.InputText("##searchbox", ref this.searchText, 32);
var kinds = new List<string> {Loc.Localize("DalamudItemSelectAll", "All")};
kinds.AddRange(this.data.GetExcelSheet<ItemSearchCategory>().GetRows().Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name));
kinds.AddRange(this.data.GetExcelSheet<ItemUICategory>().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;