Added VOID_SurfAtmo and tweaked some loading stuff or something.
Added VOID_SurfAtmo and tweaked some loading stuff or something.

--- a/VOID_Core.cs
+++ b/VOID_Core.cs
@@ -55,6 +55,8 @@
 			}
 		}
 
+		public static double Constant_G = 6.674e-11;
+
 		/*
 		 * Fields
 		 * */
@@ -90,6 +92,11 @@
 		protected string VOIDIconOffPath = "VOID/Textures/void_icon_off";
 
 		protected int windowBaseID = -96518722;
+		protected int _windowID = 0;
+
+		protected bool GUIStylesLoaded = false;
+
+		protected Dictionary<string, GUIStyle> _LabelStyles = new Dictionary<string, GUIStyle>();
 
 		[AVOID_SaveValue("togglePower")]
 		public VOID_SaveValue<bool> togglePower = true;
@@ -135,11 +142,23 @@
 			}
 		}
 
-		public Vessel vessel
+		public int windowID
 		{
 			get
 			{
-				return FlightGlobals.ActiveVessel;
+				if (this._windowID == 0)
+				{
+				this._windowID = this.windowBaseID;
+				}
+				return this._windowID++;
+			}
+		}
+
+		public Dictionary<string, GUIStyle> LabelStyles
+		{
+			get
+			{
+				return this._LabelStyles;
 			}
 		}
 
@@ -236,7 +255,7 @@
 				}
 			}
 
-			if (this.saveTimer > 15f)
+			if (this.saveTimer > 2f)
 			{
 				this.SaveConfig ();
 				this.saveTimer = 0;
@@ -261,6 +280,24 @@
 					this.powerAvailable = false;
 				}
 			}
+		}
+
+		protected void LoadGUIStyles()
+		{
+			this.LabelStyles["center"] = new GUIStyle(GUI.skin.label);
+			this.LabelStyles["center"].normal.textColor = Color.white;
+			this.LabelStyles["center"].alignment = TextAnchor.UpperCenter;
+
+			this.LabelStyles["center_bold"] = new GUIStyle(GUI.skin.label);
+			this.LabelStyles["center_bold"].normal.textColor = Color.white;
+			this.LabelStyles["center_bold"].alignment = TextAnchor.UpperCenter;
+			this.LabelStyles["center_bold"].fontStyle = FontStyle.Bold;
+
+			this.LabelStyles["txt_right"] = new GUIStyle(GUI.skin.label);
+			this.LabelStyles["txt_right"].normal.textColor = Color.white;
+			this.LabelStyles["txt_right"].alignment = TextAnchor.UpperRight;
+
+			this.GUIStylesLoaded = true;
 		}
 
 		public void VOIDMainWindow(int _)
@@ -321,9 +358,14 @@
 				this.LoadModules ();
 			}
 
+			this._windowID = this.windowBaseID;
+
 			GUI.skin = this.Skin;
 
-			int windowID = this.windowBaseID;
+			if (!this.GUIStylesLoaded)
+			{
+				this.LoadGUIStyles ();
+			}
 
 			this.VOIDIconTexture = this.VOIDIconOff;  //icon off default
 			if (this.togglePower) this.VOIDIconTexture = this.VOIDIconOn;     //or on if power_toggle==true
@@ -337,7 +379,7 @@
 				Rect _mainWindowPos = this.mainWindowPos;
 
 				_mainWindowPos = GUILayout.Window (
-					++windowID,
+					this.windowID,
 					_mainWindowPos,
 					this.VOIDMainWindow,
 					string.Join (" ", new string[] {this.VoidName, this.VoidVersion}),
@@ -356,7 +398,7 @@
 				Rect _configWindowPos = this.configWindowPos;
 
 				_configWindowPos = GUILayout.Window (
-					++windowID,
+					this.windowID,
 					_configWindowPos,
 					this.VOIDConfigWindow,
 					string.Join (" ", new string[] {this.VoidName, "Configuration"}),

--- a/VOID_HUD.cs
+++ b/VOID_HUD.cs
@@ -32,8 +32,6 @@
 		/*
 		 * Fields
 		 * */
-		protected string _Name = "Heads-Up Display";
-
 		protected new bool _hasConfigurables = true;
 
 		[AVOID_SaveValue("colorIndex")]
@@ -69,6 +67,8 @@
 		 * */
 		public VOID_HUD() : base()
 		{
+			this._Name = "Heads-Up Display";
+
 			this.textColors.Add(Color.green);
 			this.textColors.Add(Color.black);
 			this.textColors.Add(Color.white);
@@ -87,8 +87,6 @@
 
 		public override void DrawGUI()
 		{
-			Tools.PostDebugMessage ("VOID_HUD: Drawing GUI.");
-
 			GUI.skin = VOID_Core.Instance.Skin;
 
 			if (this.vessel == null)

--- a/VOID_Module.cs
+++ b/VOID_Module.cs
@@ -149,11 +149,6 @@
 
 		public virtual void SaveConfig()
 		{
-			if (!VOID_Core.Instance.configDirty)
-			{
-				return;
-			}
-
 			var config = KSP.IO.PluginConfiguration.CreateForType<VOID_Core> ();
 			config.load ();
 

--- a/VOID_Orbital.cs
+++ b/VOID_Orbital.cs
@@ -26,15 +26,18 @@
 {
 	public class VOID_Orbital : VOID_Module
 	{
-		protected new string _Name = "Orbital Information";
+		[AVOID_SaveValue("WindowPos")]
+		protected Rect WindowPos = new Rect(Screen.width / 2, Screen.height / 2, 10f, 10f);
 
-		[AVOID_SaveValue("OrbitalWindowPos")]
-		protected Rect OrbitalWindowPos = new Rect(Screen.width / 2, Screen.height / 2, 10f, 10f);
+		[AVOID_SaveValue("toggleExtended")]
+		protected VOID_SaveValue<bool> toggleExtended = false;
 
-		[AVOID_SaveValue("toggleExtendedOribtal")]
-		protected bool toggleExtendedOribtal = false;
+		public VOID_Orbital()
+		{
+			this._Name = "Orbital Information";
+		}
 
-		public void OrbitalWindow(int _)
+		public void ModuleWindow(int _)
 		{
 			// Toadicus edit: added local sidereal longitude.
 			double LSL = vessel.longitude + vessel.orbit.referenceBody.rotationAngle;
@@ -89,9 +92,9 @@
 			GUILayout.Label(Tools.MuMech_ToSI(g_vessel) + "m/s²", GUILayout.ExpandWidth(false));
             GUILayout.EndHorizontal();
 
-            toggleExtendedOribtal = GUILayout.Toggle(toggleExtendedOribtal, "Extended info");
+			this.toggleExtended = GUILayout.Toggle(this.toggleExtended, "Extended info");
 
-            if (toggleExtendedOribtal)
+			if (this.toggleExtended)
             {
                 GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
                 GUILayout.Label("Period:");
@@ -148,12 +151,20 @@
 
 		public override void DrawGUI()
 		{
-			OrbitalWindowPos = GUILayout.Window(
-				++VOID_Core.Instance.windowID,
-				OrbitalWindowPos,
-				this.OrbitalWindow,
+			Rect _Pos = this.WindowPos;
+
+			_Pos = GUILayout.Window(
+				VOID_Core.Instance.windowID,
+				_Pos,
+				this.ModuleWindow,
 				this.Name, GUILayout.Width(250),
 				GUILayout.Height(50));
+
+			if (_Pos != this.WindowPos)
+			{
+				this.WindowPos = _Pos;
+				VOID_Core.Instance.configDirty = true;
+			}
 		}
 	}
 }

file:b/VOID_SurfAtmo.cs (new)
--- /dev/null
+++ b/VOID_SurfAtmo.cs
@@ -1,1 +1,132 @@
+//
+//  VOID_Orbital.cs
+//
+//  Author:
+//       toadicus <>
+//
+//  Copyright (c) 2013 toadicus
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+using KSP;
+using System;
+using UnityEngine;
 
+namespace VOID
+{
+	public class VOID_SurfAtmo : VOID_Module
+	{
+		[AVOID_SaveValue("WindowPos")]
+		protected Rect WindowPos = new Rect(Screen.width / 2, Screen.height / 2, 10f, 10f);
+
+		public VOID_SurfAtmo()
+		{
+			this._Name = "Surface & Atmospheric Information";
+		}
+
+		public void ModuleWindow(int _)
+		{
+			GUILayout.BeginVertical();
+
+			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
+			GUILayout.Label("Altitude (true):");
+			double alt_true = vessel.orbit.altitude - vessel.terrainAltitude;
+			// HACK: This assumes that on worlds with oceans, all water is fixed at 0 m, and water covers the whole surface at 0 m.
+			if (vessel.terrainAltitude < 0 && vessel.mainBody.ocean ) alt_true = vessel.orbit.altitude;
+			GUILayout.Label(Tools.MuMech_ToSI(alt_true) + "m", GUILayout.ExpandWidth(false));
+			GUILayout.EndHorizontal ();
+
+			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
+			GUILayout.Label("Latitude:");
+			GUILayout.Label(Tools.GetLatitudeString(vessel), GUILayout.ExpandWidth(false));
+			GUILayout.EndHorizontal();
+
+			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
+			GUILayout.Label("Longitude:");
+			GUILayout.Label(Tools.GetLongitudeString(vessel), GUILayout.ExpandWidth(false));
+			GUILayout.EndHorizontal();
+
+			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
+			GUILayout.Label("Heading:");
+			GUILayout.Label(Tools.MuMech_get_heading(vessel).ToString("F2") + "° " + Tools.get_heading_text(Tools.MuMech_get_heading(vessel)), GUILayout.ExpandWidth(false));
+			GUILayout.EndHorizontal();
+
+			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
+			GUILayout.Label("Terrain elevation:");
+			GUILayout.Label(Tools.MuMech_ToSI(vessel.terrainAltitude) + "m", GUILayout.ExpandWidth(false));
+			GUILayout.EndHorizontal();
+
+			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
+			GUILayout.Label("Surface velocity:");
+			GUILayout.Label(Tools.MuMech_ToSI(vessel.srf_velocity.magnitude) + "m/s", GUILayout.ExpandWidth(false));
+			GUILayout.EndHorizontal();
+
+			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
+			GUILayout.Label("Vertical speed:");
+			GUILayout.Label(Tools.MuMech_ToSI(vessel.verticalSpeed) + "m/s", GUILayout.ExpandWidth(false));
+			GUILayout.EndHorizontal();
+
+			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
+			GUILayout.Label("Horizontal speed:");
+			GUILayout.Label(Tools.MuMech_ToSI(vessel.horizontalSrfSpeed) + "m/s", GUILayout.ExpandWidth(false));
+			GUILayout.EndHorizontal();
+
+			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
+			GUILayout.Label("Temperature:");
+			GUILayout.Label(vessel.flightIntegrator.getExternalTemperature().ToString("F2") + "° C", GUILayout.ExpandWidth(false));
+			GUILayout.EndHorizontal();
+
+			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
+			GUILayout.Label("Atmosphere density:");
+			GUILayout.Label(Tools.MuMech_ToSI(vessel.atmDensity * 1000) + "g/m³", GUILayout.ExpandWidth(false));
+			GUILayout.EndHorizontal();
+
+			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
+			GUILayout.Label("Pressure:");
+			GUILayout.Label(vessel.staticPressure.ToString("F2") + " atms", GUILayout.ExpandWidth(false));
+			GUILayout.EndHorizontal();
+
+			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
+			GUILayout.Label("Atmosphere limit:");
+			GUILayout.Label("≈ " + Tools.MuMech_ToSI(vessel.mainBody.maxAtmosphereAltitude) + "m", GUILayout.ExpandWidth(false));
+			GUILayout.EndHorizontal();
+
+			// Toadicus edit: added Biome
+			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
+			GUILayout.Label("Biome:");
+			GUILayout.Label(Tools.Toadicus_GetAtt(vessel).name, VOID_Core.Instance.LabelStyles["txt_right"]);
+			GUILayout.EndHorizontal();
+
+			GUILayout.EndVertical();
+			GUI.DragWindow();
+		}
+
+		public override void DrawGUI()
+		{
+			Rect _Pos = this.WindowPos;
+
+			_Pos = GUILayout.Window(
+				VOID_Core.Instance.windowID,
+				_Pos,
+				this.ModuleWindow,
+				this.Name, GUILayout.Width(250),
+				GUILayout.Height(50));
+
+			if (_Pos != this.WindowPos)
+			{
+				this.WindowPos = _Pos;
+				VOID_Core.Instance.configDirty = true;
+			}
+		}
+	}
+}