mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-30 12:23:41 +01:00
Add initial cleaning functions, to be improved.
This commit is contained in:
parent
7022b37043
commit
ec09a7eb0e
3 changed files with 112 additions and 5 deletions
|
|
@ -194,12 +194,16 @@ public class CollectionStorage : IReadOnlyList<ModCollection>, IDisposable, ISer
|
|||
}
|
||||
|
||||
/// <summary> Remove all settings for not currently-installed mods from the given collection. </summary>
|
||||
public void CleanUnavailableSettings(ModCollection collection)
|
||||
public int CleanUnavailableSettings(ModCollection collection)
|
||||
{
|
||||
var any = collection.Settings.Unused.Count > 0;
|
||||
((Dictionary<string, ModSettings.SavedSettings>)collection.Settings.Unused).Clear();
|
||||
if (any)
|
||||
var count = collection.Settings.Unused.Count;
|
||||
if (count > 0)
|
||||
{
|
||||
((Dictionary<string, ModSettings.SavedSettings>)collection.Settings.Unused).Clear();
|
||||
_saveService.QueueSave(new ModCollectionSave(_modStorage, collection));
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
/// <summary> Remove a specific setting for not currently-installed mods from the given collection. </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue