Fix Remove Assignment being visible for base and interface.

This commit is contained in:
Ottermandias 2024-05-28 12:51:28 +02:00
parent 5d1b17f96d
commit f5d6ac8bdb
2 changed files with 4 additions and 1 deletions

View file

@ -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<CollectionType>()
.Where(IsSpecial)
.Select(s => (s, s.ToName(), s.ToDescription()))

View file

@ -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."))