Example #1
0
 void OnVesselChange(Vessel vesselChange)
 {
     if (KASAddonPointer.isRunning)
     {
         KASAddonPointer.StopPointer();
     }
 }
Example #2
0
 private void UpdateAttachControl()
 {
     if (KASAddonPointer.isRunning)
     {
         if (
             Input.GetKeyDown(KeyCode.Escape) ||
             Input.GetKeyDown(KeyCode.Space) ||
             Input.GetKeyDown(KeyCode.Mouse1) ||
             Input.GetKeyDown(KeyCode.Mouse2) ||
             Input.GetKeyDown(KeyCode.Return) ||
             Input.GetKeyDown(attachKey.ToLower())
             )
         {
             KAS_Shared.DebugLog("Cancel key pressed, stop eva attach mode");
             KASAddonPointer.StopPointer();
         }
     }
     else if (Input.GetKeyDown(attachKey.ToLower()))
     {
         KASModuleGrab grabbedModule = KAS_Shared.GetGrabbedPartModule(FlightGlobals.ActiveVessel);
         if (grabbedModule)
         {
             if (grabbedModule.attachOnPart || grabbedModule.attachOnEva || grabbedModule.attachOnStatic)
             {
                 KASAddonPointer.StartPointer(grabbedModule.part, KASAddonPointer.PointerMode.MoveAndAttach, grabbedModule.attachOnPart, grabbedModule.attachOnEva, grabbedModule.attachOnStatic, grabbedModule.attachMaxDist, grabbedModule.part.transform, grabbedModule.attachSendMsgOnly);
             }
         }
     }
 }
Example #3
0
 public void ContextMenuEvaAttach()
 {
     if (attachOnPart || attachOnEva || attachOnStatic)
     {
         if (KASAddonPointer.isRunning)
         {
             KASAddonPointer.StopPointer();
         }
         else
         {
             KASAddonPointer.StartPointer(this.part, KASAddonPointer.PointerMode.MoveAndAttach, attachOnPart, attachOnEva, attachOnStatic, attachMaxDist, this.part.transform, attachSendMsgOnly);
         }
     }
     else
     {
         ScreenMessages.PostScreenMessage("This part cannot be attached", 5, ScreenMessageStyle.UPPER_CENTER);
     }
 }