From fc52d44c9ce9151005a255f5611583b76ed48500 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Tue, 6 Feb 2024 18:01:05 +0100 Subject: [PATCH] Improve some mousewheel stuff and add some tooltips. --- .../Customization/CustomizationDrawer.Simple.cs | 2 +- Glamourer/Gui/Equipment/EquipmentDrawer.cs | 15 ++++++++------- Glamourer/Gui/Equipment/GlamourerColorCombo.cs | 3 --- OtterGui | 2 +- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Glamourer/Gui/Customization/CustomizationDrawer.Simple.cs b/Glamourer/Gui/Customization/CustomizationDrawer.Simple.cs index e684554..3e2b453 100644 --- a/Glamourer/Gui/Customization/CustomizationDrawer.Simple.cs +++ b/Glamourer/Gui/Customization/CustomizationDrawer.Simple.cs @@ -36,7 +36,7 @@ public partial class CustomizationDrawer var tmp = (int)_currentByte.Value; ImGui.SetNextItemWidth(_comboSelectorSize); if (ImGui.SliderInt("##slider", ref tmp, 0, _currentCount - 1, "%i", ImGuiSliderFlags.AlwaysClamp) - || CaptureMouseWheel(ref tmp, 0, _currentCount - 1)) + || CaptureMouseWheel(ref tmp, 0, _currentCount)) UpdateValue((CustomizeValue)tmp); } diff --git a/Glamourer/Gui/Equipment/EquipmentDrawer.cs b/Glamourer/Gui/Equipment/EquipmentDrawer.cs index 8dfa50c..c56e56e 100644 --- a/Glamourer/Gui/Equipment/EquipmentDrawer.cs +++ b/Glamourer/Gui/Equipment/EquipmentDrawer.cs @@ -7,6 +7,7 @@ using Glamourer.Unlocks; using ImGuiNET; using OtterGui; using OtterGui.Raii; +using OtterGui.Widgets; using Penumbra.GameData.DataContainers; using Penumbra.GameData.Enums; using Penumbra.GameData.Structs; @@ -139,7 +140,7 @@ public class EquipmentDrawer public bool DrawAllStain(out StainId ret, bool locked) { using var disabled = ImRaii.Disabled(locked); - var change = _stainCombo.Draw("Dye All Slots", Stain.None.RgbaColor, string.Empty, false, false); + var change = _stainCombo.Draw("Dye All Slots", Stain.None.RgbaColor, string.Empty, false, false, MouseWheelType.None); ret = Stain.None.RowIndex; if (change) if (_stainData.TryGetValue(_stainCombo.CurrentSelection.Key, out var stain)) @@ -464,12 +465,12 @@ public class EquipmentDrawer (var tt, item, var valid) = (allowRevert && !revertItem.Equals(currentItem), allowClear && !clearItem.Equals(currentItem), ImGui.GetIO().KeyCtrl) switch { - (true, true, true) => ("Right-click to clear. Control and Right-Click to revert to game.", revertItem, true), - (true, true, false) => ("Right-click to clear. Control and Right-Click to revert to game.", clearItem, true), - (true, false, true) => ("Control and Right-Click to revert to game.", revertItem, true), - (true, false, false) => ("Control and Right-Click to revert to game.", default, false), - (false, true, _) => ("Right-click to clear.", clearItem, true), - (false, false, _) => (string.Empty, default, false), + (true, true, true) => ("Right-click to clear. Control and Right-Click to revert to game.\nControl and mouse wheel to scroll.", revertItem, true), + (true, true, false) => ("Right-click to clear. Control and Right-Click to revert to game.\nControl and mouse wheel to scroll.", clearItem, true), + (true, false, true) => ("Control and Right-Click to revert to game.\nControl and mouse wheel to scroll.", revertItem, true), + (true, false, false) => ("Control and Right-Click to revert to game.\nControl and mouse wheel to scroll.", default, false), + (false, true, _) => ("Right-click to clear.\nControl and mouse wheel to scroll.", clearItem, true), + (false, false, _) => ("Control and mouse wheel to scroll.", default, false), }; ImGuiUtil.HoverTooltip(tt); diff --git a/Glamourer/Gui/Equipment/GlamourerColorCombo.cs b/Glamourer/Gui/Equipment/GlamourerColorCombo.cs index d3fde9f..527dbb5 100644 --- a/Glamourer/Gui/Equipment/GlamourerColorCombo.cs +++ b/Glamourer/Gui/Equipment/GlamourerColorCombo.cs @@ -36,9 +36,6 @@ public sealed class GlamourerColorCombo(float _comboWidth, DictStain _stains, Fa return base.DrawSelectable(globalIdx, selected); } - public override bool Draw(string label, uint color, string name, bool found, bool gloss, float previewWidth) - => base.Draw(label, color, name, found, gloss, previewWidth); - private static Func>> CreateFunc(DictStain stains, FavoriteManager favorites) => () => stains.Select(kvp => (kvp, favorites.Contains(kvp.Key))).OrderBy(p => !p.Item2).Select(p => p.kvp) diff --git a/OtterGui b/OtterGui index 2d8a03e..1a187f7 160000 --- a/OtterGui +++ b/OtterGui @@ -1 +1 @@ -Subproject commit 2d8a03eebd80e19c6936a28ab2e3a8c164cc17f3 +Subproject commit 1a187f756f2e8823197bd43db1c3383231f5eaff