diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index 8d6ef78a79..bcb2d5aa8e 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -40,7 +40,6 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; // Listens for the falling unconscious event, just in case the menu needs to be closed ["medical_onUnconscious", { - diag_log ["im_onUn 1:",_this]; // If no menu is open just quit if (GVAR(openedMenuType) < 0) exitWith {}; @@ -50,5 +49,4 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; GVAR(actionSelected) = false; [] call FUNC(keyUp); - diag_log ["im_onUn 2:",_this]; }] call EFUNC(common,addEventhandler); diff --git a/addons/interaction/functions/fnc_addPassengerActions.sqf b/addons/interaction/functions/fnc_addPassengerActions.sqf index 1a079b1ac6..9e577ed7bb 100644 --- a/addons/interaction/functions/fnc_addPassengerActions.sqf +++ b/addons/interaction/functions/fnc_addPassengerActions.sqf @@ -16,8 +16,6 @@ EXPLODE_3_PVT(_this,_vehicle,_player,_parameters); -diag_log "addPassengerActions"; - private ["_unit","_actions"]; _unit = _parameters select 0; diff --git a/addons/interaction/functions/fnc_tapShoulder.sqf b/addons/interaction/functions/fnc_tapShoulder.sqf index 297de3fff8..11fc6b7881 100644 --- a/addons/interaction/functions/fnc_tapShoulder.sqf +++ b/addons/interaction/functions/fnc_tapShoulder.sqf @@ -13,10 +13,12 @@ if (_target != ACE_player) exitWith { addCamShake [4, 0.5, 5]; +private "_message"; +//localize is converting the escaped <> symbols, so just add them here instead of in the stringtable if (_shoulderNum == 0) then { - _message = localize "STR_ACE_Interaction_YouWereTappedRight"; + _message = format ["%1 >", (localize "STR_ACE_Interaction_YouWereTappedRight")]; } else { - _message = localize "STR_ACE_Interaction_YouWereTappedLeft"; + _message = format ["< %1", (localize "STR_ACE_Interaction_YouWereTappedLeft")]; }; -[_message] call EFUNC(common,displayTextStructured); +[parseText _message] call EFUNC(common,displayTextStructured); diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index a4417df4e8..dcd87056e2 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -363,28 +363,28 @@ Dai un colpetto - You were tapped on the RIGHT shoulder > - Te tocaron el hombro DERECHO > - Dir wurde auf die Schulter geklopft > - On te tape sur l'épaule > - Zostałeś klepnięty po ramieniu > - Vállonveregettek > - Někdo tě poklepal na rameno > - Вас похлопали по плечу > - Você foi tocado no ombro > - Ti è stato dato un colpetto sulla spalla > + You were tapped on the RIGHT shoulder + Te tocaron el hombro DERECHO + Dir wurde auf die Schulter geklopft + On te tape sur l'épaule + Zostałeś klepnięty po ramieniu + Vállonveregettek + Někdo tě poklepal na rameno + Вас похлопали по плечу + Você foi tocado no ombro + Ti è stato dato un colpetto sulla spalla - < You were tapped on the LEFT shoulder. - < Te tocaron el hombro IZQUIERDO. - < Dir wurde auf die Schulter geklopft - < On te tape sur l'épaule. - < Zostałeś klepnięty po ramieniu - < Vállonveregettek - < Někdo tě poklepal na rameno. - < Вас похлопали по плечу - < Você foi tocado no ombro. - < Ti è stato dato un colpetto sulla spalla + You were tapped on the LEFT shoulder. + Te tocaron el hombro IZQUIERDO. + Dir wurde auf die Schulter geklopft + On te tape sur l'épaule. + Zostałeś klepnięty po ramieniu + Vállonveregettek + Někdo tě poklepal na rameno. + Вас похлопали по плечу + Você foi tocado no ombro. + Ti è stato dato un colpetto sulla spalla Cancel diff --git a/addons/magazinerepack/CfgVehicles.hpp b/addons/magazinerepack/CfgVehicles.hpp index eba2edac68..a5312369d5 100644 --- a/addons/magazinerepack/CfgVehicles.hpp +++ b/addons/magazinerepack/CfgVehicles.hpp @@ -6,11 +6,9 @@ class CfgVehicles { displayName = "$STR_ACE_MagazineRepack_RepackMagazines"; condition = QUOTE(true); exceptions[] = {"isNotInside"}; - statement = QUOTE([_player] call FUNC(openSelectMagazineUI)); - showDisabled = 0; + insertChildren = QUOTE(_this call FUNC(getMagazineChildren)); priority = -2; icon = QUOTE(PATHTOF(UI\repack_ca.paa)); - hotkey = "R"; }; }; }; diff --git a/addons/magazinerepack/XEH_preInit.sqf b/addons/magazinerepack/XEH_preInit.sqf index 7cd7107f54..f78cf34ee4 100644 --- a/addons/magazinerepack/XEH_preInit.sqf +++ b/addons/magazinerepack/XEH_preInit.sqf @@ -2,9 +2,9 @@ ADDON = false; +PREP(getMagazineChildren); PREP(magazineRepackFinish); PREP(magazineRepackProgress); -PREP(openSelectMagazineUI); PREP(simulateRepackEvents); PREP(startRepackingMagazine); diff --git a/addons/magazinerepack/config.cpp b/addons/magazinerepack/config.cpp index 7011d28c0c..7c921889a1 100644 --- a/addons/magazinerepack/config.cpp +++ b/addons/magazinerepack/config.cpp @@ -17,12 +17,19 @@ class CfgPatches { #include "CfgVehicles.hpp" class ACE_Settings { + //Time to move a round from one magazine to another class GVAR(TimePerAmmo) { value = 1.5; typeName = "SCALAR"; }; + //Time to swap between magazines when repacking class GVAR(TimePerMagazine) { value = 2.0; typeName = "SCALAR"; }; + //Time to relink 2 belts together + class GVAR(TimePerBeltLink) { + value = 8.0; + typeName = "SCALAR"; + }; }; diff --git a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf new file mode 100644 index 0000000000..7a2b81371c --- /dev/null +++ b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf @@ -0,0 +1,54 @@ +/* + * Author: PabstMirror,commy2, esteldunedain, Ruthberg + * Gets magazine children for interaciton menu + * + * Argument: + * 0: Target + * 1: Player + * + * Return value: + * ChildActiosn + * + * Example: + * [player, player] call ace_magazinerepack_fnc_getMagazineChildren + * + * Public: No + */ +#include "script_component.hpp" + +private ["_unitMagazines", "_unitMagCounts", "_xFullMagazineCount", "_index", "_actions", "_displayName", "_picture", "_action"]; + +PARAMS_2(_target,_player); + +// get all mags and ammo count +_unitMagazines = []; +_unitMagCounts = []; +{ + EXPLODE_4_PVT(_x,_xClassname,_xCount,_xLoaded,_xType); + _xFullMagazineCount = getNumber (configfile >> "CfgMagazines" >> _xClassname >> "count"); + + //for every partial magazine, that is either in inventory or can be moved there + if ((_xCount < _xFullMagazineCount) && {_xCount > 0} && {(!_xLoaded) || {_player canAdd _magazineClassname}}) then { + _index = _unitMagazines find _xClassname; + if (_index == -1) then { + _unitMagazines pushBack _xClassname; + _unitMagCounts pushBack [_xCount]; + } else { + (_unitMagCounts select _index) pushBack _xCount; + }; + }; +} forEach (magazinesAmmoFull _player); + +//Create the action children for all appropriate magazines +_actions = []; +{ + if ((count (_unitMagCounts select _forEachIndex)) >= 2) then {// Ignore invalid magazines types (need 2+ partial mags to do anything) + _displayName = getText (configFile >> "CfgMagazines" >> _x >> "displayName"); + _picture = getText (configFile >> "CfgMagazines" >> _x >> "picture"); + + _action = [_x, _displayName, _picture, {_this call FUNC(startRepackingMagazine)}, {true}, {}, _x] call EFUNC(interact_menu,createAction); + _actions pushBack [_action, [], _player]; + }; +} forEach _unitMagazines; + +_actions diff --git a/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf b/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf index 038b7fb151..e677cccdce 100644 --- a/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf +++ b/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf @@ -19,13 +19,16 @@ */ #include "script_component.hpp" +private ["_structuredOutputText", "_picture", "_fullMags", "_partialMags", "_fullMagazineCount"]; + PARAMS_4(_args,_elapsedTime,_totalTime,_errorCode); EXPLODE_2_PVT(_args,_magazineClassname,_lastAmmoCount); _fullMagazineCount = getNumber (configfile >> "CfgMagazines" >> _magazineClassname >> "count"); -_structuredOutputText = +//Don't show anything if player can't interact: +if (!([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitWith {}; -if (_errorCode == 0) then { +_structuredOutputText = if (_errorCode == 0) then { format ["%1
", (localize "STR_ACE_MagazineRepack_RepackComplete")]; } else { format ["%1
", (localize "STR_ACE_MagazineRepack_RepackInterrupted")]; @@ -34,19 +37,20 @@ if (_errorCode == 0) then { _picture = getText (configFile >> "CfgMagazines" >> _magazineClassname >> "picture"); _structuredOutputText = _structuredOutputText + format ["
", _picture]; -_fullMags = 0; -_partialMags = 0; -{ - EXPLODE_2_PVT(_x,_xClassname,_xCount); - if ((_xClassname == _magazineClassname) && {_xCount > 0}) then { - if (_xCount == _fullMagazineCount) then { - _fullMags = _fullMags + 1; - } else { - _partialMags = _partialMags + 1; - }; - }; -} forEach (magazinesAmmoFull ACE_player); +//EFUNC(common,displayTextStructured) doesn't have room for this, and I don't think it's nessacary, can fix in the future if wanted: -_structuredOutputText = _structuredOutputText + format [("" + (localize "STR_ACE_MagazineRepack_RepackedMagazinesCount") + ""), _fullMags, _partialMags]; +// _fullMags = 0; +// _partialMags = 0; +// { + // EXPLODE_2_PVT(_x,_xClassname,_xCount); + // if ((_xClassname == _magazineClassname) && {_xCount > 0}) then { + // if (_xCount == _fullMagazineCount) then { + // _fullMags = _fullMags + 1; + // } else { + // _partialMags = _partialMags + 1; + // }; + // }; +// } forEach (magazinesAmmoFull ACE_player); +// _structuredOutputText = _structuredOutputText + format [("" + (localize "STR_ACE_MagazineRepack_RepackedMagazinesCount") + ""), _fullMags, _partialMags]; [parseText _structuredOutputText] call EFUNC(common,displayTextStructured); diff --git a/addons/magazinerepack/functions/fnc_openSelectMagazineUI.sqf b/addons/magazinerepack/functions/fnc_openSelectMagazineUI.sqf deleted file mode 100644 index fc183faa5b..0000000000 --- a/addons/magazinerepack/functions/fnc_openSelectMagazineUI.sqf +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Author: PabstMirror (based on repack from commy2, esteldunedain, Ruthberg) - * Opens the selectMenu UI to chose which magazine to repack. - * Only shows classnames that have 2+ partial magazines - * - * Arguments: - * 0: Unit (player) - * - * Return Value: - * Nothing - * - * Example: - * [_player] call ace_magazinerepack_fnc_openSelectMagazineUI - * - * Public: No - */ -#include "script_component.hpp" - -private ["_unitMagazines", "_unitMagCounts", "_xFullMagazineCount", "_index", "_actions", "_displayName", "_picture"]; - -PARAMS_1(_unit); - -_unitMagazines = []; -_unitMagCounts = []; - -// get all mags and ammo count -{ - EXPLODE_2_PVT(_x,_xClassname,_xCount); - _xFullMagazineCount = getNumber (configfile >> "CfgMagazines" >> _xClassname >> "count"); - - if ((_xCount != _xFullMagazineCount) && {_xCount > 0}) then {//for every partial magazine - _index = _unitMagazines find _xClassname; - if (_index == -1) then { - _unitMagazines pushBack _xClassname; - _unitMagCounts pushBack [_xCount]; - } else { - (_unitMagCounts select _index) pushBack _xCount; - }; - }; -} forEach (magazinesAmmoFull _unit); - -_actions = [localize "STR_ACE_MagazineRepack_SelectMagazineMenu", localize "STR_ACE_MagazineRepack_SelectMagazine"] call EFUNC(interaction,prepareSelectMenu); - -{ - if ((count (_unitMagCounts select _forEachIndex)) >= 2) then {// Ignore invalid magazines types (need 2+ partial mags to do anything) - _displayName = getText (configFile >> "CfgMagazines" >> _x >> "displayName"); - _picture = getText (configFile >> "CfgMagazines" >> _x >> "picture"); - _actions = [_actions, _displayName, _picture, _x] call EFUNC(interaction,addSelectableItem); - }; -} forEach _unitMagazines; - -[ -_actions, -{ [_this] call FUNC(startRepackingMagazine); }, -{ - call EFUNC(interaction,hideMenu); //ToDo: Self Interaction Integration -} -] call EFUNC(interaction,openSelectMenu); diff --git a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf index 2b8b383a9a..fb37a0dd4e 100644 --- a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf +++ b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf @@ -6,12 +6,13 @@ * Arguments: * 0: How many rounds in a full magazine * 1: Array of rounds in magazines + * 2: Magazine is a belt * * Return Value: * Array in format [time, isBullet, array of ammo counts] * * Example: - * [5, [1,2,3,8]] call ace_magazinerepack_fnc_simulateRepackEvents = + * [10, [1,2,3,8], false] call ace_magazinerepack_fnc_simulateRepackEvents = * [[1.5,true,[0,2,3,9]],[3.5,false,[0,2,3,9]],[5,true,[0,1,3,10]],[7,false,[0,1,3,10]],[8.5,true,[0,0,4,10]],[10.5,false,[0,0,4,10]]] * * Public: No @@ -20,7 +21,7 @@ private ["_newMagFnc", "_time", "_events", "_swapAmmoFnc", "_ammoSwaped", "_lowIndex", "_highIndex", "_ammoToTransfer", "_ammoAvailable", "_ammoNeeded"]; -PARAMS_2(_fullMagazineCount,_arrayOfAmmoCounts); +PARAMS_3(_fullMagazineCount,_arrayOfAmmoCounts,_isBelt); // Sort Ascending - Don't modify original _arrayOfAmmoCounts = (+_arrayOfAmmoCounts) call BIS_fnc_sortNum; @@ -29,13 +30,23 @@ _newMagFnc = { _time = _time + GVAR(TimePerMagazine); _events pushBack [_time, false, +_arrayOfAmmoCounts]; }; -_swapAmmoFnc = { - for "_swapProgress" from 0 to (_ammoSwaped - 1) do { - _time = _time + GVAR(TimePerAmmo); - _arrayOfAmmoCounts set [_lowIndex, ((_arrayOfAmmoCounts select _lowIndex) - 1)]; - _arrayOfAmmoCounts set [_highIndex, ((_arrayOfAmmoCounts select _highIndex) + 1)]; + +_swapAmmoFnc = if (_isBelt) then { + { + _time = _time + GVAR(TimePerBeltLink); + _arrayOfAmmoCounts set [_lowIndex, ((_arrayOfAmmoCounts select _lowIndex) - _ammoSwaped)]; + _arrayOfAmmoCounts set [_highIndex, ((_arrayOfAmmoCounts select _highIndex) + _ammoSwaped)]; _events pushBack [_time, true, +_arrayOfAmmoCounts]; - }; + } +} else { + { + for "_swapProgress" from 0 to (_ammoSwaped - 1) do { + _time = _time + GVAR(TimePerAmmo); + _arrayOfAmmoCounts set [_lowIndex, ((_arrayOfAmmoCounts select _lowIndex) - 1)]; + _arrayOfAmmoCounts set [_highIndex, ((_arrayOfAmmoCounts select _highIndex) + 1)]; + _events pushBack [_time, true, +_arrayOfAmmoCounts]; + }; + } }; _lowIndex = 0; diff --git a/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf b/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf index 06c0f0a137..bb98461316 100644 --- a/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf +++ b/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf @@ -5,7 +5,9 @@ * Precalcs all the event timings and starts the progressBar. * * Arguments: - * 0: Magazine Classname + * 0: Target + * 1: Player + * 2: Magazine Classname * * Return Value: * Nothing @@ -17,18 +19,21 @@ */ #include "script_component.hpp" -private ["_unit", "_fullMagazineCount", "_startingAmmoCounts", "_simEvents", "_totalTime"]; +private ["_magazineCfg", "_fullMagazineCount", "_isBelt", "_startingAmmoCounts", "_simEvents", "_totalTime"]; + +PARAMS_3(_target,_player,_magazineClassname); -PARAMS_1(_magazineClassname); if (isNil "_magazineClassname" || {_magazineClassname == ""}) exitWith {ERROR("Bad Mag Classname");}; - -_unit = ACE_player; - -[ACE_player] call EFUNC(common,goKneeling); -call EFUNC(interaction,hideMenu);//ToDo: Self Interaction Integration - +_magazineCfg = configfile >> "CfgMagazines" >> _magazineClassname; // Calculate actual ammo to transfer during repack -_fullMagazineCount = getNumber (configfile >> "CfgMagazines" >> _magazineClassname >> "count"); +_fullMagazineCount = getNumber (_magazineCfg >> "count"); +//Is linked belt magazine: +_isBelt = (isNumber (_magazineCfg >> "ACE_isBelt")) && {(getNumber (_magazineCfg >> "ACE_isBelt")) == 1}; + +//Check canInteractWith: +if (!([_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitWith {}; + +[_player] call EFUNC(common,goKneeling); _startingAmmoCounts = []; { @@ -36,25 +41,25 @@ _startingAmmoCounts = []; if ((_xClassname == _magazineClassname) && {(_xCount != _fullMagazineCount) && {_xCount > 0}}) then { if (_xLoaded) then { //Try to Remove from weapon and add to inventory, otherwise ignore - if (_unit canAdd _magazineClassname) then { + if (_player canAdd _magazineClassname) then { switch (_xType) do { - case (1): {_unit removePrimaryWeaponItem _magazineClassname;}; - case (2): {_unit removeHandgunItem _magazineClassname;}; - case (4): {_unit removeSecondaryWeaponItem _magazineClassname;}; + case (1): {_player removePrimaryWeaponItem _magazineClassname;}; + case (2): {_player removeHandgunItem _magazineClassname;}; + case (4): {_player removeSecondaryWeaponItem _magazineClassname;}; default {ERROR("Loaded Location Invalid");}; }; - _unit addMagazine [_magazineClassname, _xCount]; + _player addMagazine [_magazineClassname, _xCount]; _startingAmmoCounts pushBack _xCount; }; } else { _startingAmmoCounts pushBack _xCount; }; }; -} forEach (magazinesAmmoFull _unit); +} forEach (magazinesAmmoFull _player); if ((count _startingAmmoCounts) < 2) exitwith {ERROR("Not Enough Mags to Repack");}; -_simEvents = [_fullMagazineCount, _startingAmmoCounts] call FUNC(simulateRepackEvents); +_simEvents = [_fullMagazineCount, _startingAmmoCounts, _isBelt] call FUNC(simulateRepackEvents); _totalTime = (_simEvents select ((count _simEvents) - 1) select 0); [ @@ -63,5 +68,6 @@ _totalTime, {_this call FUNC(magazineRepackFinish)}, {_this call FUNC(magazineRepackFinish)}, (localize "STR_ACE_MagazineRepack_RepackingMagazine"), -{_this call FUNC(magazineRepackProgress)} +{_this call FUNC(magazineRepackProgress)}, +["isNotInside"] ] call EFUNC(common,progressBar); diff --git a/addons/medical/ACE_Medical_Actions.hpp b/addons/medical/ACE_Medical_Actions.hpp new file mode 100644 index 0000000000..1fd6a99252 --- /dev/null +++ b/addons/medical/ACE_Medical_Actions.hpp @@ -0,0 +1,760 @@ + class ACE_Head { + displayName = "$STR_ACE_Interaction_Head"; + runOnHover = 1; + statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); + EXCEPTIONS + icon = PATHTOF(UI\icons\medical_cross.paa); + distance = MEDICAL_ACTION_DISTANCE; + class Bandage { + displayName = "$STR_ACE_Medical_Bandage_HitHead"; + distance = 2.0; + condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(treatment)); + EXCEPTIONS + showDisabled = 1; + priority = 2; + hotkey = "B"; + icon = PATHTOF(UI\icons\bandage.paa); + }; + // Advanced medical + class FieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + distance = 5.0; + condition = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call DFUNC(treatment)); + EXCEPTIONS + showDisabled = 0; + priority = 2; + hotkey = ""; + icon = PATHTOF(UI\icons\bandage.paa); + }; + class PackingBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + condition = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\packingBandage.paa); + }; + class ElasticBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + condition = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\bandage.paa); + }; + class QuikClot: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + condition = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\bandage.paa); + }; + class CheckPulse: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckPulse"; + condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(treatment)); + EXCEPTIONS + icon = ""; + }; + class CheckBloodPressure: CheckPulse { + displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckBloodPressure"; + condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call DFUNC(treatment)); + EXCEPTIONS + }; + class CheckResponse: CheckPulse { + displayName = "Check Response"; + condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckResponse')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckResponse')] call DFUNC(treatment)); + EXCEPTIONS + }; + }; + class ACE_Torso { + displayName = "$STR_ACE_Interaction_Torso"; + runOnHover = 1; + statement = QUOTE([ARR_3(_target, true, 1)] call DFUNC(displayPatientInformation)); + EXCEPTIONS + icon = PATHTOF(UI\icons\medical_cross.paa); + distance = MEDICAL_ACTION_DISTANCE; + class Bandage { + displayName = "$STR_ACE_Medical_Bandage_HitBody"; + distance = 2.0; + condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(treatment)); + EXCEPTIONS + showDisabled = 1; + priority = 2; + hotkey = "B"; + enableInside = 1; + icon = PATHTOF(UI\icons\bandage.paa); + }; + class PlaceInBodyBag { + displayName = "$STR_ACE_MEDICAL_PlaceInBodyBag"; + distance = 2.0; + condition = QUOTE([ARR_4(_player, _target, 'body', 'BodyBag')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'body', 'BodyBag')] call DFUNC(treatment)); + EXCEPTIONS + showDisabled = 1; + priority = 2; + hotkey = ""; + enableInside = 1; + }; + class TriageCard { + displayName = "Triage Card"; + distance = 2.0; + condition = "true"; + statement = QUOTE([ARR_2(_target, true)] call DFUNC(displayTriageCard)); + EXCEPTIONS + showDisabled = 1; + priority = 2; + hotkey = ""; + enableInside = 1; + icon = PATHTOF(UI\icons\triageCard.paa); + }; + + // Advanced medical + class FieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + distance = 5.0; + condition = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call DFUNC(treatment)); + EXCEPTIONS + showDisabled = 0; + priority = 2; + hotkey = ""; + enableInside = 1; + icon = PATHTOF(UI\icons\bandage.paa); + }; + class PackingBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + condition = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\packingBandage.paa); + }; + class ElasticBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + condition = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\bandage.paa); + }; + class QuikClot: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + condition = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\bandage.paa); + }; + class SurgicalKit: fieldDressing { + displayName = "Use Surgical Kit"; + condition = QUOTE([ARR_4(_player, _target, 'body', 'SurgicalKit')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'body', 'SurgicalKit')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\surgicalKit.paa); + }; + class PersonalAidKit: fieldDressing { + displayName = "Use Personal Aid Kit"; + condition = QUOTE([ARR_4(_player, _target, 'body', 'PersonalAidKit')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'body', 'PersonalAidKit')] call DFUNC(treatment)); + EXCEPTIONS + icon = ""; + }; + class CPR: fieldDressing { + displayName = "CPR"; + condition = QUOTE([ARR_4(_player, _target, 'body', 'CPR')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'body', 'CPR')] call DFUNC(treatment)); + EXCEPTIONS + icon = ""; + }; + }; + class ACE_ArmLeft { + displayName = "$STR_ACE_Interaction_ArmLeft"; + runOnHover = 1; + statement = QUOTE([ARR_3(_target, true, 2)] call DFUNC(displayPatientInformation)); + EXCEPTIONS + icon = PATHTOF(UI\icons\medical_cross.paa); + distance = MEDICAL_ACTION_DISTANCE; + + class Bandage { + displayName = "$STR_ACE_Medical_Bandage_HitLeftArm"; + distance = 2.0; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(treatment)); + EXCEPTIONS + showDisabled = 1; + priority = 2; + hotkey = "B"; + icon = PATHTOF(UI\icons\bandage.paa); + }; + + // Advanced medical + class FieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + distance = 5.0; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call DFUNC(treatment)); + EXCEPTIONS + showDisabled = 0; + priority = 2; + hotkey = ""; + icon = PATHTOF(UI\icons\bandage.paa); + }; + class PackingBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\packingBandage.paa); + }; + class ElasticBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\bandage.paa); + }; + class QuikClot: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\bandage.paa); + }; + class Tourniquet: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\tourniquet.paa); + }; + class Morphine: fieldDressing { + displayName = "$STR_ACE_Medical_Inject_Morphine"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\autoInjector.paa); + }; + class Atropine: Morphine { + displayName = "$STR_ACE_Medical_Inject_Atropine"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\autoInjector.paa); + }; + class Epinephrine: Morphine { + displayName = "$STR_ACE_Medical_Inject_Epinephrine"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\autoInjector.paa); + }; + class BloodIV: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_1000"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\iv.paa); + }; + class BloodIV_500: BloodIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_500"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_500')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_500')] call DFUNC(treatment)); + EXCEPTIONS + }; + class BloodIV_250: BloodIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_250"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_250')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_250')] call DFUNC(treatment)); + EXCEPTIONS + }; + class PlasmaIV: BloodIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_1000"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV')] call DFUNC(treatment)); + EXCEPTIONS + }; + class PlasmaIV_500: PlasmaIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_500"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_500')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_500')] call DFUNC(treatment)); + EXCEPTIONS + }; + class PlasmaIV_250: PlasmaIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_250"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_250')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_250')] call DFUNC(treatment)); + EXCEPTIONS + }; + class SalineIV: BloodIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_1000"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV')] call DFUNC(treatment)); + EXCEPTIONS + }; + class SalineIV_500: SalineIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_500"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_500')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_500')] call DFUNC(treatment)); + EXCEPTIONS + }; + class SalineIV_250: SalineIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_250"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_250')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_250')] call DFUNC(treatment)); + EXCEPTIONS + }; + class CheckPulse: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckPulse"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(treatment)); + EXCEPTIONS + icon = ""; + }; + class CheckBloodPressure: CheckPulse { + displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckBloodPressure"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(treatment)); + EXCEPTIONS + }; + class RemoveTourniquet: Tourniquet { + displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(treatment)); + EXCEPTIONS + }; + }; + class ACE_ArmRight { + displayName = "$STR_ACE_Interaction_ArmRight"; + runOnHover = 1; + statement = QUOTE([ARR_3(_target, true, 3)] call DFUNC(displayPatientInformation)); + EXCEPTIONS + icon = PATHTOF(UI\icons\medical_cross.paa); + distance = MEDICAL_ACTION_DISTANCE; + + class Bandage { + displayName = "$STR_ACE_Medical_Bandage_HitRightArm"; + distance = 2.0; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(treatment)); + EXCEPTIONS + showDisabled = 1; + priority = 2; + hotkey = "B"; + icon = PATHTOF(UI\icons\bandage.paa); + }; + + // Advanced medical + class FieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + distance = 5.0; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call DFUNC(treatment)); + EXCEPTIONS + showDisabled = 0; + priority = 2; + hotkey = ""; + icon = PATHTOF(UI\icons\bandage.paa); + }; + class PackingBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\packingBandage.paa); + }; + class ElasticBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(treatment)); + EXCEPTIONS + }; + class QuikClot: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(treatment)); + EXCEPTIONS + }; + class Tourniquet: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\tourniquet.paa); + }; + class Morphine: fieldDressing { + displayName = "$STR_ACE_Medical_Inject_Morphine"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\autoInjector.paa); + }; + class Atropine: Morphine { + displayName = "$STR_ACE_Medical_Inject_Atropine"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Atropine')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Atropine')] call DFUNC(treatment)); + EXCEPTIONS + }; + class Epinephrine: Morphine { + displayName = "$STR_ACE_Medical_Inject_Epinephrine"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Epinephrine')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Epinephrine')] call DFUNC(treatment)); + EXCEPTIONS + }; + class BloodIV: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_1000"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\iv.paa); + }; + class BloodIV_500: BloodIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_500"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_500')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_500')] call DFUNC(treatment)); + EXCEPTIONS + }; + class BloodIV_250: BloodIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_250"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_250')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_250')] call DFUNC(treatment)); + EXCEPTIONS + }; + class PlasmaIV: BloodIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_1000"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(treatment)); + EXCEPTIONS + }; + class PlasmaIV_500: PlasmaIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_500"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_500')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_500')] call DFUNC(treatment)); + EXCEPTIONS + }; + class PlasmaIV_250: PlasmaIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_250"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_250')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_250')] call DFUNC(treatment)); + EXCEPTIONS + }; + class SalineIV: BloodIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_1000"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV')] call DFUNC(treatment)); + EXCEPTIONS + }; + class SalineIV_500: SalineIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_500"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_500')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_500')] call DFUNC(treatment)); + EXCEPTIONS + }; + class SalineIV_250: SalineIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_250"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_250')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_250')] call DFUNC(treatment)); + EXCEPTIONS + }; + class CheckPulse: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckPulse"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(treatment)); + EXCEPTIONS + icon = ""; + }; + class CheckBloodPressure: CheckPulse { + displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckBloodPressure"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(treatment)); + EXCEPTIONS + }; + class RemoveTourniquet: Tourniquet { + displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(treatment)); + EXCEPTIONS + }; + + }; + class ACE_LegLeft { + displayName = "$STR_ACE_Interaction_LegLeft"; + runOnHover = 1; + statement = QUOTE([ARR_3(_target, true, 4)] call DFUNC(displayPatientInformation)); + EXCEPTIONS + icon = PATHTOF(UI\icons\medical_cross.paa); + distance = MEDICAL_ACTION_DISTANCE; + + class Bandage { + displayName = "$STR_ACE_Medical_Bandage_HitLeftLeg"; + distance = 2.0; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(treatment)); + EXCEPTIONS + showDisabled = 1; + priority = 2; + hotkey = "B"; + icon = PATHTOF(UI\icons\bandage.paa); + }; + + + // Advanced medical + class FieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + distance = 5.0; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call DFUNC(treatment)); + EXCEPTIONS + showDisabled = 0; + priority = 2; + hotkey = ""; + icon = PATHTOF(UI\icons\bandage.paa); + }; + class PackingBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\packingBandage.paa); + }; + class ElasticBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(treatment)); + EXCEPTIONS + }; + class QuikClot: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(treatment)); + EXCEPTIONS + }; + class Tourniquet: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\tourniquet.paa); + }; + class Morphine: fieldDressing { + displayName = "$STR_ACE_Medical_Inject_Morphine"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\autoInjector.paa); + }; + class Atropine: Morphine { + displayName = "$STR_ACE_Medical_Inject_Atropine"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\autoInjector.paa); + }; + class Epinephrine: Morphine { + displayName = "$STR_ACE_Medical_Inject_Epinephrine"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call DFUNC(treatment)); + EXCEPTIONS + }; + class BloodIV: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_1000"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\iv.paa); + }; + class BloodIV_500: BloodIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_500"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_500')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_500')] call DFUNC(treatment)); + EXCEPTIONS + }; + class BloodIV_250: BloodIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_250"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_250')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_250')] call DFUNC(treatment)); + EXCEPTIONS + }; + class PlasmaIV: BloodIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_1000"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(treatment)); + EXCEPTIONS + }; + class PlasmaIV_500: PlasmaIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_500"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_500')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_500')] call DFUNC(treatment)); + EXCEPTIONS + }; + class PlasmaIV_250: PlasmaIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_250"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_250')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_250')] call DFUNC(treatment)); + EXCEPTIONS + }; + class SalineIV: BloodIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_1000"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV')] call DFUNC(treatment)); + EXCEPTIONS + }; + class SalineIV_500: SalineIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_500"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_500')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_500')] call DFUNC(treatment)); + EXCEPTIONS + }; + class SalineIV_250: SalineIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_250"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_250')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_250')] call DFUNC(treatment)); + EXCEPTIONS + }; + class RemoveTourniquet: Tourniquet { + displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(treatment)); + EXCEPTIONS + }; + }; + class ACE_LegRight { + displayName = "$STR_ACE_Interaction_LegRight"; + runOnHover = 1; + statement = QUOTE([ARR_3(_target, true, 5)] call DFUNC(displayPatientInformation)); + EXCEPTIONS + icon = PATHTOF(UI\icons\medical_cross.paa); + distance = MEDICAL_ACTION_DISTANCE; + + class Bandage { + displayName = "$STR_ACE_Medical_Bandage_HitRightLeg"; + distance = 2.0; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(treatment)); + EXCEPTIONS + showDisabled = 1; + priority = 2; + hotkey = "B"; + icon = PATHTOF(UI\icons\bandage.paa); + }; + + + // Advanced medical + class FieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + distance = 5.0; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call DFUNC(treatment)); + EXCEPTIONS + showDisabled = 0; + priority = 2; + hotkey = ""; + icon = PATHTOF(UI\icons\bandage.paa); + }; + class PackingBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\packingBandage.paa); + }; + class ElasticBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(treatment)); + EXCEPTIONS + }; + class QuikClot: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(treatment)); + EXCEPTIONS + }; + class Tourniquet: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\tourniquet.paa); + }; + class Morphine: fieldDressing { + displayName = "$STR_ACE_Medical_Inject_Morphine"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\autoInjector.paa); + }; + class Atropine: Morphine { + displayName = "$STR_ACE_Medical_Inject_Atropine"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Atropine')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Atropine')] call DFUNC(treatment)); + EXCEPTIONS + }; + class Epinephrine: Morphine { + displayName = "$STR_ACE_Medical_Inject_Epinephrine"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Epinephrine')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Epinephrine')] call DFUNC(treatment)); + EXCEPTIONS + }; + class BloodIV: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_1000"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(treatment)); + EXCEPTIONS + icon = PATHTOF(UI\icons\iv.paa); + }; + class BloodIV_500: BloodIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_500"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_500')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_500')] call DFUNC(treatment)); + EXCEPTIONS + }; + class BloodIV_250: BloodIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_250"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_250')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_250')] call DFUNC(treatment)); + EXCEPTIONS + }; + class PlasmaIV: BloodIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_1000"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(treatment)); + EXCEPTIONS + }; + class PlasmaIV_500: PlasmaIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_500"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_500')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_500')] call DFUNC(treatment)); + EXCEPTIONS + }; + class PlasmaIV_250: PlasmaIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_250"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_250')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_250')] call DFUNC(treatment)); + EXCEPTIONS + }; + class SalineIV: BloodIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_1000"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV')] call DFUNC(treatment)); + EXCEPTIONS + }; + class SalineIV_500: SalineIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_500"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_500')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_500')] call DFUNC(treatment)); + EXCEPTIONS + }; + class SalineIV_250: SalineIV { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_250"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_250')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_250')] call DFUNC(treatment)); + EXCEPTIONS + }; + class RemoveTourniquet: Tourniquet { + displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(treatment)); + EXCEPTIONS + }; + }; diff --git a/addons/medical/ACE_Medical_SelfActions.hpp b/addons/medical/ACE_Medical_SelfActions.hpp new file mode 100644 index 0000000000..e77e276af2 --- /dev/null +++ b/addons/medical/ACE_Medical_SelfActions.hpp @@ -0,0 +1,509 @@ +class Medical { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Medical"; + runOnHover = 1; + hotkey = "M"; + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); + icon = PATHTOF(UI\icons\medical_cross.paa); + + class ACE_Head { + displayName = "$STR_ACE_Interaction_Head"; + icon = PATHTOF(UI\icons\medical_cross.paa); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); + runOnHover = 1; + + class Bandage { + displayName = "$STR_ACE_Medical_Bandage_HitHead"; + distance = 2.0; + condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(treatment)); + showDisabled = 1; + priority = 2; + hotkey = "B"; + icon = PATHTOF(UI\icons\bandage.paa); + }; + // Advanced medical + class FieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + distance = 5.0; + condition = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call DFUNC(treatment)); + showDisabled = 0; + priority = 2; + hotkey = ""; + icon = PATHTOF(UI\icons\bandage.paa); + }; + class PackingBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + condition = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\packingBandage.paa); + }; + class ElasticBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + condition = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\bandage.paa); + }; + class QuikClot: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + condition = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\bandage.paa); + }; + class CheckPulse: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckPulse"; + condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(treatment)); + icon = ""; + }; + class CheckBloodPressure: CheckPulse { + displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckBloodPressure"; + condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call DFUNC(treatment)); + }; + }; + class ACE_Torso { + displayName = "$STR_ACE_Interaction_Torso"; + distance = 5.0; + condition = "true"; + runOnHover = 1; + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_3(_target, true, 1)] call DFUNC(displayPatientInformation)); + showDisabled = 1; + priority = 2; + hotkey = ""; + icon = PATHTOF(UI\icons\medical_cross.paa); + + class Bandage { + displayName = "$STR_ACE_Medical_Bandage_HitBody"; + distance = 2.0; + condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(treatment)); + showDisabled = 1; + priority = 2; + hotkey = "B"; + icon = PATHTOF(UI\icons\bandage.paa); + }; + + class TriageCard { + displayName = "$STR_ACE_MEDICAL_ACTIONS_TriageCard"; + distance = 2.0; + condition = "true"; + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_2(_target, true)] call DFUNC(displayTriageCard)); + showDisabled = 1; + priority = 2; + hotkey = ""; + icon = PATHTOF(UI\icons\triageCard.paa); + }; + + // Advanced medical + class FieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + distance = 5.0; + condition = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call DFUNC(treatment)); + showDisabled = 0; + priority = 2; + hotkey = ""; + icon = PATHTOF(UI\icons\bandage.paa); + }; + class PackingBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + condition = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\packingBandage.paa); + }; + class ElasticBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + condition = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\bandage.paa); + }; + class QuikClot: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + condition = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\bandage.paa); + }; + }; + class ACE_ArmLeft { + displayName = "$STR_ACE_Interaction_ArmLeft"; + runOnHover = 1; + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_3(_target, true, 2)] call DFUNC(displayPatientInformation)); + icon = PATHTOF(UI\icons\medical_cross.paa); + + class Bandage { + displayName = "$STR_ACE_Medical_Bandage_HitLeftArm"; + distance = 2.0; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(treatment)); + showDisabled = 1; + priority = 2; + hotkey = "B"; + icon = PATHTOF(UI\icons\bandage.paa); + }; + + // Advanced medical + class FieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + distance = 5.0; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call DFUNC(treatment)); + showDisabled = 0; + priority = 2; + hotkey = ""; + icon = PATHTOF(UI\icons\bandage.paa); + }; + class PackingBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\packingBandage.paa); + }; + class ElasticBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\bandage.paa); + }; + class QuikClot: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\bandage.paa); + }; + class Tourniquet: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\tourniquet.paa); + }; + class Morphine: fieldDressing { + displayName = "$STR_ACE_Medical_Inject_Morphine"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\autoInjector.paa); + }; + class Atropine: Morphine { + displayName = "$STR_ACE_Medical_Inject_Atropine"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\autoInjector.paa); + }; + class Epinephrine: Morphine { + displayName = "$STR_ACE_Medical_Inject_Epinephrine"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\autoInjector.paa); + }; + class CheckPulse: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckPulse"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(treatment)); + icon = ""; + }; + class CheckBloodPressure: CheckPulse { + displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckBloodPressure"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(treatment)); + }; + class RemoveTourniquet: Tourniquet { + displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(treatment)); + }; + }; + class ACE_ArmRight { + displayName = "$STR_ACE_Interaction_ArmRight"; + runOnHover = 1; + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_3(_target, true, 3)] call DFUNC(displayPatientInformation)); + icon = PATHTOF(UI\icons\medical_cross.paa); + + class Bandage { + displayName = "$STR_ACE_Medical_Bandage_HitRightArm"; + distance = 2.0; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(treatment)); + showDisabled = 1; + priority = 2; + hotkey = "B"; + icon = PATHTOF(UI\icons\bandage.paa); + }; + + // Advanced medical + class FieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + distance = 5.0; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call DFUNC(treatment)); + showDisabled = 0; + priority = 2; + hotkey = ""; + icon = PATHTOF(UI\icons\bandage.paa); + }; + class PackingBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\packingBandage.paa); + }; + class ElasticBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(treatment)); + }; + class QuikClot: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(treatment)); + }; + class Tourniquet: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\tourniquet.paa); + }; + class Morphine: fieldDressing { + displayName = "$STR_ACE_Medical_Inject_Morphine"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\autoInjector.paa); + }; + class Atropine: Morphine { + displayName = "$STR_ACE_Medical_Inject_Atropine"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Atropine')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Atropine')] call DFUNC(treatment)); + }; + class Epinephrine: Morphine { + displayName = "$STR_ACE_Medical_Inject_Epinephrine"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Epinephrine')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Epinephrine')] call DFUNC(treatment)); + }; + class CheckPulse: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckPulse"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(treatment)); + icon = ""; + }; + class CheckBloodPressure: CheckPulse { + displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckBloodPressure"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(treatment)); + }; + class RemoveTourniquet: Tourniquet { + displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(treatment)); + }; + }; + class ACE_LegLeft { + displayName = "$STR_ACE_Interaction_LegLeft"; + runOnHover = 1; + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_3(_target, true, 4)] call DFUNC(displayPatientInformation)); + icon = PATHTOF(UI\icons\medical_cross.paa); + + class Bandage { + displayName = "$STR_ACE_Medical_Bandage_HitLeftLeg"; + distance = 2.0; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(treatment)); + showDisabled = 1; + priority = 2; + hotkey = "B"; + icon = PATHTOF(UI\icons\bandage.paa); + }; + + + // Advanced medical + class FieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + distance = 5.0; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call DFUNC(treatment)); + showDisabled = 0; + priority = 2; + hotkey = ""; + icon = PATHTOF(UI\icons\bandage.paa); + }; + class PackingBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\packingBandage.paa); + }; + class ElasticBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(treatment)); + }; + class QuikClot: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(treatment)); + }; + class Tourniquet: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\tourniquet.paa); + }; + class Morphine: fieldDressing { + displayName = "$STR_ACE_Medical_Inject_Morphine"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\autoInjector.paa); + }; + class Atropine: Morphine { + displayName = "$STR_ACE_Medical_Inject_Atropine"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\autoInjector.paa); + }; + class Epinephrine: Morphine { + displayName = "$STR_ACE_Medical_Inject_Epinephrine"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call DFUNC(treatment)); + }; + class RemoveTourniquet: Tourniquet { + displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(treatment)); + }; + }; + class ACE_LegRight { + displayName = "$STR_ACE_Interaction_LegRight"; + runOnHover = 1; + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_3(_target, true, 5)] call DFUNC(displayPatientInformation)); + icon = PATHTOF(UI\icons\medical_cross.paa); + + class Bandage { + displayName = "$STR_ACE_Medical_Bandage_HitRightLeg"; + distance = 2.0; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(treatment)); + showDisabled = 1; + priority = 2; + hotkey = "B"; + icon = PATHTOF(UI\icons\bandage.paa); + }; + + + // Advanced medical + class FieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + distance = 5.0; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call DFUNC(treatment)); + showDisabled = 0; + priority = 2; + hotkey = ""; + icon = PATHTOF(UI\icons\bandage.paa); + }; + class PackingBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\packingBandage.paa); + }; + class ElasticBandage: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(treatment)); + }; + class QuikClot: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(treatment)); + }; + class Tourniquet: fieldDressing { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\tourniquet.paa); + }; + class Morphine: fieldDressing { + displayName = "$STR_ACE_Medical_Inject_Morphine"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(treatment)); + icon = PATHTOF(UI\icons\autoInjector.paa); + }; + class Atropine: Morphine { + displayName = "$STR_ACE_Medical_Inject_Atropine"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Atropine')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Atropine')] call DFUNC(treatment)); + }; + class Epinephrine: Morphine { + displayName = "$STR_ACE_Medical_Inject_Epinephrine"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Epinephrine')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Epinephrine')] call DFUNC(treatment)); + }; + class RemoveTourniquet: Tourniquet { + displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(treatment)); + }; + }; +}; \ No newline at end of file diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index af5981ebba..0c05532073 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -400,1166 +400,26 @@ class CfgVehicles { }; }; class ACE_SelfActions { - class Medical { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Medical"; - runOnHover = 1; - hotkey = "M"; - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); - icon = PATHTOF(UI\icons\medical_cross.paa); - - class ACE_Head { - displayName = "$STR_ACE_Interaction_Head"; - icon = PATHTOF(UI\icons\medical_cross.paa); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); - runOnHover = 1; - - class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitHead"; - distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(treatment)); - showDisabled = 1; - priority = 2; - hotkey = "B"; - icon = PATHTOF(UI\icons\bandage.paa); - }; - // Advanced medical - class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; - distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call DFUNC(treatment)); - showDisabled = 0; - priority = 2; - hotkey = ""; - icon = PATHTOF(UI\icons\bandage.paa); - }; - class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\packingBandage.paa); - }; - class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\bandage.paa); - }; - class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\bandage.paa); - }; - class CheckPulse: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckPulse"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(treatment)); - icon = ""; - }; - class CheckBloodPressure: CheckPulse { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckBloodPressure"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call DFUNC(treatment)); - }; - }; - class ACE_Torso { - displayName = "$STR_ACE_Interaction_Torso"; - distance = 5.0; - condition = "true"; - runOnHover = 1; - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_3(_target, true, 1)] call DFUNC(displayPatientInformation)); - showDisabled = 1; - priority = 2; - hotkey = ""; - icon = PATHTOF(UI\icons\medical_cross.paa); - - class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitBody"; - distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(treatment)); - showDisabled = 1; - priority = 2; - hotkey = "B"; - icon = PATHTOF(UI\icons\bandage.paa); - }; - - class TriageCard { - displayName = "$STR_ACE_MEDICAL_ACTIONS_TriageCard"; - distance = 2.0; - condition = "true"; - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_2(_target, true)] call DFUNC(displayTriageCard)); - showDisabled = 1; - priority = 2; - hotkey = ""; - icon = PATHTOF(UI\icons\triageCard.paa); - }; - - // Advanced medical - class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; - distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call DFUNC(treatment)); - showDisabled = 0; - priority = 2; - hotkey = ""; - icon = PATHTOF(UI\icons\bandage.paa); - }; - class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\packingBandage.paa); - }; - class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\bandage.paa); - }; - class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\bandage.paa); - }; - }; - class ACE_ArmLeft { - displayName = "$STR_ACE_Interaction_ArmLeft"; - runOnHover = 1; - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_3(_target, true, 2)] call DFUNC(displayPatientInformation)); - icon = PATHTOF(UI\icons\medical_cross.paa); - - class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitLeftArm"; - distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(treatment)); - showDisabled = 1; - priority = 2; - hotkey = "B"; - icon = PATHTOF(UI\icons\bandage.paa); - }; - - // Advanced medical - class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; - distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call DFUNC(treatment)); - showDisabled = 0; - priority = 2; - hotkey = ""; - icon = PATHTOF(UI\icons\bandage.paa); - }; - class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\packingBandage.paa); - }; - class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\bandage.paa); - }; - class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\bandage.paa); - }; - class Tourniquet: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\tourniquet.paa); - }; - class Morphine: fieldDressing { - displayName = "$STR_ACE_Medical_Inject_Morphine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\autoInjector.paa); - }; - class Atropine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Atropine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\autoInjector.paa); - }; - class Epinephrine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Epinephrine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\autoInjector.paa); - }; - class CheckPulse: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckPulse"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(treatment)); - icon = ""; - }; - class CheckBloodPressure: CheckPulse { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckBloodPressure"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(treatment)); - }; - class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(treatment)); - }; - }; - class ACE_ArmRight { - displayName = "$STR_ACE_Interaction_ArmRight"; - runOnHover = 1; - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_3(_target, true, 3)] call DFUNC(displayPatientInformation)); - icon = PATHTOF(UI\icons\medical_cross.paa); - - class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitRightArm"; - distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(treatment)); - showDisabled = 1; - priority = 2; - hotkey = "B"; - icon = PATHTOF(UI\icons\bandage.paa); - }; - - // Advanced medical - class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; - distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call DFUNC(treatment)); - showDisabled = 0; - priority = 2; - hotkey = ""; - icon = PATHTOF(UI\icons\bandage.paa); - }; - class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\packingBandage.paa); - }; - class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(treatment)); - }; - class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(treatment)); - }; - class Tourniquet: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\tourniquet.paa); - }; - class Morphine: fieldDressing { - displayName = "$STR_ACE_Medical_Inject_Morphine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\autoInjector.paa); - }; - class Atropine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Atropine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Atropine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Atropine')] call DFUNC(treatment)); - }; - class Epinephrine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Epinephrine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Epinephrine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Epinephrine')] call DFUNC(treatment)); - }; - class CheckPulse: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckPulse"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(treatment)); - icon = ""; - }; - class CheckBloodPressure: CheckPulse { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckBloodPressure"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(treatment)); - }; - class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(treatment)); - }; - }; - class ACE_LegLeft { - displayName = "$STR_ACE_Interaction_LegLeft"; - runOnHover = 1; - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_3(_target, true, 4)] call DFUNC(displayPatientInformation)); - icon = PATHTOF(UI\icons\medical_cross.paa); - - class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitLeftLeg"; - distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(treatment)); - showDisabled = 1; - priority = 2; - hotkey = "B"; - icon = PATHTOF(UI\icons\bandage.paa); - }; - - - // Advanced medical - class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; - distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call DFUNC(treatment)); - showDisabled = 0; - priority = 2; - hotkey = ""; - icon = PATHTOF(UI\icons\bandage.paa); - }; - class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\packingBandage.paa); - }; - class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(treatment)); - }; - class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(treatment)); - }; - class Tourniquet: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\tourniquet.paa); - }; - class Morphine: fieldDressing { - displayName = "$STR_ACE_Medical_Inject_Morphine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\autoInjector.paa); - }; - class Atropine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Atropine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\autoInjector.paa); - }; - class Epinephrine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Epinephrine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call DFUNC(treatment)); - }; - class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(treatment)); - }; - }; - class ACE_LegRight { - displayName = "$STR_ACE_Interaction_LegRight"; - runOnHover = 1; - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_3(_target, true, 5)] call DFUNC(displayPatientInformation)); - icon = PATHTOF(UI\icons\medical_cross.paa); - - class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitRightLeg"; - distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(treatment)); - showDisabled = 1; - priority = 2; - hotkey = "B"; - icon = PATHTOF(UI\icons\bandage.paa); - }; - - - // Advanced medical - class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; - distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call DFUNC(treatment)); - showDisabled = 0; - priority = 2; - hotkey = ""; - icon = PATHTOF(UI\icons\bandage.paa); - }; - class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\packingBandage.paa); - }; - class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(treatment)); - }; - class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(treatment)); - }; - class Tourniquet: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\tourniquet.paa); - }; - class Morphine: fieldDressing { - displayName = "$STR_ACE_Medical_Inject_Morphine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\autoInjector.paa); - }; - class Atropine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Atropine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Atropine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Atropine')] call DFUNC(treatment)); - }; - class Epinephrine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Epinephrine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Epinephrine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Epinephrine')] call DFUNC(treatment)); - }; - class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(treatment)); - }; - }; - }; + #include "ACE_Medical_SelfActions.hpp" }; class ACE_Actions { - class ACE_Head { - runOnHover = 1; - statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); - icon = PATHTOF(UI\icons\medical_cross.paa); - distance = MEDICAL_ACTION_DISTANCE; - class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitHead"; - distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(treatment)); - showDisabled = 1; - priority = 2; - hotkey = "B"; - icon = PATHTOF(UI\icons\bandage.paa); - }; - // Advanced medical - class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; - distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call DFUNC(treatment)); - showDisabled = 0; - priority = 2; - hotkey = ""; - icon = PATHTOF(UI\icons\bandage.paa); - }; - class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\packingBandage.paa); - }; - class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\bandage.paa); - }; - class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\bandage.paa); - }; - class CheckPulse: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckPulse"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(treatment)); - icon = ""; - }; - class CheckBloodPressure: CheckPulse { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckBloodPressure"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call DFUNC(treatment)); - }; - class CheckResponse: CheckPulse { - displayName = "Check Response"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckResponse')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckResponse')] call DFUNC(treatment)); - }; - }; - class ACE_Torso { - runOnHover = 1; - statement = QUOTE([ARR_3(_target, true, 1)] call DFUNC(displayPatientInformation)); - icon = PATHTOF(UI\icons\medical_cross.paa); - distance = MEDICAL_ACTION_DISTANCE; - class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitBody"; - distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(treatment)); - showDisabled = 1; - priority = 2; - hotkey = "B"; - enableInside = 1; - icon = PATHTOF(UI\icons\bandage.paa); - }; - class PlaceInBodyBag { - displayName = "$STR_ACE_MEDICAL_PlaceInBodyBag"; - distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'body', 'BodyBag')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'body', 'BodyBag')] call DFUNC(treatment)); - showDisabled = 1; - priority = 2; - hotkey = ""; - enableInside = 1; - }; - class TriageCard { - displayName = "Triage Card"; - distance = 2.0; - condition = "true"; - statement = QUOTE([ARR_2(_target, true)] call DFUNC(displayTriageCard)); - showDisabled = 1; - priority = 2; - hotkey = ""; - enableInside = 1; - icon = PATHTOF(UI\icons\triageCard.paa); - }; + // Include actions in body parts for treatment while in the open + #define EXCEPTIONS exceptions[] = {}; + #include "ACE_Medical_Actions.hpp" - // Advanced medical - class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; - distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call DFUNC(treatment)); - showDisabled = 0; - priority = 2; - hotkey = ""; - enableInside = 1; - icon = PATHTOF(UI\icons\bandage.paa); - }; - class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\packingBandage.paa); - }; - class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\bandage.paa); - }; - class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\bandage.paa); - }; - class SurgicalKit: fieldDressing { - displayName = "Use Surgical Kit"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'SurgicalKit')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'body', 'SurgicalKit')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\surgicalKit.paa); - }; - class PersonalAidKit: fieldDressing { - displayName = "Use Personal Aid Kit"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'PersonalAidKit')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'body', 'PersonalAidKit')] call DFUNC(treatment)); - icon = ""; - }; - class CPR: fieldDressing { - displayName = "CPR"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'CPR')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'body', 'CPR')] call DFUNC(treatment)); - icon = ""; - }; - }; - class ACE_ArmLeft { - runOnHover = 1; - statement = QUOTE([ARR_3(_target, true, 2)] call DFUNC(displayPatientInformation)); - icon = PATHTOF(UI\icons\medical_cross.paa); - distance = MEDICAL_ACTION_DISTANCE; + // Create a consolidates medical menu for treatment while boarded + class ACE_MainActions { + class Medical { + displayName = "$STR_ACE_MEDICAL_ACTIONS_Medical"; + runOnHover = 1; + exceptions[] = {"isNotInside"}; + condition = QUOTE(vehicle _target != _target); + statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); + icon = PATHTOF(UI\icons\medical_cross.paa); - class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitLeftArm"; - distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(treatment)); - showDisabled = 1; - priority = 2; - hotkey = "B"; - icon = PATHTOF(UI\icons\bandage.paa); - }; - - // Advanced medical - class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; - distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call DFUNC(treatment)); - showDisabled = 0; - priority = 2; - hotkey = ""; - icon = PATHTOF(UI\icons\bandage.paa); - }; - class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\packingBandage.paa); - }; - class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\bandage.paa); - }; - class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\bandage.paa); - }; - class Tourniquet: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\tourniquet.paa); - }; - class Morphine: fieldDressing { - displayName = "$STR_ACE_Medical_Inject_Morphine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\autoInjector.paa); - }; - class Atropine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Atropine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\autoInjector.paa); - }; - class Epinephrine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Epinephrine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\autoInjector.paa); - }; - class BloodIV: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_1000"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\iv.paa); - }; - class BloodIV_500: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_500"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_500')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_500')] call DFUNC(treatment)); - }; - class BloodIV_250: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_250"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_250')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_250')] call DFUNC(treatment)); - }; - class PlasmaIV: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_1000"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV')] call DFUNC(treatment)); - }; - class PlasmaIV_500: PlasmaIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_500"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_500')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_500')] call DFUNC(treatment)); - }; - class PlasmaIV_250: PlasmaIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_250"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_250')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_250')] call DFUNC(treatment)); - }; - class SalineIV: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_1000"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV')] call DFUNC(treatment)); - }; - class SalineIV_500: SalineIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_500"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_500')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_500')] call DFUNC(treatment)); - }; - class SalineIV_250: SalineIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_250"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_250')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_250')] call DFUNC(treatment)); - }; - class CheckPulse: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckPulse"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(treatment)); - icon = ""; - }; - class CheckBloodPressure: CheckPulse { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckBloodPressure"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(treatment)); - }; - class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(treatment)); - }; - }; - class ACE_ArmRight { - runOnHover = 1; - statement = QUOTE([ARR_3(_target, true, 3)] call DFUNC(displayPatientInformation)); - icon = PATHTOF(UI\icons\medical_cross.paa); - distance = MEDICAL_ACTION_DISTANCE; - - class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitRightArm"; - distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(treatment)); - showDisabled = 1; - priority = 2; - hotkey = "B"; - icon = PATHTOF(UI\icons\bandage.paa); - }; - - // Advanced medical - class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; - distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call DFUNC(treatment)); - showDisabled = 0; - priority = 2; - hotkey = ""; - icon = PATHTOF(UI\icons\bandage.paa); - }; - class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\packingBandage.paa); - }; - class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(treatment)); - }; - class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(treatment)); - }; - class Tourniquet: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\tourniquet.paa); - }; - class Morphine: fieldDressing { - displayName = "$STR_ACE_Medical_Inject_Morphine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\autoInjector.paa); - }; - class Atropine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Atropine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Atropine')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Atropine')] call DFUNC(treatment)); - }; - class Epinephrine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Epinephrine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Epinephrine')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Epinephrine')] call DFUNC(treatment)); - }; - class BloodIV: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_1000"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\iv.paa); - }; - class BloodIV_500: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_500"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_500')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_500')] call DFUNC(treatment)); - }; - class BloodIV_250: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_250"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_250')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_250')] call DFUNC(treatment)); - }; - class PlasmaIV: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_1000"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(treatment)); - }; - class PlasmaIV_500: PlasmaIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_500"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_500')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_500')] call DFUNC(treatment)); - }; - class PlasmaIV_250: PlasmaIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_250"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_250')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_250')] call DFUNC(treatment)); - }; - class SalineIV: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_1000"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV')] call DFUNC(treatment)); - }; - class SalineIV_500: SalineIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_500"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_500')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_500')] call DFUNC(treatment)); - }; - class SalineIV_250: SalineIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_250"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_250')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_250')] call DFUNC(treatment)); - }; - class CheckPulse: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckPulse"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(treatment)); - icon = ""; - }; - class CheckBloodPressure: CheckPulse { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckBloodPressure"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(treatment)); - }; - class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(treatment)); - }; - - }; - class ACE_LegLeft { - runOnHover = 1; - statement = QUOTE([ARR_3(_target, true, 4)] call DFUNC(displayPatientInformation)); - icon = PATHTOF(UI\icons\medical_cross.paa); - distance = MEDICAL_ACTION_DISTANCE; - - class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitLeftLeg"; - distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(treatment)); - showDisabled = 1; - priority = 2; - hotkey = "B"; - icon = PATHTOF(UI\icons\bandage.paa); - }; - - - // Advanced medical - class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; - distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call DFUNC(treatment)); - showDisabled = 0; - priority = 2; - hotkey = ""; - icon = PATHTOF(UI\icons\bandage.paa); - }; - class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\packingBandage.paa); - }; - class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(treatment)); - }; - class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(treatment)); - }; - class Tourniquet: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\tourniquet.paa); - }; - class Morphine: fieldDressing { - displayName = "$STR_ACE_Medical_Inject_Morphine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\autoInjector.paa); - }; - class Atropine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Atropine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\autoInjector.paa); - }; - class Epinephrine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Epinephrine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call DFUNC(treatment)); - }; - class BloodIV: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_1000"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\iv.paa); - }; - class BloodIV_500: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_500"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_500')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_500')] call DFUNC(treatment)); - }; - class BloodIV_250: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_250"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_250')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_250')] call DFUNC(treatment)); - }; - class PlasmaIV: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_1000"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(treatment)); - }; - class PlasmaIV_500: PlasmaIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_500"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_500')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_500')] call DFUNC(treatment)); - }; - class PlasmaIV_250: PlasmaIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_250"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_250')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_250')] call DFUNC(treatment)); - }; - class SalineIV: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_1000"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV')] call DFUNC(treatment)); - }; - class SalineIV_500: SalineIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_500"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_500')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_500')] call DFUNC(treatment)); - }; - class SalineIV_250: SalineIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_250"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_250')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_250')] call DFUNC(treatment)); - }; - class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(treatment)); - }; - }; - class ACE_LegRight { - runOnHover = 1; - statement = QUOTE([ARR_3(_target, true, 5)] call DFUNC(displayPatientInformation)); - icon = PATHTOF(UI\icons\medical_cross.paa); - distance = MEDICAL_ACTION_DISTANCE; - - class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitRightLeg"; - distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(treatment)); - showDisabled = 1; - priority = 2; - hotkey = "B"; - icon = PATHTOF(UI\icons\bandage.paa); - }; - - - // Advanced medical - class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; - distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call DFUNC(treatment)); - showDisabled = 0; - priority = 2; - hotkey = ""; - icon = PATHTOF(UI\icons\bandage.paa); - }; - class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\packingBandage.paa); - }; - class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(treatment)); - }; - class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(treatment)); - }; - class Tourniquet: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\tourniquet.paa); - }; - class Morphine: fieldDressing { - displayName = "$STR_ACE_Medical_Inject_Morphine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\autoInjector.paa); - }; - class Atropine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Atropine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Atropine')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Atropine')] call DFUNC(treatment)); - }; - class Epinephrine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Epinephrine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Epinephrine')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Epinephrine')] call DFUNC(treatment)); - }; - class BloodIV: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_1000"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(treatment)); - icon = PATHTOF(UI\icons\iv.paa); - }; - class BloodIV_500: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_500"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_500')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_500')] call DFUNC(treatment)); - }; - class BloodIV_250: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_250"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_250')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_250')] call DFUNC(treatment)); - }; - class PlasmaIV: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_1000"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(treatment)); - }; - class PlasmaIV_500: PlasmaIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_500"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_500')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_500')] call DFUNC(treatment)); - }; - class PlasmaIV_250: PlasmaIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_250"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_250')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_250')] call DFUNC(treatment)); - }; - class SalineIV: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_1000"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV')] call DFUNC(treatment)); - }; - class SalineIV_500: SalineIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_500"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_500')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_500')] call DFUNC(treatment)); - }; - class SalineIV_250: SalineIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_250"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_250')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_250')] call DFUNC(treatment)); - }; - class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(treatment)); + #define EXCEPTIONS exceptions[] = {"isNotInside"}; + #include "ACE_Medical_Actions.hpp" }; }; }; diff --git a/addons/medical/functions/fnc_treatment_failure.sqf b/addons/medical/functions/fnc_treatment_failure.sqf index 35e57de9ed..1a22e191fd 100644 --- a/addons/medical/functions/fnc_treatment_failure.sqf +++ b/addons/medical/functions/fnc_treatment_failure.sqf @@ -29,7 +29,9 @@ _usersOfItems = _args select 5; if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; }; -[_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation); +if (vehicle _caller == _caller) then { + [_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation); +}; _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; { diff --git a/addons/medical/functions/fnc_treatment_success.sqf b/addons/medical/functions/fnc_treatment_success.sqf index d04bee5253..85cfbf7e52 100644 --- a/addons/medical/functions/fnc_treatment_success.sqf +++ b/addons/medical/functions/fnc_treatment_success.sqf @@ -27,7 +27,9 @@ _className = _args select 3; if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; }; -[_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation); +if (vehicle _caller == _caller) then { + [_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation); +}; _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; // Record specific callback diff --git a/addons/reload/CfgMagazines.hpp b/addons/reload/CfgMagazines.hpp index 6811a49494..6df877f772 100644 --- a/addons/reload/CfgMagazines.hpp +++ b/addons/reload/CfgMagazines.hpp @@ -1,12 +1,11 @@ class CfgMagazines { + class CA_Magazine; + class 150Rnd_762x51_Box : CA_Magazine { + ACE_isBelt = 1; + }; - class CA_Magazine; - class 150Rnd_762x51_Box : CA_Magazine { - ACE_isBelt = 1; - }; - - class 100Rnd_65x39_caseless_mag; - class 200Rnd_65x39_cased_Box : 100Rnd_65x39_caseless_mag { - ACE_isBelt = 1; - }; -}; \ No newline at end of file + class 100Rnd_65x39_caseless_mag; + class 200Rnd_65x39_cased_Box : 100Rnd_65x39_caseless_mag { + ACE_isBelt = 1; + }; +}; diff --git a/tools/cba/addons/main/script_macros_common.hpp b/tools/cba/addons/main/script_macros_common.hpp new file mode 100644 index 0000000000..1385d7b389 --- /dev/null +++ b/tools/cba/addons/main/script_macros_common.hpp @@ -0,0 +1,1266 @@ +/* + Header: script_macros_common.hpp + + Description: + A general set of useful macro functions for use by CBA itself or by any module that uses CBA. + + Authors: + Sickboy and Spooner +*/ + +/* **************************************************** + New - Should be exported to general addon + Aim: + - Simplify (shorten) the amount of characters required for repetitive tasks + - Provide a solid structure that can be dynamic and easy editable (Which sometimes means we cannot adhere to Aim #1 ;-) + An example is the path that is built from defines. Some available in this file, others in mods and addons. + + Follows Standard: + Object variables: PREFIX_COMPONENT + Main-object variables: PREFIX_main + Paths: MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT\SCRIPTNAME.sqf + e.g: x\six\addons\sys_menu\fDate.sqf + + Usage: + define PREFIX and COMPONENT, then include this file + (Note, you could have a main addon for your mod, define the PREFIX in a macros.hpp, + and include this script_macros_common.hpp file. + Then in your addons, add a component.hpp, define the COMPONENT, + and include your mod's script_macros.hpp + In your scripts you can then include the addon's component.hpp with relative path) + + TODO: + - Try only to use 1 string type " vs ' + - Evaluate double functions, and simplification + - Evaluate naming scheme; current = prototype + - Evaluate "Debug" features.. + - Evaluate "create mini function per precompiled script, that will load the script on first usage, rather than on init" + - Also saw "Namespace" typeName, evaluate which we need :P + - Single/Multi player gamelogics? (Incase of MP, you would want only 1 gamelogic per component, which is pv'ed from server, etc) + */ + +#ifndef MAINPREFIX + #define MAINPREFIX x +#endif + +#ifndef SUBPREFIX + #define SUBPREFIX addons +#endif + +#ifndef MAINLOGIC + #define MAINLOGIC main +#endif + +#ifndef VERSION + #define VERSION 0 +#endif + +#ifndef VERSION_AR + #define VERSION_AR VERSION +#endif + +#ifndef VERSION_CONFIG + #define VERSION_CONFIG version = VERSION; versionStr = QUOTE(VERSION); versionAr[] = {VERSION_AR} +#endif + +#define ADDON DOUBLES(PREFIX,COMPONENT) +#define MAIN_ADDON DOUBLES(PREFIX,main) + +/* ------------------------------------------- +Group: Debugging +------------------------------------------- */ + +/* ------------------------------------------- +Macros: DEBUG_MODE_x + Managing debugging based on debug level. + + According to the *highest* level of debugging that has been defined *before* script_macros_common.hpp is included, + only the appropriate debugging commands will be functional. With no level explicitely defined, assume DEBUG_MODE_NORMAL. + + DEBUG_MODE_FULL - Full debugging output. + DEBUG_MODE_NORMAL - All debugging except and (Default setting if none specified). + DEBUG_MODE_MINIMAL - Only and enabled. + +Examples: + In order to turn on full debugging for a single file, + (begin example) + // Top of individual script file. + #define DEBUG_MODE_FULL + #include "script_component.hpp" + (end) + + In order to force minimal debugging for a single component, + (begin example) + // Top of addons\\script_component.hpp + // Ensure that any FULL and NORMAL setting from the individual files are undefined and MINIMAL is set. + #ifdef DEBUG_MODE_FULL + #undef DEBUG_MODE_FULL + #endif + #ifdef DEBUG_MODE_NORMAL + #undef DEBUG_MODE_NORMAL + #endif + #ifndef DEBUG_MODE_MINIMAL + #define DEBUG_MODE_MINIMAL + #endif + #include "script_macros.hpp" + (end) + + In order to turn on full debugging for a whole addon, + (begin example) + // Top of addons\main\script_macros.hpp + #ifndef DEBUG_MODE_FULL + #define DEBUG_MODE_FULL + #endif + #include "\x\cba\addons\main\script_macros_common.hpp" + (end) + +Author: + Spooner +------------------------------------------- */ + +// If DEBUG_MODE_FULL, then also enable DEBUG_MODE_NORMAL. +#ifdef DEBUG_MODE_FULL +#define DEBUG_MODE_NORMAL +#endif + +// If DEBUG_MODE_NORMAL, then also enable DEBUG_MODE_MINIMAL. +#ifdef DEBUG_MODE_NORMAL +#define DEBUG_MODE_MINIMAL +#endif + +// If no debug modes specified, use DEBUG_MODE_NORMAL (+ DEBUG_MODE_MINIMAL). +#ifndef DEBUG_MODE_MINIMAL +#define DEBUG_MODE_NORMAL +#define DEBUG_MODE_MINIMAL +#endif + +#ifdef THIS_FILE +#define THIS_FILE_ 'THIS_FILE' +#else +#define THIS_FILE_ __FILE__ +#endif + +/* ------------------------------------------- +Macro: LOG() + Log a timestamped message into the RPT log. + + Only run if or higher is defined. + +Parameters: + MESSAGE - Message to record [String] + +Example: + (begin example) + LOG("Initiated clog-dancing simulator."); + (end) + +Author: + Spooner +------------------------------------------- */ +#ifdef DEBUG_MODE_FULL +#define LOG(MESSAGE) [THIS_FILE_, __LINE__, MESSAGE] call CBA_fnc_log +#else +#define LOG(MESSAGE) /* disabled */ +#endif + +/* ------------------------------------------- +Macro: WARNING() + Record a timestamped, non-critical error in the RPT log. + + Only run if or higher is defined. + +Parameters: + MESSAGE - Message to record [String] + +Example: + (begin example) + WARNING("This function has been deprecated. Please don't use it in future!"); + (end) + +Author: + Spooner +------------------------------------------- */ +#ifdef DEBUG_MODE_NORMAL +#define WARNING(MESSAGE) [THIS_FILE_, __LINE__, ('WARNING: ' + MESSAGE)] call CBA_fnc_log +#else +#define WARNING(MESSAGE) /* disabled */ +#endif + +/* ------------------------------------------- +Macro: ERROR() + Record a timestamped, critical error in the RPT log. + + The heading is "ERROR" (use for a specific title). + + TODO: Popup an error dialog & throw an exception. + +Parameters: + MESSAGE - Message to record [String] + +Example: + (begin example) + ERROR("Value not found","value of frog not found in config ...yada...yada..."); + (end) + +Author: + Spooner +------------------------------------------- */ +#define ERROR(MESSAGE) \ + [THIS_FILE_, __LINE__, "ERROR", MESSAGE] call CBA_fnc_error; + +/* ------------------------------------------- +Macro: ERROR_WITH_TITLE() + Record a timestamped, critical error in the RPT log. + + The title can be specified (in the heading is always just "ERROR") + Newlines (\n) in the MESSAGE will be put on separate lines. + + TODO: Popup an error dialog & throw an exception. + +Parameters: + TITLE - Title of error message [String] + MESSAGE - Body of error message [String] + +Example: + (begin example) + ERROR_WITH_TITLE("Value not found","Value of frog not found in config ...yada...yada..."); + (end) + +Author: + Spooner +------------------------------------------- */ +#define ERROR_WITH_TITLE(TITLE,MESSAGE) \ + [THIS_FILE_, __LINE__, TITLE, MESSAGE] call CBA_fnc_error; + +/* ------------------------------------------- +Macro: RETNIL() + If a variable is undefined, return the value nil. Otherwise, return the + variable itself. + +Parameters: + VARIABLE - the variable to check + +Example: + (begin example) + // _var is undefined + hintSilent format ["_var=%1", RETNIL(_var) ]; // "_var=any" + (end example) + +Author: + Alef (see CBA issue #8514) +------------------------------------------- */ +#define RETNIL(VARIABLE) if (isNil{VARIABLE}) then {nil} else {VARIABLE} + +/* ------------------------------------------- +Macros: TRACE_n() + Log a message and 1-8 variables to the RPT log. + + Only run if is defined. + + TRACE_1(MESSAGE,A) - Log 1 variable. + TRACE_2(MESSAGE,A,B) - Log 2 variables. + TRACE_3(MESSAGE,A,B,C) - Log 3 variables. + TRACE_4(MESSAGE,A,B,C,D) - Log 4 variables. + TRACE_5(MESSAGE,A,B,C,D,E) - Log 5 variables. + TRACE_6(MESSAGE,A,B,C,D,E,F) - Log 6 variables. + TRACE_7(MESSAGE,A,B,C,D,E,F,G) - Log 7 variables. + TRACE_8(MESSAGE,A,B,C,D,E,F,G,H) - Log 8 variables. + TRACE_9(MESSAGE,A,B,C,D,E,F,G,H,I) - Log 9 variables. + +Parameters: + MESSAGE - Message to add to the trace [String] + A..H - Variable names to log values of [Any] + +Example: + (begin example) + TRACE_3("After takeoff",_vehicle player,getPos (_vehicle player), getPosASL (_vehicle player)); + (end) + +Author: + Spooner +------------------------------------------- */ +#define PFORMAT_1(MESSAGE,A) \ + format ['%1: A=%2', MESSAGE, RETNIL(A)] + +#define PFORMAT_2(MESSAGE,A,B) \ + format ['%1: A=%2, B=%3', MESSAGE, RETNIL(A), RETNIL(B)] + +#define PFORMAT_3(MESSAGE,A,B,C) \ + format ['%1: A=%2, B=%3, C=%4', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C)] + +#define PFORMAT_4(MESSAGE,A,B,C,D) \ + format ['%1: A=%2, B=%3, C=%4, D=%5', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D)] + +#define PFORMAT_5(MESSAGE,A,B,C,D,E) \ + format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E)] + +#define PFORMAT_6(MESSAGE,A,B,C,D,E,F) \ + format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F)] + +#define PFORMAT_7(MESSAGE,A,B,C,D,E,F,G) \ + format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7, G=%8', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F), RETNIL(G)] + +#define PFORMAT_8(MESSAGE,A,B,C,D,E,F,G,H) \ + format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7, G=%8, H=%9', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F), RETNIL(G), RETNIL(H)] + +#define PFORMAT_9(MESSAGE,A,B,C,D,E,F,G,H,I) \ + format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7, G=%8, H=%9, I=%10', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F), RETNIL(G), RETNIL(H), RETNIL(I)] + + +#ifdef DEBUG_MODE_FULL +#define TRACE_1(MESSAGE,A) \ + [THIS_FILE_, __LINE__, PFORMAT_1(MESSAGE,A)] call CBA_fnc_log + +#define TRACE_2(MESSAGE,A,B) \ + [THIS_FILE_, __LINE__, PFORMAT_2(MESSAGE,A,B)] call CBA_fnc_log + +#define TRACE_3(MESSAGE,A,B,C) \ + [THIS_FILE_, __LINE__, PFORMAT_3(MESSAGE,A,B,C)] call CBA_fnc_log + +#define TRACE_4(MESSAGE,A,B,C,D) \ + [THIS_FILE_, __LINE__, PFORMAT_4(MESSAGE,A,B,C,D)] call CBA_fnc_log + +#define TRACE_5(MESSAGE,A,B,C,D,E) \ + [THIS_FILE_, __LINE__, PFORMAT_5(MESSAGE,A,B,C,D,E)] call CBA_fnc_log + +#define TRACE_6(MESSAGE,A,B,C,D,E,F) \ + [THIS_FILE_, __LINE__, PFORMAT_6(MESSAGE,A,B,C,D,E,F)] call CBA_fnc_log + +#define TRACE_7(MESSAGE,A,B,C,D,E,F,G) \ + [THIS_FILE_, __LINE__, PFORMAT_7(MESSAGE,A,B,C,D,E,F,G)] call CBA_fnc_log + +#define TRACE_8(MESSAGE,A,B,C,D,E,F,G,H) \ + [THIS_FILE_, __LINE__, PFORMAT_8(MESSAGE,A,B,C,D,E,F,G,H)] call CBA_fnc_log + +#define TRACE_9(MESSAGE,A,B,C,D,E,F,G,H,I) \ + [THIS_FILE_, __LINE__, PFORMAT_9(MESSAGE,A,B,C,D,E,F,G,H,I)] call CBA_fnc_log + +#else + +#define TRACE_1(MESSAGE,A) /* disabled */ +#define TRACE_2(MESSAGE,A,B) /* disabled */ +#define TRACE_3(MESSAGE,A,B,C) /* disabled */ +#define TRACE_4(MESSAGE,A,B,C,D) /* disabled */ +#define TRACE_5(MESSAGE,A,B,C,D,E) /* disabled */ +#define TRACE_6(MESSAGE,A,B,C,D,E,F) /* disabled */ +#define TRACE_7(MESSAGE,A,B,C,D,E,F,G) /* disabled */ +#define TRACE_8(MESSAGE,A,B,C,D,E,F,G,H) /* disabled */ +#define TRACE_9(MESSAGE,A,B,C,D,E,F,G,H,I) /* disabled */ + +#endif + +/* ------------------------------------------- +Group: General +------------------------------------------- */ + +// ************************************* +// Internal Functions +#define DOUBLES(var1,var2) ##var1##_##var2 +#define TRIPLES(var1,var2,var3) ##var1##_##var2##_##var3 +#define QUOTE(var1) #var1 + +#ifdef MODULAR + #define COMPONENT_T DOUBLES(t,COMPONENT) + #define COMPONENT_M DOUBLES(m,COMPONENT) + #define COMPONENT_S DOUBLES(s,COMPONENT) + #define COMPONENT_C DOUBLES(c,COMPONENT) + #define COMPONENT_F COMPONENT_C +#else + #define COMPONENT_T COMPONENT + #define COMPONENT_M COMPONENT + #define COMPONENT_S COMPONENT + #define COMPONENT_F COMPONENT + #define COMPONENT_C COMPONENT +#endif + +/* ------------------------------------------- +Macro: INC() + +Description: + Increase a number by one. + +Parameters: + VAR - Variable to increment [Number] + +Example: + (begin example) + _counter = 0; + INC(_counter); + // _counter => 1 + (end) + +Author: + Spooner +------------------------------------------- */ +#define INC(var) var = (var) + 1 + +/* ------------------------------------------- +Macro: DEC() + +Description: + Decrease a number by one. + +Parameters: + VAR - Variable to decrement [Number] + +Example: + (begin example) + _counter = 99; + DEC(_counter); + // _counter => 98 + (end) + +Author: + Spooner +------------------------------------------- */ +#define DEC(var) var = (var) - 1 + +/* ------------------------------------------- +Macro: ADD() + +Description: + Add a value to a variable. Variable and value should be both Numbers or both Strings. + +Parameters: + VAR - Variable to add to [Number or String] + VALUE - Value to add [Number or String] + +Examples: + (begin example) + _counter = 2; + ADD(_counter,3); + // _counter => 5 + (end) + (begin example) + _str = "hello"; + ADD(_str," "); + ADD(_str,"Fred"); + // _str => "hello Fred" + (end) + +Author: + Sickboy +------------------------------------------- */ +#define ADD(var1,var2) var1 = (var1) + (var2) + +/* ------------------------------------------- +Macro: SUB() + +Description: + Subtract a value from a number variable. VAR and VALUE should both be Numbers. + +Parameters: + VAR - Variable to subtract from [Number] + VALUE - Value to subtract [Number] + +Examples: + (begin example) + _numChickens = 2; + SUB(_numChickens,3); + // _numChickens => -1 + (end) +------------------------------------------- */ +#define SUB(var1,var2) var1 = (var1) - (var2) + +/* ------------------------------------------- +Macro: REM() + +Description: + Remove an element from an array each time it occurs. + + This recreates the entire array, so use BIS_fnc_removeIndex if modification of the original array is required + or if only one of the elements that matches ELEMENT needs to be removed. + +Parameters: + ARRAY - Array to modify [Array] + ELEMENT - Element to remove [Any] + +Examples: + (begin example) + _array = [1, 2, 3, 4, 3, 8]; + REM(_array,3); + // _array = [1, 2, 4, 8]; + (end) + +Author: + Spooner +------------------------------------------- */ +#define REM(var1,var2) SUB(var1,[var2]) + +/* ------------------------------------------- +Macro: PUSH() + +Description: + Appends a single value onto the end of an ARRAY. Change is made to the ARRAY itself, not creating a new array. + +Parameters: + ARRAY - Array to push element onto [Array] + ELEMENT - Element to push [Any] + +Examples: + (begin example) + _fish = ["blue", "green", "smelly"]; + PUSH(_fish,"monkey-flavoured"); + // _fish => ["blue", "green", "smelly", "monkey-flavoured"] + (end) + +Author: + Spooner +------------------------------------------- */ +#define PUSH(var1,var2) (var1) pushBack (var2) + +/* ------------------------------------------- +Macro: ISNILS() + +Description: + Sets a variable with a value, but only if it is undefined. + +Parameters: + VARIABLE - Variable to set [Any, not nil] + DEFAULT_VALUE - Value to set VARIABLE to if it is undefined [Any, not nil] + +Examples: + (begin example) + // _fish is undefined + ISNILS(_fish,0); + // _fish => 0 + (end) + (begin example) + _fish = 12; + // ...later... + ISNILS(_fish,0); + // _fish => 12 + (end) + +Author: + Sickboy +------------------------------------------- */ +#define ISNILS(VARIABLE,DEFAULT_VALUE) if (isNil #VARIABLE) then { ##VARIABLE = ##DEFAULT_VALUE } +#define ISNILS2(var1,var2,var3,var4) ISNILS(TRIPLES(var1,var2,var3),var4) +#define ISNILS3(var1,var2,var3) ISNILS(DOUBLES(var1,var2),var3) +#define ISNIL(var1,var2) ISNILS2(PREFIX,COMPONENT,var1,var2) +#define ISNILMAIN(var1,var2) ISNILS3(PREFIX,var1,var2) + +#define CREATELOGICS(var1,var2) ##var1##_##var2## = ([sideLogic] call CBA_fnc_getSharedGroup) createUnit ["LOGIC", [0, 0, 0], [], 0, "NONE"] +#define CREATELOGICLOCALS(var1,var2) ##var1##_##var2## = "LOGIC" createVehicleLocal [0, 0, 0] +#define CREATELOGICGLOBALS(var1,var2) ##var1##_##var2## = ([sideLogic] call CBA_fnc_getSharedGroup) createUnit ["LOGIC", [0, 0, 0], [], 0, "NONE"]; publicVariable QUOTE(DOUBLES(var1,var2)) +#define CREATELOGICGLOBALTESTS(var1,var2) ##var1##_##var2## = ([sideLogic] call CBA_fnc_getSharedGroup) createUnit [QUOTE(DOUBLES(ADDON,logic)), [0, 0, 0], [], 0, "NONE"] + +#define GETVARS(var1,var2,var3) (##var1##_##var2 getVariable #var3) +#define GETVARMAINS(var1,var2) GETVARS(var1,MAINLOGIC,var2) + +#ifndef PATHTO_SYS + #define PATHTO_SYS(var1,var2,var3) \MAINPREFIX\##var1\SUBPREFIX\##var2\##var3.sqf +#endif +#ifndef PATHTOF_SYS + #define PATHTOF_SYS(var1,var2,var3) \MAINPREFIX\##var1\SUBPREFIX\##var2\##var3 +#endif + +#ifndef PATHTOF2_SYS + #define PATHTOF2_SYS(var1,var2,var3) MAINPREFIX\##var1\SUBPREFIX\##var2\##var3 +#endif + +#define PATHTO_R(var1) PATHTOF2_SYS(PREFIX,COMPONENT_C,var1) +#define PATHTO_T(var1) PATHTOF_SYS(PREFIX,COMPONENT_T,var1) +#define PATHTO_M(var1) PATHTOF_SYS(PREFIX,COMPONENT_M,var1) +#define PATHTO_S(var1) PATHTOF_SYS(PREFIX,COMPONENT_S,var1) +#define PATHTO_C(var1) PATHTOF_SYS(PREFIX,COMPONENT_C,var1) +#define PATHTO_F(var1) PATHTO_SYS(PREFIX,COMPONENT_F,var1) + +// Already quoted "" +#define QPATHTO_R(var1) QUOTE(PATHTO_R(var1)) +#define QPATHTO_T(var1) QUOTE(PATHTO_T(var1)) +#define QPATHTO_M(var1) QUOTE(PATHTO_M(var1)) +#define QPATHTO_S(var1) QUOTE(PATHTO_S(var1)) +#define QPATHTO_C(var1) QUOTE(PATHTO_C(var1)) +#define QPATHTO_F(var1) QUOTE(PATHTO_F(var1)) + +// This only works for binarized configs after recompiling the pbos +// TODO: Reduce amount of calls / code.. +#define COMPILE_FILE2_CFG_SYS(var1) compile preProcessFileLineNumbers var1 +#define COMPILE_FILE2_SYS(var1) COMPILE_FILE2_CFG_SYS(var1) + +#define COMPILE_FILE_SYS(var1,var2,var3) COMPILE_FILE2_SYS('PATHTO_SYS(var1,var2,var3)') +#define COMPILE_FILE_CFG_SYS(var1,var2,var3) COMPILE_FILE2_CFG_SYS('PATHTO_SYS(var1,var2,var3)') + +#define SETVARS(var1,var2) ##var1##_##var2 setVariable +#define SETVARMAINS(var1) SETVARS(var1,MAINLOGIC) +#define GVARMAINS(var1,var2) ##var1##_##var2## +#define CFGSETTINGSS(var1,var2) configFile >> "CfgSettings" >> #var1 >> #var2 +//#define SETGVARS(var1,var2,var3) ##var1##_##var2##_##var3 = +//#define SETGVARMAINS(var1,var2) ##var1##_##var2 = + +// Compile-Once, JIT: On first use. +// #define PREPMAIN_SYS(var1,var2,var3) ##var1##_fnc_##var3 = { ##var1##_fnc_##var3 = COMPILE_FILE_SYS(var1,var2,DOUBLES(fnc,var3)); if (isNil "_this") then { call ##var1##_fnc_##var3 } else { _this call ##var1##_fnc_##var3 } } +// #define PREP_SYS(var1,var2,var3) ##var1##_##var2##_fnc_##var3 = { ##var1##_##var2##_fnc_##var3 = COMPILE_FILE_SYS(var1,var2,DOUBLES(fnc,var3)); if (isNil "_this") then { call ##var1##_##var2##_fnc_##var3 } else { _this call ##var1##_##var2##_fnc_##var3 } } +// #define PREP_SYS2(var1,var2,var3,var4) ##var1##_##var2##_fnc_##var4 = { ##var1##_##var2##_fnc_##var4 = COMPILE_FILE_SYS(var1,var3,DOUBLES(fnc,var4)); if (isNil "_this") then { call ##var1##_##var2##_fnc_##var4 } else { _this call ##var1##_##var2##_fnc_##var4 } } + +// Compile-Once, at Macro. As opposed to Compile-Once, on first use. +#define PREPMAIN_SYS(var1,var2,var3) ##var1##_fnc_##var3 = COMPILE_FILE_SYS(var1,var2,DOUBLES(fnc,var3)) +#define PREP_SYS(var1,var2,var3) ##var1##_##var2##_fnc_##var3 = COMPILE_FILE_SYS(var1,var2,DOUBLES(fnc,var3)) +#define PREP_SYS2(var1,var2,var3,var4) ##var1##_##var2##_fnc_##var4 = COMPILE_FILE_SYS(var1,var3,DOUBLES(fnc,var4)) + +#define LSTR(var1) TRIPLES(ADDON,STR,var1) + +#define CACHE_DIS_SYS(var1,var2) (isNumber(var1 >> "CfgSettings" >> "CBA" >> "caching" >> QUOTE(var2)) && getNumber(var1 >> "CfgSettings" >> "CBA" >> "caching" >> QUOTE(var2)) != 1) +#define CACHE_DIS(var1) (!isNil "CBA_RECOMPILE" || CACHE_DIS_SYS(configFile,var1) || CACHE_DIS_SYS(missionConfigFile,var1)) + +#ifndef DEBUG_SETTINGS + #define DEBUG_SETTINGS [false, true, false] +#endif + +#define MSG_INIT QUOTE(Initializing: ADDON version: VERSION) + +// ************************************* +// User Functions +#define CFGSETTINGS CFGSETTINGSS(PREFIX,COMPONENT) +#define PATHTO(var1) PATHTO_SYS(PREFIX,COMPONENT_F,var1) +#define PATHTOF(var1) PATHTOF_SYS(PREFIX,COMPONENT,var1) + +#define COMPILE_FILE(var1) COMPILE_FILE_SYS(PREFIX,COMPONENT_F,var1) +#define COMPILE_FILE_CFG(var1) COMPILE_FILE_CFG_SYS(PREFIX,COMPONENT_F,var1) +#define COMPILE_FILE2(var1) COMPILE_FILE2_SYS('var1') +#define COMPILE_FILE2_CFG(var1) COMPILE_FILE2_CFG_SYS('var1') + + +#define VERSIONING_SYS(var1) class CfgSettings \ +{ \ + class CBA \ + { \ + class Versioning \ + { \ + class var1 \ + { \ + }; \ + }; \ + }; \ +}; + +#define VERSIONING VERSIONING_SYS(PREFIX) + +/* ------------------------------------------- +Macro: GVAR() + Get full variable identifier for a global variable owned by this component. + +Parameters: + VARIABLE - Partial name of global variable owned by this component [Any]. + +Example: + (begin example) + GVAR(frog) = 12; + // In SPON_FrogDancing component, equivalent to SPON_FrogDancing_frog = 12 + (end) + +Author: + Sickboy +------------------------------------------- */ +#define GVAR(var1) DOUBLES(ADDON,var1) +#define EGVAR(var1,var2) DOUBLES(DOUBLES(PREFIX,var1),var2) +#define QGVAR(var1) QUOTE(GVAR(var1)) + +/* ------------------------------------------- +Macro: GVARMAIN() + Get full variable identifier for a global variable owned by this addon. + +Parameters: + VARIABLE - Partial name of global variable owned by this addon [Any]. + +Example: + (begin example) + GVARMAIN(frog) = 12; + // In SPON_FrogDancing component, equivalent to SPON_frog = 12 + (end) + +Author: + Sickboy +------------------------------------------- */ +#define GVARMAIN(var1) GVARMAINS(PREFIX,var1) +// TODO: What's this? +#define SETTINGS DOUBLES(PREFIX,settings) +#define CREATELOGIC CREATELOGICS(PREFIX,COMPONENT) +#define CREATELOGICGLOBAL CREATELOGICGLOBALS(PREFIX,COMPONENT) +#define CREATELOGICGLOBALTEST CREATELOGICGLOBALTESTS(PREFIX,COMPONENT) +#define CREATELOGICLOCAL CREATELOGICLOCALS(PREFIX,COMPONENT) +#define CREATELOGICMAIN CREATELOGICS(PREFIX,MAINLOGIC) +#define GETVAR(var1) GETVARS(PREFIX,COMPONENT,var1) +#define SETVAR SETVARS(PREFIX,COMPONENT) +#define SETVARMAIN SETVARMAINS(PREFIX) +#define IFCOUNT(var1,var2,var3) if (count ##var1 > ##var2) then { ##var3 = ##var1 select ##var2 }; + +//#define PREP(var1) PREP_SYS(PREFIX,COMPONENT_F,var1) + +#ifdef DISABLE_COMPILE_CACHE + #define PREP(var1) TRIPLES(ADDON,fnc,var1) = compile preProcessFileLineNumbers 'PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))' + #define PREPMAIN(var1) TRIPLES(PREFIX,fnc,var1) = compile preProcessFileLineNumbers 'PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))' +#else + #define PREP(var1) ['PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))', 'TRIPLES(ADDON,fnc,var1)'] call SLX_XEH_COMPILE_NEW + #define PREPMAIN(var1) ['PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))', 'TRIPLES(PREFIX,fnc,var1)'] call SLX_XEH_COMPILE_NEW +#endif + +#define FUNC(var1) TRIPLES(ADDON,fnc,var1) +#define FUNCMAIN(var1) TRIPLES(PREFIX,fnc,var1) +#define FUNC_INNER(var1,var2) TRIPLES(DOUBLES(PREFIX,var1),fnc,var2) +#define EFUNC(var1,var2) FUNC_INNER(var1,var2) + +#ifndef PRELOAD_ADDONS + #define PRELOAD_ADDONS class CfgAddons \ +{ \ + class PreloadAddons \ + { \ + class ADDON \ + { \ + list[]={ QUOTE(ADDON) }; \ + }; \ + }; \ +} +#endif + +/* ------------------------------------------- +Macros: ARG_#() + Select from list of array arguments + +Parameters: + VARIABLE(1-8) - elements for the list + +Author: + Rommel +------------------------------------------- */ +#define ARG_1(A,B) ((A) select (B)) +#define ARG_2(A,B,C) (ARG_1(ARG_1(A,B),C)) +#define ARG_3(A,B,C,D) (ARG_1(ARG_2(A,B,C),D)) +#define ARG_4(A,B,C,D,E) (ARG_1(ARG_3(A,B,C,D),E)) +#define ARG_5(A,B,C,D,E,F) (ARG_1(ARG_4(A,B,C,D,E),F)) +#define ARG_6(A,B,C,D,E,F,G) (ARG_1(ARG_5(A,B,C,D,E,F),G)) +#define ARG_7(A,B,C,D,E,F,G,H) (ARG_1(ARG_6(A,B,C,D,E,E,F,G),H)) +#define ARG_8(A,B,C,D,E,F,G,H,I) (ARG_1(ARG_7(A,B,C,D,E,E,F,G,H),I)) + +/* ------------------------------------------- +Macros: ARR_#() + Create list from arguments. Useful for working around , in macro parameters. + 1-8 arguments possible. + +Parameters: + VARIABLE(1-8) - elements for the list + +Author: + Nou +------------------------------------------- */ +#define ARR_1(ARG1) ARG1 +#define ARR_2(ARG1,ARG2) ARG1, ARG2 +#define ARR_3(ARG1,ARG2,ARG3) ARG1, ARG2, ARG3 +#define ARR_4(ARG1,ARG2,ARG3,ARG4) ARG1, ARG2, ARG3, ARG4 +#define ARR_5(ARG1,ARG2,ARG3,ARG4,ARG5) ARG1, ARG2, ARG3, ARG4, ARG5 +#define ARR_6(ARG1,ARG2,ARG3,ARG4,ARG5,ARG6) ARG1, ARG2, ARG3, ARG4, ARG5, ARG6 +#define ARR_7(ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7) ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7 +#define ARR_8(ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8) ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8 + +/* ------------------------------------------- +Macros: FORMAT_#(STR, ARG1) + Format - Useful for working around , in macro parameters. + 1-8 arguments possible. + +Parameters: + STRING - string used by format + VARIABLE(1-8) - elements for usage in format + +Author: + Nou & Sickboy +------------------------------------------- */ +#define FORMAT_1(STR,ARG1) format[STR, ARG1] +#define FORMAT_2(STR,ARG1,ARG2) format[STR, ARG1, ARG2] +#define FORMAT_3(STR,ARG1,ARG2,ARG3) format[STR, ARG1, ARG2, ARG3] +#define FORMAT_4(STR,ARG1,ARG2,ARG3,ARG4) format[STR, ARG1, ARG2, ARG3, ARG4] +#define FORMAT_5(STR,ARG1,ARG2,ARG3,ARG4,ARG5) format[STR, ARG1, ARG2, ARG3, ARG4, ARG5] +#define FORMAT_6(STR,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6) format[STR, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6] +#define FORMAT_7(STR,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7) format[STR, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7] +#define FORMAT_8(STR,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8) format[STR, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8] + +// CONTROL(46) 12 +#define DISPLAY(A) (findDisplay A) +#define CONTROL(A) DISPLAY(A) displayCtrl + +/* ------------------------------------------- +Macros: IS_x() + Checking the data types of variables. + + IS_ARRAY() - Array + IS_BOOL() - Boolean + IS_BOOLEAN() - UI display handle(synonym for ) + IS_CODE() - Code block (i.e a compiled function) + IS_CONFIG() - Configuration + IS_CONTROL() - UI control handle. + IS_DISPLAY() - UI display handle. + IS_FUNCTION() - A compiled function (synonym for ) + IS_GROUP() - Group. + IS_INTEGER() - Is a number a whole number? + IS_LOCATION() - World location. + IS_NUMBER() - A floating point number (synonym for ) + IS_OBJECT() - World object. + IS_SCALAR() - Floating point number. + IS_SCRIPT() - A script handle (as returned by execVM and spawn commands). + IS_SIDE() - Game side. + IS_STRING() - World object. + IS_TEXT() - Structured text. + +Parameters: + VARIABLE - Variable to check if it is of a particular type [Any, not nil] + +Author: + Spooner +------------------------------------------- */ +#define IS_META_SYS(VAR,TYPE) (if (isNil {VAR}) then { false } else { (typeName (VAR)) == TYPE }) +#define IS_ARRAY(VAR) IS_META_SYS(VAR,"ARRAY") +#define IS_BOOL(VAR) IS_META_SYS(VAR,"BOOL") +#define IS_CODE(VAR) IS_META_SYS(VAR,"CODE") +#define IS_CONFIG(VAR) IS_META_SYS(VAR,"CONFIG") +#define IS_CONTROL(VAR) IS_META_SYS(VAR,"CONTROL") +#define IS_DISPLAY(VAR) IS_META_SYS(VAR,"DISPLAY") +#define IS_GROUP(VAR) IS_META_SYS(VAR,"GROUP") +#define IS_OBJECT(VAR) IS_META_SYS(VAR,"OBJECT") +#define IS_SCALAR(VAR) IS_META_SYS(VAR,"SCALAR") +#define IS_SCRIPT(VAR) IS_META_SYS(VAR,"SCRIPT") +#define IS_SIDE(VAR) IS_META_SYS(VAR,"SIDE") +#define IS_STRING(VAR) IS_META_SYS(VAR,"STRING") +#define IS_TEXT(VAR) IS_META_SYS(VAR,"TEXT") +#define IS_LOCATION(VAR) IS_META_SYS(VAR,"LOCATION") + +#define IS_BOOLEAN(VAR) IS_BOOL(VAR) +#define IS_FUNCTION(VAR) IS_CODE(VAR) +#define IS_INTEGER(VAR) if ( IS_SCALAR(VAR) ) then { (floor(VAR) == (VAR)) } else { false } +#define IS_NUMBER(VAR) IS_SCALAR(VAR) + +/* ------------------------------------------- +Macro: SCRIPT() + Sets name of script (relies on PREFIX and COMPONENT values being #defined). + +Parameters: + NAME - Name of script [Indentifier] + +Example: + (begin example) + SCRIPT(eradicateMuppets); + (end) + +Author: + Spooner +------------------------------------------- */ +#define SCRIPT(NAME) \ + scriptName 'PREFIX\COMPONENT\NAME' + +/* ------------------------------------------- +Macros: EXPLODE_n() + Splitting an ARRAY into a number of variables (A, B, C, etc). + + Note that this NOT does make the created variables private. + _PVT variants do. + + EXPLODE_1(ARRAY,A,B) - Split a 1-element array into separate variable. + EXPLODE_2(ARRAY,A,B) - Split a 2-element array into separate variables. + EXPLODE_3(ARRAY,A,B,C) - Split a 3-element array into separate variables. + EXPLODE_4(ARRAY,A,B,C,D) - Split a 4-element array into separate variables. + EXPLODE_5(ARRAY,A,B,C,D,E) - Split a 5-element array into separate variables. + EXPLODE_6(ARRAY,A,B,C,D,E,F) - Split a 6-element array into separate variables. + EXPLODE_7(ARRAY,A,B,C,D,E,F,G) - Split a 7-element array into separate variables. + EXPLODE_8(ARRAY,A,B,C,D,E,F,G,H) - Split a 8-element array into separate variables. + EXPLODE_9(ARRAY,A,B,C,D,E,F,G,H,I) - Split a 9-element array into separate variables. + +Parameters: + ARRAY - Array to read from [Array] + A..H - Names of variables to set from array [Identifier] + +Example: + (begin example) + _array = ["fred", 156.8, 120.9]; + EXPLODE_3(_array,_name_height,_weight); + (end) + +Author: + Spooner +------------------------------------------- */ +#define EXPLODE_1_SYS(ARRAY,A) A = if (IS_ARRAY((ARRAY))) then { (ARRAY) select 0 } else { ARRAY } +#define EXPLODE_1(ARRAY,A) EXPLODE_1_SYS(ARRAY,A); TRACE_1("EXPLODE_1, " + QUOTE(ARRAY),A) +#define EXPLODE_1_PVT(ARRAY,A) \ + private #A; \ + EXPLODE_1(ARRAY,A) + +#define EXPLODE_2_SYS(ARRAY,A,B) EXPLODE_1_SYS(ARRAY,A); B = (ARRAY) select 1 +#define EXPLODE_2(ARRAY,A,B) EXPLODE_2_SYS(ARRAY,A,B); TRACE_2("EXPLODE_2, " + QUOTE(ARRAY),A,B) +#define EXPLODE_2_PVT(ARRAY,A,B) \ + private [#A,#B]; \ + EXPLODE_2(ARRAY,A,B) + +#define EXPLODE_3_SYS(ARRAY,A,B,C) EXPLODE_2_SYS(ARRAY,A,B); C = (ARRAY) select 2 +#define EXPLODE_3(ARRAY,A,B,C) EXPLODE_3_SYS(ARRAY,A,B,C); TRACE_3("EXPLODE_3, " + QUOTE(ARRAY),A,B,C) +#define EXPLODE_3_PVT(ARRAY,A,B,C) \ + private [#A,#B,#C]; \ + EXPLODE_3(ARRAY,A,B,C) + +#define EXPLODE_4_SYS(ARRAY,A,B,C,D) EXPLODE_3_SYS(ARRAY,A,B,C); D = (ARRAY) select 3 +#define EXPLODE_4(ARRAY,A,B,C,D) EXPLODE_4_SYS(ARRAY,A,B,C,D); TRACE_4("EXPLODE_4, " + QUOTE(ARRAY),A,B,C,D) +#define EXPLODE_4_PVT(ARRAY,A,B,C,D) \ + private [#A,#B,#C,#D]; \ + EXPLODE_4(ARRAY,A,B,C,D) + +#define EXPLODE_5_SYS(ARRAY,A,B,C,D,E) EXPLODE_4_SYS(ARRAY,A,B,C,D); E = (ARRAY) select 4 +#define EXPLODE_5(ARRAY,A,B,C,D,E) EXPLODE_5_SYS(ARRAY,A,B,C,D,E); TRACE_5("EXPLODE_5, " + QUOTE(ARRAY),A,B,C,D,E) +#define EXPLODE_5_PVT(ARRAY,A,B,C,D,E) \ + private [#A,#B,#C,#D,#E]; \ + EXPLODE_5(ARRAY,A,B,C,D,E) + +#define EXPLODE_6_SYS(ARRAY,A,B,C,D,E,F) EXPLODE_5_SYS(ARRAY,A,B,C,D,E); F = (ARRAY) select 5 +#define EXPLODE_6(ARRAY,A,B,C,D,E,F) EXPLODE_6_SYS(ARRAY,A,B,C,D,E,F); TRACE_6("EXPLODE_6, " + QUOTE(ARRAY),A,B,C,D,E,F) +#define EXPLODE_6_PVT(ARRAY,A,B,C,D,E,F) \ + private [#A,#B,#C,#D,#E,#F]; \ + EXPLODE_6(ARRAY,A,B,C,D,E,F) + +#define EXPLODE_7_SYS(ARRAY,A,B,C,D,E,F,G) EXPLODE_6_SYS(ARRAY,A,B,C,D,E,F); G = (ARRAY) select 6 +#define EXPLODE_7(ARRAY,A,B,C,D,E,F,G) EXPLODE_7_SYS(ARRAY,A,B,C,D,E,F,G); TRACE_7("EXPLODE_7, " + QUOTE(ARRAY),A,B,C,D,E,F,G) +#define EXPLODE_7_PVT(ARRAY,A,B,C,D,E,F,G) \ + private [#A,#B,#C,#D,#E,#F,#G]; \ + EXPLODE_7(ARRAY,A,B,C,D,E,F,G) + +#define EXPLODE_8_SYS(ARRAY,A,B,C,D,E,F,G,H) EXPLODE_7_SYS(ARRAY,A,B,C,D,E,F,G); H = (ARRAY) select 7 +#define EXPLODE_8(ARRAY,A,B,C,D,E,F,G,H) EXPLODE_8_SYS(ARRAY,A,B,C,D,E,F,G,H); TRACE_8("EXPLODE_8, " + QUOTE(ARRAY),A,B,C,D,E,F,G,H) +#define EXPLODE_8_PVT(ARRAY,A,B,C,D,E,F,G,H) \ + private [#A,#B,#C,#D,#E,#F,#G,#H]; \ + EXPLODE_8(ARRAY,A,B,C,D,E,F,G,H) + +#define EXPLODE_9_SYS(ARRAY,A,B,C,D,E,F,G,H,I) EXPLODE_8_SYS(ARRAY,A,B,C,D,E,F,G,H); I = (ARRAY) select 8 +#define EXPLODE_9(ARRAY,A,B,C,D,E,F,G,H,I) EXPLODE_9_SYS(ARRAY,A,B,C,D,E,F,G,H,I); TRACE_9("EXPLODE_9, " + QUOTE(ARRAY),A,B,C,D,E,F,G,H,I) +#define EXPLODE_9_PVT(ARRAY,A,B,C,D,E,F,G,H,I) \ + private [#A,#B,#C,#D,#E,#F,#G,#H,#I]; \ + EXPLODE_9(ARRAY,A,B,C,D,E,F,G,H,I) + + +/* ------------------------------------------- +Group: Managing Function Parameters +------------------------------------------- */ + +/* ------------------------------------------- +Macros: PARAMS_n() + Setting variables based on parameters passed to a function. + + Each parameter is defines as private and set to the appropriate value from _this. + + PARAMS_1(A) - Get 1 parameter from the _this array (or _this if it's not an array). + PARAMS_2(A,B) - Get 2 parameters from the _this array. + PARAMS_3(A,B,C) - Get 3 parameters from the _this array. + PARAMS_4(A,B,C,D) - Get 4 parameters from the _this array. + PARAMS_5(A,B,C,D,E) - Get 5 parameters from the _this array. + PARAMS_6(A,B,C,D,E,F) - Get 6 parameters from the _this array. + PARAMS_7(A,B,C,D,E,F,G) - Get 7 parameters from the _this array. + PARAMS_8(A,B,C,D,E,F,G,H) - Get 8 parameters from the _this array. + +Parameters: + A..H - Name of variable to read from _this [Identifier] + +Example: + A function called like this: + (begin example) + [_name,_address,_telephone] call recordPersonalDetails; + (end) + expects 3 parameters and those variables could be initialised at the start of the function definition with: + (begin example) + recordPersonalDetails = { + PARAMS_3(_name,_address,_telephone); + // Rest of function follows... + }; + (end) + +Author: + Spooner +------------------------------------------- */ +#define PARAMS_1(A) EXPLODE_1_PVT(_this,A) +#define PARAMS_2(A,B) EXPLODE_2_PVT(_this,A,B) +#define PARAMS_3(A,B,C) EXPLODE_3_PVT(_this,A,B,C) +#define PARAMS_4(A,B,C,D) EXPLODE_4_PVT(_this,A,B,C,D) +#define PARAMS_5(A,B,C,D,E) EXPLODE_5_PVT(_this,A,B,C,D,E) +#define PARAMS_6(A,B,C,D,E,F) EXPLODE_6_PVT(_this,A,B,C,D,E,F) +#define PARAMS_7(A,B,C,D,E,F,G) EXPLODE_7_PVT(_this,A,B,C,D,E,F,G) +#define PARAMS_8(A,B,C,D,E,F,G,H) EXPLODE_8_PVT(_this,A,B,C,D,E,F,G,H) +#define PARAMS_9(A,B,C,D,E,F,G,H,I) EXPLODE_9_PVT(_this,A,B,C,D,E,F,G,H,I) + +/* ------------------------------------------- +Macro: DEFAULT_PARAM() + Getting a default function parameter. This may be used together with to have a mix of required and + optional parameters. + +Parameters: + INDEX - Index of parameter in _this [Integer, 0+] + NAME - Name of the variable to set [Identifier] + DEF_VALUE - Default value to use in case the array is too short or the value at INDEX is nil [Any] + +Example: + A function called with optional parameters: + (begin example) + [_name] call myFunction; + [_name, _numberOfLegs] call myFunction; + [_name, _numberOfLegs, _hasAHead] call myFunction; + (end) + 1 required parameter and 2 optional parameters. Those variables could be initialised at the start of the function + definition with: + (begin example) + myFunction = { + PARAMS_1(_name); + DEFAULT_PARAM(1,_numberOfLegs,2); + DEFAULT_PARAM(2,_hasAHead,true); + // Rest of function follows... + }; + (end) + +Author: + Spooner +------------------------------------------- */ +#define DEFAULT_PARAM(INDEX,NAME,DEF_VALUE) \ + private #NAME; \ + NAME = [RETNIL(_this), INDEX, DEF_VALUE] call CBA_fnc_defaultParam; \ + TRACE_3("DEFAULT_PARAM",INDEX,NAME,DEF_VALUE) + +/* ------------------------------------------- +Macro: KEY_PARAM() + Get value from key in _this list, return default when key is not included in list. + +Parameters: + KEY - Key name [String] + NAME - Name of the variable to set [Identifier] + DEF_VALUE - Default value to use in case key not found [ANY] + +Example: + + +Author: + Muzzleflash +------------------------------------------- */ +#define KEY_PARAM(KEY,NAME,DEF_VALUE) \ + private #NAME; \ + NAME = [toLower KEY, toUpper KEY, DEF_VALUE, RETNIL(_this)] call CBA_fnc_getArg; \ + TRACE_3("KEY_PARAM",KEY,NAME,DEF_VALUE) + +/* ------------------------------------------- +Group: Assertions +------------------------------------------- */ + +#define ASSERTION_ERROR(MESSAGE) ERROR_WITH_TITLE("Assertion failed!",MESSAGE) + +/* ------------------------------------------- +Macro: ASSERT_TRUE() + Asserts that a CONDITION is true. When an assertion fails, an error is raised with the given MESSAGE. + +Parameters: + CONDITION - Condition to assert as true [Boolean] + MESSSAGE - Message to display if (A OPERATOR B) is false [String] + +Example: + (begin example) + ASSERT_TRUE(_frogIsDead,"The frog is alive"); + (end) + +Author: + Spooner +------------------------------------------- */ +#define ASSERT_TRUE(CONDITION,MESSAGE) \ + if (not (CONDITION)) then \ + { \ + ASSERTION_ERROR('Assertion (CONDITION) failed!\n\n' + (MESSAGE)); \ + } + +/* ------------------------------------------- +Macro: ASSERT_FALSE() + Asserts that a CONDITION is false. When an assertion fails, an error is raised with the given MESSAGE. + +Parameters: + CONDITION - Condition to assert as false [Boolean] + MESSSAGE - Message to display if (A OPERATOR B) is true [String] + +Example: + (begin example) + ASSERT_FALSE(_frogIsDead,"The frog died"); + (end) + +Author: + Spooner +------------------------------------------- */ +#define ASSERT_FALSE(CONDITION,MESSAGE) \ + if (CONDITION) then \ + { \ + ASSERTION_ERROR('Assertion (not (CONDITION)) failed!\n\n' + (MESSAGE)) \ + } + +/* ------------------------------------------- +Macro: ASSERT_OP() + Asserts that (A OPERATOR B) is true. When an assertion fails, an error is raised with the given MESSAGE. + +Parameters: + A - First value [Any] + OPERATOR - Binary operator to use [Operator] + B - Second value [Any] + MESSSAGE - Message to display if (A OPERATOR B) is false. [String] + +Example: + (begin example) + ASSERT_OP(_fish,>,5,"Too few fish!"); + (end) + +Author: + Spooner +------------------------------------------- */ +#define ASSERT_OP(A,OPERATOR,B,MESSAGE) \ + if (not ((A) OPERATOR (B))) then \ + { \ + ASSERTION_ERROR('Assertion (A OPERATOR B) failed!\n' + 'A: ' + (str (A)) + '\n' + 'B: ' + (str (B)) + "\n\n" + (MESSAGE)); \ + } + +/* ------------------------------------------- +Macro: ASSERT_DEFINED() + Asserts that a VARIABLE is defined. When an assertion fails, an error is raised with the given MESSAGE.. + +Parameters: + VARIABLE - Variable to test if defined [String or Function]. + MESSAGE - Message to display if variable is undefined [String]. + +Examples: + (begin example) + ASSERT_DEFINED("_anUndefinedVar","Too few fish!"); + ASSERT_DEFINED({ obj getVariable "anUndefinedVar" },"Too many fish!"); + (end) + +Author: + Spooner +------------------------------------------- */ +#define ASSERT_DEFINED(VARIABLE,MESSAGE) \ + if (isNil VARIABLE) then \ + { \ + ASSERTION_ERROR('Assertion (VARIABLE is defined) failed!\n\n' + (MESSAGE)); \ + } + +/* ------------------------------------------- +Group: Managing Deprecation +------------------------------------------- */ + +/* ------------------------------------------- +Macro: DEPRECATE_SYS() + Allow deprecation of a function that has been renamed. + + Replaces an old OLD_FUNCTION (which will have PREFIX_ prepended) with a NEW_FUNCTION + (PREFIX_ prepended) with the intention that the old function will be disabled in the future. + + Shows a warning in RPT each time the deprecated function is used, but runs the new function. + +Parameters: + OLD_FUNCTION - Full name of old function [Identifier for function that does not exist any more] + NEW_FUNCTION - Full name of new function [Function] + +Example: + (begin example) + // After renaming CBA_fnc_frog as CBA_fnc_fish + DEPRECATE_SYS(CBA_fnc_frog,CBA_fnc_fish); + (end) + +Author: + Sickboy +------------------------------------------- */ +#define DEPRECATE_SYS(OLD_FUNCTION,NEW_FUNCTION) \ + OLD_FUNCTION = { \ + WARNING('Deprecated function used: OLD_FUNCTION (new: NEW_FUNCTION) in ADDON'); \ + if (isNil "_this") then { call NEW_FUNCTION } else { _this call NEW_FUNCTION }; \ + } + +/* ------------------------------------------- +Macro: DEPRECATE() + Allow deprecation of a function, in the current component, that has been renamed. + + Replaces an OLD_FUNCTION (which will have PREFIX_ prepended) with a NEW_FUNCTION + (PREFIX_ prepended) with the intention that the old function will be disabled in the future. + + Shows a warning in RPT each time the deprecated function is used, but runs the new function. + +Parameters: + OLD_FUNCTION - Name of old function, assuming PREFIX [Identifier for function that does not exist any more] + NEW_FUNCTION - Name of new function, assuming PREFIX [Function] + +Example: + (begin example) + // After renaming CBA_fnc_frog as CBA_fnc_fish + DEPRECATE(fnc_frog,fnc_fish); + (end) + +Author: + Sickboy +------------------------------------------- */ +#define DEPRECATE(OLD_FUNCTION,NEW_FUNCTION) \ + DEPRECATE_SYS(DOUBLES(PREFIX,OLD_FUNCTION),DOUBLES(PREFIX,NEW_FUNCTION)) + +/* ------------------------------------------- +Macro: OBSOLETE_SYS() + Replace a function that has become obsolete. + + Replace an obsolete OLD_FUNCTION with a simple COMMAND_FUNCTION, with the intention that anyone + using the function should replace it with the simple command, since the function will be disabled in the future. + + Shows a warning in RPT each time the deprecated function is used, and runs the command function. + +Parameters: + OLD_FUNCTION - Full name of old function [Identifier for function that does not exist any more] + COMMAND_CODE - Code to replace the old function [Function] + +Example: + (begin example) + // In Arma2, currentWeapon command made the CBA_fMyWeapon function obsolete: + OBSOLETE_SYS(CBA_fMyWeapon,{ currentWeapon player }); + (end) + +Author: + Spooner +------------------------------------------- */ +#define OBSOLETE_SYS(OLD_FUNCTION,COMMAND_CODE) \ + OLD_FUNCTION = { \ + WARNING('Obsolete function used: (use: OLD_FUNCTION) in ADDON'); \ + if (isNil "_this") then { call COMMAND_CODE } else { _this call COMMAND_CODE }; \ + } + +/* ------------------------------------------- +Macro: OBSOLETE() + Replace a function, in the current component, that has become obsolete. + + Replace an obsolete OLD_FUNCTION (which will have PREFIX_ prepended) with a simple + COMMAND_CODE, with the intention that anyone using the function should replace it with the simple + command. + + Shows a warning in RPT each time the deprecated function is used. + +Parameters: + OLD_FUNCTION - Name of old function, assuming PREFIX [Identifier for function that does not exist any more] + COMMAND_CODE - Code to replace the old function [Function] + +Example: + (begin example) + // In Arma2, currentWeapon command made the CBA_fMyWeapon function obsolete: + OBSOLETE(fMyWeapon,{ currentWeapon player }); + (end) + +Author: + Spooner +------------------------------------------- */ +#define OBSOLETE(OLD_FUNCTION,COMMAND_CODE) \ + OBSOLETE_SYS(DOUBLES(PREFIX,OLD_FUNCTION),COMMAND_CODE) + +#define BWC_CONFIG(NAME) class NAME { \ + units[] = {}; \ + weapons[] = {}; \ + requiredVersion = REQUIRED_VERSION; \ + requiredAddons[] = {}; \ + version = VERSION; \ +} + +// XEH Specific +#define XEH_DISABLED class EventHandlers {}; SLX_XEH_DISABLED = 1 +#define XEH_ENABLED class EventHandlers { EXTENDED_EVENTHANDLERS }; delete SLX_XEH_DISABLED + +// TODO: These are actually outdated; _Once ? +#define XEH_PRE_INIT QUOTE(call COMPILE_FILE(XEH_PreInit_Once)) +#define XEH_PRE_CINIT QUOTE(call COMPILE_FILE(XEH_PreClientInit_Once)) +#define XEH_PRE_SINIT QUOTE(call COMPILE_FILE(XEH_PreServerInit_Once)) + +#define XEH_POST_INIT QUOTE(call COMPILE_FILE(XEH_PostInit_Once)) +#define XEH_POST_CINIT QUOTE(call COMPILE_FILE(XEH_PostClientInit_Once)) +#define XEH_POST_SINIT QUOTE(call COMPILE_FILE(XEH_PostServerInit_Once)) diff --git a/tools/cba/addons/xeh/script_xeh.hpp b/tools/cba/addons/xeh/script_xeh.hpp new file mode 100644 index 0000000000..ec7a1d8b88 --- /dev/null +++ b/tools/cba/addons/xeh/script_xeh.hpp @@ -0,0 +1,99 @@ +///////////////////////////////////////////////////////////////////////////////// +// MACRO: EXTENDED_EVENTHANDLERS +// XEH uses all existing event handlers +///////////////////////////////////////////////////////////////////////////////// +#define EXTENDED_EVENTHANDLERS init = QUOTE(if(isNil'SLX_XEH_MACHINE')then{call compile preProcessFileLineNumbers '\x\cba\addons\xeh\init_pre.sqf'};_this call SLX_XEH_EH_Init); \ +fired = "_this call SLX_XEH_EH_Fired"; \ +animChanged = "_this call SLX_XEH_EH_AnimChanged"; \ +animDone = "_this call SLX_XEH_EH_AnimDone"; \ +animStateChanged = "_this call SLX_XEH_EH_AnimStateChanged"; \ +containerClosed = "_this call SLX_XEH_EH_ContainerClosed"; \ +containerOpened = "_this call SLX_XEH_EH_ContainerOpened"; \ +controlsShifted = "_this call SLX_XEH_EH_ControlsShifted"; \ +dammaged = "_this call SLX_XEH_EH_Dammaged"; \ +engine = "_this call SLX_XEH_EH_Engine"; \ +epeContact = "_this call SLX_XEH_EH_EpeContact"; \ +epeContactEnd = "_this call SLX_XEH_EH_EpeContactEnd"; \ +epeContactStart = "_this call SLX_XEH_EH_EpeContactStart"; \ +explosion = "_this call SLX_XEH_EH_Explosion"; \ +firedNear = "_this call SLX_XEH_EH_FiredNear"; \ +fuel = "_this call SLX_XEH_EH_Fuel"; \ +gear = "_this call SLX_XEH_EH_Gear"; \ +getIn = "_this call SLX_XEH_EH_GetIn"; \ +getOut = "_this call SLX_XEH_EH_GetOut"; \ +handleHeal = "_this call SLX_XEH_EH_HandleHeal"; \ +hit = "_this call SLX_XEH_EH_Hit"; \ +hitPart = "_this call SLX_XEH_EH_HitPart"; \ +incomingMissile = "_this call SLX_XEH_EH_IncomingMissile"; \ +inventoryClosed = "_this call SLX_XEH_EH_InventoryClosed"; \ +inventoryOpened = "_this call SLX_XEH_EH_InventoryOpened"; \ +killed = "_this call SLX_XEH_EH_Killed"; \ +landedTouchDown = "_this call SLX_XEH_EH_LandedTouchDown"; \ +landedStopped = "_this call SLX_XEH_EH_LandedStopped"; \ +local = "_this call SLX_XEH_EH_Local"; \ +respawn = "_this call SLX_XEH_EH_Respawn"; \ +put = "_this call SLX_XEH_EH_Put"; \ +take = "_this call SLX_XEH_EH_Take"; \ +soundPlayed = "_this call SLX_XEH_EH_SoundPlayed"; \ +weaponAssembled = "_this call SLX_XEH_EH_WeaponAssembled"; \ +weaponDisAssembled = "_this call SLX_XEH_EH_WeaponDisassembled"; + +//handleDamage = "_this call SLX_XEH_EH_HandleDamage"; \ +//mpHit = "_this call SLX_XEH_EH_MPHit"; \ +//mpKilled = "_this call SLX_XEH_EH_MPKilled"; \ +//mpRespawn = "_this call SLX_XEH_EH_MPRespawn"; + + + +///////////////////////////////////////////////////////////////////////////////// +// MACRO: DELETE_EVENTHANDLERS +// +// Example: +// +// class DefaultEventhandlers; +// class Car_F; +// class MRAP_01_base_F: Car_F { +// class EventHandlers; +// }; +// class B_MRAP_01_F: MRAP_01_base_F { +// class Eventhandlers: EventHandlers { +// DELETE_EVENTHANDLERS +// }; +// }; +///////////////////////////////////////////////////////////////////////////////// + +#define DELETE_EVENTHANDLERS delete init; \ +delete fired; \ +delete animChanged; \ +delete animDone; \ +delete animStateChanged; \ +delete containerClosed; \ +delete containerOpened; \ +delete controlsShifted; \ +delete dammaged; \ +delete engine; \ +delete epeContact; \ +delete epeContactEnd; \ +delete epeContactStart; \ +delete explosion; \ +delete firedNear; \ +delete fuel; \ +delete gear; \ +delete getIn; \ +delete getOut; \ +delete handleHeal; \ +delete hit; \ +delete hitPart; \ +delete incomingMissile; \ +delete inventoryClosed; \ +delete inventoryOpened; \ +delete killed; \ +delete landedTouchDown; \ +delete landedStopped; \ +delete local; \ +delete respawn; \ +delete put; \ +delete take; \ +delete soundPlayed; \ +delete weaponAssembled; \ +delete weaponDisAssembled; diff --git a/tools/setup.py b/tools/setup.py new file mode 100644 index 0000000000..1b9ab119d9 --- /dev/null +++ b/tools/setup.py @@ -0,0 +1,118 @@ +#!/usr/bin/env python3 + +####################### +# ACE3 Setup Script # +####################### + + +import os +import sys +import shutil +import platform +import subprocess +import winreg + + +def main(): + print(""" + ###################################### + # ACE3 Development Environment Setup # + ###################################### + + This script will create your ACE3 dev environment for you. + + Before you run this, you should already have: + - The Arma 3 Tools installed properly via Steam + - A properly set up P-drive + + If you have not done those things yet, please abort this script in the next step and do so first. + + This script will create two hard links on your system, both pointing to your ACE3 project folder: + [Arma 3 installation directory]\\z\\ace => ACE3 project folder + P:\\z\\ace => ACE3 project folder + + It will also copy the required CBA includes to P:\\x\\cba, if you do not have the CBA source code already.""") + print("\n") + + try: + reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) + key = winreg.OpenKey(reg, + r"SOFTWARE\Wow6432Node\bohemia interactive\arma 3") + armapath = winreg.EnumValue(key,1)[1] + except: + print("Failed to determine Arma 3 Path.") + return 1 + + if not os.path.exists("P:\\"): + print("No P-drive detected.") + return 2 + + scriptpath = os.path.realpath(__file__) + projectpath = os.path.dirname(os.path.dirname(scriptpath)) + + print("# Detected Paths:") + print(" Arma Path: {}".format(armapath)) + print(" Project Path: {}".format(projectpath)) + + repl = input("\nAre these correct? (y/n): ") + if repl.lower() != "y": + return 3 + + print("\n# Creating links ...") + + if os.path.exists("P:\\z\\ace"): + print("Link on P: already exists. Please finish the setup manually.") + return 4 + + if os.path.exists(os.path.join(armapath, "z", "ace")): + print("Link in Arma directory already exists. Please finish the setup manually.") + return 5 + + try: + if not os.path.exists("P:\\z"): + os.mkdir("P:\\z") + if not os.path.exists(os.path.join(armapath, "z")): + os.mkdir(os.path.join(armapath, "z")) + + if platform.win32_ver()[0] == "7": + subprocess.call(["cmd", "/c", "mklink", "/D", "P:\\z\\ace", projectpath]) + subprocess.call(["cmd", "/c", "mklink", "/D", os.path.join(armapath, "z", "ace"), projectpath]) + else: + subprocess.call(["cmd", "/c", "mklink", "/D", "/J", "P:\\z\\ace", projectpath]) + subprocess.call(["cmd", "/c", "mklink", "/D", "/J", os.path.join(armapath, "z", "ace"), projectpath]) + except: + raise + print("Something went wrong during the link creation. Please finish the setup manually.") + return 6 + + print("# Links created successfully.") + + + print("\n# Copying required CBA includes ...") + + if os.path.exists("P:\\x\\cba"): + print("P:\\x\\cba already exists, skipping.") + return -1 + + try: + shutil.copytree(os.path.join(projectpath, "tools", "cba"), "P:\\x\\cba") + except: + raise + print("Something went wrong while copying CBA includes. Please copy tools\\cba to P:\\x\\cba manually.") + return 7 + + print("# CBA includes copied successfully to P:\\x\\cba.") + + return 0 + + +if __name__ == "__main__": + exitcode = main() + + if exitcode > 0: + print("\nSomething went wrong during the setup. Make sure you run this script as administrator. If these issues persist, please follow the instructions on the ACE3 wiki to perform the setup manually.") + else: + print("\nSetup successfully completed.") + + input("\nPress enter to exit ...") + sys.exit(exitcode)