mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 12:14:17 +01:00
Add FullModSettings struct.
This commit is contained in:
parent
2483f3dcdf
commit
50b5eeb700
1 changed files with 19 additions and 0 deletions
19
Penumbra/Mods/Settings/FullModSettings.cs
Normal file
19
Penumbra/Mods/Settings/FullModSettings.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
namespace Penumbra.Mods.Settings;
|
||||||
|
|
||||||
|
public readonly record struct FullModSettings(ModSettings? Settings = null, TemporaryModSettings? TempSettings = null)
|
||||||
|
{
|
||||||
|
public static readonly FullModSettings Empty = new();
|
||||||
|
|
||||||
|
public ModSettings? Resolve()
|
||||||
|
{
|
||||||
|
if (TempSettings == null)
|
||||||
|
return Settings;
|
||||||
|
if (TempSettings.ForceInherit)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return TempSettings;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FullModSettings DeepCopy()
|
||||||
|
=> new(Settings?.DeepCopy());
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue