Add warning if the currently edited collection is not in use anywhere.

This commit is contained in:
Ottermandias 2022-06-17 16:18:56 +02:00
parent abd1fd14f5
commit 61680f0afb
4 changed files with 24 additions and 17 deletions

View file

@ -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 );
}