public static void TargetWindowShipFlight(int id) { GUIStyle guiStyleLabel; GUIStyle guiStyleLabelNorm = new GUIStyle(GUI.skin.GetStyle("Label")); GUIStyle guiStyleLabelBold = new GUIStyle(GUI.skin.GetStyle("Label")); guiStyleLabelBold.fontStyle = FontStyle.Bold; // Close Button if (GUI.Button(new Rect(AHEditor.rectTargetShipFlightWindow.size.x - 20, 2, 18, 18), "X")) { AHEditor.CloseTargetShipFlightWindow(); } GUILayout.BeginVertical(); scrollVectorFlight = GUILayout.BeginScrollView(scrollVectorFlight); foreach (Dictionary <string, string> vesselInfo in AHEditor.guiExternListShipFlight) { if (vesselInfo ["type"] != "Relay") { continue; } GUILayout.BeginHorizontal(); if (GUILayout.Button(/*Select*/ Localizer.Format("#autoLOC_AH_0022"), GUILayout.Width(60f))) { AHEditor.SetTarget(vesselInfo ["pid"]); } if (AHEditor.targetPid == vesselInfo ["pid"]) { guiStyleLabel = guiStyleLabelBold; } else { guiStyleLabel = guiStyleLabelNorm; } GUILayout.Label( "(" + AHUtil.TruePower(Double.Parse(vesselInfo ["powerRelay"])).ToString("N0") + ") " + vesselInfo ["name"], guiStyleLabel); GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); GUILayout.EndVertical(); }
public static void TargetWindow(int id) { // Close Button if (GUI.Button(new Rect(AHEditor.rectTargetWindow.size.x - 20, 2, 18, 18), "X")) { AHEditor.CloseTargetWindow(); } GUIStyle guiStyle; GUIStyle guiStyleNorm = new GUIStyle(GUI.skin.GetStyle("Button")); GUIStyle guiStyleBold = new GUIStyle(GUI.skin.GetStyle("Button")); guiStyleBold.fontStyle = FontStyle.Bold; GUILayout.BeginVertical(); for (int i = 0; i < 3; i++) { string dsnStr; if (i / 2f == AHEditor.trackingStationLevel) { dsnStr = "** " + /*DSN Level*/ Localizer.Format("#autoLOC_AH_0015") + " " + (i + 1) + " (" + GameVariables.Instance.GetDSNRange(i / 2f).ToString("N0") + ") **"; } else { dsnStr = /*DSN Level*/ Localizer.Format("#autoLOC_AH_0015") + " " + (i + 1) + " (" + GameVariables.Instance.GetDSNRange(i / 2f).ToString("N0") + ")"; } if ((AHEditor.targetType == AHEditorTargetType.DSN) && (AHEditor.targetName == /*DSN Level*/ Localizer.Format("#autoLOC_AH_0015") + " " + (i + 1).ToString())) { guiStyle = guiStyleBold; } else { guiStyle = guiStyleNorm; } if (GUILayout.Button(dsnStr, guiStyle)) { AHEditor.SetTarget(i / 2f); } } GUILayout.BeginHorizontal(); if (AHEditor.targetType == AHEditorTargetType.FLIGHT) { guiStyle = guiStyleBold; } else { guiStyle = guiStyleNorm; } if (GUILayout.Button(/*In-Flight Ships*/ Localizer.Format("#autoLOC_AH_0016"), guiStyle)) { AHEditor.CloseTargetShipEditorWindow(); AHEditor.CloseTargetPartWindow(); AHEditor.showTargetShipFlightWindow = true; } if (AHEditor.targetType == AHEditorTargetType.EDITOR) { guiStyle = guiStyleBold; } else { guiStyle = guiStyleNorm; } if (GUILayout.Button(/*Editor Ships*/ Localizer.Format("#autoLOC_AH_0017"), guiStyle)) { AHEditor.CloseTargetShipFlightWindow(); AHEditor.CloseTargetPartWindow(); AHEditor.showTargetShipEditorWindow = true; } if (AHEditor.targetType == AHEditorTargetType.PART) { guiStyle = guiStyleBold; } else { guiStyle = guiStyleNorm; } if (GUILayout.Button(/*Antenna Parts*/ Localizer.Format("#autoLOC_AH_0018"), guiStyle)) { AHEditor.CloseTargetShipEditorWindow(); AHEditor.CloseTargetShipFlightWindow(); AHEditor.showTargetPartWindow = true; } GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUI.DragWindow(); }