Esempio n. 1
0
        public void Correct(ClientPlayerMovement msg)
        {
            underwater     = msg.underwater;
            targetVelocity = msg.velocity;
            lookRotation   = msg.lookRotation;
            mode           = msg.mode;

            main.SetBool("is_underwater", msg.underwater && msg.motorMode != Player.MotorMode.Vehicle);
            main.SetBool("using_pda", msg.usingPda);
            main.SetBool("using_tool", msg.usingTool);
            main.SetBool("holding_tool", msg.handTool != TechType.None);
            main.SetBool("cyclops_steering", msg.mode == Player.Mode.Piloting);
            main.SetBool("jump", msg.falling);

            if (toolActive != null)
            {
                SetToolAnimation(toolActive, false);
                toolActive = null;
            }

            if (inventory != null)
            {
                toolActive = inventory.Get(msg.handGuid);
            }

            if (toolActive != null)
            {
                SetToolAnimation(toolActive, true);
            }
        }
Esempio n. 2
0
        private IEnumerator WaitForPlayerModeChangeFinished(Player.Mode newMode)
        {
            //print($"[{SEConfig.PROGRAM_NAME}] WaitForPlayerModeChangeFinished coroutine started for this Vehicle: {ThisVehicle.GetInstanceID()}");

            while (Player.main.currentMountedVehicle == null)
            {
                //print($"[{SEConfig.PROGRAM_NAME}] Player.main.currentMountedVehicle is NULL!");
                yield return(null);
            }

            //print($"[{SEConfig.PROGRAM_NAME}] Player.main.currentMountedVehicle is {Player.main.currentMountedVehicle.GetInstanceID()}");
            //print($"[{SEConfig.PROGRAM_NAME}] WaitForPlayerModeChangeFinished coroutine stopped for this Vehicle: {ThisVehicle.GetInstanceID()}");

            if (Player.main.currentMountedVehicle == ThisVehicle)
            {
                //player in this Vehicle: this Slot Extender now enabled
                isActive = true;
            }
            else
            {
                //player not in this Vehicle: this Slot Extender now disabled
                isActive = false;
            }

            //print($"[{SEConfig.PROGRAM_NAME}] isActive now {isActive}, Player mode now {newMode}");

            yield break;
        }
Esempio n. 3
0
 private void OnPlayerModeChanged(Player.Mode newMode)
 {
     if (newMode != Player.Mode.LockedPiloting)
     {
         ResetArms();
     }
 }
Esempio n. 4
0
        public static bool Prefix(ref uGUI_DepthCompass __instance, ref bool __result)
        {
            if (__instance == null)
            {
                __result = false;
                return(false);
            }
            if (!__instance._initialized)
            {
                __result = false;
                return(false);
            }
            if (!uGUI.isMainLevel)
            {
                __result = false;
                return(false);
            }
            if (LaunchRocket.isLaunching)
            {
                __result = false;
                return(false);
            }
            if (uGUI.isIntro)
            {
                __result = false;
                return(false);
            }
            Player main = Player.main;

            if (main == null)
            {
                __result = false;
                return(false);
            }
            PDA pda = main.GetPDA();

            if (pda != null && pda.isInUse)
            {
                __result = false;
                return(false);
            }
            Player.Mode mode = main.GetMode();
            if (mode == Player.Mode.Piloting)
            {
                __result = false;
                return(false);
            }
            Inventory main2 = Inventory.main;

            if (main2 != null && main2.equipment != null && TechTypeCheck(main2))
            {
                __result = true;
                return(false);
            }
            uGUI_CameraDrone main3 = uGUI_CameraDrone.main;

            __result = main3 != null && main3.GetCamera() != null;
            return(false);
        }
Esempio n. 5
0
 private void OnPlayerModeChanged(Player.Mode playerMode)
 {
     if (playerMode == Player.Mode.LockedPiloting)
     {
         StartCoroutine(WaitForPlayerModeChangeFinished());
         return;
     }
     isActive = false;
 }
Esempio n. 6
0
 private void OnPlayerModeChanged(Player.Mode newMode)
 {
     if (newMode == Player.Mode.Piloting)
     {
         isPiloting = true;
     }
     else
     {
         isPiloting = false;
     }
 }
 private void OnPlayerModeChanged(Player.Mode newMode)
 {
     if (newMode == Player.Mode.LockedPiloting)
     {
         StartCoroutine(WaitForPlayerModeChangeFinished(newMode));
     }
     else
     {
         isActive = false;
     }
 }
 private void OnPlayerModeChanged(Player.Mode playerMode)
 {
     if (playerMode == Player.Mode.LockedPiloting)
     {
         OnEnable();
     }
     else
     {
         OnDisable();
     }
 }
Esempio n. 9
0
 private void OnPlayerModeChanged(Player.Mode playerMode)
 {
     if (playerMode == Player.Mode.LockedPiloting)
     {
         thisVehicle = Player.main.GetVehicle();
         OnEnable();
     }
     else
     {
         OnDisable();
     }
 }
Esempio n. 10
0
        private bool IsVisible()
        {
            if (this == null)
            {
                return(false);
            }
            if (!uGUI_SceneLoading.IsLoadingScreenFinished)
            {
                return(false);
            }
            if (!uGUI.isMainLevel)
            {
                return(false);
            }
            if (LaunchRocket.isLaunching)
            {
                return(false);
            }
            if (uGUI.isIntro)
            {
                return(false);
            }
            Player main = Player.main;

            if (main == null)
            {
                return(false);
            }
            PDA pda = main.GetPDA();

            if (pda != null && pda.isInUse)
            {
                return(false);
            }
            Player.Mode mode = main.GetMode();
            if (mode == Player.Mode.Piloting)
            {
                return(false);
            }
            Inventory main2     = Inventory.main;
            int       biomeChip = main2.equipment.GetCount(CompassCore.BiomeChipID);

            if (main2 != null && main2.equipment != null && biomeChip > 0)
            {
                return(true);
            }
            uGUI_CameraDrone main3 = uGUI_CameraDrone.main;

            return(main3 != null && main3.GetCamera() != null);
        }
 internal void OnPlayerModeChanged(Player.Mode newMode)
 {
     if (newMode == Player.Mode.LockedPiloting)
     {
         // Player is in one of the vehicles but at this point Player.main.currentMountedVehicle is null.
         // therefore starting a coroutine while currentMountedVehicle is not null.
         StartCoroutine(WaitForPlayerModeChangeFinished(newMode));
     }
     else
     {
         // Player not in any Vehicle: this Slot Extender now disabled
         isActive = false;
     }
 }
Esempio n. 12
0
        void onPlayerModeChanged(Player.Mode playerMode)
        {
            if (playerMode == Player.Mode.LockedPiloting)
            {
                checkEnabled();

                if (enabled && Main.config.showHotkeyMessage)
                {
                    LanguageCache.GetButtonFormat(L10n.str("ids_enterVehicleMessage"), Main.config.hotkey).onScreen();
                }
            }
            else if (playerMode == Player.Mode.Normal)
            {
                enabled = false;
            }
        }
 internal void OnPlayerModeChanged(Player.Mode playerMode)
 {
     if (playerMode == Player.Mode.LockedPiloting)
     {
         if (Player.main.GetVehicle() == this.ThisVehicle)
         {
             isActive = true;
         }
         else
         {
             isActive = false;
         }
     }
     else
     {
         isActive = false;
     }
 }
        private IEnumerator WaitForPlayerModeChangeFinished(Player.Mode newMode)
        {
            while (Player.main.currentMountedVehicle == null)
            {
                yield return(null);
            }

            if (Player.main.currentMountedVehicle == thisSeamoth)
            {
                isPlayerInThisVehicle = true;
                OnEnable();
            }
            else
            {
                isPlayerInThisVehicle = false;
                OnDisable();
            }

            yield break;
        }
        private IEnumerator WaitForPlayerModeChangeFinished(Player.Mode newMode)
        {
            while (Player.main.currentMountedVehicle == null)
            {
                yield return(null);
            }

            if (Player.main.currentMountedVehicle == ThisVehicle)
            {
                // Player in this Vehicle: this Slot Extender now enabled
                isActive = true;
            }
            else
            {
                // Player not in this Vehicle: this Slot Extender now disabled
                isActive = false;
            }

            yield break;
        }
 internal void OnPlayerModeChanged(Player.Mode playerMode)
 {
     if (playerMode == Player.Mode.LockedPiloting)
     {
         if (PlayerMain.GetVehicle() == ThisVehicle)
         {
             //player in this Vehicle: this SlotExtenderZero now enabled
             isActive = true;
         }
         else
         {
             //player not in this Vehicle: this SlotExtenderZero now disabled
             isActive = false;
         }
     }
     else
     {
         //player not in any Vehicle: this SlotExtenderZero now disabled
         isActive = false;
     }
 }
Esempio n. 17
0
 public void ShowCursor(Player.Mode mode)
 {
     buildCursor.gameObject.SetActive(mode == Player.Mode.Build);
 }
 public void UpdateMode(Player.Mode mode)
 {
     modeText.text = string.Format("<color=#ffff00>[B]</color> Switch to {0} mode", mode == Player.Mode.Build ? Player.Mode.Selection : Player.Mode.Build);
     cursor.ShowCursor(mode);
 }