Fix build warnings for fun

This commit is contained in:
Loporrit
2025-06-30 15:53:11 +00:00
parent c8e988abc5
commit dd42bf0913
18 changed files with 54 additions and 47 deletions

View File

@@ -661,7 +661,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
}
public T? DrawColorCombo<T>(string comboName, IEnumerable<T> comboItems, Func<T, (uint Color, string Name)> toEntry,
Action<T>? onSelected = null, T? initialSelectedItem = default)
Action<T?>? onSelected = null, T? initialSelectedItem = default)
{
if (!comboItems.Any()) return default;
@@ -689,7 +689,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
{
entry = toEntry(item);
ImGui.PushStyleColor(ImGuiCol.Text, ColorHelpers.RgbaUintToVector4(ColorHelpers.SwapEndianness(entry.Color)));
bool isSelected = EqualityComparer<T>.Default.Equals(item, (T)selectedItem);
bool isSelected = EqualityComparer<T>.Default.Equals(item, (T)selectedItem!);
if (ImGui.Selectable(entry.Name, isSelected))
{
_selectedComboItems[comboName] = item!;