Example #1
0
 protected override void draw_gui()
 {
     Utils.LockIfMouseOver(LockName, WindowPos, !MapView.MapIsEnabled);
     WindowPos =
         GUILayout.Window(TCA.GetInstanceID(),
                          WindowPos,
                          DrawMainWindow,
                          vessel.vesselName,
                          GUILayout.Width(ControlsWidth),
                          GUILayout.Height(50)).clampToScreen();
     if (ORB != null)
     {
         ORB.OrbitEditorWindow();
     }
     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 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);
     }
 }