Got the close button working; now converting from a cached anonymous method to an inherited method. TODO: VOID_ConfigModule.
[VOID.git] / VOID_TWR.cs
blob:a/VOID_TWR.cs -> blob:b/VOID_TWR.cs
--- a/VOID_TWR.cs
+++ b/VOID_TWR.cs
@@ -3,11 +3,9 @@
 // This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a
 // copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/
 
+using KerbalEngineer.VesselSimulator;
 using KSP;
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using ToadicusTools;
 using UnityEngine;
 
 namespace VOID
@@ -28,12 +26,12 @@
 				(TimeWarp.CurrentRate <= TimeWarp.MaxPhysicsRate)
 			)
 			{
-				KerbalEngineer.VesselSimulator.SimManager.RequestSimulation();
+				SimManager.RequestSimulation();
 			}
 
 			GUILayout.BeginVertical();
 
-			if (core.sortedBodyList == null)
+			if (core.SortedBodyList == null)
 			{
 				GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
 
@@ -43,8 +41,11 @@
 			}
 			else
 			{
-				foreach (CelestialBody body in core.sortedBodyList)
+				CelestialBody body;
+				for (int idx = 0; idx < core.SortedBodyList.Count; idx++)
 				{
+					body = core.SortedBodyList[idx];
+
 					GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
 
 					GUILayout.Label(body.bodyName);