From f5d6ac8bdbd43edf11f5d7ed41d7f587c49590d6 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Tue, 28 May 2024 12:51:28 +0200 Subject: [PATCH] Fix Remove Assignment being visible for base and interface. --- Penumbra/Collections/Manager/CollectionType.cs | 3 +++ Penumbra/UI/CollectionTab/CollectionPanel.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Penumbra/Collections/Manager/CollectionType.cs b/Penumbra/Collections/Manager/CollectionType.cs index 8c51fd90..c25413b8 100644 --- a/Penumbra/Collections/Manager/CollectionType.cs +++ b/Penumbra/Collections/Manager/CollectionType.cs @@ -107,6 +107,9 @@ public static class CollectionTypeExtensions public static bool IsSpecial(this CollectionType collectionType) => collectionType < CollectionType.Default; + public static bool CanBeRemoved(this CollectionType collectionType) + => collectionType.IsSpecial() || collectionType is CollectionType.Individual; + public static readonly (CollectionType, string, string)[] Special = Enum.GetValues() .Where(IsSpecial) .Select(s => (s, s.ToName(), s.ToDescription())) diff --git a/Penumbra/UI/CollectionTab/CollectionPanel.cs b/Penumbra/UI/CollectionTab/CollectionPanel.cs index 8625335e..bb22e6a7 100644 --- a/Penumbra/UI/CollectionTab/CollectionPanel.cs +++ b/Penumbra/UI/CollectionTab/CollectionPanel.cs @@ -287,7 +287,7 @@ public sealed class CollectionPanel : IDisposable _active.SetCollection(ModCollection.Empty, type, _active.Individuals.GetGroup(identifier)); } - if (collection != null) + if (collection != null && type.CanBeRemoved()) { using var color = ImRaii.PushColor(ImGuiCol.Text, Colors.RegexWarningBorder); if (ImGui.MenuItem("Remove this assignment."))