mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Vehicles - Mousewheel will set speed limiter value to even multiples (#8840)
* Vehicles - Mousewheel will set speed limiter value to multiples of 5 * Limit setting to whole numbers only
This commit is contained in:
parent
f85ed213c5
commit
70f3f55367
@ -39,6 +39,7 @@ GVAR(isSpeedLimiter) = false;
|
|||||||
["ACE3 Vehicles", QGVAR(scrollUp), localize LSTRING(IncreaseSpeedLimit), {
|
["ACE3 Vehicles", QGVAR(scrollUp), localize LSTRING(IncreaseSpeedLimit), {
|
||||||
if (GVAR(isSpeedLimiter)) then {
|
if (GVAR(isSpeedLimiter)) then {
|
||||||
GVAR(speedLimit) = round (GVAR(speedLimit) + GVAR(speedLimiterStep)) max (5 max GVAR(speedLimiterStep));
|
GVAR(speedLimit) = round (GVAR(speedLimit) + GVAR(speedLimiterStep)) max (5 max GVAR(speedLimiterStep));
|
||||||
|
GVAR(speedLimit) = 5 max GVAR(speedLimiterStep) * floor (GVAR(speedLimit) / GVAR(speedLimiterStep));
|
||||||
[["%1: %2", LSTRING(SpeedLimit), GVAR(speedLimit)]] call EFUNC(common,displayTextStructured);
|
[["%1: %2", LSTRING(SpeedLimit), GVAR(speedLimit)]] call EFUNC(common,displayTextStructured);
|
||||||
true
|
true
|
||||||
};
|
};
|
||||||
@ -47,6 +48,7 @@ GVAR(isSpeedLimiter) = false;
|
|||||||
["ACE3 Vehicles", QGVAR(scrollDown), localize LSTRING(DecreaseSpeedLimit), {
|
["ACE3 Vehicles", QGVAR(scrollDown), localize LSTRING(DecreaseSpeedLimit), {
|
||||||
if (GVAR(isSpeedLimiter)) then {
|
if (GVAR(isSpeedLimiter)) then {
|
||||||
GVAR(speedLimit) = round (GVAR(speedLimit) - GVAR(speedLimiterStep)) max (5 max GVAR(speedLimiterStep));
|
GVAR(speedLimit) = round (GVAR(speedLimit) - GVAR(speedLimiterStep)) max (5 max GVAR(speedLimiterStep));
|
||||||
|
GVAR(speedLimit) = 5 max GVAR(speedLimiterStep) * ceil (GVAR(speedLimit) / GVAR(speedLimiterStep));
|
||||||
[["%1: %2", LSTRING(SpeedLimit), GVAR(speedLimit)]] call EFUNC(common,displayTextStructured);
|
[["%1: %2", LSTRING(SpeedLimit), GVAR(speedLimit)]] call EFUNC(common,displayTextStructured);
|
||||||
true
|
true
|
||||||
};
|
};
|
||||||
|
@ -25,5 +25,5 @@
|
|||||||
"SLIDER",
|
"SLIDER",
|
||||||
LSTRING(SpeedLimiterStep),
|
LSTRING(SpeedLimiterStep),
|
||||||
ELSTRING(common,ACEKeybindCategoryVehicles),
|
ELSTRING(common,ACEKeybindCategoryVehicles),
|
||||||
[1, 10, 5, 0]
|
[1, 10, 5, -1] // whole numbers only
|
||||||
] call CBA_fnc_addSetting;
|
] call CBA_fnc_addSetting;
|
||||||
|
Loading…
Reference in New Issue
Block a user