void Update()
        {
            if (active)
            {
                var  primaryDevice = GameInput.GetPrimaryDevice();
                var  text          = GameInput.GetPressedInput(primaryDevice);
                bool flag          = false;

                if (!string.IsNullOrEmpty(text))
                {
                    if (GameInput.IsBindable(text))
                    {
                        flag = true;
                        if (text == "Escape")
                        {
                            text = null;
                        }
                    }
                    else
                    {
                        text = null;
                    }
                    if (flag)
                    {
                        SetActive(false);
                        GameInput.ClearInput();
                        EventSystem.current.SetSelectedGameObject(null);
                    }
                    if (text != null)
                    {
                        TryBind(text);
                    }
                }
            }
        }
 private void SetPlayerToNormalMode()
 {
     GameInput.ClearInput();
     Player.main.transform.parent          = null;
     MainCameraControl.main.lookAroundMode = false;
     Player.main.cinematicModeActive       = false;
     typeof(Player).GetField("mode", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(Player.main, Player.Mode.Normal);
     typeof(Player).GetField("currChair", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(Player.main, null);
     Player.main.playerModeChanged.Trigger(Player.Mode.Normal);
 }
 private void SetPlayerToPilotingMode()
 {
     GameInput.ClearInput();
     typeof(Player).GetField("currChair", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(Player.main, this);
     Player.main.cinematicModeActive       = true;
     MainCameraControl.main.lookAroundMode = true;
     Player.main.transform.parent          = ParentWhilePilotingGO.transform;
     UWE.Utils.ZeroTransform(Player.main.transform);
     typeof(Player).GetField("mode", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(Player.main, Player.Mode.Piloting);
     Inventory.main.quickSlots.DeselectImmediate();
     Player.main.playerModeChanged.Trigger(Player.Mode.Piloting);
 }
Пример #4
0
 static void Prefix(FPSInputModule __instance)
 {
     if (__instance.lockPauseMenu)
     {
         return;
     }
     if (GameInput.GetButtonDown(GameInput.Button.UIMenu) && IngameMenu.main != null && !IngameMenu.main.selected || GameInput.GetButtonHeldTime(GameInput.Button.PDA) > 1.0f)
     {
         IngameMenu.main.Open();
         GameInput.ClearInput();
     }
 }
Пример #5
0
 private static void ClearInput()
 {
     //Ignore camera rotation this frame
     GameInput.ClearInput();
     _didClearInput = true;
 }