HUDs: Tweaks to the window call to make sure panes expand to show all the info.
[VOID.git] / VOID_EditorHUD.cs
blob:a/VOID_EditorHUD.cs -> blob:b/VOID_EditorHUD.cs
--- a/VOID_EditorHUD.cs
+++ b/VOID_EditorHUD.cs
@@ -30,14 +30,14 @@
 using KSP;
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using System.Text;
 using ToadicusTools;
 using UnityEngine;
 
 namespace VOID
 {
-	public class VOID_EditorHUD : VOID_HUDModule, IVOID_EditorModule
+	[VOID_Scenes(GameScenes.EDITOR)]
+	public class VOID_EditorHUD : VOID_HUDModule
 	{
 		/*
 		 * Fields
@@ -57,9 +57,12 @@
 			{
 				if (this._vesselOverlays == null)
 				{
-					this._vesselOverlays = (EditorVesselOverlays)Resources
-						.FindObjectsOfTypeAll(typeof(EditorVesselOverlays))
-						.FirstOrDefault();
+					UnityEngine.Object[] overlayObjs = Resources.FindObjectsOfTypeAll(typeof(EditorVesselOverlays));
+
+					if (overlayObjs.Length > 0)
+					{
+						this._vesselOverlays = (EditorVesselOverlays)overlayObjs[0];
+					}
 				}
 
 				return this._vesselOverlays;
@@ -97,9 +100,9 @@
 		 * */
 		public VOID_EditorHUD() : base()
 		{
-			this._Name = "Heads-Up Display";
-
-			this.toggleActive = true;
+			this.Name = "Heads-Up Display";
+
+			this.Active = true;
 
 			this.snapToLeft.value = true;
 
@@ -239,7 +242,7 @@
 
 			this.ehudWindow.WindowPos = hudPos;
 
-			this.snapToLeft = Mathf.Abs(this.ehudWindow.WindowPos.xMin - hudLeft) < 15f;
+			this.snapToLeft.value = Mathf.Abs(this.ehudWindow.WindowPos.xMin - hudLeft) < 15f;
 		}
 	}
 }