Fix MASMonitor screen camera wiping display when IVA is inactive#387
Open
kilfoil wants to merge 1 commit into
Open
Fix MASMonitor screen camera wiping display when IVA is inactive#387kilfoil wants to merge 1 commit into
kilfoil wants to merge 1 commit into
Conversation
…active 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the active vessel switches (e.g. a crew member goes on EVA, or you switch to another vessel), KSP calls
OnBecomeInactive()on allInternalModuleinstances.MASMonitordoes not override this method.The monitor's
screenCamerais left enabled withClearFlags.SolidColorand an opaque-blackbackgroundColor. WithtargetTextureno longer pointing to a live render texture, Unity falls back to rendering the camera to the main display. This wipes the skybox and scaled-space bodies (Mun, Kerbin, stars, etc.) every frame until the vessel is reactivated.Fix
Override
OnBecomeInactive()to disablescreenCamera, andOnBecomeActive()to re-enable it. The monitor has nothing to render when the IVA is inactive, so disabling the camera is correct behaviour.Reproduction
MASMonitor