mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-31 21:03:48 +01:00
Add context menu to clear temporary settings.
This commit is contained in:
parent
79938b6dd0
commit
b7b9defaa6
3 changed files with 25 additions and 12 deletions
|
|
@ -114,6 +114,20 @@ public class CollectionEditor(SaveService saveService, CommunicatorService commu
|
|||
return true;
|
||||
}
|
||||
|
||||
public int ClearTemporarySettings(ModCollection collection, int key = 0)
|
||||
{
|
||||
var numRemoved = 0;
|
||||
for (var i = 0; i < collection.Settings.Count; ++i)
|
||||
{
|
||||
if (collection.GetTempSettings(i) is { } tempSettings
|
||||
&& tempSettings.Lock == key
|
||||
&& SetTemporarySettings(collection, modStorage[i], null, key))
|
||||
++numRemoved;
|
||||
}
|
||||
|
||||
return numRemoved;
|
||||
}
|
||||
|
||||
public bool CanSetTemporarySettings(ModCollection collection, Mod mod, int key)
|
||||
{
|
||||
var old = collection.GetTempSettings(mod.Index);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue