mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-02 14:04:36 +01:00
Use ItemUICategory for ItemSearch
Matches in game display better, misses less items that are missed by ItemSearchCategory filter
This commit is contained in:
parent
a086ad47ac
commit
1b76d66c7b
1 changed files with 8 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue