From 3d340bb0ef2aa6a57abc756e3967e4a1a479983c Mon Sep 17 00:00:00 2001 From: Christian Klemm Date: Tue, 26 Sep 2017 06:22:10 +0200 Subject: [PATCH] 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 --- addons/captives/XEH_postInit.sqf | 16 ++++++++++++++++ addons/captives/stringtable.xml | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index 25f41d1320..8917ba58f8 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -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); diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index 08a14904c0..9056351363 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -427,6 +427,10 @@ 投降或無武器狀態 投降或无武器状态 + + Sets the unit under the cursor captive. + Nimmt die Einheit vor dem Cursor fest. + Require AI surrendering Benötigt AI Kapitulation