Moved the IsEnabled check from computing effective file list to the hook.

This commit is contained in:
Ottermandias 2021-01-28 11:24:08 +01:00
parent 7e51e663ec
commit b987fe53cb
3 changed files with 21 additions and 22 deletions

View file

@ -109,9 +109,6 @@ namespace Penumbra.Mods
ResolvedFiles.Clear(); ResolvedFiles.Clear();
SwappedFiles.Clear(); SwappedFiles.Clear();
if (!_plugin.Configuration.IsEnabled)
return;
var registeredFiles = new Dictionary< string, string >(); var registeredFiles = new Dictionary< string, string >();
foreach( var (mod, settings) in Mods.GetOrderedAndEnabledModListWithSettings( _plugin.Configuration.InvertModListOrder ) ) foreach( var (mod, settings) in Mods.GetOrderedAndEnabledModListWithSettings( _plugin.Configuration.InvertModListOrder ) )

View file

@ -129,6 +129,8 @@ namespace Penumbra
PluginLog.Log( "[GetResourceHandler] {0}", gameFsPath ); PluginLog.Log( "[GetResourceHandler] {0}", gameFsPath );
} }
if (Plugin.Configuration.IsEnabled)
{
var replacementPath = Plugin.ModManager.ResolveSwappedOrReplacementFilePath( gameFsPath ); var replacementPath = Plugin.ModManager.ResolveSwappedOrReplacementFilePath( gameFsPath );
// path must be < 260 because statically defined array length :( // path must be < 260 because statically defined array length :(
@ -151,6 +153,7 @@ namespace Penumbra
#if DEBUG #if DEBUG
PluginLog.Log( "[GetResourceHandler] resolved {GamePath} to {NewPath}", gameFsPath, replacementPath ); PluginLog.Log( "[GetResourceHandler] resolved {GamePath} to {NewPath}", gameFsPath, replacementPath );
#endif #endif
}
return CallOriginalHandler( isSync, pFileManager, pCategoryId, pResourceType, pResourceHash, pPath, pUnknown, isUnknown ); return CallOriginalHandler( isSync, pFileManager, pCategoryId, pResourceType, pResourceHash, pPath, pUnknown, isUnknown );
} }

View file

@ -63,7 +63,6 @@ namespace Penumbra.UI
if( ImGui.Checkbox( LabelEnabled, ref enabled ) ) if( ImGui.Checkbox( LabelEnabled, ref enabled ) )
{ {
_config.IsEnabled = enabled; _config.IsEnabled = enabled;
_base.ReloadMods();
_configChanged = true; _configChanged = true;
} }
} }