Allow searching by search-string parts.

This commit is contained in:
Ottermandias 2023-07-15 14:59:16 +02:00
parent 16dd81695f
commit fa4a426b79
3 changed files with 11 additions and 5 deletions

View file

@ -23,9 +23,10 @@ public sealed class ItemCombo : FilterComboCache<EquipItem>
public ItemCombo(DataManager gameData, ItemManager items, EquipSlot slot, TextureService textures) public ItemCombo(DataManager gameData, ItemManager items, EquipSlot slot, TextureService textures)
: base(() => GetItems(items, slot)) : base(() => GetItems(items, slot))
{ {
_textures = textures; _textures = textures;
Label = GetLabel(gameData, slot); Label = GetLabel(gameData, slot);
_currentItem = ItemManager.NothingId(slot); _currentItem = ItemManager.NothingId(slot);
SearchByParts = true;
} }
protected override void DrawList(float width, float itemHeight) protected override void DrawList(float width, float itemHeight)

View file

@ -19,7 +19,10 @@ public sealed class WeaponCombo : FilterComboCache<EquipItem>
public WeaponCombo(ItemManager items, FullEquipType type) public WeaponCombo(ItemManager items, FullEquipType type)
: base(() => GetWeapons(items, type)) : base(() => GetWeapons(items, type))
=> Label = GetLabel(type); {
Label = GetLabel(type);
SearchByParts = true;
}
protected override void DrawList(float width, float itemHeight) protected override void DrawList(float width, float itemHeight)
{ {

View file

@ -14,7 +14,9 @@ public sealed class ModCombo : FilterComboCache<(Mod Mod, ModSettings Settings)>
{ {
public ModCombo(PenumbraService penumbra) public ModCombo(PenumbraService penumbra)
: base(penumbra.GetMods) : base(penumbra.GetMods)
{ } {
SearchByParts = false;
}
protected override string ToString((Mod Mod, ModSettings Settings) obj) protected override string ToString((Mod Mod, ModSettings Settings) obj)
=> obj.Mod.Name; => obj.Mod.Name;