Added adjustable GUI display size.
Added adjustable GUI display size.

--- a/KerbalEngineer/Editor/BuildAdvanced.cs
+++ b/KerbalEngineer/Editor/BuildAdvanced.cs
@@ -171,6 +171,7 @@
             this.windowId = this.GetHashCode();

             this.InitialiseStyles();

             RenderingManager.AddToPostDrawQueue(0, this.OnDraw);

+            GuiDisplaySize.OnSizeChanged += this.OnSizeChanged;

         }

 

         /// <summary>

@@ -198,7 +199,7 @@
                     {

                         textColor = Color.white

                     },

-                    fontSize = 11,

+                    fontSize = (int)(11 * GuiDisplaySize.Offset),

                     fontStyle = FontStyle.Bold,

                     alignment = TextAnchor.MiddleCenter

                 };

@@ -209,7 +210,7 @@
                     {

                         textColor = Color.white

                     },

-                    fontSize = 11,

+                    fontSize = (int)(11 * GuiDisplaySize.Offset),

                     fontStyle = FontStyle.Bold,

                     alignment = TextAnchor.MiddleCenter,

                     stretchWidth = true,

@@ -217,7 +218,7 @@
 

                 this.infoStyle = new GUIStyle(HighLogic.Skin.label)

                 {

-                    fontSize = 11,

+                    fontSize = (int)(11 * GuiDisplaySize.Offset),

                     fontStyle = FontStyle.Bold,

                     alignment = TextAnchor.MiddleCenter,

                     stretchWidth = true

@@ -234,6 +235,12 @@
             }

         }

 

+        private void OnSizeChanged()

+        {

+            this.InitialiseStyles();

+            this.hasChanged = true;

+        }

+

         #endregion

 

         #region Update and Drawing

@@ -349,7 +356,7 @@
             try

             {

                 // Draw the compact mode toggle.

-                if (GUI.Toggle(new Rect(this.windowPosition.width - 70.0f, 5.0f, 65.0f, 20.0f), this.compactMode, "COMPACT", this.buttonStyle) != this.compactMode)

+                if (GUI.Toggle(new Rect(this.windowPosition.width - 70.0f * GuiDisplaySize.Offset, 5.0f, 65.0f * GuiDisplaySize.Offset, 20.0f), this.compactMode, "COMPACT", this.buttonStyle) != this.compactMode)

                 {

                     this.hasChanged = true;

                     this.compactCheck = 2;

@@ -360,25 +367,25 @@
                 // When not in compact mode draw the 'All Stages' and 'Atmospheric' toggles.

                 if (!this.compactMode)

                 {

-                    if (GUI.Toggle(new Rect(this.windowPosition.width - 143.0f, 5.0f, 70.0f, 20.0f), this.showSettings, "SETTINGS", this.buttonStyle) != this.showSettings)

+                    if (GUI.Toggle(new Rect(this.windowPosition.width - 143.0f * GuiDisplaySize.Offset, 5.0f, 70.0f * GuiDisplaySize.Offset, 20.0f), this.showSettings, "SETTINGS", this.buttonStyle) != this.showSettings)

                     {

                         this.hasChanged = true;

                         this.showSettings = !this.showSettings;

                     }

 

-                    if (GUI.Toggle(new Rect(this.windowPosition.width - 226.0f, 5.0f, 80.0f, 20.0f), this.showAllStages, "ALL STAGES", this.buttonStyle) != this.showAllStages)

+                    if (GUI.Toggle(new Rect(this.windowPosition.width - 226.0f * GuiDisplaySize.Offset, 5.0f, 80.0f * GuiDisplaySize.Offset, 20.0f), this.showAllStages, "ALL STAGES", this.buttonStyle) != this.showAllStages)

                     {

                         this.hasChanged = true;

                         this.showAllStages = !this.showAllStages;

                     }

 

-                    if (GUI.Toggle(new Rect(this.windowPosition.width - 324.0f, 5.0f, 95.0f, 20.0f), this.showAtmosphericDetails, "ATMOSPHERIC", this.buttonStyle) != this.showAtmosphericDetails)

+                    if (GUI.Toggle(new Rect(this.windowPosition.width - 324.0f * GuiDisplaySize.Offset, 5.0f, 95.0f * GuiDisplaySize.Offset, 20.0f), this.showAtmosphericDetails, "ATMOSPHERIC", this.buttonStyle) != this.showAtmosphericDetails)

                     {

                         this.hasChanged = true;

                         this.showAtmosphericDetails = !this.showAtmosphericDetails;

                     }

 

-                    if (GUI.Toggle(new Rect(this.windowPosition.width - 452.0f, 5.0f, 125.0f, 20.0f), this.showReferenceBodies, "REFERENCE BODIES", this.buttonStyle) != this.showReferenceBodies)

+                    if (GUI.Toggle(new Rect(this.windowPosition.width - 452.0f * GuiDisplaySize.Offset, 5.0f, 125.0f * GuiDisplaySize.Offset, 20.0f), this.showReferenceBodies, "REFERENCE BODIES", this.buttonStyle) != this.showReferenceBodies)

                     {

                         this.hasChanged = true;

                         this.showReferenceBodies = !this.showReferenceBodies;

@@ -447,13 +454,13 @@
             try

             {

                 GUILayout.BeginHorizontal();

-                GUILayout.Label("Pressure " + (this.atmosphericPercentage * 100.0f).ToString("F1") + "%", this.settingStyle, GUILayout.Width(125.0f));

+                GUILayout.Label("Pressure " + (this.atmosphericPercentage * 100.0f).ToString("F1") + "%", this.settingStyle, GUILayout.Width(125.0f * GuiDisplaySize.Offset));

                 GUI.skin = HighLogic.Skin;

                 this.atmosphericPercentage = GUILayout.HorizontalSlider(this.atmosphericPercentage, 0, 1.0f);

                 GUI.skin = null;

                 GUILayout.EndHorizontal();

                 GUILayout.BeginHorizontal();

-                GUILayout.Label("Velocity " + this.atmosphericVelocity.ToString("F1") + "m/s", this.settingStyle, GUILayout.Width(125.0f));

+                GUILayout.Label("Velocity " + this.atmosphericVelocity.ToString("F1") + "m/s", this.settingStyle, GUILayout.Width(125.0f * GuiDisplaySize.Offset));

                 GUI.skin = HighLogic.Skin;

                 this.atmosphericVelocity = GUILayout.HorizontalSlider(this.atmosphericVelocity, 0, 2500f);

                 GUI.skin = null;

@@ -504,15 +511,27 @@
             {

                 GUILayout.BeginHorizontal();

                 GUILayout.Label("Compact mode collapses to the:", this.settingStyle);

-                this.compactCollapseRight = !GUILayout.Toggle(!this.compactCollapseRight, "LEFT", this.buttonStyle, GUILayout.Width(100.0f));

-                this.compactCollapseRight = GUILayout.Toggle(this.compactCollapseRight, "RIGHT", this.buttonStyle, GUILayout.Width(100.0f));

+                this.compactCollapseRight = !GUILayout.Toggle(!this.compactCollapseRight, "LEFT", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));

+                this.compactCollapseRight = GUILayout.Toggle(this.compactCollapseRight, "RIGHT", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));

                 GUILayout.EndHorizontal();

 

                 GUILayout.BeginHorizontal();

                 GUILayout.Label("Flight Engineer activation mode:", this.settingStyle);

-                FlightEngineerPartless.IsPartless = GUILayout.Toggle(FlightEngineerPartless.IsPartless, "PARTLESS", this.buttonStyle, GUILayout.Width(100.0f));

-                FlightEngineerPartless.IsPartless = !GUILayout.Toggle(!FlightEngineerPartless.IsPartless, "MODULE", this.buttonStyle, GUILayout.Width(100.0f));

+                FlightEngineerPartless.IsPartless = GUILayout.Toggle(FlightEngineerPartless.IsPartless, "PARTLESS", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));

+                FlightEngineerPartless.IsPartless = !GUILayout.Toggle(!FlightEngineerPartless.IsPartless, "MODULE", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));

                 GUILayout.EndHorizontal();

+

+                GUILayout.BeginHorizontal();

+                GUILayout.Label("GUI Size: " + GuiDisplaySize.Increment, this.settingStyle);

+                if (GUILayout.Button("<", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset)))

+                {

+                    GuiDisplaySize.Increment--;

+                }

+                if (GUILayout.Button(">", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset)))

+                {

+                    GuiDisplaySize.Increment++;

+                }

+                GUILayout.EndHorizontal();

             }

             catch (Exception ex)

             {

@@ -527,7 +546,7 @@
         {

             try

             {

-                GUILayout.BeginVertical(GUILayout.Width(30.0f));

+                GUILayout.BeginVertical(GUILayout.Width(30.0f * GuiDisplaySize.Offset));

                 GUILayout.Label(string.Empty, this.titleStyle);

                 foreach (var stage in SimManager.Stages)

                 {

@@ -551,7 +570,7 @@
         {

             try

             {

-                GUILayout.BeginVertical(GUILayout.Width(50.0f));

+                GUILayout.BeginVertical(GUILayout.Width(50.0f * GuiDisplaySize.Offset));

                 GUILayout.Label("PARTS", this.titleStyle);

                 foreach (var stage in SimManager.Stages)

                 {

@@ -575,7 +594,7 @@
         {

             try

             {

-                GUILayout.BeginVertical(GUILayout.Width(110.0f));

+                GUILayout.BeginVertical(GUILayout.Width(110.0f * GuiDisplaySize.Offset));

                 GUILayout.Label("COST", this.titleStyle);

                 foreach (var stage in SimManager.Stages)

                 {

@@ -599,7 +618,7 @@
         {

             try

             {

-                GUILayout.BeginVertical(GUILayout.Width(110.0f));

+                GUILayout.BeginVertical(GUILayout.Width(110.0f * GuiDisplaySize.Offset));

                 GUILayout.Label("MASS", this.titleStyle);

                 foreach (var stage in SimManager.Stages)

                 {

@@ -623,7 +642,7 @@
         {

             try

             {

-                GUILayout.BeginVertical(GUILayout.Width(75.0f));

+                GUILayout.BeginVertical(GUILayout.Width(75.0f * GuiDisplaySize.Offset));

                 GUILayout.Label("ISP", this.titleStyle);

                 foreach (var stage in SimManager.Stages)

                 {

@@ -647,7 +666,7 @@
         {

             try

             {

-                GUILayout.BeginVertical(GUILayout.Width(75.0f));

+                GUILayout.BeginVertical(GUILayout.Width(75.0f * GuiDisplaySize.Offset));

                 GUILayout.Label("THRUST", this.titleStyle);

                 foreach (var stage in SimManager.Stages)

                 {

@@ -671,7 +690,7 @@
         {

             try

             {

-                GUILayout.BeginVertical(GUILayout.Width(100.0f));

+                GUILayout.BeginVertical(GUILayout.Width(100.0f * GuiDisplaySize.Offset));

                 GUILayout.Label("TWR (MAX)", this.titleStyle);

                 foreach (var stage in SimManager.Stages)

                 {

@@ -695,7 +714,7 @@
         {

             try

             {

-                GUILayout.BeginVertical(GUILayout.Width(100.0f));

+                GUILayout.BeginVertical(GUILayout.Width(100.0f * GuiDisplaySize.Offset));

                 GUILayout.Label("DELTA-V", this.titleStyle);

                 foreach (var stage in SimManager.Stages)

                 {

@@ -719,7 +738,7 @@
         {

             try

             {

-                GUILayout.BeginVertical(GUILayout.Width(75.0f));

+                GUILayout.BeginVertical(GUILayout.Width(75.0f * GuiDisplaySize.Offset));

                 GUILayout.Label("BURN", this.titleStyle);

                 foreach (var stage in SimManager.Stages)

                 {

@@ -759,6 +778,7 @@
                 handler.Set("showSettings", this.showSettings);

                 handler.Set("selectedBodyName", CelestialBodies.Instance.SelectedBodyName);

                 handler.Save("BuildAdvanced.xml");

+                GuiDisplaySize.OnSizeChanged -= this.OnSizeChanged;

             }

             catch (Exception ex)

             {


--- a/KerbalEngineer/Editor/BuildOverlay.cs
+++ b/KerbalEngineer/Editor/BuildOverlay.cs
@@ -59,6 +59,7 @@
         private void Awake()

         {

             Instance = this;

+            GuiDisplaySize.OnSizeChanged += this.OnSizeChanged;

         }

 

         private void Start()

@@ -127,7 +128,7 @@
                     },

                     margin = new RectOffset(),

                     padding = new RectOffset(),

-                    fontSize = 11,

+                    fontSize = (int)(11 * GuiDisplaySize.Offset),

                     fontStyle = FontStyle.Bold,

                     stretchWidth = true

                 };

@@ -136,7 +137,7 @@
                 {

                     margin = new RectOffset(),

                     padding = new RectOffset(),

-                    fontSize = 11,

+                    fontSize = (int)(11 * GuiDisplaySize.Offset),

                     fontStyle = FontStyle.Bold,

                     stretchWidth = true

                 };

@@ -147,14 +148,14 @@
                     {

                         textColor = Color.white

                     },

-                    fontSize = 11,

+                    fontSize = (int)(11 * GuiDisplaySize.Offset),

                     fontStyle = FontStyle.Bold,

                     stretchWidth = true

                 };

 

                 this.tooltipInfoStyle = new GUIStyle(HighLogic.Skin.label)

                 {

-                    fontSize = 11,

+                    fontSize = (int)(11 * GuiDisplaySize.Offset),

                     fontStyle = FontStyle.Bold,

                     stretchWidth = true

                 };

@@ -163,6 +164,13 @@
             {

                 Logger.Exception(ex, "BuildOverlay->InitialiseStyles");

             }

+        }

+

+        private void OnSizeChanged()

+        {

+            this.InitialiseStyles();

+            this.windowPosition.width = 0;

+            this.windowPosition.height = 0;

         }

 

         #endregion

@@ -271,14 +279,14 @@
                 GUILayout.BeginHorizontal();

 

                 // Titles

-                GUILayout.BeginVertical(GUILayout.Width(75.0f));

+                GUILayout.BeginVertical(GUILayout.Width(75.0f * GuiDisplaySize.Offset));

                 //GUILayout.Label("Parts:", this.titleStyle);

                 GUILayout.Label("Delta-V:", this.titleStyle);

                 GUILayout.Label("TWR:", this.titleStyle);

                 GUILayout.EndVertical();

 

                 // Details

-                GUILayout.BeginVertical(GUILayout.Width(100.0f));

+                GUILayout.BeginVertical(GUILayout.Width(100.0f * GuiDisplaySize.Offset));

                 //GUILayout.Label(SimulationManager.Instance.LastStage.partCount.ToString("N0"), this.infoStyle);

                 GUILayout.Label(SimManager.LastStage.totalDeltaV.ToString("N0") + " m/s", this.infoStyle);

                 GUILayout.Label(SimManager.LastStage.thrustToWeight.ToString("F2"), this.infoStyle);

@@ -439,7 +447,7 @@
                 var content = new GUIContent(value);

                 var size = this.tooltipInfoStyle.CalcSize(content);

 

-                position.y += 16.0f;

+                position.y += 16.0f * GuiDisplaySize.Offset;

                 position.width = size.x;

                 position.height = size.y;

                 GUI.Label(position, content, this.tooltipInfoStyle);

@@ -464,6 +472,7 @@
                 var handler = new SettingHandler();

                 handler.Set("visible", this.visible);

                 handler.Save("BuildOverlay.xml");

+                GuiDisplaySize.OnSizeChanged -= this.OnSizeChanged;

             }

             catch (Exception ex)

             {


--- a/KerbalEngineer/Flight/DisplayStack.cs
+++ b/KerbalEngineer/Flight/DisplayStack.cs
@@ -52,7 +52,7 @@
         private int numberOfStackSections;

         private bool resizeRequested;

         private int windowId;

-        private Rect windowPosition = new Rect(Screen.width - 275.0f, 50.0f, 250.0f, 0);

+        private Rect windowPosition;

 

         #endregion

 

@@ -68,6 +68,7 @@
                 if (Instance == null)

                 {

                     Instance = this;

+                    GuiDisplaySize.OnSizeChanged += this.OnSizeChanged;

                     Logger.Log("ActionMenu->Awake");

                 }

                 else

@@ -143,7 +144,7 @@
                     margin = new RectOffset(0, 0, 5, 3),

                     padding = new RectOffset(),

                     alignment = TextAnchor.MiddleCenter,

-                    fontSize = 13,

+                    fontSize = (int)(13 * GuiDisplaySize.Offset),

                     fontStyle = FontStyle.Bold,

                     stretchWidth = true

                 };

@@ -157,10 +158,10 @@
                     margin = new RectOffset(),

                     padding = new RectOffset(),

                     alignment = TextAnchor.MiddleCenter,

-                    fontSize = 11,

+                    fontSize = (int)(11 * GuiDisplaySize.Offset),

                     fontStyle = FontStyle.Bold,

-                    fixedWidth = 60.0f,

-                    fixedHeight = 25.0f,

+                    fixedWidth = 60.0f * GuiDisplaySize.Offset,

+                    fixedHeight = 25.0f * GuiDisplaySize.Offset,

                 };

             }

             catch (Exception ex)

@@ -169,6 +170,12 @@
             }

         }

 

+        private void OnSizeChanged()

+        {

+            this.InitialiseStyles();

+            this.RequestResize();

+        }

+

         #endregion

 

         #region Updating

@@ -212,13 +219,19 @@
                 if (this.resizeRequested || this.numberOfStackSections != SectionLibrary.Instance.NumberOfStackSections)

                 {

                     this.numberOfStackSections = SectionLibrary.Instance.NumberOfStackSections;

+                    this.windowPosition.width = 0;

                     this.windowPosition.height = 0;

                     this.resizeRequested = false;

                 }

 

                 if (!this.Hidden && (SectionLibrary.Instance.NumberOfStackSections > 0 || this.ShowControlBar))

                 {

+                    var shouldCentre = this.windowPosition.min == Vector2.zero && this.windowPosition.max == Vector2.zero;

                     this.windowPosition = GUILayout.Window(this.windowId, this.windowPosition, this.Window, string.Empty, this.windowStyle).ClampToScreen();

+                    if (shouldCentre)

+                    {

+                        this.windowPosition.center = new Vector2(Screen.width * 0.5f, Screen.height * 0.5f);

+                    }

                 }

             }

             catch (Exception ex)


--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Miscellaneous/ChangeGuiSize.cs
@@ -1,1 +1,49 @@
-
+// 

+//     Kerbal Engineer Redux

+// 

+//     Copyright (C) 2014 CYBUTEK

+// 

+//     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 UnityEngine;

+

+namespace KerbalEngineer.Flight.Readouts.Miscellaneous

+{

+    public class ChangeGuiSize : ReadoutModule

+    {

+        public ChangeGuiSize()

+        {

+            this.Name = "Change GUI Size";

+            this.Category = ReadoutCategory.Miscellaneous;

+            this.HelpString = "Shows a control that will allow you to change the GUI size.";

+            this.IsDefault = false;

+        }

+

+        public override void Draw()

+        {

+            GUILayout.BeginHorizontal();

+            GUILayout.Label("GUI Size: " + GuiDisplaySize.Increment, this.NameStyle);

+            if (GUILayout.Button("<", this.ButtonStyle))

+            {

+                GuiDisplaySize.Increment--;

+            }

+            if (GUILayout.Button(">", this.ButtonStyle))

+            {

+                GuiDisplaySize.Increment++;

+            }

+            GUILayout.EndHorizontal();

+        }

+    }

+}

--- a/KerbalEngineer/Flight/Readouts/ReadoutCategory.cs
+++ b/KerbalEngineer/Flight/Readouts/ReadoutCategory.cs
@@ -29,6 +29,6 @@
         Surface = 2,

         Vessel = 4,

         Rendezvous = 8,

-        Misc = 16

+        Miscellaneous = 16

     }

 }

--- a/KerbalEngineer/Flight/Readouts/ReadoutLibrary.cs
+++ b/KerbalEngineer/Flight/Readouts/ReadoutLibrary.cs
@@ -22,6 +22,7 @@
 using System.Collections.Generic;

 using System.Linq;

 

+using KerbalEngineer.Flight.Readouts.Miscellaneous;

 using KerbalEngineer.Flight.Readouts.Orbital;

 using KerbalEngineer.Flight.Readouts.Rendezvous;

 using KerbalEngineer.Flight.Readouts.Surface;

@@ -124,6 +125,9 @@
             this.readoutModules.Add(new Distance());

             this.readoutModules.Add(new Rendezvous.OrbitalPeriod());

 

+            // Miscellaneous

+            this.readoutModules.Add(new  ChangeGuiSize());

+

             this.LoadHelpStrings();

         }

 


--- a/KerbalEngineer/Flight/Readouts/ReadoutModule.cs
+++ b/KerbalEngineer/Flight/Readouts/ReadoutModule.cs
@@ -35,6 +35,7 @@
         protected ReadoutModule()

         {

             this.InitialiseStyles();

+            GuiDisplaySize.OnSizeChanged += this.OnSizeChanged;

         }

 

         #endregion

@@ -115,10 +116,10 @@
                 margin = new RectOffset(),

                 padding = new RectOffset(5, 0, 0, 0),

                 alignment = TextAnchor.MiddleLeft,

-                fontSize = 11,

+                fontSize = (int)(11 * GuiDisplaySize.Offset),

                 fontStyle = FontStyle.Bold,

-                fixedWidth = 115.0f,

-                fixedHeight = 20.0f

+                fixedWidth = 115.0f * GuiDisplaySize.Offset,

+                fixedHeight = 20.0f * GuiDisplaySize.Offset

             };

 

             this.ValueStyle = new GUIStyle(HighLogic.Skin.label)

@@ -126,10 +127,10 @@
                 margin = new RectOffset(),

                 padding = new RectOffset(0, 5, 0, 0),

                 alignment = TextAnchor.MiddleRight,

-                fontSize = 11,

+                fontSize = (int)(11 * GuiDisplaySize.Offset),

                 fontStyle = FontStyle.Normal,

-                fixedWidth = 115.0f,

-                fixedHeight = 20.0f

+                fixedWidth = 115.0f * GuiDisplaySize.Offset,

+                fixedHeight = 20.0f * GuiDisplaySize.Offset

             };

 

             this.MessageStyle = new GUIStyle(HighLogic.Skin.label)

@@ -141,10 +142,10 @@
                 margin = new RectOffset(),

                 padding = new RectOffset(),

                 alignment = TextAnchor.MiddleCenter,

-                fontSize = 11,

+                fontSize = (int)(11 * GuiDisplaySize.Offset),

                 fontStyle = FontStyle.Normal,

                 fixedWidth = this.ContentWidth,

-                fixedHeight = 20.0f

+                fixedHeight = 20.0f * GuiDisplaySize.Offset

             };

 

             this.FlexiLabelStyle = new GUIStyle(this.NameStyle)

@@ -162,8 +163,8 @@
                 margin = new RectOffset(0, 0, 1, 1),

                 padding = new RectOffset(),

                 alignment = TextAnchor.MiddleCenter,

-                fontSize = 11,

-                fixedHeight = 18.0f

+                fontSize = (int)(11 * GuiDisplaySize.Offset),

+                fixedHeight = 18.0f * GuiDisplaySize.Offset

             };

 

             this.TextFieldStyle = new GUIStyle(HighLogic.Skin.textField)

@@ -171,9 +172,15 @@
                 margin = new RectOffset(0, 0, 1, 1),

                 padding = new RectOffset(5, 5, 0, 0),

                 alignment = TextAnchor.MiddleLeft,

-                fontSize = 11,

-                fixedHeight = 18.0f

-            };

+                fontSize = (int)(11 * GuiDisplaySize.Offset),

+                fixedHeight = 18.0f * GuiDisplaySize.Offset

+            };

+        }

+

+        private void OnSizeChanged()

+        {

+            this.InitialiseStyles();

+            this.ResizeRequested = true;

         }

 

         #endregion


--- a/KerbalEngineer/Flight/Sections/SectionEditor.cs
+++ b/KerbalEngineer/Flight/Sections/SectionEditor.cs
@@ -271,10 +271,10 @@
                 this.selectedCategory = ReadoutCategory.Rendezvous;

             }

 

-            isSelected = this.selectedCategory == ReadoutCategory.Misc;

-            if (GUILayout.Toggle(isSelected, ReadoutCategory.Misc.ToString().ToUpper(), this.categoryButtonStyle) && !isSelected)

-            {

-                this.selectedCategory = ReadoutCategory.Misc;

+            isSelected = this.selectedCategory == ReadoutCategory.Miscellaneous;

+            if (GUILayout.Toggle(isSelected, ReadoutCategory.Miscellaneous.ToString().ToUpper(), this.categoryButtonStyle) && !isSelected)

+            {

+                this.selectedCategory = ReadoutCategory.Miscellaneous;

             }

             GUILayout.EndHorizontal();

         }


--- a/KerbalEngineer/Flight/Sections/SectionModule.cs
+++ b/KerbalEngineer/Flight/Sections/SectionModule.cs
@@ -56,6 +56,7 @@
             this.EditorPositionY = Screen.height * 0.5f - SectionEditor.Height * 0.5f;

             this.ReadoutModules = new List<ReadoutModule>();

             this.InitialiseStyles();

+            GuiDisplaySize.OnSizeChanged += this.OnSizeChanged;

         }

 

         #endregion

@@ -187,6 +188,7 @@
                 },

                 margin = new RectOffset(),

                 padding = new RectOffset(2, 0, 5, 2),

+                fontSize = (int)(13 * GuiDisplaySize.Offset),

                 fontStyle = FontStyle.Bold,

                 stretchWidth = true

             };

@@ -199,8 +201,9 @@
                 },

                 margin = new RectOffset(0, 0, 5, 3),

                 padding = new RectOffset(),

-                fontSize = 10,

-                stretchHeight = true

+                fontSize = (int)(10 * GuiDisplaySize.Offset),

+                stretchHeight = true,

+                fixedWidth = 60.0f * GuiDisplaySize.Offset

             };

 

             this.messageStyle = new GUIStyle(HighLogic.Skin.label)

@@ -212,11 +215,16 @@
                 margin = new RectOffset(),

                 padding = new RectOffset(),

                 alignment = TextAnchor.MiddleCenter,

-                fontSize = 12,

+                fontSize = (int)(12 * GuiDisplaySize.Offset),

                 fontStyle = FontStyle.Bold,

-                fixedWidth = 220.0f,

-                fixedHeight = 20.0f

+                fixedWidth = 220.0f * GuiDisplaySize.Offset,

+                fixedHeight = 20.0f * GuiDisplaySize.Offset

             };

+        }

+

+        private void OnSizeChanged()

+        {

+            this.InitialiseStyles();

         }

 

         #endregion

@@ -277,8 +285,8 @@
         {

             GUILayout.BeginHorizontal();

             GUILayout.Label(this.Name.ToUpper(), this.titleStyle);

-            this.IsEditorVisible = GUILayout.Toggle(this.IsEditorVisible, "EDIT", this.buttonStyle, GUILayout.Width(60.0f));

-            this.IsFloating = GUILayout.Toggle(this.IsFloating, "FLOAT", this.buttonStyle, GUILayout.Width(60.0f));

+            this.IsEditorVisible = GUILayout.Toggle(this.IsEditorVisible, "EDIT", this.buttonStyle);

+            this.IsFloating = GUILayout.Toggle(this.IsFloating, "FLOAT", this.buttonStyle);

             GUILayout.EndHorizontal();

         }

 


--- a/KerbalEngineer/Flight/Sections/SectionWindow.cs
+++ b/KerbalEngineer/Flight/Sections/SectionWindow.cs
@@ -47,6 +47,7 @@
             this.windowId = this.GetHashCode();

             this.InitialiseStyles();

             RenderingManager.AddToPostDrawQueue(0, this.Draw);

+            GuiDisplaySize.OnSizeChanged += this.OnSizeChanged;

         }

 

         #endregion

@@ -81,8 +82,14 @@
             this.windowStyle = new GUIStyle(HighLogic.Skin.window)

             {

                 margin = new RectOffset(),

-                padding = new RectOffset(5, 5, 0, 5)

+                padding = new RectOffset(5, 5, 0, 5),

             };

+        }

+

+        private void OnSizeChanged()

+        {

+            this.InitialiseStyles();

+            this.RequestResize();

         }

 

         #endregion

@@ -98,6 +105,7 @@
             {

                 if (this.resizeRequested)

                 {

+                    this.windowPosition.width = 0;

                     this.windowPosition.height = 0;

                     this.resizeRequested = false;

                 }

@@ -127,6 +135,7 @@
         private void OnDestroy()

         {

             RenderingManager.RemoveFromPostDrawQueue(0, this.Draw);

+            GuiDisplaySize.OnSizeChanged -= this.OnSizeChanged;

         }

 

         #endregion


--- /dev/null
+++ b/KerbalEngineer/GuiDisplaySize.cs
@@ -1,1 +1,128 @@
-
+// 

+//     Kerbal Engineer Redux

+// 

+//     Copyright (C) 2014 CYBUTEK

+// 

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

+// 

+

+#region Using Directives

+

+using System;

+

+using KerbalEngineer.Settings;

+

+#endregion

+

+namespace KerbalEngineer

+{

+    public class GuiDisplaySize

+    {

+        #region Delegates

+

+        public delegate void SizeChanged();

+

+        #endregion

+

+        #region Fields

+

+        private static float multiplier = 1.1f;

+        private static int increment = 1;

+        private static float offset;

+        public static event SizeChanged OnSizeChanged;

+

+        #endregion

+

+        #region Constructor

+

+        static GuiDisplaySize()

+        {

+            try

+            {

+                var handler = SettingHandler.Load("GuiDisplaySize.xml");

+                handler.GetSet("multiplier", ref multiplier);

+                handler.GetSet("increment", ref increment);

+                handler.Save("GuiDisplaySize.xml");

+                offset = 1 + (increment * multiplier) - increment;

+            }

+            catch (Exception ex)

+            {

+                Logger.Exception(ex, "GuiDisplaySize->GuiDisplaySize");

+            }

+        }

+

+        #endregion

+

+        #region Properties

+

+        public static float Multiplier

+        {

+            get { return multiplier; }

+            set

+            {

+                try

+                {

+                    if (multiplier == value)

+                    {

+                        return;

+                    }

+

+                    var handler = SettingHandler.Load("GuiDisplaySize.xml");

+                    handler.Set("multiplier", multiplier);

+                    handler.Save("GuiDisplaySize.xml");

+                    multiplier = value;

+                    offset = 1 + (increment * multiplier) - increment;

+                    OnSizeChanged();

+                }

+                catch (Exception ex)

+                {

+                    Logger.Exception(ex, "GuiDisplaySize->Multiplier");

+                }

+            }

+        }

+

+        public static int Increment

+        {

+            get { return increment; }

+            set

+            {

+                try

+                {

+                    if (increment == value)

+                    {

+                        return;

+                    }

+

+                    var handler = SettingHandler.Load("GuiDisplaySize.xml");

+                    handler.Set("increment", increment);

+                    handler.Save("GuiDisplaySize.xml");

+                    increment = value;

+                    offset = 1 + (increment * multiplier) - increment;

+                    OnSizeChanged();

+                }

+                catch (Exception ex)

+                {

+                    Logger.Exception(ex, "GuiDisplaySize->Increment");

+                }

+            }

+        }

+

+        public static float Offset

+        {

+            get { return offset; }

+        }

+

+        #endregion

+    }

+}

--- a/KerbalEngineer/KerbalEngineer.csproj
+++ b/KerbalEngineer/KerbalEngineer.csproj
@@ -61,10 +61,12 @@
     <Compile Include="CelestialBodies.cs" />

     <Compile Include="Editor\BuildToolbar.cs" />

     <Compile Include="Flight\FlightEngineerPartless.cs" />

+    <Compile Include="Flight\Readouts\Miscellaneous\ChangeGuiSize.cs" />

     <Compile Include="Flight\Readouts\Surface\ImpactBiome.cs" />

     <Compile Include="Flight\Readouts\Surface\Slope.cs" />

     <Compile Include="Flight\Readouts\Surface\Biome.cs" />

     <Compile Include="Flight\Readouts\Vessel\SimulationDelay.cs" />

+    <Compile Include="GuiDisplaySize.cs" />

     <Compile Include="Logger.cs" />

     <Compile Include="EngineerGlobals.cs" />

     <Compile Include="Extensions\DoubleExtensions.cs" />


 Binary files a/Output/KerbalEngineer/KerbalEngineer.dll and b/Output/KerbalEngineer/KerbalEngineer.dll differ