diff --git a/Penumbra/Collections/CollectionManager.Active.cs b/Penumbra/Collections/CollectionManager.Active.cs index d21ad8f9..f06a574f 100644 --- a/Penumbra/Collections/CollectionManager.Active.cs +++ b/Penumbra/Collections/CollectionManager.Active.cs @@ -20,6 +20,9 @@ public partial class ModCollection // The collection currently selected for changing settings. public ModCollection Current { get; private set; } = Empty; + // The collection currently selected is in use either as an active collection or through inheritance. + public bool CurrentCollectionInUse { get; private set; } + // The collection used for general file redirections and all characters not specifically named. public ModCollection Default { get; private set; } = Empty; @@ -78,6 +81,8 @@ public partial class ModCollection break; } + CurrentCollectionInUse = Characters.Values.Prepend( Default ).SelectMany( c => c.GetFlattenedInheritance() ).Contains( Current ); + CollectionChanged.Invoke( type, this[ oldCollectionIdx ], newCollection, characterName ); } diff --git a/Penumbra/UI/ConfigWindow.Misc.cs b/Penumbra/UI/ConfigWindow.Misc.cs index 17cc424d..7d8969ee 100644 --- a/Penumbra/UI/ConfigWindow.Misc.cs +++ b/Penumbra/UI/ConfigWindow.Misc.cs @@ -101,18 +101,16 @@ public partial class ConfigWindow _ => throw new ArgumentOutOfRangeException( nameof( type ), type, null ), }; - using var combo = ImRaii.Combo( label, current.Name ); - if( !combo ) + using var combo = ImRaii.Combo( label, current.Name ); + if( combo ) { - return; - } - - foreach( var collection in Penumbra.CollectionManager.GetEnumeratorWithEmpty().Skip( withEmpty ? 0 : 1 ).OrderBy( c => c.Name ) ) - { - using var id = ImRaii.PushId( collection.Index ); - if( ImGui.Selectable( collection.Name, collection == current ) ) + foreach( var collection in Penumbra.CollectionManager.GetEnumeratorWithEmpty().Skip( withEmpty ? 0 : 1 ).OrderBy( c => c.Name ) ) { - Penumbra.CollectionManager.SetCollection( collection, type, characterName ); + using var id = ImRaii.PushId( collection.Index ); + if( ImGui.Selectable( collection.Name, collection == current ) ) + { + Penumbra.CollectionManager.SetCollection( collection, type, characterName ); + } } } } diff --git a/Penumbra/UI/ConfigWindow.ModPanel.Header.cs b/Penumbra/UI/ConfigWindow.ModPanel.Header.cs index 6830884e..4893c6da 100644 --- a/Penumbra/UI/ConfigWindow.ModPanel.Header.cs +++ b/Penumbra/UI/ConfigWindow.ModPanel.Header.cs @@ -12,17 +12,12 @@ namespace Penumbra.UI; public partial class ConfigWindow { - private partial class ModPanel : IDisposable + private partial class ModPanel { // We use a big, nice game font for the title. private readonly GameFontHandle _nameFont = Dalamud.PluginInterface.UiBuilder.GetGameFontHandle( new GameFontStyle( GameFontFamilyAndSize.Jupiter23 ) ); - public void Dispose() - { - _nameFont.Dispose(); - } - // Header data. private string _modName = string.Empty; private string _modAuthor = string.Empty; diff --git a/Penumbra/UI/ConfigWindow.ModsTab.cs b/Penumbra/UI/ConfigWindow.ModsTab.cs index f09f1423..d85ff38a 100644 --- a/Penumbra/UI/ConfigWindow.ModsTab.cs +++ b/Penumbra/UI/ConfigWindow.ModsTab.cs @@ -63,6 +63,10 @@ public partial class ConfigWindow DrawInheritedCollectionButton( 3 * buttonSize ); ImGui.SameLine(); DrawCollectionSelector( "##collectionSelector", 2 * buttonSize.X, ModCollection.Type.Current, false, null ); + if( !Penumbra.CollectionManager.CurrentCollectionInUse ) + { + ImGuiUtil.DrawTextButton( "The currently selected collection is not used in any way.", -Vector2.UnitX, Colors.PressEnterWarningBg ); + } } private static void DrawDefaultCollectionButton( Vector2 width ) @@ -112,7 +116,7 @@ public partial class ConfigWindow // The basic setup for the mod panel. // Details are in other files. - private partial class ModPanel + private partial class ModPanel : IDisposable { private readonly ConfigWindow _window; @@ -123,6 +127,11 @@ public partial class ConfigWindow public ModPanel( ConfigWindow window ) => _window = window; + public void Dispose() + { + _nameFont.Dispose(); + } + public void Draw( ModFileSystemSelector selector ) { Init( selector );