Some current collection fixes.

This commit is contained in:
Ottermandias 2021-07-09 23:11:05 +02:00
parent 89835b437a
commit cfdff30189
2 changed files with 10 additions and 4 deletions

View file

@ -562,7 +562,7 @@ namespace Penumbra.UI
if( ImGui.Checkbox( label, ref enabled ) && oldEnabled != enabled ) if( ImGui.Checkbox( label, ref enabled ) && oldEnabled != enabled )
{ {
Mod.Settings.Settings[ group.GroupName ] ^= 1 << idx; Mod.Settings.Settings[ group.GroupName ] ^= 1 << idx;
if( Mod.Settings.Enabled ) if( Mod.Settings.Enabled && _modManager.Collections.CurrentCollection.Cache != null )
{ {
_modManager.Collections.CurrentCollection.CalculateEffectiveFileList( Mod.Data.BasePath, _modManager.Collections.CurrentCollection.CalculateEffectiveFileList( Mod.Data.BasePath,
Mod.Data.Resources.MetaManipulations.Count > 0 ); Mod.Data.Resources.MetaManipulations.Count > 0 );
@ -602,7 +602,7 @@ namespace Penumbra.UI
&& code != Mod.Settings.Settings[ group.GroupName ] ) && code != Mod.Settings.Settings[ group.GroupName ] )
{ {
Mod.Settings.Settings[ group.GroupName ] = code; Mod.Settings.Settings[ group.GroupName ] = code;
if( Mod.Settings.Enabled ) if( Mod.Settings.Enabled && _modManager.Collections.CurrentCollection.Cache != null )
{ {
_modManager.Collections.CurrentCollection.CalculateEffectiveFileList( Mod.Data.BasePath, _modManager.Collections.CurrentCollection.CalculateEffectiveFileList( Mod.Data.BasePath,
Mod.Data.Resources.MetaManipulations.Count > 0 ); Mod.Data.Resources.MetaManipulations.Count > 0 );

View file

@ -203,7 +203,10 @@ namespace Penumbra.UI
Mod.Settings.Priority = priority; Mod.Settings.Priority = priority;
var collection = _modManager.Collections.CurrentCollection; var collection = _modManager.Collections.CurrentCollection;
collection.Save( _base._plugin.PluginInterface! ); collection.Save( _base._plugin.PluginInterface! );
collection.CalculateEffectiveFileList( _modManager.BasePath, Mod.Data.Resources.MetaManipulations.Count > 0 ); if( collection.Cache != null )
{
collection.CalculateEffectiveFileList( _modManager.BasePath, Mod.Data.Resources.MetaManipulations.Count > 0 );
}
} }
if( ImGui.IsItemHovered() ) if( ImGui.IsItemHovered() )
@ -221,7 +224,10 @@ namespace Penumbra.UI
Mod.Settings.Enabled = enabled; Mod.Settings.Enabled = enabled;
var collection = _modManager.Collections.CurrentCollection; var collection = _modManager.Collections.CurrentCollection;
collection.Save( _base._plugin.PluginInterface! ); collection.Save( _base._plugin.PluginInterface! );
collection.CalculateEffectiveFileList( _modManager.BasePath, Mod.Data.Resources.MetaManipulations.Count > 0 ); if( collection.Cache != null )
{
collection.CalculateEffectiveFileList( _modManager.BasePath, Mod.Data.Resources.MetaManipulations.Count > 0 );
}
} }
} }