mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2026-02-24 05:31:50 +01:00
Improve item combos a bit.
This commit is contained in:
parent
ac23125b53
commit
e5fe782c17
2 changed files with 19 additions and 6 deletions
|
|
@ -5,7 +5,8 @@ using Penumbra.GameData.Structs;
|
|||
|
||||
namespace Glamourer.Gui.Equipment;
|
||||
|
||||
public abstract class BaseItemCombo(FavoriteManager favorites, ItemManager items) : FilterComboBase<BaseItemCombo.CacheItem>(new ItemFilter())
|
||||
public abstract class BaseItemCombo(FavoriteManager favorites, ItemManager items)
|
||||
: FilterComboBase<BaseItemCombo.CacheItem>(new ItemFilter(), ConfigData.Default with { ComputeWidth = true })
|
||||
{
|
||||
public abstract StringU8 Label { get; }
|
||||
|
||||
|
|
@ -34,6 +35,17 @@ public abstract class BaseItemCombo(FavoriteManager favorites, ItemManager items
|
|||
return false;
|
||||
}
|
||||
|
||||
protected override void PreDrawList()
|
||||
{
|
||||
ImStyleDouble.ItemSpacing.PushY(0)
|
||||
.PushY(ImStyleDouble.SelectableTextAlign, 0.5f);
|
||||
}
|
||||
|
||||
protected override void PostDrawList()
|
||||
{
|
||||
Im.StyleDisposable.PopUnsafe(2);
|
||||
}
|
||||
|
||||
public readonly struct CacheItem(EquipItem item)
|
||||
{
|
||||
public readonly EquipItem Item = item;
|
||||
|
|
@ -66,7 +78,7 @@ public abstract class BaseItemCombo(FavoriteManager favorites, ItemManager items
|
|||
.MaxBy(i => Im.Font.CalculateSize($"{i.Item2.Name} ({i.Item2.ModelString})").X).Item2;
|
||||
}
|
||||
|
||||
ComboWidth = Im.Font.CalculateSize($"{_longestItem.Name} ({_longestItem.Name})").X
|
||||
ComboWidth = Im.Font.CalculateSize($"{_longestItem.Name} ({_longestItem.ModelString})").X
|
||||
+ Im.Style.FrameHeight
|
||||
+ Im.Style.ItemSpacing.X * 3;
|
||||
}
|
||||
|
|
@ -79,7 +91,8 @@ public abstract class BaseItemCombo(FavoriteManager favorites, ItemManager items
|
|||
{
|
||||
UiHelpers.DrawFavoriteStar(Favorites, item.Item);
|
||||
Im.Line.Same();
|
||||
var ret = Im.Selectable(item.Name.Utf8, selected);
|
||||
Im.Cursor.Y -= Im.Style.FramePadding.Y;
|
||||
var ret = Im.Selectable(item.Name.Utf8, selected, SelectableFlags.None, new Vector2(0, Im.Style.FrameHeight));
|
||||
Im.Line.Same();
|
||||
using var color = ImGuiColor.Text.Push(Rgba32.Gray);
|
||||
ImEx.TextRightAligned(item.Model.Utf8);
|
||||
|
|
|
|||
|
|
@ -269,9 +269,9 @@ public sealed class EquipmentDrawer : IUiService
|
|||
Im.Line.Same();
|
||||
DrawApply(equipDrawData);
|
||||
}
|
||||
|
||||
|
||||
DrawEquipLabel(equipDrawData is { IsDesign: true, HasAdvancedDyes: true }, label);
|
||||
|
||||
|
||||
DrawStain(equipDrawData, false);
|
||||
if (equipDrawData.DisplayApplication)
|
||||
{
|
||||
|
|
@ -282,7 +282,7 @@ public sealed class EquipmentDrawer : IUiService
|
|||
{
|
||||
_advancedDyes.DrawButton(equipDrawData.Slot, equipDrawData.HasAdvancedDyes ? _advancedMaterialColor : ColorParameter.Default);
|
||||
}
|
||||
|
||||
|
||||
if (VerifyRestrictedGear(equipDrawData))
|
||||
{
|
||||
Im.Line.Same();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue