Skip to content

Commit

Permalink
Medical - Show "Inventory" action on unconscious units (#8083)
Browse files Browse the repository at this point in the history
* Update XEH_preInit.sqf

* Style pass, remove double localize

* only run if (hasInterface) {

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
  • Loading branch information
LinkIsGrim and PabstMirror authored Mar 3, 2021
1 parent 98e74ab commit 496a6d8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions addons/medical_status/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 496a6d8

Please sign in to comment.