Example #1
0
 /// <summary>Handles keyboard input.</summary>
 private void UpdateKey()
 {
     if (isRunning)
     {
         if (KIS_Shared.IsKeyUp(KeyCode.Escape) || KIS_Shared.IsKeyDown(KeyCode.Return))
         {
             DebugEx.Fine("Cancel key pressed, stop eva attach mode");
             CancelPointer(this);
         }
         if (GameSettings.Editor_toggleSymMethod.GetKeyDown()) // "R" by default.
         {
             if (pointerTarget != PointerTarget.PartMount && attachNodes.Count() > 1)
             {
                 if (attachNodeIndex < attachNodes.Count - 1)
                 {
                     attachNodeIndex++;
                 }
                 else
                 {
                     attachNodeIndex = 0;
                 }
                 DebugEx.Fine("Attach node index changed to: {0}", attachNodeIndex);
                 ResetMouseOver();
                 SendPointerState(pointerTarget, PointerState.OnChangeAttachNode, null, null);
             }
             else
             {
                 ScreenMessaging.ShowInfoScreenMessage(OnlyOneAttachNodeMsg);
                 UISounds.PlayBipWrong();
             }
         }
     }
 }
Example #2
0
 /// <summary>Handles keyboard input.</summary>
 private void UpdateKey()
 {
     if (isRunning)
     {
         if (KIS_Shared.IsKeyUp(KeyCode.Escape) || KIS_Shared.IsKeyDown(KeyCode.Return))
         {
             Debug.Log("Cancel key pressed, stop eva attach mode");
             StopPointer(unlockUI: false);
             SendPointerClick(PointerTarget.Nothing, Vector3.zero, Quaternion.identity, null, null);
             // Delay unlocking to not let ESC be handled by the game.
             AsyncCall.CallOnEndOfFrame(this, UnlockUI);
         }
         if (GameSettings.Editor_toggleSymMethod.GetKeyDown()) // "R" by default.
         {
             if (pointerTarget != PointerTarget.PartMount && attachNodes.Count() > 1)
             {
                 attachNodeIndex++;
                 if (attachNodeIndex > (attachNodes.Count - 1))
                 {
                     attachNodeIndex = 0;
                 }
                 Debug.LogFormat("Attach node index changed to: {0}", attachNodeIndex);
                 UpdatePointerAttachNode();
                 ResetMouseOver();
                 SendPointerState(pointerTarget, PointerState.OnChangeAttachNode, null, null);
             }
             else
             {
                 ScreenMessaging.ShowInfoScreenMessage("This part has only one attach node!");
                 audioBipWrong.Play();
             }
         }
     }
 }