Fix default collection on fresh installs.

This commit is contained in:
Ottermandias 2022-09-27 14:12:31 +02:00
parent c681f1533d
commit ef418b6821

View file

@ -97,7 +97,7 @@ public partial class ModCollection
{ {
case CollectionType.Default: case CollectionType.Default:
Default = newCollection; Default = newCollection;
if( Penumbra.CharacterUtility.Ready && Penumbra.Config.EnableMods) if( Penumbra.CharacterUtility.Ready && Penumbra.Config.EnableMods )
{ {
Penumbra.ResidentResources.Reload(); Penumbra.ResidentResources.Reload();
Default.SetFiles(); Default.SetFiles();
@ -202,7 +202,7 @@ public partial class ModCollection
var configChanged = !ReadActiveCollections( out var jObject ); var configChanged = !ReadActiveCollections( out var jObject );
// Load the default collection. // Load the default collection.
var defaultName = jObject[ nameof( Default ) ]?.ToObject< string >() ?? ( configChanged ? Empty.Name : DefaultCollection ); var defaultName = jObject[ nameof( Default ) ]?.ToObject< string >() ?? ( configChanged ? DefaultCollection : Empty.Name );
var defaultIdx = GetIndexForCollectionName( defaultName ); var defaultIdx = GetIndexForCollectionName( defaultName );
if( defaultIdx < 0 ) if( defaultIdx < 0 )
{ {
@ -216,7 +216,7 @@ public partial class ModCollection
} }
// Load the interface collection. // Load the interface collection.
var interfaceName = jObject[ nameof( Interface ) ]?.ToObject< string >() ?? ( configChanged ? Empty.Name : Default.Name ); var interfaceName = jObject[ nameof( Interface ) ]?.ToObject< string >() ?? Default.Name;
var interfaceIdx = GetIndexForCollectionName( interfaceName ); var interfaceIdx = GetIndexForCollectionName( interfaceName );
if( interfaceIdx < 0 ) if( interfaceIdx < 0 )
{ {