protected override void MainWindow(int windowID) { GUILayout.BeginVertical(Styles.white_on_black); VSL.Info.Draw(); GUILayout.EndVertical(); TooltipManager.GetTooltip(); }
protected override void MainWindow(int windowID) { GUILayout.BeginHorizontal(); if (GUILayout.Button(new GUIContent(cues_short[CFG.AT.state], cues_long[CFG.AT.state] + ". Push to disable."), Styles.green, GUILayout.ExpandWidth(false))) { CFG.AT.Off(); } //attitude error display var err = "OFF"; if (VSL.AutopilotDisabled) { err = "USER"; } else if (CFG.AT) { err = string.Format("Err: {0:F1}°", VSL.Controls.AttitudeError); } GUILayout.Label(err, VSL.Controls.Aligned? Styles.green : Styles.white, GUILayout.Width(100)); GUILayout.EndHorizontal(); TooltipManager.GetTooltip(); }
protected override void draw_gui() { //handle collapsed state if (Collapsed) { if (ShowOnHover) { if (Event.current.type == EventType.Repaint) { draw_main_window = WindowPos.Contains(Event.current.mousePosition); } if (!draw_main_window) { UnlockControls(); var prefix = CFG.Enabled? "<b><color=lime>TCA: </color></b>" : (VSL.LandedOrSplashed? "<b>TCA: </b>" : "<b><color=red>TCA: </color></b>"); GUI.Label(collapsed_rect, prefix + StatusString(), Styles.boxed_label); } } else { UnlockControls(); GUI.Label(collapsed_rect, new GUIContent("TCA", "Push to show Main Window"), CFG.Enabled? Styles.green : (VSL.LandedOrSplashed? Styles.white : Styles.red)); if (Input.GetMouseButton(0) && collapsed_rect.Contains(Event.current.mousePosition)) { Collapsed = false; } TooltipManager.GetTooltip(); } } else { draw_main_window = true; } //draw main window if allowed if (draw_main_window) { LockControls(); WindowPos = GUILayout.Window(TCA.GetInstanceID(), WindowPos, DrawMainWindow, RemoteControl? "RC: " + vessel.vesselName : vessel.vesselName, GUILayout.Width(ControlsWidth), GUILayout.Height(50)).clampToScreen(); update_collapsed_rect(); } //draw waypoints and all subwindows if (RemoteControl && Event.current.type == EventType.Repaint) { Markers.DrawWorldMarker(TCA.vessel.transform.position, Color.green, "Remotely Controlled Vessel", NavigationTab.PathNodeMarker, 8); } if (NAV != null) { NAV.DrawWaypoints(); } AllWindows.ForEach(w => w.Draw()); ModulesGraph.Draw(); #if DEBUG GUI.Label(debug_rect, string.Format("[{0}] {1:HH:mm:ss.fff}", TCA != null && vessel != null? vessel.situation.ToString() : "", DateTime.Now), Styles.boxed_label); #endif }
protected override void MainWindow(int windowID) { GUILayout.BeginVertical(); #if DEBUG ATC.DrawDebugLines(); Utils.ButtonSwitch("Mouse", ref ATC.FollowMouse, "Follow mouse", GUILayout.ExpandWidth(false)); Utils.ButtonSwitch("Gimball", ref AttitudeControlBase.UseGimball, "Use gimball", GUILayout.ExpandWidth(false)); #endif GUILayout.BeginHorizontal(); if (Utils.ButtonSwitch("Kill", CFG.AT[Attitude.KillRotation], "Kill rotation", GUILayout.ExpandWidth(false))) { CFG.AT.XToggle(Attitude.KillRotation); } if (Utils.ButtonSwitch("Hold", CFG.AT[Attitude.HoldAttitude], "Hold current attitude", GUILayout.ExpandWidth(false))) { CFG.AT.XToggle(Attitude.HoldAttitude); } GUILayout.EndHorizontal(); if (Utils.ButtonSwitch("Maneuver", CFG.AT[Attitude.ManeuverNode], "Maneuver Node", GUILayout.ExpandWidth(false))) { CFG.AT.XToggle(Attitude.ManeuverNode); } GUILayout.BeginHorizontal(); if (Utils.ButtonSwitch("PG", CFG.AT[Attitude.Prograde], "Prograde", GUILayout.ExpandWidth(false))) { CFG.AT.XToggle(Attitude.Prograde); } if (Utils.ButtonSwitch("RG", CFG.AT[Attitude.Retrograde], "Retrograde", GUILayout.ExpandWidth(false))) { CFG.AT.XToggle(Attitude.Retrograde); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (Utils.ButtonSwitch("R+", CFG.AT[Attitude.Radial], "Radial", GUILayout.ExpandWidth(false))) { CFG.AT.XToggle(Attitude.Radial); } if (Utils.ButtonSwitch("R-", CFG.AT[Attitude.AntiRadial], "Anti Radial", GUILayout.ExpandWidth(false))) { CFG.AT.XToggle(Attitude.AntiRadial); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (Utils.ButtonSwitch("N+", CFG.AT[Attitude.Normal], "Normal", GUILayout.ExpandWidth(false))) { CFG.AT.XToggle(Attitude.Normal); } if (Utils.ButtonSwitch("N-", CFG.AT[Attitude.AntiNormal], "Anti Normal", GUILayout.ExpandWidth(false))) { CFG.AT.XToggle(Attitude.AntiNormal); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (Utils.ButtonSwitch("T+", CFG.AT[Attitude.Target], "To Target", GUILayout.ExpandWidth(false))) { CFG.AT.XToggle(Attitude.Target); } if (Utils.ButtonSwitch("T-", CFG.AT[Attitude.AntiTarget], "From Target", GUILayout.ExpandWidth(false))) { CFG.AT.XToggle(Attitude.AntiTarget); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (Utils.ButtonSwitch("rV+", CFG.AT[Attitude.RelVel], "Relative Velocity", GUILayout.ExpandWidth(false))) { CFG.AT.XToggle(Attitude.RelVel); } if (Utils.ButtonSwitch("rV-", CFG.AT[Attitude.AntiRelVel], "Against Relative Velocity", GUILayout.ExpandWidth(false))) { CFG.AT.XToggle(Attitude.AntiRelVel); } GUILayout.EndHorizontal(); if (Utils.ButtonSwitch("T+ rV-", CFG.AT[Attitude.TargetCorrected], "To Target, correcting lateral velocity", GUILayout.ExpandWidth(true))) { CFG.AT.XToggle(Attitude.TargetCorrected); } GUILayout.EndVertical(); TooltipManager.GetTooltip(); }
protected override void draw_gui() { //draw main window if allowed if (draw_main_window) { LockControls(); WindowPos = GUILayout.Window(TCA.GetInstanceID(), WindowPos, DrawMainWindow, RemoteControl? "RC: " + vessel.vesselName : vessel.vesselName, GUILayout.Width(ControlsWidth), GUILayout.Height(50)).clampToScreen(); update_collapsed_rect(); } //handle collapsed state if (Collapsed) { if (ShowOnHover) { if (!draw_main_window) { UnlockControls(); var prefix = CFG.Enabled? Colors.Enabled.Tag("<b>TCA</b>") : (VSL.LandedOrSplashed? "<b>TCA</b>" : Colors.Danger.Tag("<b>TCA</b>")); GUI.Label(collapsed_rect, prefix, Styles.boxed_label); } if (Event.current.type == EventType.Repaint) { if (WindowPos.Contains(Event.current.mousePosition)) { draw_main_window = ShowOnHover_fade_in_timer.TimePassed; if (draw_main_window) { ShowOnHover_fade_out_timer.Reset(); } } else { draw_main_window = !ShowOnHover_fade_out_timer.TimePassed; if (!draw_main_window) { ShowOnHover_fade_in_timer.Reset(); } } } } else { UnlockControls(); draw_main_window = false; GUI.Label(collapsed_rect, new GUIContent("TCA", "Push to show Main Window"), CFG.Enabled? Styles.enabled : (VSL.LandedOrSplashed? Styles.white : Styles.danger)); if (Input.GetMouseButton(0) && collapsed_rect.Contains(Event.current.mousePosition)) { draw_main_window = true; Collapsed = false; } TooltipManager.GetTooltip(); } } else { draw_main_window = true; } //draw waypoints NAV?.DrawWaypoints(); if (RemoteControl && Event.current.type == EventType.Repaint) { Markers.DrawWorldMarker(TCA.vessel.transform.position, Colors.Good, "Remotely Controlled Vessel", NavigationTab.PathNodeMarker, 8); } }