private void OnInputFocus(VREvent_t arg)
 {
     if (!OWTime.IsPaused())
     {
         SimulateInput(JoystickButton.Start);
     }
 }
 private void UpdateVisibility()
 {
     if (OWTime.IsPaused(OWTime.PauseType.Menu) || OWTime.IsPaused(OWTime.PauseType.Sleeping) || SceneHelper.IsInTitle())
     {
         Show();
     }
     else
     {
         Hide();
     }
 }
Beispiel #3
0
 private void Update()
 {
     if (!_isStarted || OWTime.IsPaused())
     {
         return;
     }
     if (Input.GetMouseButtonDown(0) && _isDucksEnabled)
     {
         ShootDuck();
     }
     else if (Input.GetMouseButtonDown(1) && _isCubesEnabled)
     {
         CreateCube();
     }
 }
Beispiel #4
0
            private void UpdateSignalscopeReticuleVisibility()
            {
                if (_reticule == null)
                {
                    return;
                }

                if (_reticule.gameObject.activeSelf && OWTime.IsPaused())
                {
                    _reticule.gameObject.SetActive(false);
                }
                else if (!_reticule.gameObject.activeSelf && !OWTime.IsPaused())
                {
                    _reticule.gameObject.SetActive(true);
                }
            }
Beispiel #5
0
            private static void UpdateWakeUpPrompt()
            {
                var hand            = HandsController.Behaviour.RightHand;
                var isLookingAtHand = hand != null && CameraHelper.IsOnScreen(hand.position);
                var isSleeping      = OWTime.IsPaused(OWTime.PauseType.Sleeping);
                var shouldShowText  = !isLookingAtHand && isSleeping;
                var isShowingText   = IsShowing(GestureText.WakeUp);

                if (!isShowingText && shouldShowText)
                {
                    SetText(GestureText.WakeUp);
                }
                else if (isShowingText && !shouldShowText)
                {
                    SetText(GestureText.None);
                }
            }
                private static bool PreUpdateRumble(object[] ___m_theList, bool ___m_isEnabled)
                {
                    if (OWTime.IsPaused())
                    {
                        return(false);
                    }

                    var a = Vector2.zero;

                    if (___m_isEnabled && OWInput.UsingGamepad())
                    {
                        var deltaTime = Time.deltaTime;
                        for (var i = 0; i < ___m_theList.Length; i++)
                        {
                            var rumble  = ___m_theList[i];
                            var isAlive = (bool)rumble.GetType().GetMethod("IsAlive").Invoke(rumble, new object[] { });

                            if (isAlive)
                            {
                                rumble.Invoke("Update", deltaTime);
                            }

                            var isAliveAgain = (bool)rumble.GetType().GetMethod("IsAlive").Invoke(rumble, new object[] { });

                            if (isAliveAgain)
                            {
                                var power = (Vector2)rumble.GetType().GetMethod("GetPower").Invoke(rumble, new object[] { });
                                a += power;
                            }
                        }
                        a.x *= 1.42857146f;
                        a.y *= 1.42857146f;

                        var haptic     = SteamVR_Actions.default_Haptic;
                        var frequency  = 0.1f;
                        var amplitudeY = a.y * ModSettings.VibrationStrength;
                        var amplitudeX = a.x * ModSettings.VibrationStrength;
                        haptic.Execute(0, frequency, 10, amplitudeY, SteamVR_Input_Sources.RightHand);
                        haptic.Execute(0, frequency, 50, amplitudeX, SteamVR_Input_Sources.RightHand);
                        haptic.Execute(0, frequency, 10, amplitudeY, SteamVR_Input_Sources.LeftHand);
                        haptic.Execute(0, frequency, 50, amplitudeX, SteamVR_Input_Sources.LeftHand);
                    }

                    return(false);
                }
Beispiel #7
0
 private bool IsPaused()
 {
     return(OWTime.IsPaused(OWTime.PauseType.Menu) ||
            OWTime.IsPaused(OWTime.PauseType.Sleeping) ||
            SceneHelper.IsInTitle());
 }
Beispiel #8
0
 private bool IsMenuInteractionAllowed()
 {
     return(OWTime.IsPaused() || !SceneHelper.IsInGame() || PlayerState.IsSleepingAtCampfire());
 }
Beispiel #9
0
        private void OnGUI()
        {
            if (_playerController == null || _playerForceDetector == null)
            {
                this._playerForceDetector = Locator.GetPlayerForceDetector();
                this._playerController    = Locator.GetPlayerController();
                if (_playerController == null || _playerForceDetector == null)
                {
                    return;
                }
            }
            float num = 400f;

            if (GUIMode.IsHiddenMode() || PlayerState.UsingShipComputer())
            {
                return;
            }
            if (inputHUD == 1)
            {
                GUI.Label(new Rect(10f + num, 10f, 200f, 20f), "Time Scale: " + Mathf.Round(Time.timeScale * 100f) / 100f);
                GUI.Label(new Rect(10f + num, 25f, 200f, 20f), string.Concat(new object[]
                {
                    "Time Remaining: ",
                    Mathf.Floor(TimeLoop.GetSecondsRemaining() / 60f),
                    ":",
                    Mathf.Round(TimeLoop.GetSecondsRemaining() % 60f * 100f / 100f)
                }));
                GUI.Label(new Rect(10f + num, 40f, 200f, 20f), "Loop Count: " + TimeLoop.GetLoopCount());
                GUI.Label(new Rect(10f + num, 55f, 90f, 40f), "PauseFlags: ");
                GUI.Label(new Rect(100f + num, 55f, 50f, 40f), "MENU\n" + ((!OWTime.IsPaused(OWTime.PauseType.Menu)) ? "FALSE" : "TRUE "));
                GUI.Label(new Rect(150f + num, 55f, 50f, 40f), "LOAD\n" + ((!OWTime.IsPaused(OWTime.PauseType.Loading)) ? "FALSE" : "TRUE "));
                GUI.Label(new Rect(200f + num, 55f, 50f, 40f), "READ\n" + ((!OWTime.IsPaused(OWTime.PauseType.Reading)) ? "FALSE" : "TRUE "));
                GUI.Label(new Rect(250f + num, 55f, 50f, 40f), "SLP\n" + ((!OWTime.IsPaused(OWTime.PauseType.Sleeping)) ? "FALSE" : "TRUE "));
                GUI.Label(new Rect(300f + num, 55f, 50f, 40f), "INIT\n" + ((!OWTime.IsPaused(OWTime.PauseType.Initializing)) ? "FALSE" : "TRUE "));
                GUI.Label(new Rect(350f + num, 55f, 50f, 40f), "STRM\n" + ((!OWTime.IsPaused(OWTime.PauseType.Streaming)) ? "FALSE" : "TRUE "));
                GUI.Label(new Rect(400f + num, 55f, 50f, 40f), "SYS\n" + ((!OWTime.IsPaused(OWTime.PauseType.System)) ? "FALSE" : "TRUE "));
                GUI.Label(new Rect(10f + num, 85f, 200f, 20f), "Input Mode: " + OWInput.GetInputMode().ToString());
                this._inputModeArray = OWInput.GetInputModeStack();
                GUI.Label(new Rect(10f + num, 100f, 200f, 20f), "Input Mode Stack: ");
                int num2 = 150;
                int num3 = 0;
                while (num3 < this._inputModeArray.Length && this._inputModeArray[num3] != InputMode.None)
                {
                    GUI.Label(new Rect((float)num2 + num, 100f, 200f, 20f), this._inputModeArray[num3].ToString());
                    num2 += 75;
                    num3++;
                }
                GUI.Label(new Rect(10f + num, 115f, 300f, 20f), "Net Force Accel: " + Mathf.Round(this._playerForceDetector.GetForceAcceleration().magnitude * 100f) / 100f);
                GUI.Label(new Rect(210f + num, 115f, 300f, 20f), "G-Force: " + Mathf.Round(this._gForce * 100f) / 100f);
                GUI.Label(new Rect(10f + num, 130f, 200f, 20f), "Load Time: " + LoadTimeTracker.GetLatestLoadTime());
                if (DynamicResolutionManager.isEnabled)
                {
                    GUI.Label(new Rect(10f + num, 145f, 200f, 20f), "Resolution Scale: " + DynamicResolutionManager.currentResolutionScale);
                }
                GUI.Label(new Rect(10f + num, 160f, 200f, 20f), "Player Speed: " + (Locator.GetCenterOfTheUniverse().GetOffsetVelocity() + Locator.GetPlayerBody().GetVelocity()).magnitude.ToString());
                GUI.Label(new Rect(210f + num, 160f, 200f, 20f), "Player Accel: " + Locator.GetPlayerBody().GetAcceleration().magnitude.ToString());
                if (Locator.GetPlayerSuit().GetComponent <JetpackThrusterModel>())
                {
                    GUI.Label(new Rect(10f + num, 175f, 200f, 20f), string.Concat(new object[]
                    {
                        "Jetpack Max Accel: ",
                        Locator.GetPlayerSuit().GetComponent <JetpackThrusterModel>().GetMaxTranslationalThrust().ToString(),
                        "/",
                        Locator.GetPlayerSuit().GetComponent <JetpackThrusterModel>().GetBoostMaxThrust().ToString()
                    }));
                }
                if (Locator.GetShipBody().GetComponent <ShipThrusterModel>())
                {
                    GUI.Label(new Rect(210f + num, 175f, 200f, 20f), "Ship Max Accel: " + Locator.GetShipBody().GetComponent <ShipThrusterModel>().GetMaxTranslationalThrust().ToString());
                }
                GUI.Label(new Rect(10f + num, 190f, 400f, 20f), string.Concat(new object[]
                {
                    "Inspector layer: ",
                    rayMask,
                    " ",
                    LayerMask.LayerToName(rayMask)
                }));
                if (GetWarpOWRigidbody())
                {
                    GUI.Label(new Rect(10f + num, 205f, 400f, 20f), string.Concat(new string[]
                    {
                        "Warp Body: ",
                        GetWarpOWRigidbody().gameObject.name,
                        " layer: ",
                        GetWarpOWRigidbody().gameObject.layer.ToString(),
                        " ",
                        LayerMask.LayerToName(GetWarpOWRigidbody().gameObject.layer)
                    }));
                }
                if (hit.collider)
                {
                    GUI.Label(new Rect(10f + num, 220f, 400f, 20f), string.Concat(new string[]
                    {
                        "Latest hit layer: ",
                        hit.collider.gameObject.layer.ToString(),
                        " ",
                        LayerMask.LayerToName(hit.collider.gameObject.layer)
                    }));
                    GUI.Label(new Rect(10f + num, 235f, 600f, 20f), "Name: " + hit.collider.gameObject.name + " Distance: " + (hit.point - Locator.GetPlayerBody().transform.position).magnitude.ToString());
                }

                /*if (PadEZ.PadManager.GetActiveController()!=null)
                 *              {
                 *                      GUI.Label(new Rect(10f + num, 250f, 600f, 20f), PadEZ.PadManager.GetActiveController().GetIndex().ToString() + " " + PadEZ.PadManager.GetActiveController().GetPadType().ToString() +" "+ UnityEngine.Input.GetJoystickNames()[PadEZ.PadManager.GetActiveController().GetIndex()]);
                 *              }*/
            }
            if (inputHUD == 2)
            {
                GUI.Label(new Rect(10f, 10f, 300f, 2500f), ReadInputManager.ReadCommandInputs(false));
            }
            if (inputHUD == 3)
            {
                GUI.Label(new Rect(0f, 0f, 300f, 2500f), ReadInputManager.ReadCommandInputs(false));
                GUI.Label(new Rect(300f, 0f, 300f, 2500f), ReadInputManager.ReadCommandInputs(true));
            }
            if (inputHUD == 4)
            {
                GUI.Label(new Rect(0f, 0f, 500f, 2500f), ReadInputManager.ReadInputAxes());
                GUI.Label(new Rect(500f, 0f, 500f, 2500f), ReadInputManager.ReadRawInputManagerButtons());
            }
        }