Medical - Show "Inventory" action on unconscious units (#8083)

* Update XEH_preInit.sqf

* Style pass, remove double localize

* only run if (hasInterface) {

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
This commit is contained in:
Salluci 2021-03-03 18:30:49 -03:00 committed by GitHub
parent 98e74ab3d1
commit 496a6d800a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,4 +25,20 @@ PREP_RECOMPILE_END;
addMissionEventHandler ["EntityKilled", {_this call FUNC(handleKilledMission)}];
if (hasInterface) {
//Add Inventory action to uncon units
["CAManBase", "init", {
params ["_unit"];
private _id = _unit addAction ["", {
params ["_target", "_caller", "_actionId", "_arguments"];
_caller action ["Gear", _target];
}, nil, 5.1, true, true, "gear", "_target getVariable ['ACE_isUnconscious',false] && {alive _target}", 3.5];
_unit setUserActionText [_id, localize "STR_ACTION_GEAR", "<img image='\A3\ui_f\data\igui\cfg\actions\gear_ca.paa' size='2.5' shadow=2 />"];
}, nil, nil, true] call CBA_fnc_addClassEventHandler;
};
ADDON = true;