Added captive hotkey (#5529)

* added captive hotkey

* Removed toggling + distance check

* adjusts

player -> ace_player
interact check
stringtable adjust

* Update XEH_postInit.sqf

* Update XEH_postInit.sqf

* Removed dots

* Removed comment

* Use targetEvent
This commit is contained in:
Christian Klemm 2017-09-26 06:22:10 +02:00 committed by PabstMirror
parent 4a6b06dfeb
commit 3d340bb0ef
2 changed files with 20 additions and 0 deletions

View File

@ -1,4 +1,5 @@
#include "script_component.hpp"
#include "\a3\editor_f\Data\Scripts\dikCodes.h"
["ace_settingsInitialized", {
// Hold on a little bit longer to ensure anims will work
@ -35,6 +36,21 @@ if (isServer) then {
if (!hasInterface) exitWith {};
["ACE3 Common", QGVAR(captives), [(localize LSTRING(SetCaptive)), (localize LSTRING(KeyComb_description))],
{
private _target = cursorObject;
if !([ACE_player, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
if !(_target isKindOf "CAManBase" || {(_target distance ACE_player) > getNumber (configFile >> "CfgVehicles" >> "CAManBase" >> "ACE_Actions" >> "ACE_ApplyHandcuffs" >> "distance")}) exitWith {false};
if ([ACE_player, _target] call FUNC(canApplyHandcuffs)) exitWith {
[QGVAR(setHandcuffed), [_target, true], _target] call CBA_fnc_targetEvent;
true
};
false
},
{false},
[DIK_F1, [true, false, false]], true] call CBA_fnc_addKeybind; // Shift + F1
["isNotEscorting", {!(GETVAR(_this select 0,GVAR(isEscorting),false))}] call EFUNC(common,addCanInteractWithCondition);
["isNotHandcuffed", {!(GETVAR(_this select 0,GVAR(isHandcuffed),false))}] call EFUNC(common,addCanInteractWithCondition);
["isNotSurrendering", {!(GETVAR(_this select 0,GVAR(isSurrendering),false))}] call EFUNC(common,addCanInteractWithCondition);

View File

@ -427,6 +427,10 @@
<Chinese>投降或無武器狀態</Chinese>
<Chinesesimp>投降或无武器状态</Chinesesimp>
</Key>
<Key ID="STR_ACE_Captives_KeyComb_Description">
<English>Sets the unit under the cursor captive.</English>
<German>Nimmt die Einheit vor dem Cursor fest.</German>
</Key>
<Key ID="STR_ACE_Captives_ModuleSettings_requireSurrenderAi_name">
<English>Require AI surrendering</English>
<German>Benötigt AI Kapitulation</German>