コード例 #1
0
 public void EnableGrabMode()
 {
     if (!KISAddonPointer.isRunning)
     {
         List <ModuleKISPickup> pickupModules = FlightGlobals.ActiveVessel.FindPartModulesImplementing <ModuleKISPickup>();
         // Grab only if pickup module is present on vessel
         if (pickupModules.Count > 0)
         {
             if (!draggedPart)
             {
                 KISAddonCursor.StartPartDetection(OnMouseGrabPartClick, OnMouseGrabEnterPart, null, OnMouseGrabExitPart);
                 KISAddonCursor.CursorEnable("KIS/Textures/grab", "Grab", "");
                 grabActive = true;
             }
         }
     }
 }
コード例 #2
0
        public void EnableAttachMode()
        {
            List <ModuleKISPickup> pickupModules = FlightGlobals.ActiveVessel.FindPartModulesImplementing <ModuleKISPickup>();

            // Attach/detach only if pickup module is present on vessel
            if (pickupModules.Count > 0)
            {
                if (!draggedPart && !grabActive && !KISAddonPointer.isRunning)
                {
                    KISAddonCursor.StartPartDetection(OnMouseDetachPartClick, OnMouseDetachEnterPart, null, OnMouseDetachExitPart);
                    KISAddonCursor.CursorEnable("KIS/Textures/detach", "Detach", "");
                    detachActive = true;
                }
                if (KISAddonPointer.isRunning && KISAddonPointer.pointerTarget != KISAddonPointer.PointerTarget.PartMount)
                {
                    KISAddonPickup.instance.pointerMode = KISAddonPickup.PointerMode.Attach;
                    KIS_Shared.PlaySoundAtPoint("KIS/Sounds/click", FlightGlobals.ActiveVessel.transform.position);
                }
            }
        }
コード例 #3
0
 private void Pickup()
 {
     icon = new KIS_IconViewer(draggedPart, draggedIconResolution);
     KISAddonCursor.StartPartDetection();
     grabActive = false;
     KISAddonCursor.CursorDisable();
     if (HighLogic.LoadedSceneIsFlight)
     {
         InputLockManager.SetControlLock(ControlTypes.VESSEL_SWITCHING, "KISpickup");
         // Disable jetpack mouse control (workaround as SetControlLock didn't have any effect on this)
         KerbalEVA Keva = FlightGlobals.ActiveVessel.rootPart.GetComponent <KerbalEVA>();
         if (Keva)
         {
             if (Keva.JetpackDeployed)
             {
                 Keva.JetpackDeployed = false;
                 jetpackLock          = true;
                 KIS_Shared.DebugLog("Jetpack mouse input disabled");
             }
         }
     }
 }