mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-24 01:19:22 +01:00
Fix some bugs and start work on new collections tab.
This commit is contained in:
parent
e9fc57022e
commit
fba5bc6820
26 changed files with 1346 additions and 717 deletions
24
Penumbra/UI/CollectionTab/WorldCombo.cs
Normal file
24
Penumbra/UI/CollectionTab/WorldCombo.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using ImGuiNET;
|
||||
using OtterGui.Widgets;
|
||||
|
||||
namespace Penumbra.UI.CollectionTab;
|
||||
|
||||
public sealed class WorldCombo : FilterComboCache<KeyValuePair<ushort, string>>
|
||||
{
|
||||
private static readonly KeyValuePair<ushort, string> AllWorldPair = new(ushort.MaxValue, "Any World");
|
||||
|
||||
public WorldCombo(IReadOnlyDictionary<ushort, string> worlds)
|
||||
: base(worlds.OrderBy(kvp => kvp.Value).Prepend(AllWorldPair))
|
||||
{
|
||||
CurrentSelection = AllWorldPair;
|
||||
CurrentSelectionIdx = 0;
|
||||
}
|
||||
|
||||
protected override string ToString(KeyValuePair<ushort, string> obj)
|
||||
=> obj.Value;
|
||||
|
||||
public bool Draw(float width)
|
||||
=> Draw("##worldCombo", CurrentSelection.Value, string.Empty, width, ImGui.GetTextLineHeightWithSpacing());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue