Skip to content

Commit 29c4ca2

Browse files
Add interact behavior setting
1 parent 1335fcb commit 29c4ca2

3 files changed

Lines changed: 44 additions & 9 deletions

File tree

addons/main/cba_settings.sqf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,18 @@
214214
false
215215
] call CBA_fnc_addSetting;
216216

217+
[QGVAR(interactBehaviorInVehicle),"LIST",
218+
[LSTRING(SettingDisplayName_interactBehaviorInVehicle),LSTRING(SettingDescription_interactBehaviorInVehicle)],
219+
[LSTRING(EnhancedMovementRework),LSTRING(SettingCategory_Preferences)],
220+
[["DISMOUNT","ENGINE"],[
221+
LSTRING(interactBehaviorInVehicle_Dismount),
222+
LSTRING(interactBehaviorInVehicle_Engine)
223+
],0],
224+
false,
225+
{},
226+
false
227+
] call CBA_fnc_addSetting;
228+
217229
//---------------------------------------------//
218230
// Stamina
219231

addons/main/functions/fnc_interact.sqf

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,28 @@ if !(_unit in _unit) exitWith {
77

88
if (unitIsUAV _vehicle && _unit in [driver _vehicle,gunner _vehicle]) exitWith {false};
99

10-
if (_unit == driver _vehicle) then {
11-
_vehicle engineOn false;
12-
};
10+
switch GVAR(interactBehaviorInVehicle) do {
11+
case "DISMOUNT" : {
12+
if (_unit == driver _vehicle) then {
13+
_vehicle engineOn false;
14+
};
1315

14-
if (_vehicle isKindOf "Air" || _vehicle isKindOf "StaticWeapon") then {
15-
_unit action ["GetOut",_vehicle];
16-
} else {
17-
_unit action ["Eject",_vehicle];
18-
};
16+
if (_vehicle isKindOf "Air" || _vehicle isKindOf "StaticWeapon") then {
17+
_unit action ["GetOut",_vehicle];
18+
} else {
19+
_unit action ["Eject",_vehicle];
20+
};
1921

20-
true
22+
true
23+
};
24+
case "ENGINE" : {
25+
if (_unit == driver _vehicle) then {
26+
_vehicle engineOn !isEngineOn _vehicle;
27+
};
28+
29+
true
30+
};
31+
};
2132
};
2233

2334
private _reach = ((AGLToASL positionCameraToWorld [0,0,0]) vectorDistance (_unit modelToWorldVisualWorld (_unit selectionPosition "Head"))) + 2;

addons/main/stringtable.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@
224224
<Japanese>とび降りるアクションを実行するのにどのくらい下を向けばよいかの角度。</Japanese>
225225
<German>Wie weit nach unten geschaut werden muss, mit der Alles in einem Funktion um das Fallen auszulösen.</German>
226226
</Key>
227+
<Key ID="STR_EMR_Main_SettingDisplayName_interactBehaviorInVehicle">
228+
<English>Interact behavior in vehicles</English>
229+
</Key>
230+
<Key ID="STR_EMR_Main_SettingDescription_interactBehaviorInVehicle">
231+
<English>Action to perform when using the interact keybind while inside a vehicle</English>
232+
</Key>
227233
<Key ID="STR_EMR_Main_SettingDisplayName_staminaCoefficient">
228234
<English>Stamina coefficient</English>
229235
<Japanese>スタミナ係数</Japanese>
@@ -419,5 +425,11 @@
419425
<Japanese>車両は満員です</Japanese>
420426
<German>FAHRZEUG IST VOLL</German>
421427
</Key>
428+
<Key ID="STR_EMR_Main_interactBehaviorInVehicle_Dismount">
429+
<English>Dismount</English>
430+
</Key>
431+
<Key ID="STR_EMR_Main_interactBehaviorInVehicle_Engine">
432+
<English>Toggle engine (must be driver)</English>
433+
</Key>
422434
</Package>
423435
</Project>

0 commit comments

Comments
 (0)