Default debug UI to hidden
This commit is contained in:
parent
178b9102b3
commit
c1d001053e
1 changed files with 24 additions and 1 deletions
|
|
@ -31,7 +31,7 @@ public static class AquariumHost
|
|||
runtime.RenderPlan,
|
||||
runtime.GraphicsSettings,
|
||||
message => window.PaintSplash("Fensalir", message));
|
||||
renderer.DebugUiVisible = !runtime.Options.Headless;
|
||||
renderer.DebugUiVisible = !runtime.Options.Headless && ParseDebugUiVisible(args);
|
||||
var settingsRuntime = runtimeLoader.Runtime;
|
||||
|
||||
var frameClock = Stopwatch.StartNew();
|
||||
|
|
@ -115,6 +115,24 @@ public static class AquariumHost
|
|||
return args.Any(arg => string.Equals(arg, "--headless", StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
private static bool ParseDebugUiVisible(IReadOnlyCollection<string> args)
|
||||
{
|
||||
if (args.Any(arg => string.Equals(arg, "--show-debug-ui", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(arg, "--debug-ui", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args.Any(arg => string.Equals(arg, "--hide-debug-ui", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(arg, "--no-debug-ui", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return IsTruthy(Environment.GetEnvironmentVariable("AQUARIUM_SHOW_DEBUG_UI"))
|
||||
|| IsTruthy(Environment.GetEnvironmentVariable("AQUARIUM_DEBUG_UI_VISIBLE"));
|
||||
}
|
||||
|
||||
private static int ParseHeadlessReadyFrames()
|
||||
{
|
||||
return int.TryParse(Environment.GetEnvironmentVariable("AQUARIUM_HEADLESS_READY_FRAMES"), out var value)
|
||||
|
|
@ -237,6 +255,11 @@ public static class AquariumHost
|
|||
: fallback;
|
||||
}
|
||||
|
||||
private static bool IsTruthy(string? value)
|
||||
{
|
||||
return value?.Trim().ToLowerInvariant() is "1" or "true" or "yes" or "on";
|
||||
}
|
||||
|
||||
private static IAquariumRenderer CreateRenderer(
|
||||
IntPtr windowHandle,
|
||||
int width,
|
||||
|
|
|
|||
Loading…
Reference in a new issue