From 74674cfa0c52d6e24dd63276a35e274c7ebdf29b Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Fri, 23 May 2025 10:47:47 +0200 Subject: [PATCH] Make combos start from preview selection if possible. --- Glamourer/Gui/Customization/CustomizationDrawer.Color.cs | 2 +- Glamourer/Gui/Tabs/DesignTab/DesignColorCombo.cs | 8 -------- OtterGui | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/Glamourer/Gui/Customization/CustomizationDrawer.Color.cs b/Glamourer/Gui/Customization/CustomizationDrawer.Color.cs index 4cc6ac3..8db07ff 100644 --- a/Glamourer/Gui/Customization/CustomizationDrawer.Color.cs +++ b/Glamourer/Gui/Customization/CustomizationDrawer.Color.cs @@ -37,7 +37,7 @@ public partial class CustomizationDrawer using var dragDropTarget = ImUtf8.DragDropTarget(); if (!dragDropTarget.Success || !dragDropTarget.IsDropping("##colorDragDrop"u8)) return; - + var idx = _set.DataByValue(_draggedColorType, _draggedColorValue, out var draggedData, _customize.Face); var bestMatch = _draggedColorValue; if (draggedData.HasValue) diff --git a/Glamourer/Gui/Tabs/DesignTab/DesignColorCombo.cs b/Glamourer/Gui/Tabs/DesignTab/DesignColorCombo.cs index 9444ff7..0efa358 100644 --- a/Glamourer/Gui/Tabs/DesignTab/DesignColorCombo.cs +++ b/Glamourer/Gui/Tabs/DesignTab/DesignColorCombo.cs @@ -1,7 +1,6 @@ using Glamourer.Designs; using ImGuiNET; using OtterGui; -using OtterGui.Extensions; using OtterGui.Raii; using OtterGui.Widgets; @@ -13,13 +12,6 @@ public sealed class DesignColorCombo(DesignColors _designColors, bool _skipAutom : _designColors.Keys.OrderBy(k => k).Prepend(DesignColors.AutomaticName), MouseWheelType.Control, Glamourer.Log) { - protected override void OnMouseWheel(string preview, ref int current, int steps) - { - if (CurrentSelectionIdx < 0) - CurrentSelectionIdx = Items.IndexOf(preview); - base.OnMouseWheel(preview, ref current, steps); - } - protected override bool DrawSelectable(int globalIdx, bool selected) { var isAutomatic = !_skipAutomatic && globalIdx == 0; diff --git a/OtterGui b/OtterGui index 9aeda9a..421874a 160000 --- a/OtterGui +++ b/OtterGui @@ -1 +1 @@ -Subproject commit 9aeda9a892d9b971e32b10db21a8daf9c0b9ee53 +Subproject commit 421874a12540b7f8c1279dcc6a92e895a94d2fbc