-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathVOID_TWR.cs
More file actions
68 lines (55 loc) · 1.46 KB
/
VOID_TWR.cs
File metadata and controls
68 lines (55 loc) · 1.46 KB
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
// 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 KerbalEngineer.VesselSimulator;
using KSP;
using System;
using UnityEngine;
namespace VOID
{
[VOID_Scenes(GameScenes.EDITOR, GameScenes.FLIGHT)]
public class VOID_TWR : VOID_WindowModule
{
public VOID_TWR() : base()
{
this.Name = "IP Thrust-to-Weight Ratios";
}
public override void ModuleWindow(int id)
{
if (
!HighLogic.LoadedSceneIsFlight ||
(TimeWarp.WarpMode == TimeWarp.Modes.LOW) ||
(TimeWarp.CurrentRate <= TimeWarp.MaxPhysicsRate)
)
{
SimManager.RequestSimulation();
}
GUILayout.BeginVertical();
if (core.SortedBodyList == null)
{
GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
GUILayout.Label("Unavailable");
GUILayout.EndHorizontal();
}
else
{
CelestialBody body;
for (int idx = 0; idx < core.SortedBodyList.Count; idx++)
{
body = core.SortedBodyList[idx];
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();
base.ModuleWindow(id);
}
}
}