Make CopySettings save even for unused settings.

This commit is contained in:
Ottermandias 2024-01-20 13:12:08 +01:00
parent 8c763d5379
commit c752835d2c
3 changed files with 9 additions and 5 deletions

View file

@ -156,9 +156,14 @@ public class CollectionEditor
// Either copy the unused source settings directly if they are not inheriting,
// or remove any unused settings for the target if they are inheriting.
if (savedSettings != null)
{
((Dictionary<string, ModSettings.SavedSettings>)collection.UnusedSettings)[targetName] = savedSettings.Value;
else
((Dictionary<string, ModSettings.SavedSettings>)collection.UnusedSettings).Remove(targetName);
_saveService.QueueSave(new ModCollectionSave(_modStorage, collection));
}
else if (((Dictionary<string, ModSettings.SavedSettings>)collection.UnusedSettings).Remove(targetName))
{
_saveService.QueueSave(new ModCollectionSave(_modStorage, collection));
}
}
return true;