feat: add native runtime settings
This commit is contained in:
@@ -19,14 +19,43 @@ public static class PlayoutOptionsLoader
|
||||
"Config",
|
||||
"playout.local.json");
|
||||
|
||||
public static PlayoutOptions Load(string? path = null)
|
||||
public static PlayoutOptions Load(
|
||||
string? path = null,
|
||||
string? operatorSceneDirectory = null,
|
||||
string? operatorBackgroundDirectory = null)
|
||||
{
|
||||
var options = LoadJson(path ?? DefaultPath);
|
||||
ApplyOperatorAssetOverrides(
|
||||
options,
|
||||
operatorSceneDirectory,
|
||||
operatorBackgroundDirectory);
|
||||
ApplyEnvironment(options);
|
||||
ApplyExecutableAssetDefaults(options, AppContext.BaseDirectory);
|
||||
return options;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Applies only the two non-command asset roots selected by the native settings
|
||||
/// screen. Process environment values are applied afterwards and therefore retain
|
||||
/// precedence for controlled diagnostic and development-live launches.
|
||||
/// </summary>
|
||||
internal static void ApplyOperatorAssetOverrides(
|
||||
PlayoutOptions options,
|
||||
string? sceneDirectory,
|
||||
string? backgroundDirectory)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(options);
|
||||
if (!string.IsNullOrWhiteSpace(sceneDirectory))
|
||||
{
|
||||
options.SceneDirectory = sceneDirectory.Trim();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(backgroundDirectory))
|
||||
{
|
||||
options.LegacyBackgroundDirectory = backgroundDirectory.Trim();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads only the specified JSON file and deliberately ignores all environment
|
||||
/// overrides. Intended for explicit, reproducible diagnostic commands.
|
||||
|
||||
Reference in New Issue
Block a user