1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | // VOID © 2014 toadicus // // 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 KSP; using System; using System.Collections.Generic; using System.Linq; using ToadicusTools; using UnityEngine; namespace VOID { public class VOID_TWR : VOID_WindowModule { public VOID_TWR() : base() { this._Name = "IP Thrust-to-Weight Ratios"; } public override void ModuleWindow(int _) { if ( HighLogic.LoadedSceneIsEditor || (TimeWarp.WarpMode == TimeWarp.Modes.LOW) || (TimeWarp.CurrentRate <= TimeWarp.MaxPhysicsRate) ) { Engineer.VesselSimulator.SimManager.RequestSimulation(); } GUILayout.BeginVertical(); if (core.sortedBodyList == null) { GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true)); GUILayout.Label("Unavailable"); GUILayout.EndHorizontal(); } else { foreach (CelestialBody body in core.sortedBodyList) { GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true)); GUILayout.Label(body.bodyName); GUILayout.FlexibleSpace(); GUILayout.Label( (VOID_Data.nominalThrustWeight.Value / body.GeeASL).ToString("0.0##"), GUILayout.ExpandWidth(true) ); GUILayout.EndHorizontal(); } } GUILayout.EndVertical(); GUI.DragWindow(); } } public class VOID_EditorTWR : VOID_TWR, IVOID_EditorModule {} } |