From e4f9bf72e237da6473254e9c3daf8874ed760d4f Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Sun, 27 Jun 2021 12:09:24 +0200 Subject: [PATCH] Potential fix for being unable to load into character select until reloading player resources. --- Penumbra/Meta/MetaManager.cs | 8 +------- Penumbra/Mods/CollectionManager.cs | 9 +++++++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Penumbra/Meta/MetaManager.cs b/Penumbra/Meta/MetaManager.cs index 9551d8f4..5be982be 100644 --- a/Penumbra/Meta/MetaManager.cs +++ b/Penumbra/Meta/MetaManager.cs @@ -56,6 +56,7 @@ namespace Penumbra.Meta private static void DisposeFile( FileInfo? file ) { + file?.Refresh(); if( !( file?.Exists ?? false ) ) { return; @@ -94,11 +95,6 @@ namespace Penumbra.Meta public void Dispose() => Reset(); - ~MetaManager() - { - Reset( false ); - } - private void ClearDirectory() { _dir.Refresh(); @@ -132,8 +128,6 @@ namespace Penumbra.Meta kvp.Value.Write( _dir ); _resolvedFiles[ kvp.Key ] = kvp.Value.CurrentFile!; } - - _resourceManagement.ReloadPlayerResources(); } public bool ApplyMod( MetaManipulation m, Mod.Mod mod ) diff --git a/Penumbra/Mods/CollectionManager.cs b/Penumbra/Mods/CollectionManager.cs index 847020b7..a25bf124 100644 --- a/Penumbra/Mods/CollectionManager.cs +++ b/Penumbra/Mods/CollectionManager.cs @@ -74,6 +74,11 @@ namespace Penumbra.Mods collection.Cache?.UpdateMetaManipulations(); } } + + if( recomputeMeta ) + { + Service.Get().ReloadPlayerResources(); + } } public bool AddCollection( string name, Dictionary< string, ModSettings > settings ) @@ -168,11 +173,11 @@ namespace Penumbra.Mods if( ActiveCollection == CurrentCollection ) { ActiveCollection = c; + var resourceManager = Service.Get(); + resourceManager.ReloadPlayerResources(); } CurrentCollection = c; - var resourceManager = Service< GameResourceManagement >.Get(); - resourceManager.ReloadPlayerResources(); }, s => _plugin.Configuration.CurrentCollection = s ); public void SetForcedCollection( ModCollection newCollection )