MouseWheels are pretty great.

This commit is contained in:
Ottermandias 2024-02-05 15:21:29 +01:00
parent 5e37f8d2e8
commit 1fefe7366c
22 changed files with 250 additions and 88 deletions

View file

@ -10,7 +10,7 @@ using Penumbra.GameData.Structs;
namespace Glamourer.Gui.Equipment;
public sealed class GlamourerColorCombo(float _comboWidth, DictStain _stains, FavoriteManager _favorites)
: FilterComboColors(_comboWidth, CreateFunc(_stains, _favorites), Glamourer.Log)
: FilterComboColors(_comboWidth, MouseWheelType.Unmodified, CreateFunc(_stains, _favorites), Glamourer.Log)
{
protected override bool DrawSelectable(int globalIdx, bool selected)
{
@ -36,6 +36,9 @@ public sealed class GlamourerColorCombo(float _comboWidth, DictStain _stains, Fa
return base.DrawSelectable(globalIdx, selected);
}
public override bool Draw(string label, uint color, string name, bool found, bool gloss, float previewWidth)
=> base.Draw(label, color, name, found, gloss, previewWidth);
private static Func<IReadOnlyList<KeyValuePair<byte, (string Name, uint Color, bool Gloss)>>> CreateFunc(DictStain stains,
FavoriteManager favorites)
=> () => stains.Select(kvp => (kvp, favorites.Contains(kvp.Key))).OrderBy(p => !p.Item2).Select(p => p.kvp)

View file

@ -24,7 +24,7 @@ public sealed class ItemCombo : FilterComboCache<EquipItem>
public Variant CustomVariant { get; private set; }
public ItemCombo(IDataManager gameData, ItemManager items, EquipSlot slot, Logger log, FavoriteManager favorites)
: base(() => GetItems(favorites, items, slot), log)
: base(() => GetItems(favorites, items, slot), MouseWheelType.Unmodified, log)
{
_favorites = favorites;
Label = GetLabel(gameData, slot);

View file

@ -17,7 +17,7 @@ public sealed class WeaponCombo : FilterComboCache<EquipItem>
private float _innerWidth;
public WeaponCombo(ItemManager items, FullEquipType type, Logger log)
: base(() => GetWeapons(items, type), log)
: base(() => GetWeapons(items, type), MouseWheelType.Unmodified, log)
{
Label = GetLabel(type);
SearchByParts = true;