Potential fix for being unable to load into character select until reloading player resources.

This commit is contained in:
Ottermandias 2021-06-27 12:09:24 +02:00
parent 5952d5e312
commit e4f9bf72e2
2 changed files with 8 additions and 9 deletions

View file

@ -56,6 +56,7 @@ namespace Penumbra.Meta
private static void DisposeFile( FileInfo? file ) private static void DisposeFile( FileInfo? file )
{ {
file?.Refresh();
if( !( file?.Exists ?? false ) ) if( !( file?.Exists ?? false ) )
{ {
return; return;
@ -94,11 +95,6 @@ namespace Penumbra.Meta
public void Dispose() public void Dispose()
=> Reset(); => Reset();
~MetaManager()
{
Reset( false );
}
private void ClearDirectory() private void ClearDirectory()
{ {
_dir.Refresh(); _dir.Refresh();
@ -132,8 +128,6 @@ namespace Penumbra.Meta
kvp.Value.Write( _dir ); kvp.Value.Write( _dir );
_resolvedFiles[ kvp.Key ] = kvp.Value.CurrentFile!; _resolvedFiles[ kvp.Key ] = kvp.Value.CurrentFile!;
} }
_resourceManagement.ReloadPlayerResources();
} }
public bool ApplyMod( MetaManipulation m, Mod.Mod mod ) public bool ApplyMod( MetaManipulation m, Mod.Mod mod )

View file

@ -74,6 +74,11 @@ namespace Penumbra.Mods
collection.Cache?.UpdateMetaManipulations(); collection.Cache?.UpdateMetaManipulations();
} }
} }
if( recomputeMeta )
{
Service<GameResourceManagement>.Get().ReloadPlayerResources();
}
} }
public bool AddCollection( string name, Dictionary< string, ModSettings > settings ) public bool AddCollection( string name, Dictionary< string, ModSettings > settings )
@ -168,11 +173,11 @@ namespace Penumbra.Mods
if( ActiveCollection == CurrentCollection ) if( ActiveCollection == CurrentCollection )
{ {
ActiveCollection = c; ActiveCollection = c;
var resourceManager = Service<GameResourceManagement>.Get();
resourceManager.ReloadPlayerResources();
} }
CurrentCollection = c; CurrentCollection = c;
var resourceManager = Service< GameResourceManagement >.Get();
resourceManager.ReloadPlayerResources();
}, s => _plugin.Configuration.CurrentCollection = s ); }, s => _plugin.Configuration.CurrentCollection = s );
public void SetForcedCollection( ModCollection newCollection ) public void SetForcedCollection( ModCollection newCollection )