feat: add native runtime settings

This commit is contained in:
2026-07-21 12:07:18 +09:00
parent b6208c0971
commit fc4007d676
25 changed files with 3543 additions and 63 deletions

View File

@@ -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.