mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-29 07:20:19 +00:00
move "show speedometer" setting to PedManager
This commit is contained in:
parent
ce0fb3ffa9
commit
d167b39d49
4 changed files with 7 additions and 10 deletions
|
@ -17,8 +17,6 @@ namespace SanAndreasUnity.Behaviours
|
|||
|
||||
private Ped m_ped;
|
||||
|
||||
public static bool _showVel = true;
|
||||
|
||||
// Alpha speedometer
|
||||
private const float velTimer = 1 / 4f;
|
||||
|
||||
|
@ -71,7 +69,7 @@ namespace SanAndreasUnity.Behaviours
|
|||
GUILayout.EndArea();
|
||||
}
|
||||
|
||||
if (_showVel)
|
||||
if (PedManager.Instance.showPedSpeedometer)
|
||||
GUI.Label(GUIUtils.GetCornerRect(ScreenCorner.TopLeft, 100, 25, new Vector2(5, 5)), string.Format("{0:0.0} km/h", m_deltaPos.magnitude * 3.6f / velTimer), new GUIStyle("label") { alignment = TextAnchor.MiddleCenter });
|
||||
|
||||
// show current ped state
|
||||
|
@ -98,10 +96,6 @@ namespace SanAndreasUnity.Behaviours
|
|||
if (!m_ped.IsControlledByLocalPlayer)
|
||||
return;
|
||||
|
||||
// FIXME: this should not be here
|
||||
if (Input.GetKeyDown(KeyCode.F9))
|
||||
_showVel = !_showVel;
|
||||
|
||||
if (!Loader.HasLoaded)
|
||||
return;
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ namespace SanAndreasUnity.Behaviours
|
|||
|
||||
public float pedTurnSpeed = 10f;
|
||||
public float enterVehicleRadius = 2.0f;
|
||||
public bool showPedSpeedometer = true;
|
||||
|
||||
[Header("Health bar")]
|
||||
|
||||
|
|
|
@ -26,9 +26,9 @@ namespace SanAndreasUnity.Settings {
|
|||
|
||||
OptionsWindow.BoolInput m_showSpeedometerInput = new OptionsWindow.BoolInput() {
|
||||
description = "Show speedometer",
|
||||
isAvailable = () => PlayerController.Instance != null,
|
||||
getValue = () => PlayerController._showVel,
|
||||
setValue = (value) => { PlayerController._showVel = value; },
|
||||
isAvailable = () => PedManager.Instance != null,
|
||||
getValue = () => PedManager.Instance.showPedSpeedometer,
|
||||
setValue = (value) => { PedManager.Instance.showPedSpeedometer = value; },
|
||||
};
|
||||
OptionsWindow.FloatInput m_mouseSensitivityXInput = new OptionsWindow.FloatInput() {
|
||||
description = "Mouse sensitivity x",
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
|
||||
- Make all settings persistent
|
||||
|
||||
- Update controls window
|
||||
|
||||
- Add option to change fixed delta time ?
|
||||
|
||||
- Crouching: adjust camera aim offset ? ;
|
||||
|
|
Loading…
Reference in a new issue