HUDs: Tweaks to the window call to make sure panes expand to show all the info.
[VOID.git] / VOID_HUDAdvanced.cs
blob:a/VOID_HUDAdvanced.cs -> blob:b/VOID_HUDAdvanced.cs
--- a/VOID_HUDAdvanced.cs
+++ b/VOID_HUDAdvanced.cs
@@ -72,9 +72,9 @@
 		 * */
 		public VOID_HUDAdvanced() : base()
 		{
-			this._Name = "Advanced Heads-Up Display";
-
-			this.toggleActive = true;
+			this.Name = "Advanced Heads-Up Display";
+
+			this.Active = true;
 
 			this.leftHUD = new HUDWindow("leftHUD",
 				this.leftHUDWindow,
@@ -95,7 +95,7 @@
 			);
 			this.Windows.Add(this.rightHUD);
 
-			this.positionsLocked = true;
+			this.positionsLocked.value = true;
 
 			Tools.PostDebugMessage (this, "Constructed.");
 		}
@@ -241,11 +241,22 @@
 				}
 			}
 
+			if (VOID_Data.upcomingManeuverNodes < 1 && this.Windows.Contains(this.rightHUD))
+			{
+				this.Windows.Remove(this.rightHUD);
+			}
+			else if (VOID_Data.upcomingManeuverNodes > 0 && !this.Windows.Contains(this.rightHUD))
+			{
+				this.Windows.Add(this.rightHUD);
+			}
+
 			base.DrawGUI();
 		}
 
 		public override void DrawConfigurables()
 		{
+			base.DrawConfigurables();
+
 			if (GUILayout.Button(string.Intern("Reset Advanced HUD Positions"), GUILayout.ExpandWidth(false)))
 			{
 				foreach (HUDWindow window in this.Windows)
@@ -254,9 +265,7 @@
 				}
 			}
 
-			this.positionsLocked = GUILayout.Toggle(this.positionsLocked,
-				string.Intern("Lock Advanced HUD Positions"),
-				GUILayout.ExpandWidth(false));
+			this.positionsLocked.value = GUITools.Toggle(this.positionsLocked, string.Intern("Lock Advanced HUD Positions"));
 		}
 	}
 }