Fix collection in use not updating on first load.

This commit is contained in:
Ottermandias 2022-06-18 12:45:04 +02:00
parent c097b634ab
commit 27650708f0
2 changed files with 6 additions and 2 deletions

View file

@ -81,11 +81,14 @@ public partial class ModCollection
break; break;
} }
CurrentCollectionInUse = Characters.Values.Prepend( Default ).SelectMany( c => c.GetFlattenedInheritance() ).Contains( Current );
UpdateCurrentCollectionInUse();
CollectionChanged.Invoke( type, this[ oldCollectionIdx ], newCollection, characterName ); CollectionChanged.Invoke( type, this[ oldCollectionIdx ], newCollection, characterName );
} }
private void UpdateCurrentCollectionInUse()
=> CurrentCollectionInUse = Characters.Values.Prepend( Default ).SelectMany( c => c.GetFlattenedInheritance() ).Contains( Current );
public void SetCollection( ModCollection collection, Type type, string? characterName = null ) public void SetCollection( ModCollection collection, Type type, string? characterName = null )
=> SetCollection( collection.Index, type, characterName ); => SetCollection( collection.Index, type, characterName );

View file

@ -72,6 +72,7 @@ public partial class ModCollection
CollectionChanged += SaveOnChange; CollectionChanged += SaveOnChange;
ReadCollections(); ReadCollections();
LoadCollections(); LoadCollections();
UpdateCurrentCollectionInUse();
} }
public void Dispose() public void Dispose()