Skip to content

Commit

Permalink
And another tiny feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihara committed Dec 10, 2013
1 parent d3d5acc commit 17a881c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 6 additions & 2 deletions RasterPropMonitor/Core/MonitorPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,12 @@ public void RenderBackground(RenderTexture screen)
GL.Clear(true, true, ourMonitor.emptyColor);
break;
case BackgroundType.Camera:
if (!cameraObject.Render())
GL.Clear(true, true, ourMonitor.emptyColor);
if (!cameraObject.Render()) {
if (ourMonitor.noSignalTexture != null)
Graphics.Blit(ourMonitor.noSignalTexture, screen);
else
GL.Clear(true, true, ourMonitor.emptyColor);
}
break;
case BackgroundType.Texture:
Graphics.Blit(backgroundTexture, screen);
Expand Down
7 changes: 7 additions & 0 deletions RasterPropMonitor/Core/RasterPropMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public class RasterPropMonitor: InternalModule
public bool needsElectricCharge = true;
[KSPField]
public Color32 defaultFontTint = Color.white;
[KSPField]
public string noSignalTextureURL;
// This needs to be public so that pages can point it.
public FlyingCamera CameraStructure;
// Some things in life are constant;
Expand Down Expand Up @@ -71,6 +73,7 @@ public class RasterPropMonitor: InternalModule
private Rect[] fontCharacters;
private FXGroup audioOutput;
private double electricChargeReserve;
public Texture2D noSignalTexture;

public void Start()
{
Expand Down Expand Up @@ -108,6 +111,10 @@ public void Start()
foreach (string layerID in textureLayerID.Split())
screenMat.SetTexture(layerID.Trim(), screenTexture);

if (GameDatabase.Instance.ExistsTexture(noSignalTextureURL.EnforceSlashes())) {
noSignalTexture = GameDatabase.Instance.GetTexture(noSignalTextureURL.EnforceSlashes(), false);
}

// Create camera instance...
CameraStructure = new FlyingCamera(part, screenTexture, cameraAspect);

Expand Down

0 comments on commit 17a881c

Please sign in to comment.