Skip to content

Commit

Permalink
Vehicles - Configurable speed limiter step (#7601)
Browse files Browse the repository at this point in the history
Co-Authored-By: mharis001 <34453221+mharis001@users.noreply.github.com>
Co-Authored-By: Elgin675 <elgin675@hotmail.com>
  • Loading branch information
3 people authored Apr 20, 2020
1 parent 142fc1e commit eb8856e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/vehicles/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ GVAR(isSpeedLimiter) = false;

["ACE3 Vehicles", QGVAR(scrollUp), localize LSTRING(IncreaseSpeedLimit), {
if (GVAR(isSpeedLimiter)) then {
GVAR(speedLimit) = round (GVAR(speedLimit) + 1) max 5;
GVAR(speedLimit) = round (GVAR(speedLimit) + GVAR(speedLimiterStep)) max (5 max GVAR(speedLimiterStep));
[["%1: %2", LSTRING(SpeedLimit), GVAR(speedLimit)]] call EFUNC(common,displayTextStructured);
true
};
}, {false}, [MOUSE_SCROLL_UP, [false, true, false]], false] call CBA_fnc_addKeybind; // Ctrl + Mouse Wheel Scroll Up

["ACE3 Vehicles", QGVAR(scrollDown), localize LSTRING(DecreaseSpeedLimit), {
if (GVAR(isSpeedLimiter)) then {
GVAR(speedLimit) = round (GVAR(speedLimit) - 1) max 5;
GVAR(speedLimit) = round (GVAR(speedLimit) - GVAR(speedLimiterStep)) max (5 max GVAR(speedLimiterStep));
[["%1: %2", LSTRING(SpeedLimit), GVAR(speedLimit)]] call EFUNC(common,displayTextStructured);
true
};
Expand Down
8 changes: 8 additions & 0 deletions addons/vehicles/initSettings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,11 @@
},
true // needs restart
] call CBA_fnc_addSetting;

[
QGVAR(speedLimiterStep),
"SLIDER",
LSTRING(SpeedLimiterStep),
ELSTRING(common,ACEKeybindCategoryVehicles),
[1, 10, 5, 0]
] call CBA_fnc_addSetting;
6 changes: 6 additions & 0 deletions addons/vehicles/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,11 @@
<Italian>Nasconde la voce Espelli dal menu azione. Richiede il riavvio del gioco.</Italian>
<Czech>Schová akci vyskošení z vozidla z akčního menu. Vyžaduje restart hry.</Czech>
</Key>
<Key ID="STR_ACE_Vehicles_SpeedLimiterStep">
<English>Speed Limiter Step</English>
<German>Schrittgröße des Geschwindigkeitsbegrenzers</German>
<Polish>Przeskok limitera prędkości</Polish>
<French>Pas du limiteur de vitesse</French>
</Key>
</Package>
</Project>

0 comments on commit eb8856e

Please sign in to comment.