Adds external category search
Extends the inventory filter to include searching through external category tags provided by other mods.
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using AetherBags.Helpers;
|
||||
using AetherBags.Inventory.Items;
|
||||
using AetherBags.IPC.ExternalCategorySystem;
|
||||
|
||||
namespace AetherBags.Inventory.Categories;
|
||||
|
||||
@@ -46,6 +47,11 @@ public static class InventoryFilter
|
||||
isMatch = info.Name.Contains(filterString, StringComparison.OrdinalIgnoreCase) || info.DescriptionContains(filterString);
|
||||
}
|
||||
|
||||
if (!isMatch)
|
||||
{
|
||||
isMatch = ExternalCategoryManager.MatchesSearchTag(info.Item.ItemId, filterString);
|
||||
}
|
||||
|
||||
if (isMatch != invert)
|
||||
filtered.Add(info);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user