示例#1
0
        //private void modeSlowmoFPSKeeper()
        //{
        //    GUI.enabled = (TimeController.Instance.IsOperational
        //        && (TimeController.Instance.CurrentWarpState == TimeControllable.None || TimeController.Instance.CurrentWarpState == TimeControllable.SlowMo));

        //    bool fpsKeeperActive = GUILayout.Toggle( TimeController.Instance.IsFpsKeeperActive, "FPS Keeper: " + Mathf.Round( Settings.Instance.FpsMinSlider / 5 ) * 5 + " fps" );
        //    if (fpsKeeperActive != TimeController.Instance.IsFpsKeeperActive)
        //        TimeController.Instance.SetFPSKeeper( fpsKeeperActive );

        //    Settings.Instance.FpsMinSlider = (int)GUILayout.HorizontalSlider( Settings.Instance.FpsMinSlider, 5, 60 );

        //    GUI.enabled = true;
        //}

        private void GUITimeScale()
        {
            bool priorGUIEnabled = GUI.enabled;

            GUI.enabled = priorGUIEnabled && (SlowMoController.Instance?.CanSlowMo ?? false);

            GUILayout.BeginVertical();
            {
                SlowMoController.Instance.DeltaLocked = GUILayout.Toggle(SlowMoController.Instance.DeltaLocked, "Lock physics delta to default");

                float  ratePct           = (float)Math.Round(SlowMoController.Instance.SlowMoRate * 100f, 0);
                string slowMoSliderLabel = "Slow Motion Rate: ".MemoizedConcat(ratePct.MemoizedToString().MemoizedConcat("%"));

                Action <float> updateSlowMo = delegate(float f)
                {
                    SlowMoController.Instance.SlowMoRate = (float)Math.Round(f / 100f, 2);
                };

                Func <float, float> modifySlowMo = delegate(float f) { return(Mathf.Floor(f)); };
                IMGUIExtensions.floatTextBoxSliderPlusMinus(slowMoSliderLabel, ratePct, 0f, 100f, 1f, updateSlowMo, modifySlowMo, true);

                GUILayout.Label("", GUILayout.Height(5));

                sharedGUI.GUIThrottleControl();
            }
            GUILayout.EndVertical();

            GUI.enabled = priorGUIEnabled;
        }
示例#2
0
        private void GUIMaxRate()
        {
            string         hyperMaxRateLabel  = "Attempted Rate: ".MemoizedConcat(Mathf.Round(HyperWarpController.Instance.MaxAttemptedRate).MemoizedToString());
            Action <float> updateHyperMaxRate = delegate(float f) { HyperWarpController.Instance.MaxAttemptedRate = f; };
            // Force slider to select integer values between min and max
            Func <float, float> modifyFieldHyperMaxRate = delegate(float f) { return(Mathf.Round(f)); };

            IMGUIExtensions.floatTextBoxSliderPlusMinusWithButtonList(hyperMaxRateLabel, HyperWarpController.Instance.MaxAttemptedRate, HyperWarpController.AttemptedRateMin, HyperWarpController.AttemptedRateMax, 1f, updateHyperMaxRate, maxRateButtons, modifyFieldHyperMaxRate);
        }
示例#3
0
        private void GUIMaxDelta()
        {
            const float deltaIncrement = 0.01f;

            string hyperMaxRateLabel = "Max Delta Time During Hyper-Warp: ".MemoizedConcat(HyperWarpController.Instance.MaximumDeltaTime.MemoizedToString());

            if (HyperWarpController.Instance.MaximumDeltaTime > 0.12f)
            {
                hyperMaxRateLabel = hyperMaxRateLabel.MemoizedConcat(" - Low FPS Likely");
            }

            Action <float> updateHyperMaxDelta = delegate(float f) { HyperWarpController.Instance.MaximumDeltaTime = f; };
            // Force slider to select integer values between min and max
            Func <float, float> modifyFieldHyperMaxDelta = delegate(float f) { return(Mathf.Round(f * (1f / deltaIncrement)) / (1f / deltaIncrement)); };

            IMGUIExtensions.floatTextBoxSliderPlusMinus(hyperMaxRateLabel, HyperWarpController.Instance.MaximumDeltaTime, TimeController.MaximumDeltaTimeMin, TimeController.MaximumDeltaTimeMax, deltaIncrement, updateHyperMaxDelta, modifyFieldHyperMaxDelta);
        }
示例#4
0
        private void GUIMinPhys()
        {
            const float physIncrement = 0.1f;

            string hyperMinPhysLabel = "Physics Accuracy: ".MemoizedConcat(HyperWarpController.Instance.PhysicsAccuracy.MemoizedToString());

            if (HyperWarpController.Instance.PhysicsAccuracy > 4f)
            {
                hyperMinPhysLabel = hyperMinPhysLabel.MemoizedConcat(" !!! DANGER !!!");
            }

            Action <float> updatehyperMinPhys = delegate(float f)
            {
                HyperWarpController.Instance.PhysicsAccuracy = f;
            };

            Func <float, float> modifyFieldMinPhys = delegate(float f) { return(Mathf.Round(f * (1f / physIncrement)) / (1f / physIncrement)); };

            IMGUIExtensions.floatTextBoxSliderPlusMinusWithButtonList(hyperMinPhysLabel, HyperWarpController.Instance.PhysicsAccuracy, HyperWarpController.PhysicsAccuracyMin, HyperWarpController.PhysicsAccuracyMax, physIncrement, updatehyperMinPhys, phyAccuracyButtons, modifyFieldMinPhys);
        }
示例#5
0
        internal void GUIThrottleControl()
        {
            throttleToggle = GUILayout.Toggle(throttleToggle, "Throttle Control: " + Mathf.Round(throttleSet * 100) + "%");

            Action <float> updateThrottle = delegate(float f)
            {
                throttleSet = f / 100.0f;
            };

            if (FlightInputHandler.state != null && throttleToggle && FlightInputHandler.state.mainThrottle != throttleSet)
            {
                FlightInputHandler.state.mainThrottle = throttleSet;
            }

            // Force slider to select 1 decimal place values between min and max
            Func <float, float> modifyFieldThrottle = delegate(float f)
            {
                return(Mathf.Floor(f));
            };

            IMGUIExtensions.floatTextBoxSliderPlusMinusWithButtonList(null, (throttleSet * 100f), 0.0f, 100.0f, 1f, updateThrottle, throttleRateButtons, modifyFieldThrottle);
        }