Multiple Profiles can now be selected

This commit is contained in:
Peer Hogeterp committed 2026-09-07 16:09:00 +02:00
1 parent d043fbc8f0
commit cefc5464d5
89 files changed
+1360 -503

No files matched your search

@@ -33,6 +33,11 @@ public record ConfigMeta<TClass, TValue> : ConfigMetaBase
/// </summary>
public required TValue Default { get; init; }
/// <summary>
/// Whether a managed user-value snapshot may restore JSON null for this setting.
/// </summary>
public bool AllowNullSnapshot { get; init; }
/// <summary>
/// The additive value contributions, one per contributing configuration plugin.
/// </summary>
@@ -70,10 +75,10 @@ public record ConfigMeta<TClass, TValue> : ConfigMetaBase
try
{
var value = JsonSerializer.Deserialize<TValue>(json, SettingsManager.JSON_OPTIONS);
if (value is null)
if (value is null && !this.AllowNullSnapshot)
return false;
this.SetValue(value);
this.SetValue(value!);
return true;
}
catch (Exception e)
@@ -116,4 +121,4 @@ public record ConfigMeta<TClass, TValue> : ConfigMetaBase
return default!;
}
}
}