Changed VOID_ConfigValue to VOID_SaveValue, to be more intuitive.
Changed VOID_ConfigValue to VOID_SaveValue, to be more intuitive.

file:b/.gitattributes (new)
--- /dev/null
+++ b/.gitattributes
@@ -1,1 +1,3 @@
+* text=auto
+* eol=lf
 

--- /dev/null
+++ b/AVOID_ConfigValue.cs
@@ -1,1 +1,28 @@
+//
+//  AVOID_ConfigValue.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 System;
 
+namespace VOID
+{
+
+}
+
+

--- /dev/null
+++ b/AVOID_Configurable.cs
@@ -1,1 +1,29 @@
+//
+//  AVOID_Configurable.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 System;
 
+namespace VOID
+{
+	[AttributeUsage(AttributeTargets.Method)]
+	public class AVOID_Configurable : Attribute { }
+}
+
+

--- a/IVOID_Module.cs
+++ b/IVOID_Module.cs
@@ -24,7 +24,7 @@
 {
 	public interface IVOID_Module
 	{
-		bool hasGUIConfig { get; }
+		bool hasConfigurables { get; }
 		bool toggleActive { get; }
 		bool guiRunning { get; }
 
@@ -32,6 +32,8 @@
 		void StartGUI();
 		void StopGUI();
 
+		void DrawConfigurables();
+
 		void LoadConfig();
 
 		void SaveConfig();

file:a/Tools.cs -> file:b/Tools.cs
--- a/Tools.cs
+++ b/Tools.cs
@@ -1,617 +1,618 @@
-//

-//  Tools.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/>.

-//

-//  This software uses VesselSimulator and Engineer.Extensions from Engineer Redux.

-//  Engineer Redux (c) 2013 cybutek

-//  Used by permission.

-//

-///////////////////////////////////////////////////////////////////////////////

-

-

-using System;

-using UnityEngine;

-

-namespace VOID

-{

-	public class VOIDLabels

-	{

-		public string void_primary;

-		public string void_altitude_asl;

-		public string void_velocity;

-		public string void_apoapsis;

-		public string void_periapsis;

-	}

-

-	public static class Tools

-	{

-		// Toadicus edit: Added re-implementation of the CBAttributeMap.GetAtt function that does not fire a debug message to the game screen.

-		public static CBAttributeMap.MapAttribute Toadicus_GetAtt(Vessel vessel)

-		{

-			CBAttributeMap.MapAttribute mapAttribute;

-

-			try

-			{

-				CBAttributeMap BiomeMap = vessel.mainBody.BiomeMap;

-				double lat = vessel.latitude * Math.PI / 180d;

-				double lon = vessel.longitude * Math.PI / 180d;

-

-				lon -= Math.PI / 2d;

-

-				if (lon < 0d)

-				{

-					lon += 2d * Math.PI;

-				}

-

-				float v = (float)(lat / Math.PI) + 0.5f;

-				float u = (float)(lon / (2d * Math.PI));

-

-				Color pixelBilinear = BiomeMap.Map.GetPixelBilinear (u, v);

-				mapAttribute = BiomeMap.defaultAttribute;

-

-				if (BiomeMap.Map != null)

-				{

-					if (BiomeMap.exactSearch)

-					{

-						for (int i = 0; i < BiomeMap.Attributes.Length; ++i)

-						{

-							if (pixelBilinear == BiomeMap.Attributes[i].mapColor)

-							{

-								mapAttribute = BiomeMap.Attributes[i];

-							}

-						}

-					}

-					else

-					{

-						float zero = 0;

-						float num = 1 / zero;

-						for (int j = 0; j < BiomeMap.Attributes.Length; ++j)

-						{

-							Color mapColor = BiomeMap.Attributes [j].mapColor;

-							float sqrMagnitude = ((Vector4)(mapColor - pixelBilinear)).sqrMagnitude;

-							if (sqrMagnitude < num)

-							{

-								bool testCase = true;

-								if (BiomeMap.nonExactThreshold != -1)

-								{

-									testCase = (sqrMagnitude < BiomeMap.nonExactThreshold);

-								}

-								if (testCase)

-								{

-									mapAttribute = BiomeMap.Attributes[j];

-									num = sqrMagnitude;

-								}

-							}

-						}

-					}

-				}

-			}

-			catch (NullReferenceException)

-			{

-				mapAttribute = new CBAttributeMap.MapAttribute();

-				mapAttribute.name = "N/A";

-			}

-

-			return mapAttribute;

-		}

-

-		public static string GetLongitudeString(Vessel vessel, string format="F4")

-		{

-			string dir_long = "W";

-			double v_long = vessel.longitude;

-

-			v_long = FixDegreeDomain(v_long);

-

-			if (v_long < -180d)

-			{

-				v_long += 360d;

-			}

-			if (v_long >= 180)

-			{

-				v_long -= 360d;

-			}

-

-			if (v_long > 0) dir_long = "E";

-

-			return string.Format("{0}° {1}", Math.Abs(v_long).ToString(format), dir_long);

-		}

-

-		public static string GetLatitudeString(Vessel vessel, string format="F4")

-		{

-			string dir_lat = "S";

-			double v_lat = vessel.latitude;

-			if (v_lat > 0) dir_lat = "N";

-

-			return string.Format("{0}° {1}", Math.Abs(v_lat).ToString(format), dir_lat);

-		}

-

-        ///////////////////////////////////////////////////////////////////////////////

-

-        //For MuMech_get_heading()

-        public class MuMech_MovingAverage

-        {

-            private double[] store;

-            private int storeSize;

-            private int nextIndex = 0;

-

-            public double value

-            {

-                get

-                {

-                    double tmp = 0;

-                    foreach (double i in store)

-                    {

-                        tmp += i;

-                    }

-                    return tmp / storeSize;

-                }

-                set

-                {

-                    store[nextIndex] = value;

-                    nextIndex = (nextIndex + 1) % storeSize;

-                }

-            }

-

-            public MuMech_MovingAverage(int size = 10, double startingValue = 0)

-            {

-                storeSize = size;

-                store = new double[size];

-                force(startingValue);

-            }

-

-            public void force(double newValue)

-            {

-                for (int i = 0; i < storeSize; i++)

-                {

-                    store[i] = newValue;

-                }

-            }

-

-            public static implicit operator double(MuMech_MovingAverage v)

-            {

-                return v.value;

-            }

-

-            public override string ToString()

-            {

-                return value.ToString();

-            }

-

-            public string ToString(string format)

-            {

-                return value.ToString(format);

-            }

-        }

-

-        //From http://svn.mumech.com/KSP/trunk/MuMechLib/VOID.vesselState.cs

-        public static double MuMech_get_heading(Vessel vessel)

-        {

-            Vector3d CoM = vessel.findWorldCenterOfMass();

-            Vector3d up = (CoM - vessel.mainBody.position).normalized;

-            Vector3d north = Vector3d.Exclude(up, (vessel.mainBody.position + vessel.mainBody.transform.up * (float)vessel.mainBody.Radius) - CoM).normalized;

-

-            Quaternion rotationSurface = Quaternion.LookRotation(north, up);

-            Quaternion rotationvesselSurface = Quaternion.Inverse(Quaternion.Euler(90, 0, 0) * Quaternion.Inverse(vessel.transform.rotation) * rotationSurface);

-            MuMech_MovingAverage vesselHeading = new MuMech_MovingAverage();

-            vesselHeading.value = rotationvesselSurface.eulerAngles.y;

-            return vesselHeading.value * 10;    // *10 by me

-        }

-

-        //From http://svn.mumech.com/KSP/trunk/MuMechLib/MuUtils.cs

-        public static string MuMech_ToSI(double d)

-        {

-            int digits = 2;

-            double exponent = Math.Log10(Math.Abs(d));

-            if (Math.Abs(d) >= 1)

-            {

-                switch ((int)Math.Floor(exponent))

-                {

-                    case 0:

-                    case 1:

-                    case 2:

-                        return d.ToString("F" + digits);

-                    case 3:

-                    case 4:

-                    case 5:

-                        return (d / 1e3).ToString("F" + digits) + "k";

-                    case 6:

-                    case 7:

-                    case 8:

-                        return (d / 1e6).ToString("F" + digits) + "M";

-                    case 9:

-                    case 10:

-                    case 11:

-                        return (d / 1e9).ToString("F" + digits) + "G";

-                    case 12:

-                    case 13:

-                    case 14:

-                        return (d / 1e12).ToString("F" + digits) + "T";

-                    case 15:

-                    case 16:

-                    case 17:

-                        return (d / 1e15).ToString("F" + digits) + "P";

-                    case 18:

-                    case 19:

-                    case 20:

-                        return (d / 1e18).ToString("F" + digits) + "E";

-                    case 21:

-                    case 22:

-                    case 23:

-                        return (d / 1e21).ToString("F" + digits) + "Z";

-                    default:

-                        return (d / 1e24).ToString("F" + digits) + "Y";

-                }

-            }

-            else if (Math.Abs(d) > 0)

-            {

-                switch ((int)Math.Floor(exponent))

-                {

-                    case -1:

-                    case -2:

-                    case -3:

-                        return (d * 1e3).ToString("F" + digits) + "m";

-                    case -4:

-                    case -5:

-                    case -6:

-                        return (d * 1e6).ToString("F" + digits) + "μ";

-                    case -7:

-                    case -8:

-                    case -9:

-                        return (d * 1e9).ToString("F" + digits) + "n";

-                    case -10:

-                    case -11:

-                    case -12:

-                        return (d * 1e12).ToString("F" + digits) + "p";

-                    case -13:

-                    case -14:

-                    case -15:

-                        return (d * 1e15).ToString("F" + digits) + "f";

-                    case -16:

-                    case -17:

-                    case -18:

-                        return (d * 1e18).ToString("F" + digits) + "a";

-                    case -19:

-                    case -20:

-                    case -21:

-                        return (d * 1e21).ToString("F" + digits) + "z";

-                    default:

-                        return (d * 1e24).ToString("F" + digits) + "y";

-                }

-            }

-            else

-            {

-                return "0";

-            }

-        }

-

-        public static string ConvertInterval(double seconds)

-        {

-            string format_1 = "{0:D1}y {1:D1}d {2:D2}h {3:D2}m {4:D2}.{5:D1}s";

-            string format_2 = "{0:D1}d {1:D2}h {2:D2}m {3:D2}.{4:D1}s";

-            string format_3 = "{0:D2}h {1:D2}m {2:D2}.{3:D1}s";

-

-			TimeSpan interval;

-

-			try

-			{

-            	interval = TimeSpan.FromSeconds(seconds);

-			}

-			catch (OverflowException)

-			{

-				return "NaN";

-			}

-

-            int years = interval.Days / 365;

-

-            string output;

-            if (years > 0)

-            {

-                output = string.Format(format_1,

-                    years,

-                    interval.Days - (years * 365), //  subtract years * 365 for accurate day count

-                    interval.Hours,

-                    interval.Minutes,

-                    interval.Seconds,

-                    interval.Milliseconds.ToString().Substring(0, 1));

-            }

-            else if (interval.Days > 0)

-            {

-                output = string.Format(format_2,

-                    interval.Days,

-                    interval.Hours,

-                    interval.Minutes,

-                    interval.Seconds,

-                    interval.Milliseconds.ToString().Substring(0, 1));

-            }

-            else

-            {

-                output = string.Format(format_3,

-                    interval.Hours,

-                    interval.Minutes,

-                    interval.Seconds,

-                    interval.Milliseconds.ToString().Substring(0, 1));

-            }

-            return output;

-        }

-

-        public static string UppercaseFirst(string s)

-        {

-            if (string.IsNullOrEmpty(s))

-            {

-                return string.Empty;

-            }

-            char[] a = s.ToCharArray();

-            a[0] = char.ToUpper(a[0]);

-            return new string(a);

-        }

-

-        //transfer angles

-

-        public static double Nivvy_CalcTransferPhaseAngle(double r_current, double r_target, double grav_param)

-        {

-            double T_target = (2 * Math.PI) * Math.Sqrt(Math.Pow((r_target / 1000), 3) / (grav_param / 1000000000));

-            double T_transfer = (2 * Math.PI) * Math.Sqrt(Math.Pow((((r_target / 1000) + (r_current / 1000)) / 2), 3) / (grav_param / 1000000000));

-            return 360 * (0.5 - (T_transfer / (2 * T_target)));

-        }

-

-        public static double Younata_DeltaVToGetToOtherBody(double mu, double r1, double r2)

-        {

-            /*

-            def deltaVToGetToOtherBody(mu, r1, r2):

-            # mu = gravity param of common orbiting body of r1 and r2

-            # (e.g. for mun to minmus, mu is kerbin's gravity param

-            # r1 = initial body's orbit radius

-            # r2 = target body's orbit radius

-		

-            # return value is km/s

-            sur1 = math.sqrt(mu / r1)

-            sr1r2 = math.sqrt(float(2*r2)/float(r1+r2))

-            mult = sr1r2 - 1

-            return sur1 * mult

-            */

-            double sur1, sr1r2, mult;

-            sur1 = Math.Sqrt(mu / r1);

-            sr1r2 = Math.Sqrt((2 * r2) / (r1 + r2));

-            mult = sr1r2 - 1;

-            return sur1 * mult;

-        }

-

-        public static double Younata_DeltaVToExitSOI(double mu, double r1, double r2, double v)

-        {

-            /*

-            def deltaVToExitSOI(mu, r1, r2, v):

-            # mu = gravity param of current body

-            # r1 = current orbit radius

-            # r2 = SOI radius

-            # v = SOI exit velocity

-            foo = r2 * (v**2) - 2 * mu

-            bar = r1 * foo + (2 * r2 * mu)

-            r = r1*r2

-            return math.sqrt(bar / r)

-            */

-            double foo = r2 * Math.Pow(v, 2) - 2 * mu;

-            double bar = r1 * foo + (2 * r2 * mu);

-            double r = r1 * r2;

-            return Math.Sqrt(bar / r);

-        }

-

-        public static double Younata_TransferBurnPoint(double r, double v, double angle, double mu)

-        {

-            /*

-            def transferBurnPoint(r, v, angle, mu):

-            # r = parking orbit radius

-            # v = ejection velocity

-            # angle = phase angle (from function phaseAngle())

-            # mu = gravity param of current body.

-            epsilon = ((v**2)/2) - (mu / r)

-            h = r * v * math.sin(angle)

-            e = math.sqrt(1 + ((2 * epsilon * h**2)/(mu**2)))

-            theta = math.acos(1.0 / e)

-            degrees = theta * (180.0 / math.pi)

-            return 180 - degrees

-            */

-            double epsilon, h, ee, theta, degrees;

-            epsilon = (Math.Pow(v, 2) / 2) - (mu / r);

-            h = r * v * Math.Sin(angle);

-            ee = Math.Sqrt(1 + ((2 * epsilon * Math.Pow(h, 2)) / Math.Pow(mu, 2)));

-            theta = Math.Acos(1.0 / ee);

-            degrees = theta * (180.0 / Math.PI);

-            return 180 - degrees;

-            // returns the ejection angle

-        }

-

-        public static double Adammada_CurrrentPhaseAngle(double body_LAN, double body_orbitPct, double origin_LAN, double origin_orbitPct)

-        {

-            double angle = (body_LAN / 360 + body_orbitPct) - (origin_LAN / 360 + origin_orbitPct);

-            if (angle > 1) angle = angle - 1;

-            if (angle < 0) angle = angle + 1;

-            if (angle > 0.5) angle = angle - 1;

-            angle = angle * 360;

-            return angle;

-        }

-

-        public static double Adammada_CurrentEjectionAngle(double vessel_long, double origin_rotAngle, double origin_LAN, double origin_orbitPct)

-        {

-            //double eangle = ((FlightGlobals.ActiveVOID.vessel.longitude + orbiting.rotationAngle) - (orbiting.orbit.LAN / 360 + orbiting.orbit.orbitPercent) * 360);

-            double eangle = ((vessel_long + origin_rotAngle) - (origin_LAN / 360 + origin_orbitPct) * 360);

-

-            while (eangle < 0) eangle = eangle + 360;

-            while (eangle > 360) eangle = eangle - 360;

-            if (eangle < 270) eangle = 90 - eangle;

-            else eangle = 450 - eangle;

-            return eangle;

-        }

-

-        public static double mrenigma03_calcphase(Vessel vessel, CelestialBody target)   //calculates phase angle between the current body and target body

-        {

-            Vector3d vecthis = new Vector3d();

-            Vector3d vectarget = new Vector3d();

-            vectarget = target.orbit.getRelativePositionAtUT(Planetarium.GetUniversalTime());

-

-            if ((vessel.mainBody.name == "Sun") || (vessel.mainBody.referenceBody.referenceBody.name == "Sun"))

-            {

-                vecthis = vessel.orbit.getRelativePositionAtUT(Planetarium.GetUniversalTime());

-            }

-            else

-            {

-                vecthis = vessel.mainBody.orbit.getRelativePositionAtUT(Planetarium.GetUniversalTime());

-            }

-

-            vecthis = Vector3d.Project(new Vector3d(vecthis.x, 0, vecthis.z), vecthis);

-            vectarget = Vector3d.Project(new Vector3d(vectarget.x, 0, vectarget.z), vectarget);

-

-            Vector3d prograde = new Vector3d();

-            prograde = Quaternion.AngleAxis(90, Vector3d.forward) * vecthis;

-

-            double phase = Vector3d.Angle(vecthis, vectarget);

-

-            if (Vector3d.Angle(prograde, vectarget) > 90) phase = 360 - phase;

-

-            return (phase + 360) % 360;

-        }

-

-		public static double FixAngleDomain(double Angle, bool Degrees = false)

-		{

-			double Extent = 2d * Math.PI;

-			if (Degrees) {

-				Extent = 360d;

-			}

-

-			Angle = Angle % (Extent);

-			if (Angle < 0d)

-			{

-				Angle += Extent;

-			}

-

-			return Angle;

-		}

-

-		public static double FixDegreeDomain(double Angle)

-		{

-			return FixAngleDomain (Angle, true);

-		}

-

-        public static double adjustCurrPhaseAngle(double transfer_angle, double curr_phase)

-        {

-            if (transfer_angle < 0)

-            {

-                if (curr_phase > 0) return (-1 * (360 - curr_phase));

-                else if (curr_phase < 0) return curr_phase;

-            }

-            else if (transfer_angle > 0)

-            {

-                if (curr_phase > 0) return curr_phase;

-                else if (curr_phase < 0) return (360 + curr_phase);

-            }

-            return curr_phase;

-        }

-

-        public static double adjust_current_ejection_angle(double curr_ejection)

-        {

-            //curr_ejection WILL need to be adjusted once for all transfers as it returns values ranging -180 to 180

-            // need 0-360 instead

-            //

-            // ie i have -17 in the screenshot

-            // need it to show 343

-            //

-            // do this

-            //

-            // if < 0, add curr to 360  // 360 + (-17) = 343

-            // else its good as it is

-

-            if (curr_ejection < 0) return 360 + curr_ejection;

-            else return curr_ejection;

-

-        }

-

-        public static double adjust_transfer_ejection_angle(double trans_ejection, double trans_phase)

-        {

-            // if transfer_phase_angle < 0 its a lower transfer

-            //180 + curr_ejection

-            // else if transfer_phase_angle > 0 its good as it is

-

-            if (trans_phase < 0) return 180 + trans_ejection;

-            else return trans_ejection;

-

-        }

-

-        public static double TrueAltitude(Vessel vessel)

-		{

-			double trueAltitude = 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 )

-			{

-				trueAltitude = vessel.orbit.altitude;

-			}

-

-			return trueAltitude;

-		}

-

-		public static string get_heading_text(double heading)

-		{

-			if (heading > 348.75 || heading <= 11.25) return "N";

-			else if (heading > 11.25 && heading <= 33.75) return "NNE";

-			else if (heading > 33.75 && heading <= 56.25) return "NE";

-			else if (heading > 56.25 && heading <= 78.75) return "ENE";

-			else if (heading > 78.75 && heading <= 101.25) return "E";

-			else if (heading > 101.25 && heading <= 123.75) return "ESE";

-			else if (heading > 123.75 && heading <= 146.25) return "SE";

-			else if (heading > 146.25 && heading <= 168.75) return "SSE";

-			else if (heading > 168.75 && heading <= 191.25) return "S";

-			else if (heading > 191.25 && heading <= 213.75) return "SSW";

-			else if (heading > 213.75 && heading <= 236.25) return "SW";

-			else if (heading > 236.25 && heading <= 258.75) return "WSW";

-			else if (heading > 258.75 && heading <= 281.25) return "W";

-			else if (heading > 281.25 && heading <= 303.75) return "WNW";

-			else if (heading > 303.75 && heading <= 326.25) return "NW";

-			else if (heading > 326.25 && heading <= 348.75) return "NNW";

-			else return "";

-		}

-

-		public static double[] ParseXYString(string s)

-		{

-			string[] xy = s.Split (',');

-			if (xy.Length != 2)

-			{

-				throw new ArgumentException ("Argument must be of the format 'x,y'.");

-			}

-

-			double x = double.Parse (xy [0].Trim ());

-			double y = double.Parse (xy [1].Trim ());

-

-			return new double[] { x, y };

-		}

-				

-		private static ScreenMessage debugmsg = new ScreenMessage("", 2f, ScreenMessageStyle.UPPER_RIGHT);

-

-		[System.Diagnostics.Conditional("DEBUG")]

-		public static void PostDebugMessage(string Msg)

-		{

-			if (HighLogic.LoadedScene > GameScenes.SPACECENTER)

-			{

-				debugmsg.message = Msg;

-				ScreenMessages.PostScreenMessage(debugmsg, true);

-			}

-

-			KSPLog.print(Msg);

-		}

-	}

+//
+//  Tools.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/>.
+//
+//  This software uses VesselSimulator and Engineer.Extensions from Engineer Redux.
+//  Engineer Redux (c) 2013 cybutek
+//  Used by permission.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace VOID
+{
+	public class VOIDLabels
+	{
+		public string void_primary;
+		public string void_altitude_asl;
+		public string void_velocity;
+		public string void_apoapsis;
+		public string void_periapsis;
+	}
+
+	public static class Tools
+	{
+		// Toadicus edit: Added re-implementation of the CBAttributeMap.GetAtt function that does not fire a debug message to the game screen.
+		public static CBAttributeMap.MapAttribute Toadicus_GetAtt(Vessel vessel)
+		{
+			CBAttributeMap.MapAttribute mapAttribute;
+
+			try
+			{
+				CBAttributeMap BiomeMap = vessel.mainBody.BiomeMap;
+				double lat = vessel.latitude * Math.PI / 180d;
+				double lon = vessel.longitude * Math.PI / 180d;
+
+				lon -= Math.PI / 2d;
+
+				if (lon < 0d)
+				{
+					lon += 2d * Math.PI;
+				}
+
+				float v = (float)(lat / Math.PI) + 0.5f;
+				float u = (float)(lon / (2d * Math.PI));
+
+				Color pixelBilinear = BiomeMap.Map.GetPixelBilinear (u, v);
+				mapAttribute = BiomeMap.defaultAttribute;
+
+				if (BiomeMap.Map != null)
+				{
+					if (BiomeMap.exactSearch)
+					{
+						for (int i = 0; i < BiomeMap.Attributes.Length; ++i)
+						{
+							if (pixelBilinear == BiomeMap.Attributes[i].mapColor)
+							{
+								mapAttribute = BiomeMap.Attributes[i];
+							}
+						}
+					}
+					else
+					{
+						float zero = 0;
+						float num = 1 / zero;
+						for (int j = 0; j < BiomeMap.Attributes.Length; ++j)
+						{
+							Color mapColor = BiomeMap.Attributes [j].mapColor;
+							float sqrMagnitude = ((Vector4)(mapColor - pixelBilinear)).sqrMagnitude;
+							if (sqrMagnitude < num)
+							{
+								bool testCase = true;
+								if (BiomeMap.nonExactThreshold != -1)
+								{
+									testCase = (sqrMagnitude < BiomeMap.nonExactThreshold);
+								}
+								if (testCase)
+								{
+									mapAttribute = BiomeMap.Attributes[j];
+									num = sqrMagnitude;
+								}
+							}
+						}
+					}
+				}
+			}
+			catch (NullReferenceException)
+			{
+				mapAttribute = new CBAttributeMap.MapAttribute();
+				mapAttribute.name = "N/A";
+			}
+
+			return mapAttribute;
+		}
+
+		public static string GetLongitudeString(Vessel vessel, string format="F4")
+		{
+			string dir_long = "W";
+			double v_long = vessel.longitude;
+
+			v_long = FixDegreeDomain(v_long);
+
+			if (v_long < -180d)
+			{
+				v_long += 360d;
+			}
+			if (v_long >= 180)
+			{
+				v_long -= 360d;
+			}
+
+			if (v_long > 0) dir_long = "E";
+
+			return string.Format("{0}° {1}", Math.Abs(v_long).ToString(format), dir_long);
+		}
+
+		public static string GetLatitudeString(Vessel vessel, string format="F4")
+		{
+			string dir_lat = "S";
+			double v_lat = vessel.latitude;
+			if (v_lat > 0) dir_lat = "N";
+
+			return string.Format("{0}° {1}", Math.Abs(v_lat).ToString(format), dir_lat);
+		}
+
+        ///////////////////////////////////////////////////////////////////////////////
+
+        //For MuMech_get_heading()
+        public class MuMech_MovingAverage
+        {
+            private double[] store;
+            private int storeSize;
+            private int nextIndex = 0;
+
+            public double value
+            {
+                get
+                {
+                    double tmp = 0;
+                    foreach (double i in store)
+                    {
+                        tmp += i;
+                    }
+                    return tmp / storeSize;
+                }
+                set
+                {
+                    store[nextIndex] = value;
+                    nextIndex = (nextIndex + 1) % storeSize;
+                }
+            }
+
+            public MuMech_MovingAverage(int size = 10, double startingValue = 0)
+            {
+                storeSize = size;
+                store = new double[size];
+                force(startingValue);
+            }
+
+            public void force(double newValue)
+            {
+                for (int i = 0; i < storeSize; i++)
+                {
+                    store[i] = newValue;
+                }
+            }
+
+            public static implicit operator double(MuMech_MovingAverage v)
+            {
+                return v.value;
+            }
+
+            public override string ToString()
+            {
+                return value.ToString();
+            }
+
+            public string ToString(string format)
+            {
+                return value.ToString(format);
+            }
+        }
+
+        //From http://svn.mumech.com/KSP/trunk/MuMechLib/VOID.vesselState.cs
+        public static double MuMech_get_heading(Vessel vessel)
+        {
+            Vector3d CoM = vessel.findWorldCenterOfMass();
+            Vector3d up = (CoM - vessel.mainBody.position).normalized;
+            Vector3d north = Vector3d.Exclude(up, (vessel.mainBody.position + vessel.mainBody.transform.up * (float)vessel.mainBody.Radius) - CoM).normalized;
+
+            Quaternion rotationSurface = Quaternion.LookRotation(north, up);
+            Quaternion rotationvesselSurface = Quaternion.Inverse(Quaternion.Euler(90, 0, 0) * Quaternion.Inverse(vessel.transform.rotation) * rotationSurface);
+            MuMech_MovingAverage vesselHeading = new MuMech_MovingAverage();
+            vesselHeading.value = rotationvesselSurface.eulerAngles.y;
+            return vesselHeading.value * 10;    // *10 by me
+        }
+
+        //From http://svn.mumech.com/KSP/trunk/MuMechLib/MuUtils.cs
+        public static string MuMech_ToSI(double d)
+        {
+            int digits = 2;
+            double exponent = Math.Log10(Math.Abs(d));
+            if (Math.Abs(d) >= 1)
+            {
+                switch ((int)Math.Floor(exponent))
+                {
+                    case 0:
+                    case 1:
+                    case 2:
+                        return d.ToString("F" + digits);
+                    case 3:
+                    case 4:
+                    case 5:
+                        return (d / 1e3).ToString("F" + digits) + "k";
+                    case 6:
+                    case 7:
+                    case 8:
+                        return (d / 1e6).ToString("F" + digits) + "M";
+                    case 9:
+                    case 10:
+                    case 11:
+                        return (d / 1e9).ToString("F" + digits) + "G";
+                    case 12:
+                    case 13:
+                    case 14:
+                        return (d / 1e12).ToString("F" + digits) + "T";
+                    case 15:
+                    case 16:
+                    case 17:
+                        return (d / 1e15).ToString("F" + digits) + "P";
+                    case 18:
+                    case 19:
+                    case 20:
+                        return (d / 1e18).ToString("F" + digits) + "E";
+                    case 21:
+                    case 22:
+                    case 23:
+                        return (d / 1e21).ToString("F" + digits) + "Z";
+                    default:
+                        return (d / 1e24).ToString("F" + digits) + "Y";
+                }
+            }
+            else if (Math.Abs(d) > 0)
+            {
+                switch ((int)Math.Floor(exponent))
+                {
+                    case -1:
+                    case -2:
+                    case -3:
+                        return (d * 1e3).ToString("F" + digits) + "m";
+                    case -4:
+                    case -5:
+                    case -6:
+                        return (d * 1e6).ToString("F" + digits) + "μ";
+                    case -7:
+                    case -8:
+                    case -9:
+                        return (d * 1e9).ToString("F" + digits) + "n";
+                    case -10:
+                    case -11:
+                    case -12:
+                        return (d * 1e12).ToString("F" + digits) + "p";
+                    case -13:
+                    case -14:
+                    case -15:
+                        return (d * 1e15).ToString("F" + digits) + "f";
+                    case -16:
+                    case -17:
+                    case -18:
+                        return (d * 1e18).ToString("F" + digits) + "a";
+                    case -19:
+                    case -20:
+                    case -21:
+                        return (d * 1e21).ToString("F" + digits) + "z";
+                    default:
+                        return (d * 1e24).ToString("F" + digits) + "y";
+                }
+            }
+            else
+            {
+                return "0";
+            }
+        }
+
+        public static string ConvertInterval(double seconds)
+        {
+            string format_1 = "{0:D1}y {1:D1}d {2:D2}h {3:D2}m {4:D2}.{5:D1}s";
+            string format_2 = "{0:D1}d {1:D2}h {2:D2}m {3:D2}.{4:D1}s";
+            string format_3 = "{0:D2}h {1:D2}m {2:D2}.{3:D1}s";
+
+			TimeSpan interval;
+
+			try
+			{
+            	interval = TimeSpan.FromSeconds(seconds);
+			}
+			catch (OverflowException)
+			{
+				return "NaN";
+			}
+
+            int years = interval.Days / 365;
+
+            string output;
+            if (years > 0)
+            {
+                output = string.Format(format_1,
+                    years,
+                    interval.Days - (years * 365), //  subtract years * 365 for accurate day count
+                    interval.Hours,
+                    interval.Minutes,
+                    interval.Seconds,
+                    interval.Milliseconds.ToString().Substring(0, 1));
+            }
+            else if (interval.Days > 0)
+            {
+                output = string.Format(format_2,
+                    interval.Days,
+                    interval.Hours,
+                    interval.Minutes,
+                    interval.Seconds,
+                    interval.Milliseconds.ToString().Substring(0, 1));
+            }
+            else
+            {
+                output = string.Format(format_3,
+                    interval.Hours,
+                    interval.Minutes,
+                    interval.Seconds,
+                    interval.Milliseconds.ToString().Substring(0, 1));
+            }
+            return output;
+        }
+
+        public static string UppercaseFirst(string s)
+        {
+            if (string.IsNullOrEmpty(s))
+            {
+                return string.Empty;
+            }
+            char[] a = s.ToCharArray();
+            a[0] = char.ToUpper(a[0]);
+            return new string(a);
+        }
+
+        //transfer angles
+
+        public static double Nivvy_CalcTransferPhaseAngle(double r_current, double r_target, double grav_param)
+        {
+            double T_target = (2 * Math.PI) * Math.Sqrt(Math.Pow((r_target / 1000), 3) / (grav_param / 1000000000));
+            double T_transfer = (2 * Math.PI) * Math.Sqrt(Math.Pow((((r_target / 1000) + (r_current / 1000)) / 2), 3) / (grav_param / 1000000000));
+            return 360 * (0.5 - (T_transfer / (2 * T_target)));
+        }
+
+        public static double Younata_DeltaVToGetToOtherBody(double mu, double r1, double r2)
+        {
+            /*
+            def deltaVToGetToOtherBody(mu, r1, r2):
+            # mu = gravity param of common orbiting body of r1 and r2
+            # (e.g. for mun to minmus, mu is kerbin's gravity param
+            # r1 = initial body's orbit radius
+            # r2 = target body's orbit radius
+		
+            # return value is km/s
+            sur1 = math.sqrt(mu / r1)
+            sr1r2 = math.sqrt(float(2*r2)/float(r1+r2))
+            mult = sr1r2 - 1
+            return sur1 * mult
+            */
+            double sur1, sr1r2, mult;
+            sur1 = Math.Sqrt(mu / r1);
+            sr1r2 = Math.Sqrt((2 * r2) / (r1 + r2));
+            mult = sr1r2 - 1;
+            return sur1 * mult;
+        }
+
+        public static double Younata_DeltaVToExitSOI(double mu, double r1, double r2, double v)
+        {
+            /*
+            def deltaVToExitSOI(mu, r1, r2, v):
+            # mu = gravity param of current body
+            # r1 = current orbit radius
+            # r2 = SOI radius
+            # v = SOI exit velocity
+            foo = r2 * (v**2) - 2 * mu
+            bar = r1 * foo + (2 * r2 * mu)
+            r = r1*r2
+            return math.sqrt(bar / r)
+            */
+            double foo = r2 * Math.Pow(v, 2) - 2 * mu;
+            double bar = r1 * foo + (2 * r2 * mu);
+            double r = r1 * r2;
+            return Math.Sqrt(bar / r);
+        }
+
+        public static double Younata_TransferBurnPoint(double r, double v, double angle, double mu)
+        {
+            /*
+            def transferBurnPoint(r, v, angle, mu):
+            # r = parking orbit radius
+            # v = ejection velocity
+            # angle = phase angle (from function phaseAngle())
+            # mu = gravity param of current body.
+            epsilon = ((v**2)/2) - (mu / r)
+            h = r * v * math.sin(angle)
+            e = math.sqrt(1 + ((2 * epsilon * h**2)/(mu**2)))
+            theta = math.acos(1.0 / e)
+            degrees = theta * (180.0 / math.pi)
+            return 180 - degrees
+            */
+            double epsilon, h, ee, theta, degrees;
+            epsilon = (Math.Pow(v, 2) / 2) - (mu / r);
+            h = r * v * Math.Sin(angle);
+            ee = Math.Sqrt(1 + ((2 * epsilon * Math.Pow(h, 2)) / Math.Pow(mu, 2)));
+            theta = Math.Acos(1.0 / ee);
+            degrees = theta * (180.0 / Math.PI);
+            return 180 - degrees;
+            // returns the ejection angle
+        }
+
+        public static double Adammada_CurrrentPhaseAngle(double body_LAN, double body_orbitPct, double origin_LAN, double origin_orbitPct)
+        {
+            double angle = (body_LAN / 360 + body_orbitPct) - (origin_LAN / 360 + origin_orbitPct);
+            if (angle > 1) angle = angle - 1;
+            if (angle < 0) angle = angle + 1;
+            if (angle > 0.5) angle = angle - 1;
+            angle = angle * 360;
+            return angle;
+        }
+
+        public static double Adammada_CurrentEjectionAngle(double vessel_long, double origin_rotAngle, double origin_LAN, double origin_orbitPct)
+        {
+            //double eangle = ((FlightGlobals.ActiveVOID.vessel.longitude + orbiting.rotationAngle) - (orbiting.orbit.LAN / 360 + orbiting.orbit.orbitPercent) * 360);
+            double eangle = ((vessel_long + origin_rotAngle) - (origin_LAN / 360 + origin_orbitPct) * 360);
+
+            while (eangle < 0) eangle = eangle + 360;
+            while (eangle > 360) eangle = eangle - 360;
+            if (eangle < 270) eangle = 90 - eangle;
+            else eangle = 450 - eangle;
+            return eangle;
+        }
+
+        public static double mrenigma03_calcphase(Vessel vessel, CelestialBody target)   //calculates phase angle between the current body and target body
+        {
+            Vector3d vecthis = new Vector3d();
+            Vector3d vectarget = new Vector3d();
+            vectarget = target.orbit.getRelativePositionAtUT(Planetarium.GetUniversalTime());
+
+            if ((vessel.mainBody.name == "Sun") || (vessel.mainBody.referenceBody.referenceBody.name == "Sun"))
+            {
+                vecthis = vessel.orbit.getRelativePositionAtUT(Planetarium.GetUniversalTime());
+            }
+            else
+            {
+                vecthis = vessel.mainBody.orbit.getRelativePositionAtUT(Planetarium.GetUniversalTime());
+            }
+
+            vecthis = Vector3d.Project(new Vector3d(vecthis.x, 0, vecthis.z), vecthis);
+            vectarget = Vector3d.Project(new Vector3d(vectarget.x, 0, vectarget.z), vectarget);
+
+            Vector3d prograde = new Vector3d();
+            prograde = Quaternion.AngleAxis(90, Vector3d.forward) * vecthis;
+
+            double phase = Vector3d.Angle(vecthis, vectarget);
+
+            if (Vector3d.Angle(prograde, vectarget) > 90) phase = 360 - phase;
+
+            return (phase + 360) % 360;
+        }
+
+		public static double FixAngleDomain(double Angle, bool Degrees = false)
+		{
+			double Extent = 2d * Math.PI;
+			if (Degrees) {
+				Extent = 360d;
+			}
+
+			Angle = Angle % (Extent);
+			if (Angle < 0d)
+			{
+				Angle += Extent;
+			}
+
+			return Angle;
+		}
+
+		public static double FixDegreeDomain(double Angle)
+		{
+			return FixAngleDomain (Angle, true);
+		}
+
+        public static double adjustCurrPhaseAngle(double transfer_angle, double curr_phase)
+        {
+            if (transfer_angle < 0)
+            {
+                if (curr_phase > 0) return (-1 * (360 - curr_phase));
+                else if (curr_phase < 0) return curr_phase;
+            }
+            else if (transfer_angle > 0)
+            {
+                if (curr_phase > 0) return curr_phase;
+                else if (curr_phase < 0) return (360 + curr_phase);
+            }
+            return curr_phase;
+        }
+
+        public static double adjust_current_ejection_angle(double curr_ejection)
+        {
+            //curr_ejection WILL need to be adjusted once for all transfers as it returns values ranging -180 to 180
+            // need 0-360 instead
+            //
+            // ie i have -17 in the screenshot
+            // need it to show 343
+            //
+            // do this
+            //
+            // if < 0, add curr to 360  // 360 + (-17) = 343
+            // else its good as it is
+
+            if (curr_ejection < 0) return 360 + curr_ejection;
+            else return curr_ejection;
+
+        }
+
+        public static double adjust_transfer_ejection_angle(double trans_ejection, double trans_phase)
+        {
+            // if transfer_phase_angle < 0 its a lower transfer
+            //180 + curr_ejection
+            // else if transfer_phase_angle > 0 its good as it is
+
+            if (trans_phase < 0) return 180 + trans_ejection;
+            else return trans_ejection;
+
+        }
+
+        public static double TrueAltitude(Vessel vessel)
+		{
+			double trueAltitude = 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 )
+			{
+				trueAltitude = vessel.orbit.altitude;
+			}
+
+			return trueAltitude;
+		}
+
+		public static string get_heading_text(double heading)
+		{
+			if (heading > 348.75 || heading <= 11.25) return "N";
+			else if (heading > 11.25 && heading <= 33.75) return "NNE";
+			else if (heading > 33.75 && heading <= 56.25) return "NE";
+			else if (heading > 56.25 && heading <= 78.75) return "ENE";
+			else if (heading > 78.75 && heading <= 101.25) return "E";
+			else if (heading > 101.25 && heading <= 123.75) return "ESE";
+			else if (heading > 123.75 && heading <= 146.25) return "SE";
+			else if (heading > 146.25 && heading <= 168.75) return "SSE";
+			else if (heading > 168.75 && heading <= 191.25) return "S";
+			else if (heading > 191.25 && heading <= 213.75) return "SSW";
+			else if (heading > 213.75 && heading <= 236.25) return "SW";
+			else if (heading > 236.25 && heading <= 258.75) return "WSW";
+			else if (heading > 258.75 && heading <= 281.25) return "W";
+			else if (heading > 281.25 && heading <= 303.75) return "WNW";
+			else if (heading > 303.75 && heading <= 326.25) return "NW";
+			else if (heading > 326.25 && heading <= 348.75) return "NNW";
+			else return "";
+		}
+
+		public static double[] ParseXYString(string s)
+		{
+			string[] xy = s.Split (',');
+			if (xy.Length != 2)
+			{
+				throw new ArgumentException ("Argument must be of the format 'x,y'.");
+			}
+
+			double x = double.Parse (xy [0].Trim ());
+			double y = double.Parse (xy [1].Trim ());
+
+			return new double[] { x, y };
+		}
+				
+		private static ScreenMessage debugmsg = new ScreenMessage("", 2f, ScreenMessageStyle.UPPER_RIGHT);
+
+		[System.Diagnostics.Conditional("DEBUG")]
+		public static void PostDebugMessage(string Msg)
+		{
+			if (HighLogic.LoadedScene > GameScenes.SPACECENTER)
+			{
+				debugmsg.message = Msg;
+				ScreenMessages.PostScreenMessage(debugmsg, true);
+			}
+
+			KSPLog.print(Msg);
+		}
+	}
 }

--- a/VOIDFlightMaster.cs
+++ b/VOIDFlightMaster.cs
@@ -42,28 +42,36 @@
 	[KSPAddon(KSPAddon.Startup.Flight, false)]
 	public class VOIDFlightMaster : MonoBehaviour
 	{
-		protected List<IVOID_Module> Modules;
+		protected VOID_Core Core;
 
-		public void OnAwake()
+		public void Awake()
 		{
-			this.Modules = new List<IVOID_Module>();
+			Tools.PostDebugMessage ("VOIDLightMaster: Waking up.");
+			this.Core = (VOID_Core)VOID_Core.Instance;
+			this.Core.StartGUI ();
+			Tools.PostDebugMessage ("VOIDFlightMaster: Awake.");
 		}
 
-		public void OnUpdate()
+		public void Update()
 		{
-			foreach (IVOID_Module module in this.Modules)
+			if (this.Core == null)
 			{
-				if (!module.guiRunning && module.toggleActive)
-				{
-					module.StartGUI();
-				}
+				return;
+			}
 
-				if (module.guiRunning && !module.toggleActive)
-				{
-					module.StopGUI();
-				}
+			this.Core.Update ();
+		}
+
+		public void FixedUpdate()
+		{
+			if (this.Core == null)
+			{
+				return;
 			}
+
+			this.Core.FixedUpdate ();
 		}
+
 //        private bool debugging = false;
 //
 //        private int window_base_id = -96518722;

file:a/VOID_Config.cs (deleted)
--- a/VOID_Config.cs
+++ /dev/null
@@ -1,509 +1,1 @@
-//
-//  VOID_Config.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 System;
-using System.Collections.Generic;
-using KSP;
-using UnityEngine;
 
-namespace VOID
-{
-	public class VOID_Config
-	{
-		/*
-		 * Static Members
-		 * */
-		// Singleton
-		private static VOID_Config _instance;
-		public static VOID_Config Instance
-		{
-			get
-			{
-				if (_instance == null)
-				{
-					_instance = new VOID_Config();
-				}
-				return _instance;
-			}
-		}
-
-		/*
-		 * Fields
-		 * */
-		protected List<IVOID_Module> Modules = new List<IVOID_Module>();
-		/*
-		 * Properties
-		 * */
-
-		/*
-		 * Methods
-		 * */
-		public void LoadConfig()
-		{
-			Tools.PostDebugMessage ("VOID: Loading settings.");
-			var config = KSP.IO.PluginConfiguration.CreateForType<VOIDFlightMaster> ();
-			config.load ();
-
-			int loadedConfigVersion = config.GetValue ("ConfigVersion", 0);
-
-			if (loadedConfigVersion < 1 || true)
-			{
-				this.load_old_settings ();
-				// this.write_settings ();
-				// TODO: Enable this when the config update works for sure.
-				// KSP.IO.File.Delete<VOID> ("VOID.cfg");
-				return;
-			}
-
-			this.main_window_pos = config.GetValue("MAIN_WINDOW_POS", main_window_pos);
-			this.void_window_pos = config.GetValue("VOID_WINDOW_POS", void_window_pos);
-			this.atmo_window_pos = config.GetValue("ATMO_WINDOW_POS", atmo_window_pos);
-			this.transfer_window_pos = config.GetValue("TAD_WINDOW_POS", transfer_window_pos);
-			this.vessel_register_window_pos = config.GetValue("VESREG_WINDOW_POS", vessel_register_window_pos);
-			this.data_logging_window_pos = config.GetValue("DATATIME_WINDOW_POS", data_logging_window_pos);
-			this.vessel_info_window_pos = config.GetValue("VESINFO_WINDOW_POS", vessel_info_window_pos);
-			this.misc_window_pos = config.GetValue("MISC_WINDOW_POS", misc_window_pos);
-			this.body_op_window_pos = config.GetValue("CELINFO_WINDOW_POS", body_op_window_pos);
-			this.rendezvous_info_window_pos = config.GetValue("RENDEZVOUS_WINDOW_POS", rendezvous_info_window_pos);
-			this.main_icon_pos = config.GetValue("ICON_POS", main_icon_pos);
-
-			this.toggleHUDModule = config.GetValue("HUD_MODULE", false);
-			this.void_module = config.GetValue("VOID_MODULE", false);
-			this.atmo_module = config.GetValue("ATMO_MODULE", false);
-			this.tad_module = config.GetValue("TAD_MODULE", false);
-			this.vessel_register_module = config.GetValue("VESREG_MODULE", false);
-			this.data_time_module = config.GetValue("DATATIME_MODULE", false);
-			this.vessel_info_module = config.GetValue("VESINFO_MODULE", false);
-			this.misc_module = config.GetValue("MISC_MODULE", false);
-			this.celestial_body_info_module = config.GetValue("CELINFO_MODULE", false);
-			this.body_op_show_orbital = config.GetValue("CELINFO_SHOW_OBTL", false);
-			this.body_op_show_physical = config.GetValue("CELINFO_SHOW_PHYS", false);
-			this.main_gui_minimized = config.GetValue("MAIN_GUI_MINIMIZED", false);
-			this.hide_on_pause = config.GetValue("HIDE_ON_PAUSE", false);
-			this.disable_power_usage = config.GetValue("DISABLE_POWER_USAGE", true);
-			this.show_tooltips = config.GetValue("SHOW_TOOLTIPS", false);
-			this.rendezvous_module = config.GetValue("SHOW_RENDEZVOUS_INFO", false);
-			this.hide_vesreg_info = config.GetValue("USE_KSP_TARGET", false);
-
-			this.skin_index = config.GetValue ("SKIN_INDEX", 0);
-
-			this.user_lang = (languages)Enum.Parse(typeof(languages), config.GetValue ("USER_LANG", "EN"));
-		}
-
-		private void LoadOldConfig()
-		{
-			if (KSP.IO.File.Exists<VOID_Config>("VOID.cfg", null))
-			{
-				string[] data = KSP.IO.File.ReadAllLines<VOID_Config>("VOID.cfg", null);
-				string[] name_val;
-				string[] temp;
-				string name = "";
-				string val = "";
-
-				foreach (string s in data)
-				{
-					name_val = s.Split('=');
-					name = name_val[0].Trim();
-					val = name_val[1].Trim();
-
-					if (val != "")
-					{
-						if (name == "MAIN WINDOW POS")
-						{
-							temp = val.Split(',');
-							//window_0_pos = new Rect(Convert.ToSingle(temp[0].Trim()), Convert.ToSingle(temp[1].Trim()), 10, 10);
-							main_window_pos.x = Convert.ToSingle(temp[0].Trim());
-							main_window_pos.y = Convert.ToSingle(temp[1].Trim());
-						}
-						if (name == "VOID WINDOW POS")
-						{
-							temp = val.Split(',');
-							void_window_pos = new Rect(Convert.ToSingle(temp[0].Trim()), Convert.ToSingle(temp[1].Trim()), 10f, 10f);
-						}
-						if (name == "ATMO WINDOW POS")
-						{
-							temp = val.Split(',');
-							atmo_window_pos = new Rect(Convert.ToSingle(temp[0].Trim()), Convert.ToSingle(temp[1].Trim()), 10f, 10f);
-						}
-						if (name == "TAD WINDOW POS")
-						{
-							temp = val.Split(',');
-							transfer_window_pos = new Rect(Convert.ToSingle(temp[0].Trim()), Convert.ToSingle(temp[1].Trim()), 10f, 10f);
-						}
-						if (name == "VESREG WINDOW POS")
-						{
-							temp = val.Split(',');
-							vessel_register_window_pos = new Rect(Convert.ToSingle(temp[0].Trim()), Convert.ToSingle(temp[1].Trim()), 10f, 10f);
-						}
-						if (name == "DATATIME WINDOW POS")
-						{
-							temp = val.Split(',');
-							data_logging_window_pos = new Rect(Convert.ToSingle(temp[0].Trim()), Convert.ToSingle(temp[1].Trim()), 10f, 10f);
-						}
-						if (name == "VESINFO WINDOW POS")
-						{
-							temp = val.Split(',');
-							vessel_info_window_pos = new Rect(Convert.ToSingle(temp[0].Trim()), Convert.ToSingle(temp[1].Trim()), 10f, 10f);
-						}
-						if (name == "MISC WINDOW POS")
-						{
-							temp = val.Split(',');
-							misc_window_pos = new Rect(Convert.ToSingle(temp[0].Trim()), Convert.ToSingle(temp[1].Trim()), 10f, 10f);
-						}
-						if (name == "CELINFO WINDOW POS")
-						{
-							temp = val.Split(',');
-							body_op_window_pos = new Rect(Convert.ToSingle(temp[0].Trim()), Convert.ToSingle(temp[1].Trim()), 10f, 10f);
-						}
-						if (name == "RENDEZVOUS WINDOW POS")
-						{
-							temp = val.Split(',');
-							rendezvous_info_window_pos = new Rect(Convert.ToSingle(temp[0].Trim()), Convert.ToSingle(temp[1].Trim()), 10f, 10f);
-						}
-						if (name == "ICON POS")
-						{
-							temp = val.Split(',');
-							main_icon_pos = new Rect(Convert.ToSingle(temp[0].Trim()), Convert.ToSingle(temp[1].Trim()), 30f, 30f);
-						}
-						if (name == "HUD MODULE") toggleHUDModule = Boolean.Parse(val);
-						if (name == "VOID MODULE") void_module = Boolean.Parse(val);
-						if (name == "ATMO MODULE") atmo_module = Boolean.Parse(val);
-						if (name == "TAD MODULE") tad_module = Boolean.Parse(val);
-						if (name == "VESREG MODULE") vessel_register_module = Boolean.Parse(val);
-						if (name == "DATATIME MODULE") data_time_module = Boolean.Parse(val);
-						if (name == "VESINFO MODULE") vessel_info_module = Boolean.Parse(val);
-						if (name == "MISC MODULE") misc_module = Boolean.Parse(val);
-						if (name == "CELINFO MODULE") celestial_body_info_module = Boolean.Parse(val);
-						if (name == "CELINFO SHOW OBTL") body_op_show_orbital = Boolean.Parse(val);
-						if (name == "CELINFO SHOW PHYS") body_op_show_physical = Boolean.Parse(val);
-						if (name == "MAIN GUI MINIMIZED") main_gui_minimized = Boolean.Parse(val);
-						if (name == "HIDE ON PAUSE") hide_on_pause = Boolean.Parse(val);
-						if (name == "SKIN INDEX") skin_index = Int32.Parse(val);
-						if (name == "DISABLE POWER USAGE") disable_power_usage = Boolean.Parse(val);
-						if (name == "SHOW TOOLTIPS") show_tooltips = Boolean.Parse(val);
-						if (name == "SHOW RENDEZVOUS INFO") rendezvous_module = Boolean.Parse(val);
-						if (name == "USE KSP TARGET") hide_vesreg_info = Boolean.Parse(val);
-						if (name == "USER LANG") user_lang = (languages)Enum.Parse(typeof(languages), val);
-					}
-				}
-			}
-		}
-
-		public void SaveConfig()
-		{
-			Tools.PostDebugMessage ("VOID: Writing settings.");
-			try
-			{
-				var config = KSP.IO.PluginConfiguration.CreateForType<VOIDFlightMaster> ();
-				config.load ();
-
-				/*
-				config.SetValue ("ConfigVersion", this.configVersion);
-				config.SetValue("MAIN_WINDOW_POS", main_window_pos);
-				config.SetValue("VOID_WINDOW_POS", void_window_pos);
-				config.SetValue("ATMO_WINDOW_POS", atmo_window_pos);
-				config.SetValue("TAD_WINDOW_POS", transfer_window_pos);
-				config.SetValue("VESREG_WINDOW_POS", vessel_register_window_pos);
-				config.SetValue("DATATIME_WINDOW_POS", data_logging_window_pos);
-				config.SetValue("VESINFO_WINDOW_POS", vessel_info_window_pos);
-				config.SetValue("MISC_WINDOW_POS", misc_window_pos);
-				config.SetValue("CELINFO_WINDOW_POS", body_op_window_pos);
-				config.SetValue("RENDEZVOUS_WINDOW_POS", rendezvous_info_window_pos);
-				config.SetValue("ICON_POS", main_icon_pos);
-				config.SetValue("HUD_MODULE", toggleHUDModule);
-				config.SetValue("VOID_MODULE", void_module);
-				config.SetValue("ATMO_MODULE", atmo_module);
-				config.SetValue("TAD_MODULE", tad_module);
-				config.SetValue("VESREG_MODULE", vessel_register_module);
-				config.SetValue("DATATIME_MODULE", data_time_module);
-				config.SetValue("VESINFO_MODULE", vessel_info_module);
-				config.SetValue("MISC_MODULE", misc_module);
-				config.SetValue("CELINFO_MODULE", celestial_body_info_module);
-				config.SetValue("CELINFO_SHOW_OBTL", body_op_show_orbital);
-				config.SetValue("CELINFO_SHOW_PHYS", body_op_show_physical);
-				config.SetValue("MAIN_GUI_MINIMIZED", main_gui_minimized);
-				config.SetValue("HIDE_ON_PAUSE", hide_on_pause);
-				config.SetValue("SKIN_INDEX", skin_index);
-				config.SetValue("DISABLE_POWER_USAGE", disable_power_usage);
-				config.SetValue("SHOW_TOOLTIPS", show_tooltips);
-				config.SetValue("SHOW_RENDEZVOUS_INFO", rendezvous_module);
-				config.SetValue("USE_KSP_TARGET", hide_vesreg_info);
-				config.SetValue("USER_LANG", user_lang);
-				*/
-
-				try
-				{
-					config.SetValue ("ConfigVersion", this.configVersion);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue (\"ConfigVersion\", this.configVersion);");
-				}
-				try
-				{
-					config.SetValue("MAIN_WINDOW_POS", main_window_pos);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"MAIN_WINDOW_POS\", main_window_pos);");
-				}
-				try
-				{
-					config.SetValue("VOID_WINDOW_POS", void_window_pos);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"VOID_WINDOW_POS\", void_window_pos);");
-				}
-				try
-				{
-					config.SetValue("ATMO_WINDOW_POS", atmo_window_pos);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"ATMO_WINDOW_POS\", atmo_window_pos);");
-				}
-				try
-				{
-					config.SetValue("TAD_WINDOW_POS", transfer_window_pos);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"TAD_WINDOW_POS\", transfer_window_pos);");
-				}
-				try
-				{
-					config.SetValue("VESREG_WINDOW_POS", vessel_register_window_pos);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"VESREG_WINDOW_POS\", vessel_register_window_pos);");
-				}
-				try
-				{
-					config.SetValue("DATATIME_WINDOW_POS", data_logging_window_pos);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"DATATIME_WINDOW_POS\", data_logging_window_pos);");
-				}
-				try
-				{
-					config.SetValue("VESINFO_WINDOW_POS", vessel_info_window_pos);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"VESINFO_WINDOW_POS\", vessel_info_window_pos);");
-				}
-				try
-				{
-					config.SetValue("MISC_WINDOW_POS", misc_window_pos);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"MISC_WINDOW_POS\", misc_window_pos);");
-				}
-				try
-				{
-					config.SetValue("CELINFO_WINDOW_POS", body_op_window_pos);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"CELINFO_WINDOW_POS\", body_op_window_pos);");
-				}
-				try
-				{
-					config.SetValue("RENDEZVOUS_WINDOW_POS", rendezvous_info_window_pos);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"RENDEZVOUS_WINDOW_POS\", rendezvous_info_window_pos);");
-				}
-				try
-				{
-					config.SetValue("ICON_POS", main_icon_pos);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"ICON_POS\", main_icon_pos);");
-				}
-				try
-				{
-					config.SetValue("HUD_MODULE", toggleHUDModule);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"HUD_MODULE\", toggleHUDModule);");
-				}
-				try
-				{
-					config.SetValue("VOID_MODULE", void_module);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"VOID_MODULE\", void_module);");
-				}
-				try
-				{
-					config.SetValue("ATMO_MODULE", atmo_module);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"ATMO_MODULE\", atmo_module);");
-				}
-				try
-				{
-					config.SetValue("TAD_MODULE", tad_module);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"TAD_MODULE\", tad_module);");
-				}
-				try
-				{
-					config.SetValue("VESREG_MODULE", vessel_register_module);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"VESREG_MODULE\", vessel_register_module);");
-				}
-				try
-				{
-					config.SetValue("DATATIME_MODULE", data_time_module);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"DATATIME_MODULE\", data_time_module);");
-				}
-				try
-				{
-					config.SetValue("VESINFO_MODULE", vessel_info_module);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"VESINFO_MODULE\", vessel_info_module);");
-				}
-				try
-				{
-					config.SetValue("MISC_MODULE", misc_module);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"MISC_MODULE\", misc_module);");
-				}
-				try
-				{
-					config.SetValue("CELINFO_MODULE", celestial_body_info_module);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"CELINFO_MODULE\", celestial_body_info_module);");
-				}
-				try
-				{
-					config.SetValue("CELINFO_SHOW_OBTL", body_op_show_orbital);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"CELINFO_SHOW_OBTL\", body_op_show_orbital);");
-				}
-				try
-				{
-					config.SetValue("CELINFO_SHOW_PHYS", body_op_show_physical);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"CELINFO_SHOW_PHYS\", body_op_show_physical);");
-				}
-				try
-				{
-					config.SetValue("MAIN_GUI_MINIMIZED", main_gui_minimized);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"MAIN_GUI_MINIMIZED\", main_gui_minimized);");
-				}
-				try
-				{
-					config.SetValue("HIDE_ON_PAUSE", hide_on_pause);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"HIDE_ON_PAUSE\", hide_on_pause);");
-				}
-				try
-				{
-					config.SetValue("SKIN_INDEX", skin_index);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"SKIN_INDEX\", skin_index);");
-				}
-				try
-				{
-					config.SetValue("DISABLE_POWER_USAGE", disable_power_usage);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"DISABLE_POWER_USAGE\", disable_power_usage);");
-				}
-				try
-				{
-					config.SetValue("SHOW_TOOLTIPS", show_tooltips);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"SHOW_TOOLTIPS\", show_tooltips);");
-				}
-				try
-				{
-					config.SetValue("SHOW_RENDEZVOUS_INFO", rendezvous_module);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"SHOW_RENDEZVOUS_INFO\", rendezvous_module);");
-				}
-				try
-				{
-					config.SetValue("USE_KSP_TARGET", hide_vesreg_info);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"USE_KSP_TARGET\", hide_vesreg_info);");
-				}
-				try
-				{
-					config.SetValue("USER_LANG", user_lang);
-				}
-				catch (NullReferenceException)
-				{
-					UnityEngine.Debug.LogError("config.SetValue(\"USER_LANG\", user_lang);");
-				}
-				config.save ();
-			}
-			catch (NullReferenceException)
-			{
-				return;
-			}
-		}
-	}
-}
-
-

--- a/VOID_Core.cs
+++ b/VOID_Core.cs
@@ -19,25 +19,38 @@
 //  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 System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
 using KSP;
 using UnityEngine;
 
 namespace VOID
 {
-	public class VOID_Core : IVOID_Module
+	public class VOID_Core : VOID_Module, IVOID_Module
 	{
 		/*
 		 * Static Members
 		 * */
+		protected static bool _initialized = false;
+		public static bool Initialized
+		{
+			get 
+			{
+			return _initialized;
+			}
+		}
+
 		protected static VOID_Core _instance;
-
-		public static IVOID_Module Instance {
-			get {
-				if (_instance == null) {
-					Tools.PostDebugMessage ("Instantiating VOID_HUD");
-					_instance = new VOID_Core ();
-				}
-				Tools.PostDebugMessage ("Returning VOID_HUD instance.");
+		public static VOID_Core Instance
+		{
+			get
+			{
+				if (_instance == null)
+				{
+					_instance = new VOID_Core();
+					_initialized = true;
+				}
 				return _instance;
 			}
 		}
@@ -45,74 +58,337 @@
 		/*
 		 * Fields
 		 * */
-		protected Rect main_window_pos = new Rect(Screen.width / 2, Screen.height / 2, 10f, 10f); //VOID main
-
-		protected Rect main_icon_pos = new Rect(Screen.width / 2 - 80, Screen.height - 32, 30f, 30f);
-		protected Texture2D void_icon_off = new Texture2D(30, 30, TextureFormat.ARGB32, false);
-		protected Texture2D void_icon_on = new Texture2D(30, 30, TextureFormat.ARGB32, false);
-		protected Texture2D void_icon = new Texture2D(30, 30, TextureFormat.ARGB32, false);
-
-		protected bool _Active = true;
-		protected bool _Running = false;
+		protected string VoidName = "VOID";
+		protected string VoidVersion = "0.9.9";
+
+		[AVOID_SaveValue("configValue")]
+		protected VOID_SaveValue<int> configVersion = 1;
+
+		protected List<VOID_Module> _modules = new List<VOID_Module>();
+		protected bool _modulesLoaded = false;
+
+		protected List<Callback> _configurableCallbacks = new List<Callback>();
+
+		[AVOID_SaveValue("mainWindowPos")]
+		protected VOID_SaveValue<Rect> mainWindowPos = new Rect(Screen.width / 2, Screen.height / 2, 10f, 10f);
+
+		[AVOID_SaveValue("mainGuiMinimized")]
+		protected VOID_SaveValue<bool> mainGuiMinimized = false;
+
+		[AVOID_SaveValue("configWindowPos")]
+		protected VOID_SaveValue<Rect> configWindowPos = new Rect(Screen.width / 2, Screen.height  /2, 10f, 10f);
+
+		[AVOID_SaveValue("configWindowMinimized")]
+		protected VOID_SaveValue<bool> configWindowMinimized = true;
+
+		[AVOID_SaveValue("VOIDIconPos")]
+		protected VOID_SaveValue<Rect> VOIDIconPos = new Rect(Screen.width / 2 - 200, Screen.height - 30, 30f, 30f);
+		protected Texture2D VOIDIconOff = new Texture2D(30, 30, TextureFormat.ARGB32, false);
+		protected Texture2D VOIDIconOn = new Texture2D(30, 30, TextureFormat.ARGB32, false);
+		protected Texture2D VOIDIconTexture;
+		protected string VOIDIconOnPath = "VOID/Textures/void_icon_on";
+		protected string VOIDIconOffPath = "VOID/Textures/void_icon_off";
+
+		protected int windowBaseID = -96518722;
+
+		[AVOID_SaveValue("togglePower")]
+		public VOID_SaveValue<bool> togglePower = true;
+
+		public bool powerAvailable = true;
+
+		[AVOID_SaveValue("consumeResource")]
+		protected VOID_SaveValue<bool> consumeResource = false;
+
+		[AVOID_SaveValue("resourceName")]
+		protected VOID_SaveValue<string> resourceName = "ElectricCharge";
+
+		[AVOID_SaveValue("resourceRate")]
+		protected VOID_SaveValue<float> resourceRate = 0.2f;
+
+		public float saveTimer = 0;
+
+		protected string defaultSkin = "KSP window 2";
+		protected VOID_SaveValue<string> _skin;
+
+		public bool configDirty;
+
 		/*
 		 * Properties
 		 * */
-		public bool hasGUIConfig
+		public List<VOID_Module> Modules
 		{
 			get
 			{
-				return false;
-			}
-		}
-
-		public bool toggleActive
+				return this._modules;
+			}
+		}
+
+		public GUISkin Skin
 		{
 			get
 			{
-				return this._Active;
-			}
-			set
-			{
-				this._Active = value;
-			}
-		}
-
-		public bool guiRunning
+				if (this._skin == null)
+				{
+					this._skin = this.defaultSkin;
+				}
+				return AssetBase.GetGUISkin(this._skin);
+			}
+		}
+
+		public Vessel vessel
 		{
 			get
 			{
-				return this._Running;
+				return FlightGlobals.ActiveVessel;
 			}
 		}
 
 		/*
 		 * Methods
 		 * */
-		public void DrawGUI()
-		{
-
-		}
-
-		public void StartGUI()
-		{
-			RenderingManager.AddToPostDrawQueue(3, this.DrawGUI);
-		}
-
-		public void StopGUI()
-		{
-			RenderingManager.RemoveFromPostDrawQueue(3, this.DrawGUI);
-		}
-
-		public void LoadConfig()
-		{
-			var config = KSP.IO.PluginConfiguration.CreateForType<VOID_Core>();
-			config.load();
-			this.main_window_pos = config.GetValue("main_window_pos", this.main_window_pos);
-			this.main_icon_pos = config.GetValue("main_icon_pos", this.main_icon_pos);
-		}
-
-		public void SaveConfig()
-		{
+		protected VOID_Core()
+		{
+			this._Name = "VOID Core";
+
+			this.VOIDIconOn = GameDatabase.Instance.GetTexture (this.VOIDIconOnPath, false);
+			this.VOIDIconOff = GameDatabase.Instance.GetTexture (this.VOIDIconOffPath, false);
+
+			Tools.PostDebugMessage (string.Format ("VOID_Core: Loaded {0} modules.", this.Modules.Count));
+
+			this.LoadConfig ();
+		}
+
+		protected void LoadModules()
+		{
+			var types = AssemblyLoader.loadedAssemblies
+				.Select (a => a.assembly.GetExportedTypes ())
+					.SelectMany (t => t)
+					.Where (v => typeof(IVOID_Module).IsAssignableFrom (v)
+					        && !(v.IsInterface || v.IsAbstract) &&
+					        !typeof(VOID_Core).IsAssignableFrom (v)
+					        );
+
+			Tools.PostDebugMessage (string.Format (
+				"{0}: Checking {1} modules to check.",
+				this.GetType ().Name,
+				types.Count ()
+				));
+			foreach (var voidType in types)
+			{
+				Tools.PostDebugMessage (string.Format (
+					"{0}: found Type {1}",
+					this.GetType ().Name,
+					voidType.Name
+					));
+
+				this.LoadModule(voidType);
+			}
+
+			this._modulesLoaded = true;
+		}
+
+		protected void LoadModule(Type T)
+		{
+			var existingModules = this._modules.Where (mod => mod.GetType ().Name == T.Name);
+			if (existingModules.Any())
+			{
+				Tools.PostDebugMessage(string.Format(
+					"{0}: refusing to load {1}: already loaded",
+					this.GetType().Name,
+					T.Name
+				));
+				return;
+			}
+			VOID_Module module = Activator.CreateInstance (T) as VOID_Module;
+			this._modules.Add (module);
+		}
+
+		public void Update()
+		{
+			this.saveTimer += Time.deltaTime;
+
+			if (!this.guiRunning)
+			{
+				this.StartGUI ();
+			}
+
+			if (!HighLogic.LoadedSceneIsFlight && this.guiRunning)
+			{
+				this.StopGUI ();
+			}
+
+			foreach (VOID_Module module in this.Modules)
+			{
+				if (!module.guiRunning && module.toggleActive)
+				{
+					module.StartGUI ();
+				}
+				if (module.guiRunning && !module.toggleActive || !this.togglePower || !HighLogic.LoadedSceneIsFlight)
+				{
+					module.StopGUI();
+				}
+			}
+
+			if (this.saveTimer > 15f)
+			{
+				this.SaveConfig ();
+				this.saveTimer = 0;
+			}
+		}
+
+		public void FixedUpdate()
+		{
+			if (this.consumeResource &&
+			    this.vessel.vesselType != VesselType.EVA &&
+			    TimeWarp.deltaTime != 0
+			    )
+			{
+				float powerReceived = this.vessel.rootPart.RequestResource(this.resourceName,
+				                                                          this.resourceRate * TimeWarp.fixedDeltaTime);
+				if (powerReceived > 0)
+				{
+					this.powerAvailable = true;
+				}
+				else
+				{
+					this.powerAvailable = false;
+				}
+			}
+		}
+
+		public void VOIDMainWindow(int _)
+		{
+			GUILayout.BeginVertical();
+			
+			if (this.powerAvailable)
+			{
+				string str = "ON";
+				if (togglePower) str = "OFF";
+				if (GUILayout.Button("Power " + str)) togglePower = !togglePower;
+			    if (togglePower)
+			    {
+					foreach (VOID_Module module in this.Modules)
+					{
+						module.toggleActive = GUILayout.Toggle (module.toggleActive, module.Name);
+					}
+			    }
+			}
+			else
+			{
+			    GUIStyle label_txt_red = new GUIStyle(GUI.skin.label);
+			    label_txt_red.normal.textColor = Color.red;
+			    label_txt_red.alignment = TextAnchor.MiddleCenter;
+			    GUILayout.Label("-- POWER LOST --", label_txt_red);
+			}
+
+			this.configWindowMinimized = !GUILayout.Toggle (!this.configWindowMinimized, "Configuration");
+
+			GUILayout.EndVertical();
+			GUI.DragWindow();
+		}
+
+		public void VOIDConfigWindow(int _)
+		{
+			GUILayout.BeginVertical ();
+
+			this.DrawConfigurables ();
+
+			GUILayout.EndVertical ();
+			GUI.DragWindow ();
+		}
+
+		public override void DrawConfigurables()
+		{
+			this.consumeResource = GUILayout.Toggle (this.consumeResource, "Consume Resources");
+
+			foreach (VOID_Module mod in this.Modules)
+			{
+				mod.DrawConfigurables ();
+			}
+		}
+
+		public override void DrawGUI()
+		{
+			if (!this._modulesLoaded)
+			{
+				this.LoadModules ();
+			}
+
+			GUI.skin = this.Skin;
+
+			int windowID = this.windowBaseID;
+
+			this.VOIDIconTexture = this.VOIDIconOff;  //icon off default
+			if (this.togglePower) this.VOIDIconTexture = this.VOIDIconOn;     //or on if power_toggle==true
+			if (GUI.Button(new Rect(VOIDIconPos), VOIDIconTexture, new GUIStyle()))
+			{
+				this.mainGuiMinimized = !this.mainGuiMinimized;
+			}
+
+			if (!this.mainGuiMinimized)
+			{
+				Rect _mainWindowPos = this.mainWindowPos;
+
+				_mainWindowPos = GUILayout.Window (
+					++windowID,
+					_mainWindowPos,
+					this.VOIDMainWindow,
+					string.Join (" ", new string[] {this.VoidName, this.VoidVersion}),
+					GUILayout.Width (250),
+					GUILayout.Height (50)
+				);
+
+				if (_mainWindowPos != this.mainWindowPos)
+				{
+					this.mainWindowPos = _mainWindowPos;
+				}
+			}
+
+			if (!this.configWindowMinimized)
+			{
+				Rect _configWindowPos = this.configWindowPos;
+
+				_configWindowPos = GUILayout.Window (
+					++windowID,
+					_configWindowPos,
+					this.VOIDConfigWindow,
+					string.Join (" ", new string[] {this.VoidName, "Configuration"}),
+					GUILayout.Width (250),
+					GUILayout.Height (50)
+				);
+
+				if (_configWindowPos != this.configWindowPos)
+				{
+					this.configWindowPos = _configWindowPos;
+				}
+			}
+		}
+
+		public override void LoadConfig()
+		{
+			base.LoadConfig ();
+
+			foreach (VOID_Module module in this.Modules)
+			{
+				module.LoadConfig ();
+			}
+		}
+
+		public override void SaveConfig()
+		{
+			if (!this.configDirty)
+			{
+				return;
+			}
+
+			base.SaveConfig ();
+
+			foreach (VOID_Module module in this.Modules)
+			{
+				module.SaveConfig ();
+			}
+
+			this.configDirty = false;
 		}
 	}
 }

--- a/VOID_HUD.cs
+++ b/VOID_HUD.cs
@@ -27,44 +27,22 @@
 
 namespace VOID
 {
-	public class VOID_HUD : IVOID_Module
+	public class VOID_HUD : VOID_Module, IVOID_Module
 	{
-		/*
-		 * Static Members
-		 * */
-		protected static VOID_HUD _instance;
-
-		public static IVOID_Module Instance {
-			get {
-				if (_instance == null) {
-					Tools.PostDebugMessage ("Instantiating VOID_HUD");
-					_instance = new VOID_HUD ();
-				}
-				Tools.PostDebugMessage ("Returning VOID_HUD instance.");
-				return _instance;
-			}
-		}
-
 		/*
 		 * Fields
 		 * */
+		protected new bool _hasConfigurables = true;
+
+		[AVOID_SaveValue("colorIndex")]
+		protected VOID_SaveValue<int> _colorIndex = 0;
+
 		protected List<Color> textColors = new List<Color>();
 
 		protected GUIStyle labelStyle;
 
-		protected int _counterTextColor = 0;
-
 		protected Vessel vessel = null;
 
-		public bool guiRunning = false;
-
-		public bool hasGUIConfig
-		{
-			get
-			{
-				return false;
-			}
-		}
 		/*
 		 * Properties
 		 * */
@@ -72,25 +50,26 @@
 		{
 			get
 			{
-				return this._counterTextColor;
+				return this._colorIndex;
 			}
 			set
 			{
-				if (this._counterTextColor >= this.textColors.Count - 1)
+				if (this._colorIndex >= this.textColors.Count - 1)
 				{
-					this._counterTextColor = 0;
+					this._colorIndex = 0;
 					return;
 				}
 
-				this._counterTextColor = value;
+				this._colorIndex = value;
 			}
 		}
 
 		/* 
 		 * Methods
 		 * */
-		private VOID_HUD() : base()
+		public VOID_HUD() : base()
 		{
+			this._Name = "Heads-Up Display";
 			this.textColors.Add(Color.green);
 			this.textColors.Add(Color.black);
 			this.textColors.Add(Color.white);
@@ -103,16 +82,16 @@
 
 			this.labelStyle = new GUIStyle ();
 			this.labelStyle.normal.textColor = this.textColors [this.ColorIndex];
+
+			Tools.PostDebugMessage ("VOID_HUD: Constructed.");
 		}
 
-		~VOID_HUD()
-		{
-			this.SaveConfig();
-		}
-
-		public void DrawGUI()
+		public override void DrawGUI()
 		{
 			Tools.PostDebugMessage ("VOID_HUD: Drawing GUI.");
+
+			GUI.skin = VOID_Core.Instance.Skin;
+
 			if (vessel == null)
 			{
 				vessel = FlightGlobals.ActiveVessel;
@@ -123,74 +102,48 @@
 				vessel = FlightGlobals.ActiveVessel;
 			}
 
-			if (true)
+			if (VOID_Core.Instance.powerAvailable)
 			{
-				if (true)
-				{
-					labelStyle.normal.textColor = textColors [ColorIndex];
+				labelStyle.normal.textColor = textColors [ColorIndex];
 
-					GUI.Label (
-						new Rect ((Screen.width * .2083f), 0, 300f, 70f),
-						"Obt Alt: " + Tools.MuMech_ToSI (vessel.orbit.altitude) + "m" +
-						" Obt Vel: " + Tools.MuMech_ToSI (vessel.orbit.vel.magnitude) + "m/s" +
-						"\nAp: " + Tools.MuMech_ToSI (vessel.orbit.ApA) + "m" +
-						" ETA " + Tools.ConvertInterval (vessel.orbit.timeToAp) +
-						"\nPe: " + Tools.MuMech_ToSI (vessel.orbit.PeA) + "m" +
-						" ETA " + Tools.ConvertInterval (vessel.orbit.timeToPe) +
-						"\nInc: " + vessel.orbit.inclination.ToString ("F3") + "°",
-						labelStyle);
-					// Toadicus edit: Added "Biome: " line to surf/atmo HUD
-					GUI.Label (
-						new Rect ((Screen.width * .625f), 0, 300f, 90f),
-						"Srf Alt: " + Tools.MuMech_ToSI (Tools.TrueAltitude (vessel)) + "m" +
-						" Srf Vel: " + Tools.MuMech_ToSI (vessel.srf_velocity.magnitude) + "m/s" +
-						"\nVer: " + Tools.MuMech_ToSI (vessel.verticalSpeed) + "m/s" +
-						" Hor: " + Tools.MuMech_ToSI (vessel.horizontalSrfSpeed) + "m/s" +
-						"\nLat: " + Tools.GetLatitudeString (vessel, "F3") +
-						" Lon: " + Tools.GetLongitudeString (vessel, "F3") +
-						"\nHdg: " + Tools.MuMech_get_heading (vessel).ToString ("F2") + "° " +
-						Tools.get_heading_text (Tools.MuMech_get_heading (vessel)) +
-						"\nBiome: " + Tools.Toadicus_GetAtt (vessel).name,
-						labelStyle);
-				}
-				else
-				{
-					labelStyle.normal.textColor = Color.red;
-					GUI.Label (new Rect ((Screen.width * .2083f), 0, 300f, 70f), "-- POWER LOST --", labelStyle);
-					GUI.Label (new Rect ((Screen.width * .625f), 0, 300f, 70f), "-- POWER LOST --", labelStyle);
-				}
+				GUI.Label (
+					new Rect ((Screen.width * .2083f), 0, 300f, 70f),
+					"Obt Alt: " + Tools.MuMech_ToSI (vessel.orbit.altitude) + "m" +
+					" Obt Vel: " + Tools.MuMech_ToSI (vessel.orbit.vel.magnitude) + "m/s" +
+					"\nAp: " + Tools.MuMech_ToSI (vessel.orbit.ApA) + "m" +
+					" ETA " + Tools.ConvertInterval (vessel.orbit.timeToAp) +
+					"\nPe: " + Tools.MuMech_ToSI (vessel.orbit.PeA) + "m" +
+					" ETA " + Tools.ConvertInterval (vessel.orbit.timeToPe) +
+					"\nInc: " + vessel.orbit.inclination.ToString ("F3") + "°",
+					labelStyle);
+				// Toadicus edit: Added "Biome: " line to surf/atmo HUD
+				GUI.Label (
+					new Rect ((Screen.width * .625f), 0, 300f, 90f),
+					"Srf Alt: " + Tools.MuMech_ToSI (Tools.TrueAltitude (vessel)) + "m" +
+					" Srf Vel: " + Tools.MuMech_ToSI (vessel.srf_velocity.magnitude) + "m/s" +
+					"\nVer: " + Tools.MuMech_ToSI (vessel.verticalSpeed) + "m/s" +
+					" Hor: " + Tools.MuMech_ToSI (vessel.horizontalSrfSpeed) + "m/s" +
+					"\nLat: " + Tools.GetLatitudeString (vessel, "F3") +
+					" Lon: " + Tools.GetLongitudeString (vessel, "F3") +
+					"\nHdg: " + Tools.MuMech_get_heading (vessel).ToString ("F2") + "° " +
+					Tools.get_heading_text (Tools.MuMech_get_heading (vessel)) +
+					"\nBiome: " + Tools.Toadicus_GetAtt (vessel).name,
+					labelStyle);
+			}
+			else
+			{
+				labelStyle.normal.textColor = Color.red;
+				GUI.Label (new Rect ((Screen.width * .2083f), 0, 300f, 70f), "-- POWER LOST --", labelStyle);
+				GUI.Label (new Rect ((Screen.width * .625f), 0, 300f, 70f), "-- POWER LOST --", labelStyle);
 			}
 		}
 
-		public void StartGUI()
+		public override void DrawConfigurables()
 		{
-			Tools.PostDebugMessage ("Adding VOID_HUD to the draw queue.");
-			RenderingManager.AddToPostDrawQueue (3, new Callback(this.DrawGUI));
-			this.guiRunning = true;
-		}
-
-		public void StopGUI()
-		{
-			Tools.PostDebugMessage ("Removing VOID_HUD from the draw queue.");
-			RenderingManager.RemoveFromPostDrawQueue (3, new Callback(this.DrawGUI));
-			this.guiRunning = false;
-		}
-
-		public void SaveConfig()
-		{
-			Tools.PostDebugMessage ("VOID_HUD: Saving Config.");
-			var config = KSP.IO.PluginConfiguration.CreateForType<VOID_HUD> ();
-			config.load ();
-			config.SetValue ("ColorIndex", this.ColorIndex);
-			config.save ();
-		}
-
-		public void LoadConfig()
-		{
-			Tools.PostDebugMessage ("VOID_HUD: Loading Config.");
-			var config = KSP.IO.PluginConfiguration.CreateForType<VOID_HUD> ();
-			config.load ();
-			this.ColorIndex = config.GetValue ("ColorIndex", 0);
+			if (GUILayout.Button ("Change HUD color", GUILayout.ExpandWidth (false)))
+			{
+				++this.ColorIndex;
+			}
 		}
 	}
 }

file:b/VOID_Module.cs (new)
--- /dev/null
+++ b/VOID_Module.cs
@@ -1,1 +1,194 @@
+//
+//  VOID_Module.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 System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
 
+namespace VOID
+{
+	public abstract class VOID_Module : IVOID_Module
+	{
+		/*
+		 * Fields
+		 * */
+		[AVOID_SaveValue("Active")]
+		protected VOID_SaveValue<bool> _Active = true;
+		protected bool _Running = false;
+		protected bool _hasConfigurables = false;
+
+		protected string _Name;
+
+		/*
+		 * Properties
+		 * */
+		public virtual bool hasConfigurables
+		{
+			get
+			{
+				return this._hasConfigurables;
+			}
+		}
+
+		public virtual bool toggleActive
+		{
+			get
+			{
+				return this._Active;
+			}
+			set
+			{
+				this._Active = value;
+			}
+		}
+
+		public virtual bool guiRunning
+		{
+			get
+			{
+				return this._Running;
+			}
+		}
+
+		public virtual string Name
+		{
+			get
+			{
+				return this._Name;
+			}
+		}
+
+		/*
+		 * Methods
+		 * */
+		public void StartGUI()
+		{
+			if (!this.toggleActive)
+			{
+				return;
+			}
+
+			Tools.PostDebugMessage (string.Format("Adding {0} to the draw queue.", this.GetType().Name));
+			RenderingManager.AddToPostDrawQueue (3, this.DrawGUI);
+			this._Running = true;
+		}
+
+		public void StopGUI()
+		{
+			Tools.PostDebugMessage (string.Format("Removing {0} from the draw queue.", this.GetType().Name));
+			RenderingManager.RemoveFromPostDrawQueue (3, this.DrawGUI);
+			this._Running = false;
+		}
+
+		public abstract void DrawGUI();
+
+		public virtual void DrawConfigurables() {}
+
+		public virtual void LoadConfig()
+		{
+			var config = KSP.IO.PluginConfiguration.CreateForType<VOID_Core> ();
+			config.load ();
+
+			foreach (var field in this.GetType().GetFields(
+				BindingFlags.NonPublic |
+				BindingFlags.Public |
+				BindingFlags.Instance
+				))
+			{
+				object[] attrs = field.GetCustomAttributes(typeof(AVOID_SaveValue), false);
+
+				if (attrs.Length == 0) {
+					return;
+				}
+
+				AVOID_SaveValue attr = attrs.FirstOrDefault () as AVOID_SaveValue;
+
+				string fieldName = string.Format("{0}_{1}", this.GetType().Name, attr.Name);
+
+				object fieldValue = field.GetValue(this);
+
+				bool convertBack = false;
+				if (fieldValue is IVOID_SaveValue)
+				{
+					fieldValue = (fieldValue as IVOID_SaveValue).AsType;
+					convertBack = true;
+				}
+
+				fieldValue = config.GetValue(fieldName, fieldValue);
+
+				if (convertBack)
+				{
+					Type type = typeof(VOID_SaveValue<>).MakeGenericType (fieldValue.GetType ());
+					IVOID_SaveValue convertValue = Activator.CreateInstance (type) as IVOID_SaveValue;
+					convertValue.SetValue (fieldValue);
+					fieldValue = convertValue;
+				}
+
+				field.SetValue (this, fieldValue);
+
+				Tools.PostDebugMessage(string.Format("{0}: Loaded field {1}.", this.GetType().Name, fieldName));
+			}
+		}
+
+		public virtual void SaveConfig()
+		{
+			if (!VOID_Core.Instance.configDirty)
+			{
+				return;
+			}
+
+			var config = KSP.IO.PluginConfiguration.CreateForType<VOID_Core> ();
+			config.load ();
+
+			foreach (var field in this.GetType().GetFields(
+				BindingFlags.NonPublic |
+				BindingFlags.Public |
+				BindingFlags.Instance
+				))
+			{
+				object[] attrs = field.GetCustomAttributes(typeof(AVOID_SaveValue), false);
+
+				if (attrs.Length == 0) {
+					return;
+				}
+
+				AVOID_SaveValue attr = attrs.FirstOrDefault () as AVOID_SaveValue;
+
+				string fieldName = string.Format("{0}_{1}", this.GetType().Name, attr.Name);
+
+				object fieldValue = field.GetValue(this);
+
+				if (fieldValue is IVOID_SaveValue)
+				{
+					fieldValue = (fieldValue as IVOID_SaveValue).AsType;
+				}
+
+				config.SetValue(fieldName, fieldValue);
+
+				Tools.PostDebugMessage(string.Format("{0}: Saved field {1}.", this.GetType().Name, fieldName));
+			}
+
+			config.save ();
+		}
+	}
+}
+
+

file:b/VOID_SaveValue.cs (new)
--- /dev/null
+++ b/VOID_SaveValue.cs
@@ -1,1 +1,115 @@
+//
+//  VOID_Config.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 System;
+using System.Collections.Generic;
+using KSP;
+using UnityEngine;
 
+namespace VOID
+{
+	public struct VOID_SaveValue<T> : IVOID_SaveValue
+	{
+		private T _value;
+		private Type _type;
+
+		public T value
+		{
+			get
+			{
+				return this._value;
+			}
+			set
+			{
+				this._value = value;
+			}
+		}
+
+		public Type type
+		{
+			get
+			{
+				return this._type;
+			}
+			set
+			{
+				this._type = value;
+			}
+		}
+
+		public object AsType
+		{
+			get
+			{
+				return (T)this._value;
+			}
+		}
+
+		public void SetValue(object v)
+		{
+			this._value = (T)v;
+		}
+
+		public static implicit operator T(VOID_SaveValue<T> v)
+		{
+			return v.value;
+		}
+
+		public static implicit operator VOID_SaveValue<T>(T v)
+		{
+			VOID_SaveValue<T> r = new VOID_SaveValue<T>();
+			r.value = v;
+			r.type = v.GetType();
+			if (VOID_Core.Initialized)
+			{
+				VOID_Core.Instance.configDirty = true;
+			}
+			return r;
+		}
+	}
+
+	public interface IVOID_SaveValue
+	{
+		Type type { get; }
+		object AsType { get; }
+		void SetValue(object v);
+	}
+
+	[AttributeUsage(AttributeTargets.Field)]
+	public class AVOID_SaveValue : Attribute
+	{
+		protected string _name;
+
+		public string Name
+		{
+			get
+			{
+				return this._name;
+			}
+		}
+
+		public AVOID_SaveValue(string fieldName)
+		{
+			this._name = fieldName;
+		}
+	}
+}
+
+