Initial commit: AetherBags + KamiToolKit for FC Gitea
Debug Build and Test / Build against Latest Dalamud (push) Has been cancelled
Debug Build and Test / Build against Staging Dalamud (push) Has been cancelled

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-08 14:46:31 -05:00
commit 8db4ce6094
375 changed files with 34124 additions and 0 deletions
@@ -0,0 +1,37 @@
using System.Text.RegularExpressions;
using KamiToolKit.Nodes;
using Lumina.Excel.Sheets;
namespace KamiToolKit.Premade.SearchAddons;
public class ItemSearchAddonBase<T> : BaseSearchAddon<Item, T> where T : ListItemNode<Item>, new() {
protected override int Comparer(Item left, Item right, string sortingString, bool reversed) {
var result = sortingString switch {
"Alphabetical" => string.CompareOrdinal(left.Name.ToString(), right.Name.ToString()),
"Id" => left.RowId.CompareTo(right.RowId),
_ => 0,
};
return reversed ? -result : result;
}
protected override bool IsMatch(Item item, string searchString) {
var isDescriptionSearch = searchString.StartsWith('$');
if (isDescriptionSearch) {
searchString = searchString[1..];
}
var regex = new Regex(searchString,RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (regex.IsMatch(item.RowId.ToString())) return true;
if (regex.IsMatch(item.Name.ToString())) return true;
if (regex.IsMatch(item.Description.ToString()) && isDescriptionSearch) return true;
if (regex.IsMatch(item.LevelEquip.ToString())) return true;
if (regex.IsMatch(item.LevelItem.RowId.ToString())) return true;
if (regex.IsMatch(item.ClassJobCategory.Value.Name.ToString())) return true;
if (regex.IsMatch(item.ItemUICategory.Value.Name.ToString())) return true;
return false;
}
}