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); }
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); }
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); }