Ejemplo n.º 1
0
 private static void OnWindow(int windowID)
 {
     // Start a new GUILayout
     GUILayout.BeginVertical(GUILayout.Width(250.0f));
     // Create the text field
     GUI.SetNextControlName("Warp TextField");
     currentSeed = GUILayout.TextField(currentSeed);
     // Select the text in the text field
     GUI.FocusControl("Warp TextField");
     // Make the button
     if (GUILayout.Button("Start Warp Drive") || Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter))
     {
         // User has hit the button or pressed enter
         Warp(true, currentSeed, false);
         PersistenceGenerator.WarpSingleVessel(lastSeed, seedString, FlightGlobals.ActiveVessel);
         RenderingManager.RemoveFromPostDrawQueue(0, OnDraw);
         InputLockManager.RemoveControlLock(CONTROL_LOCK_ID);
     }
     GUILayout.EndVertical();
     // Allow the window to be draggable
     GUI.DragWindow();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Automatically jumps to kerbol.
 /// </summary>
 public static void JumpToKerbol(bool processActions, Vessel warpVessel)
 {
     currentSeed = AstroUtils.KERBIN_SYSTEM_COORDS;
     Warp(processActions, currentSeed, false);
     PersistenceGenerator.WarpSingleVessel(lastSeed, seedString, warpVessel);
 }