FUCKING COMBO BOXES
This commit is contained in:
@@ -558,22 +558,12 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
|||||||
if (!comboItems.Any()) return default;
|
if (!comboItems.Any()) return default;
|
||||||
|
|
||||||
if (!_selectedComboItems.TryGetValue(comboName, out var selectedItem) && selectedItem == null)
|
if (!_selectedComboItems.TryGetValue(comboName, out var selectedItem) && selectedItem == null)
|
||||||
{
|
|
||||||
if (!EqualityComparer<T>.Default.Equals(initialSelectedItem, default(T)))
|
|
||||||
{
|
{
|
||||||
selectedItem = initialSelectedItem;
|
selectedItem = initialSelectedItem;
|
||||||
_selectedComboItems[comboName] = selectedItem!;
|
|
||||||
if (!EqualityComparer<T>.Default.Equals(initialSelectedItem, default))
|
|
||||||
onSelected?.Invoke(initialSelectedItem);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
selectedItem = null;
|
|
||||||
_selectedComboItems[comboName] = selectedItem;
|
_selectedComboItems[comboName] = selectedItem;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (ImGui.BeginCombo(comboName, toName((T?)selectedItem)))
|
if (ImGui.BeginCombo(comboName, selectedItem == null ? "Unset Value" : toName((T?)selectedItem)))
|
||||||
{
|
{
|
||||||
foreach (var item in comboItems)
|
foreach (var item in comboItems)
|
||||||
{
|
{
|
||||||
@@ -887,7 +877,6 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
var aliasPairs = _discordOAuthUIDs?.Result?.Select(t => new UIDAliasPair(t.Key, t.Value)).ToList() ?? [new UIDAliasPair(item.UID ?? null, null)];
|
var aliasPairs = _discordOAuthUIDs?.Result?.Select(t => new UIDAliasPair(t.Key, t.Value)).ToList() ?? [new UIDAliasPair(item.UID ?? null, null)];
|
||||||
var uidComboName = "UID###" + item.CharacterName + item.WorldId + serverUri + indexOffset;
|
var uidComboName = "UID###" + item.CharacterName + item.WorldId + serverUri + indexOffset;
|
||||||
logger?.LogInformation("Drawing Combo with name {name}", uidComboName);
|
|
||||||
DrawCombo(uidComboName, aliasPairs,
|
DrawCombo(uidComboName, aliasPairs,
|
||||||
(v) =>
|
(v) =>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user