From 8f16aa7ee91fd0d350616542fa288785dae3b94b Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Mon, 2 Oct 2023 23:21:07 +0200 Subject: [PATCH] Fix collection button ids. --- Penumbra/UI/Classes/CollectionSelectHeader.cs | 11 ++++++----- Penumbra/UI/Tabs/ModsTab.cs | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Penumbra/UI/Classes/CollectionSelectHeader.cs b/Penumbra/UI/Classes/CollectionSelectHeader.cs index f4fa1b68..de2b6a34 100644 --- a/Penumbra/UI/Classes/CollectionSelectHeader.cs +++ b/Penumbra/UI/Classes/CollectionSelectHeader.cs @@ -36,10 +36,10 @@ public class CollectionSelectHeader var buttonSize = new Vector2(comboWidth * 3f / 4f, 0f); using (var _ = ImRaii.Group()) { - DrawCollectionButton(buttonSize, GetDefaultCollectionInfo()); - DrawCollectionButton(buttonSize, GetInterfaceCollectionInfo()); - DrawCollectionButton(buttonSize, GetPlayerCollectionInfo()); - DrawCollectionButton(buttonSize, GetInheritedCollectionInfo()); + DrawCollectionButton(buttonSize, GetDefaultCollectionInfo(), 1); + DrawCollectionButton(buttonSize, GetInterfaceCollectionInfo(), 2); + DrawCollectionButton(buttonSize, GetPlayerCollectionInfo(), 3); + DrawCollectionButton(buttonSize, GetInheritedCollectionInfo(), 4); _collectionCombo.Draw("##collectionSelector", comboWidth, ColorId.SelectedCollection.Value()); } @@ -126,9 +126,10 @@ public class CollectionSelectHeader }; } - private void DrawCollectionButton(Vector2 buttonWidth, (ModCollection?, string, string, bool) tuple) + private void DrawCollectionButton(Vector2 buttonWidth, (ModCollection?, string, string, bool) tuple, int id) { var (collection, name, tooltip, disabled) = tuple; + using var _ = ImRaii.PushId(id); if (ImGuiUtil.DrawDisabledButton(name, buttonWidth, tooltip, disabled)) _activeCollections.SetCollection(collection!, CollectionType.Current); ImGui.SameLine(); diff --git a/Penumbra/UI/Tabs/ModsTab.cs b/Penumbra/UI/Tabs/ModsTab.cs index 16f0180e..1e675036 100644 --- a/Penumbra/UI/Tabs/ModsTab.cs +++ b/Penumbra/UI/Tabs/ModsTab.cs @@ -146,6 +146,7 @@ public class ModsTab : ITab ImGuiUtil.HoverTooltip(lower.Length > 0 ? $"Execute '/penumbra redraw {lower}'." : $"Execute '/penumbra redraw'."); } + using var id = ImRaii.PushId("Redraw"); using var disabled = ImRaii.Disabled(_clientState.LocalPlayer == null); ImGui.SameLine(); var buttonWidth = frameHeight with { X = ImGui.GetContentRegionAvail().X / 4 };