Added a bunch of logging, small fix.

This commit is contained in:
Ottermandias 2022-04-29 15:30:08 +02:00
parent 9af4406c8c
commit e8ee729ec5
16 changed files with 86 additions and 38 deletions

View file

@ -33,6 +33,7 @@ public partial class Mod
try
{
Directory.Delete( mod.BasePath.FullName, true );
PluginLog.Debug( "Deleted directory {Directory:l} for {Name:l}.", mod.BasePath.FullName, mod.Name );
}
catch( Exception e )
{
@ -47,6 +48,7 @@ public partial class Mod
}
ModPathChanged.Invoke( ModPathChangeType.Deleted, mod, mod.BasePath, null );
PluginLog.Debug( "Deleted mod {Name:l}.", mod.Name );
}
// Load a new mod and add it to the manager if successful.
@ -66,6 +68,7 @@ public partial class Mod
mod.Index = _mods.Count;
_mods.Add( mod );
ModPathChanged.Invoke( ModPathChangeType.Added, mod, null, mod.BasePath );
PluginLog.Debug( "Added new mod {Name:l} from {Directory:l}.", mod.Name, modFolder.FullName );
}
// Add new mods to NewMods and remove deleted mods from NewMods.

View file

@ -56,6 +56,7 @@ public sealed partial class Mod
Valid = Directory.Exists( newDir.FullName );
if( Penumbra.Config.ModDirectory != BasePath.FullName )
{
PluginLog.Information( "Set new mod base directory from {OldDirectory:l} to {NewDirectory:l}.", Penumbra.Config.ModDirectory, BasePath.FullName );
Penumbra.Config.ModDirectory = BasePath.FullName;
Penumbra.Config.Save();
}
@ -86,6 +87,7 @@ public sealed partial class Mod
}
ModDiscoveryFinished?.Invoke();
PluginLog.Information( "Rediscovered mods." );
}
}
}