mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Add settings cleanup to Auto-Generate Groups.
This commit is contained in:
parent
cd74a41453
commit
88a1e9f2ae
2 changed files with 12 additions and 3 deletions
|
|
@ -519,6 +519,10 @@ namespace Penumbra.Mod
|
||||||
meta.Groups.Add( groupDir.Name, @group );
|
meta.Groups.Add( groupDir.Name, @group );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach(var collection in Service<ModManager>.Get().Collections.Collections.Values)
|
||||||
|
collection.UpdateSetting(baseDir, meta, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -96,19 +96,24 @@ namespace Penumbra.Mods
|
||||||
public void ClearCache()
|
public void ClearCache()
|
||||||
=> Cache = null;
|
=> Cache = null;
|
||||||
|
|
||||||
public void UpdateSetting( ModData mod )
|
public void UpdateSetting( DirectoryInfo modPath, ModMeta meta, bool clear )
|
||||||
{
|
{
|
||||||
if( !Settings.TryGetValue( mod.BasePath.Name, out var settings ) )
|
if( !Settings.TryGetValue( modPath.Name, out var settings ) )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( settings.FixInvalidSettings( mod.Meta ) )
|
if (clear)
|
||||||
|
settings.Settings.Clear();
|
||||||
|
if( settings.FixInvalidSettings( meta ) )
|
||||||
{
|
{
|
||||||
Save();
|
Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void UpdateSetting( ModData mod )
|
||||||
|
=> UpdateSetting( mod.BasePath, mod.Meta, false );
|
||||||
|
|
||||||
public void UpdateSettings( bool forceSave )
|
public void UpdateSettings( bool forceSave )
|
||||||
{
|
{
|
||||||
if( Cache == null )
|
if( Cache == null )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue