Skip to content

Commit 79fb279

Browse files
committed
Fix MASMonitor screen camera rendering to main display when IVA is inactive
When the active vessel switches (e.g. crew goes on EVA), KSP calls OnBecomeInactive() on all InternalModules. MASMonitor's screenCamera is left enabled with ClearFlags.SolidColor and an opaque-black background, so it renders to the main screen every frame, wiping the skybox and scaled-space bodies (Mun, Kerbin, etc.) until the vessel is reactivated. Fix: override OnBecomeInactive() to disable screenCamera, and OnBecomeActive() to re-enable it.
1 parent 109f31c commit 79fb279

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

Source/MASMonitor.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,30 @@ public void OnDestroy()
344344
}
345345
}
346346

347+
/// <summary>
348+
/// Disable the screen camera when the IVA becomes inactive (e.g. on EVA or vessel switch).
349+
/// Without this, the camera renders to the main screen with its opaque-black SolidColor
350+
/// clear, wiping the skybox and scaled-space bodies every frame.
351+
/// </summary>
352+
public override void OnBecomeInactive()
353+
{
354+
if (screenCamera != null)
355+
{
356+
screenCamera.enabled = false;
357+
}
358+
}
359+
360+
/// <summary>
361+
/// Re-enable the screen camera when the IVA becomes active again.
362+
/// </summary>
363+
public override void OnBecomeActive()
364+
{
365+
if (screenCamera != null)
366+
{
367+
screenCamera.enabled = true;
368+
}
369+
}
370+
347371
/// <summary>
348372
/// Just in case we lose context.
349373
/// </summary>

0 commit comments

Comments
 (0)