Changed windowId to Guid hash.
Changed windowId to Guid hash.

--- a/KerbalEngineer/Editor/BuildAdvanced.cs
+++ b/KerbalEngineer/Editor/BuildAdvanced.cs
@@ -46,7 +46,7 @@
 

         #region Fields

 

-        private readonly int windowId = EngineerGlobals.GetNextWindowId();

+        private readonly int windowId = new Guid().GetHashCode();

 

         private bool hasChanged;

         private bool isEditorLocked;


--- a/KerbalEngineer/EngineerGlobals.cs
+++ b/KerbalEngineer/EngineerGlobals.cs
@@ -42,24 +42,18 @@
 

         #endregion

 

-        #region Fields

-

-        private static int _windowId = int.MaxValue;

-

-        #endregion

-

         #region Properties

 

-        private static string _assemblyFile;

-        private static string _assemblyName;

-        private static string _assemblyPath;

+        private static string assemblyFile;

+        private static string assemblyName;

+        private static string assemblyPath;

 

         /// <summary>

         ///     Gets the Kerbal Engineer assembly's path including the file name.

         /// </summary>

         public static string AssemblyFile

         {

-            get { return _assemblyFile ?? (_assemblyFile = Assembly.GetExecutingAssembly().Location); }

+            get { return assemblyFile ?? (assemblyFile = Assembly.GetExecutingAssembly().Location); }

         }

 

         /// <summary>

@@ -67,7 +61,7 @@
         /// </summary>

         public static string AssemblyName

         {

-            get { return _assemblyName ?? (_assemblyName = new FileInfo(AssemblyFile).Name); }

+            get { return assemblyName ?? (assemblyName = new FileInfo(AssemblyFile).Name); }

         }

 

         /// <summary>

@@ -75,17 +69,7 @@
         /// </summary>

         public static string AssemblyPath

         {

-            get { return _assemblyPath ?? (_assemblyPath = AssemblyFile.Replace(new FileInfo(AssemblyFile).Name, "")); }

-        }

-

-        #endregion

-

-        #region Methods

-

-        public static int GetNextWindowId()

-        {

-            _windowId--;

-            return _windowId;

+            get { return assemblyPath ?? (assemblyPath = AssemblyFile.Replace(new FileInfo(AssemblyFile).Name, "")); }

         }

 

         #endregion


--- a/KerbalEngineer/Flight/ActionMenu.cs
+++ b/KerbalEngineer/Flight/ActionMenu.cs
@@ -19,6 +19,7 @@
 

 #region Using Directives

 

+using System;

 using System.Collections.Generic;

 

 using KerbalEngineer.Flight.Sections;

@@ -44,10 +45,11 @@
 

         #region Fields

 

+        private readonly int windowId = new Guid().GetHashCode();

+

         private bool isOpen = true;

         private int numberOfSections;

         private float scrollPercent;

-        private int windowId;

         private Rect windowPosition = new Rect((Screen.width * 0.25f) - 100.0f, 0, 200.0f, 0);

 

         #endregion

@@ -59,7 +61,6 @@
         /// </summary>

         private void Start()

         {

-            this.windowId = this.GetHashCode();

             this.InitialiseStyles();

             this.Load();

             RenderingManager.AddToPostDrawQueue(0, this.Draw);


--- a/KerbalEngineer/Flight/DisplayStack.cs
+++ b/KerbalEngineer/Flight/DisplayStack.cs
@@ -19,6 +19,7 @@
 

 #region Using Directives

 

+using System;

 using System.Collections.Generic;

 

 using KerbalEngineer.Extensions;

@@ -47,9 +48,10 @@
 

         #region Fields

 

+        private readonly int windowId = new Guid().GetHashCode();

+

         private int numberOfStackSections;

         private bool resizeRequested;

-        private int windowId;

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

 

         #endregion

@@ -76,7 +78,6 @@
         /// </summary>

         private void Start()

         {

-            this.windowId = this.GetHashCode();

             this.InitialiseStyles();

             this.Load();

 


--- a/KerbalEngineer/Flight/Sections/SectionEditor.cs
+++ b/KerbalEngineer/Flight/Sections/SectionEditor.cs
@@ -18,6 +18,8 @@
 // 

 

 #region Using Directives

+

+using System;

 

 using KerbalEngineer.Extensions;

 using KerbalEngineer.Flight.Readouts;

@@ -39,10 +41,11 @@
 

         #region Fields

 

+        private readonly int windowId = new Guid().GetHashCode();

+

         private Vector2 scrollPositionAvailable;

         private Vector2 scrollPositionInstalled;

         private ReadoutCategory selectedCategory = ReadoutCategory.Orbital;

-        private int windowId;

         private Rect windowPosition;

 

         #endregion

@@ -54,7 +57,6 @@
         /// </summary>

         private void Start()

         {

-            this.windowId = this.GetHashCode();

             this.InitialiseStyles();

             RenderingManager.AddToPostDrawQueue(0, this.Draw);

         }


--- a/KerbalEngineer/Flight/Sections/SectionWindow.cs
+++ b/KerbalEngineer/Flight/Sections/SectionWindow.cs
@@ -19,6 +19,8 @@
 

 #region Using Directives

 

+using System;

+

 using KerbalEngineer.Extensions;

 

 using UnityEngine;

@@ -31,8 +33,9 @@
     {

         #region Fields

 

+        private readonly int windowId = new Guid().GetHashCode();

+

         private bool resizeRequested;

-        private int windowId;

         private Rect windowPosition;

 

         #endregion

@@ -44,7 +47,6 @@
         /// </summary>

         private void Start()

         {

-            this.windowId = this.GetHashCode();

             this.InitialiseStyles();

             RenderingManager.AddToPostDrawQueue(0, this.Draw);

         }