Skip to content

Commit

Permalink
Always update in transparent pods.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihara committed Jul 25, 2014
1 parent 31ffe6f commit aadd2d0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
7 changes: 6 additions & 1 deletion RasterPropMonitor/Core/RasterPropMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public class RasterPropMonitor: InternalModule
private int loopsWithoutInitCounter = 0;
private bool startupFailed = false;

private bool ourPodIsTransparent = false;

private enum Script
{
Normal,
Expand Down Expand Up @@ -246,6 +248,9 @@ public void Start()

audioOutput = JUtil.SetupIVASound(internalProp, buttonClickSound, buttonClickVolume, false);

// One last thing to make sure of: If our pod is transparent, we're always active.
ourPodIsTransparent = JUtil.IsPodTransparent(part);

// And if the try block never completed, startupComplete will never be true.
startupComplete = true;
} catch {
Expand Down Expand Up @@ -541,7 +546,7 @@ public override void OnUpdate()
return;
}

if (!JUtil.UserIsInPod(part))
if (!ourPodIsTransparent && !JUtil.UserIsInPod(part))
return;

// Screenshots need to happen in at this moment, because otherwise they may miss.
Expand Down
10 changes: 10 additions & 0 deletions RasterPropMonitor/Core/UtilityFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,16 @@ public static void SetCameraCullingMaskForIVA(string cameraName, bool flag)

}

public static bool IsPodTransparent(Part thatPart)
{
foreach (PartModule thatModule in thatPart.Modules) {
if (thatModule is JSITransparentPod) {
return true;
}
}
return false;
}

public static void SetMainCameraCullingMaskForIVA(bool flag)
{
SetCameraCullingMaskForIVA("Camera 00", flag);
Expand Down
2 changes: 1 addition & 1 deletion SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Now this is the actual version number with build number.
// As I release newer ones, I'll bump them manually.
// Build number is altered automatically.
[assembly: AssemblyFileVersion("0.18.1.1")]
[assembly: AssemblyFileVersion("0.18.1.3")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
Expand Down

0 comments on commit aadd2d0

Please sign in to comment.