From 1da67d7b483a822638e4291ef7a763c38d869b92 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Tue, 10 Mar 2015 21:12:35 +0100 Subject: [PATCH 01/61] First draft of triage card --- addons/medical/XEH_preInit.sqf | 2 + addons/medical/config.cpp | 1 + .../fnc_displayPatientInformation.sqf | 2 +- .../functions/fnc_displayTriageCard.sqf | 78 ++++++++ .../functions/fnc_dropDownTriageCard.sqf | 34 ++++ addons/medical/ui/triagecard.hpp | 175 ++++++++++++++++++ 6 files changed, 291 insertions(+), 1 deletion(-) create mode 100644 addons/medical/functions/fnc_displayTriageCard.sqf create mode 100644 addons/medical/functions/fnc_dropDownTriageCard.sqf create mode 100644 addons/medical/ui/triagecard.hpp diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index c6ddbf0783..a670244302 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -79,6 +79,8 @@ PREP(treatmentTourniquetLocal); PREP(useItem); PREP(useItems); PREP(displayPatientInformation); +PREP(displayTriageCard); +PREP(dropDownTriageCard); PREP(moduleMedicalSettings); PREP(moduleAssignMedicRoles); PREP(moduleAssignMedicalVehicle); diff --git a/addons/medical/config.cpp b/addons/medical/config.cpp index 3e8aaa8d55..17060716a8 100644 --- a/addons/medical/config.cpp +++ b/addons/medical/config.cpp @@ -20,3 +20,4 @@ class CfgPatches { #include "ACE_Medical_Treatments.hpp" #include "ACE_Settings.hpp" #include "UI\RscTitles.hpp" +#include "UI\triagecard.hpp" diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index b9b450ea65..dafc0bf55d 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -149,4 +149,4 @@ if (_show) then { } else { ("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; -}; \ No newline at end of file +}; diff --git a/addons/medical/functions/fnc_displayTriageCard.sqf b/addons/medical/functions/fnc_displayTriageCard.sqf new file mode 100644 index 0000000000..95e6713d9a --- /dev/null +++ b/addons/medical/functions/fnc_displayTriageCard.sqf @@ -0,0 +1,78 @@ +/* + * Author: Glowbal + * Display triage card for a unit + * + * Arguments: + * 0: The unit + * + * Return Value: + * nil + * + * Public: Yes + */ + +#include "script_component.hpp" + +private ["_target", "_show"]; +_target = _this select 0; +_show = if (count _this > 1) then {_this select 1} else {true}; +GVAR(currentSelectedSelectionN) = if (count _this > 2) then {_this select 2} else {0}; + +GVAR(TriageCardTarget) = if (_show) then {_target} else {ObjNull}; + +if (_show) then { + //("ACE_MedicalTriageCard" call BIS_fnc_rscLayer) cutRsc [QGVAR(triageCard),"PLAIN"]; + createDialog QGVAR(triageCard); + + [{ + private ["_target", "_display", "_alphaLevel", "_damaged", "_availableSelections", "_openWounds", "_selectionBloodLoss", "_red", "_green", "_blue", "_alphaLevel", "_allInjuryTexts", "_lbCtrl", "_genericMessages"]; + _target = (_this select 0) select 0; + if (GVAR(TriageCardTarget) != _target) exitwith { + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + + disableSerialization; + _display = uiNamespace getvariable QGVAR(triageCard); + if (isnil "_display") exitwith { + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + + _triageCardTexts = []; + + // TODO fill the lb with the appropiate information for the patient + _lbCtrl = (_display displayCtrl 200); + lbClear _lbCtrl; + + _log = _target getvariable ["myVariableTESTKOEAKJR", []]; + { + // [_message,_moment,_type, _arguments] + _message = _x select 0; + _moment = _x select 1; + _arguments = _x select 3; + if (isLocalized _message) then { + _message = localize _message; + }; + + { + if (typeName _x == "STRING" && {isLocalized _x}) then { + _arguments set [_foreachIndex, localize _x]; + }; + }foreach _arguments; + _message = format([_message] + _arguments); + _lbCtrl lbAdd format["%1 %2", _moment, _message]; + }foreach _log; + + if (count _triageCardTexts == 0) then { + _lbCtrl lbAdd "No entries on this triage card.."; + }; + + _triageStatus = [_target] call FUNC(getTriageStatus); + (_display displayCtrl 2000) ctrlSetText (_triageStatus select 0); + (_display displayCtrl 2000) ctrlSetBackgroundColor (_triageStatus select 2); + + }, 0, [_target]] call CBA_fnc_addPerFrameHandler; + +} else { + //("ACE_MedicalTriageCard" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; + closeDialog 7010; +}; diff --git a/addons/medical/functions/fnc_dropDownTriageCard.sqf b/addons/medical/functions/fnc_dropDownTriageCard.sqf new file mode 100644 index 0000000000..c9a85d91af --- /dev/null +++ b/addons/medical/functions/fnc_dropDownTriageCard.sqf @@ -0,0 +1,34 @@ +/* + * Author: Glowbal + * Display triage card for a unit + * + * Arguments: + * 0: The unit + * + * Return Value: + * nil + * + * Public: Yes + */ + +#include "script_component.hpp" + +private ["_show"]; +_show = _this select 0; +disableSerialization; + +_display = uiNamespace getvariable QGVAR(triageCard); +if (isnil "_display") exitwith {}; + +_pos = [0,0,0,0]; +if (_show) then { + _pos = ctrlPosition (_display displayCtrl 2001); +}; +for "_idc" from 2002 to 2006 step 1 do +{ + _pos set [1, (_pos select 1) + (_pos select 3)]; + _ctrl = (_display displayCtrl _idc); + _ctrl ctrlSetPosition _pos; + _ctrl ctrlCommit 0; +}; + diff --git a/addons/medical/ui/triagecard.hpp b/addons/medical/ui/triagecard.hpp new file mode 100644 index 0000000000..22cd9fcc51 --- /dev/null +++ b/addons/medical/ui/triagecard.hpp @@ -0,0 +1,175 @@ +class ACE_gui_buttonBase; + +class GVAR(triageCard) { + idd = 7010; + movingenable = 0; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QUOTE(GVAR(triageCard))), _this select 0)]); + onUnload = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QUOTE(GVAR(triageCard))), nil)]); + class controlsBackground { + class Background: ACE_gui_backgroundBase { + idc = -1; + type = CT_STATIC; + x = "10 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "19 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorText[] = {0.0, 0.0, 0.0, 1}; + colorBackground[] = {1,1,1,1}; + text = ""; + }; + + class TriageCardLabel { + idc = 199; + type = CT_STATIC; + x = "14.25 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "7.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "0.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + style = 0x02 + 0x100; // ST_LEFT + ST_SHADOW + font = "PuristaMedium"; + colorText[] = {0,0,0,1}; + colorBackground[] = {0,0,0,0}; + text = "TRIAGE CARD"; + }; + class TriageList: ACE_gui_listBoxBase { + idc = 200; + x = "11 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "13 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "13 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + rowHeight = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + colorBackground[] = {0, 0, 0, 0}; + colorText[] = {0,0,0, 1.0}; + colorScrollbar[] = {0.95, 0.95, 0.95, 0}; + colorSelect[] = {0.0, 0.0, 0.0, 1}; + colorSelect2[] = {0.0, 0.0, 0.0, 1}; + colorSelectBackground[] = {0, 0, 0, 0.0}; + colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.0}; + }; + class TriageTextBottom: TriageCardLabel { + idc = 2000; + x = "10 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "20 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = 0x02; + colorText[] = {1, 1, 1.0, 1}; + colorBackground[] = {0,0.0,0.0,0.7}; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + text = ""; + }; + class selectTriageStatus: ACE_gui_buttonBase { + idc = 2001; + x = "10 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "20 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = 0x02; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.0)"; + action = QUOTE([true] call FUNC(dropDownTriageCard);); + text = ""; + }; + class selectTriageStatusNone: selectTriageStatus { + idc = 2002; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_ACE_MEDICAL_TRIAGE_STATUS_NONE; + style = 0x02; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.9)"; + action = QUOTE([false] call FUNC(dropDownTriageCard); GVAR(TriageCardTarget) setvariable [ARR_3('ACE_medical_triageLevel',0,true)];); + }; + class selectTriageStatusMinor: selectTriageStatus { + idc = 2003; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_ACE_MEDICAL_TRIAGE_STATUS_MINOR; + style = 0x02; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + animTextureOver = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + animTextureFocused = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + animTexturePressed = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + animTextureDefault = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + action = QUOTE([false] call FUNC(dropDownTriageCard); GVAR(TriageCardTarget) setvariable [ARR_3('ACE_medical_triageLevel',1,true)];); + }; + class selectTriageStatusDelayed: selectTriageStatus { + idc = 2004; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_ACE_MEDICAL_TRIAGE_STATUS_DELAYED; + style = 0x02; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + animTextureOver = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + animTextureFocused = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + animTexturePressed = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + animTextureDefault = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + action = QUOTE([false] call FUNC(dropDownTriageCard); GVAR(TriageCardTarget) setvariable [ARR_3('ACE_medical_triageLevel',2,true)];); + }; + class selectTriageStatusImmediate: selectTriageStatus { + idc = 2005; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_ACE_MEDICAL_TRIAGE_STATUS_IMMEDIATE; + style = 0x02; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + animTextureOver = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + animTextureFocused = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + animTexturePressed = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + animTextureDefault = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + action = QUOTE([false] call FUNC(dropDownTriageCard); GVAR(TriageCardTarget) setvariable [ARR_3('ACE_medical_triageLevel', 3, true)];); + }; + class selectTriageStatusDeceased: selectTriageStatus { + idc = 2006; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_ACE_MEDICAL_TRIAGE_STATUS_DECEASED; + style = 0x02; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.9)"; + action = QUOTE([false] call FUNC(dropDownTriageCard); GVAR(TriageCardTarget) setvariable [ARR_3('ACE_medical_triageLevel', 4, true)];); + }; + }; +}; \ No newline at end of file From 8d22b61a2d60a278c4c2476dccc30193fe12f1b7 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Wed, 11 Mar 2015 18:08:00 +0100 Subject: [PATCH 02/61] Assign structural damage to torso --- .../medical/functions/fnc_handleDamage_basic.sqf | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/addons/medical/functions/fnc_handleDamage_basic.sqf b/addons/medical/functions/fnc_handleDamage_basic.sqf index f31c9f186d..de7647f245 100644 --- a/addons/medical/functions/fnc_handleDamage_basic.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic.sqf @@ -112,8 +112,20 @@ if (_selection == "") then { }; -// Assign orphan structural damage to torso; -// @todo +// Assign orphan structural damage to torso +[{ + private ["_unit", "_damagesum"]; + _unit = _this select 0; + _damagesum = (_unit getHitPointDamage "HitHead") + + (_unit getHitPointDamage "HitBody") + + (_unit getHitPointDamage "HitLeftArm") + + (_unit getHitPointDamage "HitRightArm") + + (_unit getHitPointDamage "HitLeftLeg") + + (_unit getHitPointDamage "HitRightLeg"); + if (_damagesum < 0.06 and damage _unit > 0.06 and alive _unit) then { + _unit setHitPointDamage ["HitBody", damage _unit]; + }; +}, [_unit], 2, 0.1] call EFUNC(common,waitAndExecute); if (_selection == "") then { From a641a5db8bf2ed0a6d5170216d05b1473d7bb129 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Wed, 11 Mar 2015 18:08:29 +0100 Subject: [PATCH 03/61] Make use of fnc_setUnconscious --- addons/medical/functions/fnc_handleDamage_basic.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_handleDamage_basic.sqf b/addons/medical/functions/fnc_handleDamage_basic.sqf index de7647f245..d082a62a81 100644 --- a/addons/medical/functions/fnc_handleDamage_basic.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic.sqf @@ -185,7 +185,7 @@ if (_selection == "" and )) then { // random chance to kill AI instead of knocking them out if (_unit getVariable [QGVAR(allowUnconscious), ([_unit] call EFUNC(common,isPlayer)) or random 1 > 0.5]) then { - hint "unconscious"; // @todo + [_unit, true] call FUNC(setUnconscious); } else { _damageReturn = 1; }; From 809f6754cc5c779048cb5e8e65b4d94e5f766544 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Thu, 12 Mar 2015 07:33:44 +0100 Subject: [PATCH 04/61] Add pain & painkiller reduction over time --- addons/medical/CfgVehicles.hpp | 1 + addons/medical/functions/fnc_handleUnitVitals.sqf | 12 ++++++++++++ .../functions/fnc_treatmentBasic_morphine.sqf | 2 -- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index a15167f820..f5e28a520e 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -346,6 +346,7 @@ class CfgVehicles { }; class ACE_Actions { + // @todo morphine, epi, bloodbag actions for basic class ACE_Head { runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index e7c55d5d08..d7af4d47d1 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -73,6 +73,18 @@ if ([_unit] call EFUNC(common,isAwake)) then { }; }; +if (GVAR(level) == 1) then { + // reduce pain + if (_unit getVariable [QGVAR(pain), 0] > 0) then { + _unit setVariable [QGVAR(pain), ((_unit getVariable QGVAR(pain)) - 0.001) max 0, true]; + }; + + // reduce painkillers + if (_unit getVariable [QGVAR(morphine), 0] > 0) then { + _unit setVariable [QGVAR(morphine), ((_unit getVariable QGVAR(morphine)) - 0.0015) max 0, true]; + }; +}; + // handle advanced medical, with vitals if (GVAR(level) >= 2) then { diff --git a/addons/medical/functions/fnc_treatmentBasic_morphine.sqf b/addons/medical/functions/fnc_treatmentBasic_morphine.sqf index 30c87b6f05..e52f598c49 100644 --- a/addons/medical/functions/fnc_treatmentBasic_morphine.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_morphine.sqf @@ -29,5 +29,3 @@ _pain = ((_target getVariable [QGVAR(pain), 0]) - MORPHINEHEAL) max 0; _target setVariable [QGVAR(pain), _pain, true]; // @todo overdose - -// @todo pain, painkiller reduction From ef491a7c7615e1bd69ca119f5723155fd47f637d Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Thu, 12 Mar 2015 07:34:29 +0100 Subject: [PATCH 05/61] Add basic information to dialog --- .../medical/functions/fnc_displayPatientInformation.sqf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index b9b450ea65..d836f97119 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -75,9 +75,11 @@ if (_show) then { }; }foreach _openWounds; } else { - // TODO handle basic medical colors for body part selections here - + { + _selectionBloodLoss set [_forEachIndex, _unit getHitPointDamage _x]; + } forEach ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; + // @todo Injury texts? }; // Handle the body image coloring @@ -149,4 +151,4 @@ if (_show) then { } else { ("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; -}; \ No newline at end of file +}; From 7f19ab77509ea8600d5a68302b8320f8adf20a9c Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Sun, 15 Mar 2015 01:46:23 +0100 Subject: [PATCH 06/61] Only run JIP updates for wounds in advanced --- addons/medical/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index d23a02225f..bddd1893d8 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -217,7 +217,7 @@ if (isNil QGVAR(level)) then { }, 0, []] call CBA_fnc_addPerFrameHandler; // broadcast injuries to JIP clients in a MP session -if (isMultiplayer) then { +if (isMultiplayer and GVAR(level) >= 2) then { [QGVAR(onPlayerConnected), "onPlayerConnected", { if (isNil QGVAR(InjuredCollection)) then { GVAR(InjuredCollection) = []; From 77ae99799353376dd09555c675fe8689b012b253 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Sun, 15 Mar 2015 01:48:50 +0100 Subject: [PATCH 07/61] Don't handle unit vitals when game is paused --- .../medical/functions/fnc_handleUnitVitals.sqf | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index d7af4d47d1..1edda53fae 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -16,6 +16,11 @@ private ["_unit", "_heartRate","_bloodPressure","_bloodVolume","_painStatus", "_lastTimeValuesSynced", "_syncValues"]; _unit = _this select 0; +_interval = time - (_unit getVariable [QGVAR(lastMomentVitalsHandled), 0]); +_unit setVariable [QGVAR(lastMomentVitalsHandled), time]; + +if (_interval == 0) exitWith {}; + _lastTimeValuesSynced = _unit getvariable [QGVAR(lastMomentValuesSynced), 0]; _syncValues = time - _lastTimeValuesSynced >= (10 + floor(random(10))); if (_syncValues) then { @@ -76,12 +81,12 @@ if ([_unit] call EFUNC(common,isAwake)) then { if (GVAR(level) == 1) then { // reduce pain if (_unit getVariable [QGVAR(pain), 0] > 0) then { - _unit setVariable [QGVAR(pain), ((_unit getVariable QGVAR(pain)) - 0.001) max 0, true]; + _unit setVariable [QGVAR(pain), ((_unit getVariable QGVAR(pain)) - 0.001 * _interval) max 0, _syncValues]; }; // reduce painkillers if (_unit getVariable [QGVAR(morphine), 0] > 0) then { - _unit setVariable [QGVAR(morphine), ((_unit getVariable QGVAR(morphine)) - 0.0015) max 0, true]; + _unit setVariable [QGVAR(morphine), ((_unit getVariable QGVAR(morphine)) - 0.0015 * _interval) max 0, _syncValues]; }; }; @@ -89,7 +94,7 @@ if (GVAR(level) == 1) then { if (GVAR(level) >= 2) then { // Set the vitals - _heartRate = (_unit getvariable [QGVAR(heartRate), 0]) + ([_unit] call FUNC(getHeartRateChange)); + _heartRate = (_unit getvariable [QGVAR(heartRate), 0]) + ([_unit] call FUNC(getHeartRateChange)) * _interval; _unit setvariable [QGVAR(heartRate), _heartRate, _syncValues]; _bloodPressure = [_unit] call FUNC(getBloodPressure); @@ -100,12 +105,12 @@ if (GVAR(level) >= 2) then { _airwayStatus = _unit getvariable [QGVAR(airwayStatus), 100]; if (((_unit getvariable [QGVAR(airwayOccluded), false]) || (_unit getvariable [QGVAR(airwayCollapsed), false])) && !((_unit getvariable [QGVAR(airwaySecured), false]))) then { if (_airwayStatus >= 0.5) then { - _unit setvariable [QGVAR(airwayStatus), _airwayStatus - 0.5, _syncValues]; + _unit setvariable [QGVAR(airwayStatus), _airwayStatus - 0.5 * _interval, _syncValues]; }; } else { if !((_unit getvariable [QGVAR(airwayOccluded), false]) || (_unit getvariable [QGVAR(airwayCollapsed), false])) then { if (_airwayStatus < 100) then { - _unit setvariable [QGVAR(airwayStatus), (_airwayStatus + 1.5) min 100, _syncValues]; + _unit setvariable [QGVAR(airwayStatus), (_airwayStatus + 1.5 * _interval) min 100, _syncValues]; }; }; }; @@ -120,7 +125,7 @@ if (GVAR(level) >= 2) then { // Check vitals for medical status // TODO check for in revive state instead of variable // TODO Implement cardiac arrest. - _bloodPressureL = _bloodPressure select 0; + _bloodPressureL = _bloodPressure select 0; _bloodPressureH = _bloodPressure select 1; if (!(_unit getvariable [QGVAR(inCardiacArrest),false])) then { From d640367ff2f88bdac3705560246381a18cb0c0a4 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Sun, 15 Mar 2015 03:25:31 +0100 Subject: [PATCH 08/61] Add isInMedicalVehicle function --- .../functions/fnc_isInMedicalVehicle.sqf | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 addons/medical/functions/fnc_isInMedicalVehicle.sqf diff --git a/addons/medical/functions/fnc_isInMedicalVehicle.sqf b/addons/medical/functions/fnc_isInMedicalVehicle.sqf new file mode 100644 index 0000000000..e610a5cf3f --- /dev/null +++ b/addons/medical/functions/fnc_isInMedicalVehicle.sqf @@ -0,0 +1,23 @@ +/* + * Author: KoffeinFlummi + * Checks if a unit is in a medical vehicle. + * + * Arguments: + * 0: unit to be checked + * + * Return Value: + * Is unit in medical vehicle? + * + * Public: Yes + */ + +private ["_unit", "_vehicle"]; + +_unit = _this select 0; +_vehicle = vehicle _unit; + +if (_unit == _vehicle) exitWith {false}; +if (_unit in [driver _vehicle, gunner _vehicle, commander _vehicle]) exitWith {false}; + +// @todo: variable names standard? +_vehicle getVariable [QGVAR(isMedic), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant") == 1] From 4cc1b0819645aaf218d27d79bbd03b14e85fd4f6 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Sun, 15 Mar 2015 03:26:00 +0100 Subject: [PATCH 09/61] Add basic bleeding --- addons/medical/functions/fnc_handleUnitVitals.sqf | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index 1edda53fae..27be791756 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -88,6 +88,19 @@ if (GVAR(level) == 1) then { if (_unit getVariable [QGVAR(morphine), 0] > 0) then { _unit setVariable [QGVAR(morphine), ((_unit getVariable QGVAR(morphine)) - 0.0015 * _interval) max 0, _syncValues]; }; + + // bleeding + _blood = _unit getVariable [QGVAR(bloodVolume), 100]; + _blood = (_blood - 0.4 * (damage _unit) * _interval) max 0; + if (_blood != (_unit getVariable [QGVAR(bloodVolume), 100])) then { + _unit setVariable [QGVAR(bloodVolume), _blood, _syncValues]; + if (_blood <= 35 and !(_unit getVariable [QGVAR(isUnconscious), false])) then { + [_unit, true] call FUNC(setUnconscious); + }; + if (_blood == 0) then { + _unit setDamage 1; + }; + }; }; // handle advanced medical, with vitals From 99899d6562893fdd57ce21845ea6c0f24750c5b0 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Sun, 15 Mar 2015 03:26:10 +0100 Subject: [PATCH 10/61] Move advanced bloodloss handling to advanced --- .../functions/fnc_handleUnitVitals.sqf | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index 27be791756..b7c2aeac37 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -65,19 +65,6 @@ if (_painStatus > 0) then { }; }; - -if (_bloodVolume < 30) exitwith { - [_unit] call FUNC(setDead); -}; - -if ([_unit] call EFUNC(common,isAwake)) then { - if (_bloodVolume < 60) then { - if (random(1) > 0.9) then { - [_unit] call FUNC(setUnconscious); - }; - }; -}; - if (GVAR(level) == 1) then { // reduce pain if (_unit getVariable [QGVAR(pain), 0] > 0) then { @@ -105,6 +92,17 @@ if (GVAR(level) == 1) then { // handle advanced medical, with vitals if (GVAR(level) >= 2) then { + if (_bloodVolume < 30) exitwith { + [_unit] call FUNC(setDead); + }; + + if ([_unit] call EFUNC(common,isAwake)) then { + if (_bloodVolume < 60) then { + if (random(1) > 0.9) then { + [_unit] call FUNC(setUnconscious); + }; + }; + }; // Set the vitals _heartRate = (_unit getvariable [QGVAR(heartRate), 0]) + ([_unit] call FUNC(getHeartRateChange)) * _interval; From 726bf8d407c969213595363f5d45119727dbf04a Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 15 Mar 2015 11:27:21 -0500 Subject: [PATCH 11/61] Headers, Formating, Fixes, Lock Inventory Option --- addons/vehiclelock/CfgEventHandlers.hpp | 12 ++ addons/vehiclelock/CfgMagazines.hpp | 15 +- addons/vehiclelock/CfgVehicles.hpp | 191 +++++++++--------- addons/vehiclelock/CfgWeapons.hpp | 76 +++---- addons/vehiclelock/XEH_postInit.sqf | 5 + addons/vehiclelock/XEH_preInit.sqf | 5 +- addons/vehiclelock/config.cpp | 4 + .../functions/fnc_addKeyForVehicle.sqf | 67 +++--- .../functions/fnc_getVehicleSideKey.sqf | 40 ++-- .../functions/fnc_hasKeyForVehicle.sqf | 44 ++-- addons/vehiclelock/functions/fnc_lockpick.sqf | 105 +++++----- .../vehiclelock/functions/fnc_moduleInit.sqf | 80 ++++---- .../vehiclelock/functions/fnc_moduleSync.sqf | 79 ++++---- .../functions/fnc_onOpenInventory.sqf | 40 ++++ .../functions/fnc_serverSetupCustomKeyEH.sqf | 36 ++-- .../functions/fnc_setVehicleLockEH.sqf | 42 ++-- 16 files changed, 433 insertions(+), 408 deletions(-) create mode 100644 addons/vehiclelock/XEH_postInit.sqf create mode 100644 addons/vehiclelock/functions/fnc_onOpenInventory.sqf diff --git a/addons/vehiclelock/CfgEventHandlers.hpp b/addons/vehiclelock/CfgEventHandlers.hpp index b928bc2de6..cf704d000c 100644 --- a/addons/vehiclelock/CfgEventHandlers.hpp +++ b/addons/vehiclelock/CfgEventHandlers.hpp @@ -3,3 +3,15 @@ class Extended_PreInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; +class Extended_InventoryOpened_EventHandlers { + class CAManBase { + class ADDON { + clientInventoryOpened = QUOTE(_this call FUNC(onOpenInventory);); + }; + }; +}; diff --git a/addons/vehiclelock/CfgMagazines.hpp b/addons/vehiclelock/CfgMagazines.hpp index 198c617509..100df8065b 100644 --- a/addons/vehiclelock/CfgMagazines.hpp +++ b/addons/vehiclelock/CfgMagazines.hpp @@ -1,9 +1,10 @@ class CfgMagazines { - class CA_Magazine; - class ACE_key_customKeyMagazine: CA_Magazine { - picture = QUOTE(PATHTOF(ui\keyBlack.paa)); - displayName = "ACE Vehicle Key"; //!!!CANNONT be localized!!!, because it is used as part of the magazineDetail string - descriptionShort = "$STR_ACE_Vehicle_Item_Custom_Description"; - count = 1; - }; + class CA_Magazine; + class ACE_key_customKeyMagazine: CA_Magazine { + picture = QUOTE(PATHTOF(ui\keyBlack.paa)); + displayName = "ACE Vehicle Key"; //!!!CANNOT be localized!!!: because it is used as part of the magazineDetail string + descriptionShort = "$STR_ACE_Vehicle_Item_Custom_Description"; + count = 1; + mass = 0; + }; }; diff --git a/addons/vehiclelock/CfgVehicles.hpp b/addons/vehiclelock/CfgVehicles.hpp index 5be796c126..1a7da461ca 100644 --- a/addons/vehiclelock/CfgVehicles.hpp +++ b/addons/vehiclelock/CfgVehicles.hpp @@ -1,102 +1,107 @@ #define MACRO_LOCK_ACTIONS \ - class ACE_MainActions { \ - class ACE_unlockVehicle { \ - displayName = "$STR_ACE_Vehicle_Action_UnLock"; \ - distance = 4; \ - condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(2,3)]}); \ - statement = QUOTE([ARR_3('SetVehicleLock', [_target], [ARR_2(_target,false)])] call EFUNC(common,targetEvent)); \ - showDisabled = 0; \ - priority = 0.3; \ - icon = QUOTE(PATHTOF(ui\key_menuIcon_ca.paa)); \ - }; \ - class ACE_lockVehicle { \ - displayName = "$STR_ACE_Vehicle_Action_Lock"; \ - distance = 4; \ - condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(0,1)]}); \ - statement = QUOTE([ARR_3('SetVehicleLock', [_target], [ARR_2(_target,true)])] call EFUNC(common,targetEvent)); \ - showDisabled = 0; \ - priority = 0.2; \ - icon = QUOTE(PATHTOF(ui\key_menuIcon_ca.paa)); \ - }; \ - class ACE_lockpickVehicle { \ - displayName = "$STR_ACE_Vehicle_Action_Lockpick"; \ - distance = 4; \ - condition = QUOTE([ARR_3(_player, _target, 'canLockpick')] call FUNC(lockpick)); \ - statement = QUOTE([ARR_3(_player, _target, 'startLockpick')] call FUNC(lockpick)); \ - showDisabled = 0; \ - priority = 0.1; \ - }; \ - }; + class ACE_MainActions { \ + class ACE_unlockVehicle { \ + displayName = "$STR_ACE_Vehicle_Action_UnLock"; \ + distance = 4; \ + condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(2,3)]}); \ + statement = QUOTE([ARR_3('VehicleLock_SetVehicleLock', [_target], [ARR_2(_target,false)])] call EFUNC(common,targetEvent)); \ + showDisabled = 0; \ + priority = 0.3; \ + icon = QUOTE(PATHTOF(ui\key_menuIcon_ca.paa)); \ + }; \ + class ACE_lockVehicle { \ + displayName = "$STR_ACE_Vehicle_Action_Lock"; \ + distance = 4; \ + condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(0,1)]}); \ + statement = QUOTE([ARR_3('VehicleLock_SetVehicleLock', [_target], [ARR_2(_target,true)])] call EFUNC(common,targetEvent)); \ + showDisabled = 0; \ + priority = 0.2; \ + icon = QUOTE(PATHTOF(ui\key_menuIcon_ca.paa)); \ + }; \ + class ACE_lockpickVehicle { \ + displayName = "$STR_ACE_Vehicle_Action_Lockpick"; \ + distance = 4; \ + condition = QUOTE([ARR_3(_player, _target, 'canLockpick')] call FUNC(lockpick)); \ + statement = QUOTE([ARR_3(_player, _target, 'startLockpick')] call FUNC(lockpick)); \ + showDisabled = 0; \ + priority = 0.1; \ + }; \ + }; class CfgVehicles { - class LandVehicle; - class Car: LandVehicle { - class ACE_Actions { - MACRO_LOCK_ACTIONS - }; - }; - class Tank: LandVehicle { - class ACE_Actions { - MACRO_LOCK_ACTIONS - }; - }; - class Air; - class Helicopter: Air { - class ACE_Actions { - MACRO_LOCK_ACTIONS - }; - }; - - class Logic; - class Module_F: Logic { - class ArgumentsBaseUnits {}; - class ModuleDescription {}; - }; - class ACE_VehicleLock_ModuleSetup: Module_F { - author = "$STR_ACE_Common_ACETeam"; - category = "ACE"; - displayName = "Vehicle Lock Setup"; - function = "ACE_VehicleLock_fnc_moduleInit"; - scope = 2; - isGlobal = 1; - icon = QUOTE(PATHTOF(ui\IconLock_ca.paa)); - functionPriority = 0; - class Arguments { - class SetLockState { - displayName = "Set Lock State"; // Argument label - description = "Set lock state for all vehicles on map at start"; // Tooltip description - typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL" - class values { - class None {name = "As Is"; value = 0; default = 1;}; - class Side {name = "Locked"; value = 1;}; - class Unique {name = "Unlocked"; value = 2;}; + class LandVehicle; + class Car: LandVehicle { + class ACE_Actions { + MACRO_LOCK_ACTIONS }; - }; - class LockpickStrength { - displayName = "Global Lockpick Strength"; - description = "Global Time to lockpick (in seconds). Default: 10"; - typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL" - defaultValue = "10"; // Default text filled in the input box - }; }; - class ModuleDescription: ModuleDescription { - description = "Settings for lockpick strength and initial vehicle lock state. Removes ambiguous lock states.
Source: vehiclelock.pbo"; + class Tank: LandVehicle { + class ACE_Actions { + MACRO_LOCK_ACTIONS + }; + }; + class Air; + class Helicopter: Air { + class ACE_Actions { + MACRO_LOCK_ACTIONS + }; }; - }; - class ACE_VehicleLock_ModuleSyncedAssign: Module_F { - author = "$STR_ACE_Common_ACETeam"; - category = "ACE"; - displayName = "Vehicle Key Assign"; - function = "ACE_VehicleLock_fnc_moduleSync"; - scope = 2; - isGlobal = 1; - icon = QUOTE(PATHTOF(ui\IconLock_ca.paa)); - functionPriority = 0; - class Arguments {}; - class ModuleDescription: ModuleDescription { - description = "Sync with vehicles and players. Will handout custom keys to players for every synced vehicle. Only valid for objects present at mission start.
Source: vehiclelock.pbo"; - sync[] = {"AnyPlayer", "AnyVehicle"}; + class Logic; + class Module_F: Logic { + class ModuleDescription {}; + }; + class ACE_VehicleLock_ModuleSetup: Module_F { + author = "$STR_ACE_Common_ACETeam"; + category = "ACE"; + displayName = "Vehicle Lock Setup"; + function = QUOTE(DFUNC(moduleInit)); + scope = 2; + isGlobal = 0; + icon = QUOTE(PATHTOF(ui\IconLock_ca.paa)); + functionPriority = 0; + class Arguments { + class LockVehicleInventory { + displayName = "Lock Vehicle Inventory"; + description = "Locks the inventory of locked vehicles"; + typeName = "BOOL"; + defaultValue = 0; + }; + class SetLockState { + displayName = "Set Lock State"; // Argument label + description = "Set lock state for all vehicles on map at start"; // Tooltip description + typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL" + class values { + class None {name = "As Is"; value = 0; default = 1;}; + class Side {name = "Locked"; value = 1;}; + class Unique {name = "Unlocked"; value = 2;}; + }; + }; + class DefaultLockpickStrength { + displayName = "Default Lockpick Strength"; + description = "Default Time to lockpick (in seconds). Default: 10"; + typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL" + defaultValue = "10"; // Default text filled in the input box + }; + }; + class ModuleDescription: ModuleDescription { + description = "Settings for lockpick strength and initial vehicle lock state. Removes ambiguous lock states.
Source: vehiclelock.pbo"; + }; + }; + + class ACE_VehicleLock_ModuleSyncedAssign: Module_F { + author = "$STR_ACE_Common_ACETeam"; + category = "ACE"; + displayName = "Vehicle Key Assign"; + function = QUOTE(DFUNC(moduleSync)); + scope = 2; + isGlobal = 0; + icon = QUOTE(PATHTOF(ui\IconLock_ca.paa)); + functionPriority = 0; + class Arguments {}; + class ModuleDescription: ModuleDescription { + description = "Sync with vehicles and players. Will handout custom keys to players for every synced vehicle. Only valid for objects present at mission start.
Source: vehiclelock.pbo"; + sync[] = {"AnyPlayer", "AnyVehicle"}; + }; }; - }; }; diff --git a/addons/vehiclelock/CfgWeapons.hpp b/addons/vehiclelock/CfgWeapons.hpp index 157fb4bf60..4b20de15d7 100644 --- a/addons/vehiclelock/CfgWeapons.hpp +++ b/addons/vehiclelock/CfgWeapons.hpp @@ -1,41 +1,41 @@ class CfgWeapons { - class InventoryItem_Base_F; - class ACE_ItemCore; + class InventoryItem_Base_F; + class ACE_ItemCore; - class ACE_key_master: ACE_ItemCore { - author = "$STR_ACE_Common_ACETeam"; - displayName = "Vehicle Key: Master"; - descriptionShort = "$STR_ACE_Vehicle_Item_Master_Description"; - model = "\A3\weapons_F\ammo\mag_univ.p3d"; - picture = QUOTE(PATHTOF(ui\keyBlack.paa)); - scope = 2; - class ItemInfo: InventoryItem_Base_F { - mass = 0.1; - }; - }; - class ACE_key_lockpick: ACE_key_master { - displayName = "Lockpick"; - descriptionShort = "$STR_ACE_Vehicle_Item_Lockpick_Description"; - picture = QUOTE(PATHTOF(ui\lockpick.paa)); - }; - class ACE_key_west: ACE_key_master { - displayName = "Vehicle Key: West"; - descriptionShort = "$STR_ACE_Vehicle_Item_West_Description"; - picture = QUOTE(PATHTOF(ui\keyBlue.paa)); - }; - class ACE_key_east: ACE_key_master { - displayName = "Vehicle Key: East"; - descriptionShort = "$STR_ACE_Vehicle_Item_East_Description"; - picture = QUOTE(PATHTOF(ui\keyRed.paa)); - }; - class ACE_key_indp: ACE_key_master { - displayName = "Vehicle Key: Independent"; - descriptionShort = "$STR_ACE_Vehicle_Item_Indp_Description"; - picture = QUOTE(PATHTOF(ui\keyPurple.paa)); - }; - class ACE_key_civ: ACE_key_master { - displayName = "Vehicle Key: Civilian"; - descriptionShort = "$STR_ACE_Vehicle_Item_Civ_Description"; - picture = QUOTE(PATHTOF(ui\keyGreen.paa)); - }; + class ACE_key_master: ACE_ItemCore { + author = "$STR_ACE_Common_ACETeam"; + displayName = "Vehicle Key: Master"; + descriptionShort = "$STR_ACE_Vehicle_Item_Master_Description"; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + picture = QUOTE(PATHTOF(ui\keyBlack.paa)); + scope = 2; + class ItemInfo: InventoryItem_Base_F { + mass = 0; + }; + }; + class ACE_key_lockpick: ACE_key_master { + displayName = "Lockpick"; + descriptionShort = "$STR_ACE_Vehicle_Item_Lockpick_Description"; + picture = QUOTE(PATHTOF(ui\lockpick.paa)); + }; + class ACE_key_west: ACE_key_master { + displayName = "Vehicle Key: West"; + descriptionShort = "$STR_ACE_Vehicle_Item_West_Description"; + picture = QUOTE(PATHTOF(ui\keyBlue.paa)); + }; + class ACE_key_east: ACE_key_master { + displayName = "Vehicle Key: East"; + descriptionShort = "$STR_ACE_Vehicle_Item_East_Description"; + picture = QUOTE(PATHTOF(ui\keyRed.paa)); + }; + class ACE_key_indp: ACE_key_master { + displayName = "Vehicle Key: Independent"; + descriptionShort = "$STR_ACE_Vehicle_Item_Indp_Description"; + picture = QUOTE(PATHTOF(ui\keyPurple.paa)); + }; + class ACE_key_civ: ACE_key_master { + displayName = "Vehicle Key: Civilian"; + descriptionShort = "$STR_ACE_Vehicle_Item_Civ_Description"; + picture = QUOTE(PATHTOF(ui\keyGreen.paa)); + }; }; diff --git a/addons/vehiclelock/XEH_postInit.sqf b/addons/vehiclelock/XEH_postInit.sqf new file mode 100644 index 0000000000..c635de2bd3 --- /dev/null +++ b/addons/vehiclelock/XEH_postInit.sqf @@ -0,0 +1,5 @@ +#include "script_component.hpp" + +//Add Event Handlers +["VehicleLock_SetupCustomKey", {_this call FUNC(serverSetupCustomKeyEH)}] call EFUNC(common,addEventHandler); +["VehicleLock_SetVehicleLock", {_this call FUNC(setVehicleLockEH)}] call EFUNC(common,addEventHandler); diff --git a/addons/vehiclelock/XEH_preInit.sqf b/addons/vehiclelock/XEH_preInit.sqf index 80d1d6335f..bdab28fc75 100644 --- a/addons/vehiclelock/XEH_preInit.sqf +++ b/addons/vehiclelock/XEH_preInit.sqf @@ -8,11 +8,8 @@ PREP(hasKeyForVehicle); PREP(lockpick); PREP(moduleInit); PREP(moduleSync); +PREP(onOpenInventory); PREP(serverSetupCustomKeyEH); PREP(setVehicleLockEH); -//Add Event Handlers -["SetupCustomKey", {_this call FUNC(serverSetupCustomKeyEH)}] call EFUNC(common,addEventHandler); -["SetVehicleLock", {_this call FUNC(setVehicleLockEH)}] call EFUNC(common,addEventHandler); - ADDON = true; diff --git a/addons/vehiclelock/config.cpp b/addons/vehiclelock/config.cpp index 9031987315..700e27b3cb 100644 --- a/addons/vehiclelock/config.cpp +++ b/addons/vehiclelock/config.cpp @@ -17,6 +17,10 @@ class ACE_Settings { value = 10; typeName = "SCALAR"; }; + class GVAR(LockVehicleInventory) { + value = 0; + typeName = "BOOL"; + }; }; #include "CfgEventHandlers.hpp" diff --git a/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf b/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf index c64a0f890d..d683073286 100644 --- a/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf +++ b/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf @@ -1,45 +1,40 @@ /* - Name: ACE_VehicleLock_fnc_addKeyForVehicle - - Author: Pabst Mirror - - Description: - Adds a key to a unit that will open a vehicle - - Parameters: - 0: OBJECT - unit - 1: OBJECT - vehicle - 2: BOOL - custom key (true: custom key (magazine) - false: side key (item)) - - Returns: - Nothing - - Example: - [bob, car1, true] call ACE_VehicleLock_fnc_addKeyForVehicle; -*/ - + * Author: PabstMirror + * Adds a key to a unit that will open a vehicle + * Note: has global effects for Unit (will add items to remote unit) + * + * Arguments: + * 0: Unit + * 1: Vehicle + * 2: custom key (true: custom key (magazine) - false: side key (item)) + * + * Return Value: + * None + * + * Example: + * [ACE_player, car, true] call ACE_VehicleLock_fnc_addKeyForVehicle + * + * Public: Yes + */ #include "script_component.hpp" -private ["_unit","_veh","_useCustom","_previousMags","_newMags","_keyMagazine","_keyName"]; +private ["_previousMags","_newMags","_keyMagazine","_keyName"]; -_unit = [_this, 0, objNull, [objNull]] call bis_fnc_param; -_veh = [_this, 1, objNull, [objNull]] call bis_fnc_param; -_useCustom = [_this, 2, false, [false]] call bis_fnc_param; +PARAMS_3(_unit,_veh,_useCustom); -if (isNull _unit) exitWith {["addKeyForVehicleClient: null unit"] call BIS_fnc_error;}; -if (isNull _veh) exitWith {["addKeyForVehicleClient: null vehicle"] call BIS_fnc_error;}; +if (isNull _unit) exitWith {ERROR("null unit");}; +if (isNull _veh) exitWith {ERROR("null vehicle");}; if (_useCustom) then { - _previousMags = magazinesDetail _unit; - _unit addMagazine ["ACE_key_customKeyMagazine", 1]; - _newMags = (magazinesDetail _unit) - _previousMags; - if ((count _newMags) == 0) exitWith { - ["ACE_VehicleLock_fnc_addKeyForVehicle: failed to add magazine (inventory full?)"] call BIS_fnc_error; - }; - _keyMagazine = _newMags select 0; - TRACE_2("setting up key on server",_veh,_keyMagazine); - ["SetupCustomKey", [_veh, _keyMagazine]] call EFUNC(common,serverEvent); + _previousMags = magazinesDetail _unit; + _unit addMagazine ["ACE_key_customKeyMagazine", 1]; //addMagazine array has global effects + _newMags = (magazinesDetail _unit) - _previousMags; + if ((count _newMags) == 0) exitWith {ERROR("failed to add magazine (inventory full?)");}; + _keyMagazine = _newMags select 0; + TRACE_2("setting up key on server",_veh,_keyMagazine); + //Have the server run add the key to the vehicle's key array: + ["VehicleLock_SetupCustomKey", [_veh, _keyMagazine]] call EFUNC(common,serverEvent); } else { - _keyName = [_veh] call FUNC(getVehicleSideKey); - _unit addItem _keyName; + _keyName = [_veh] call FUNC(getVehicleSideKey); + _unit addItem _keyName; //addItem has global effects }; diff --git a/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf b/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf index 819c13c332..999f471ac3 100644 --- a/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf +++ b/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf @@ -1,27 +1,25 @@ /* -Name: ACE_VehicleLock_fnc_getVehicleSideKey - -Author: Pabst Mirror - -Description: - Returns the side specifc key for a vehicle - -Parameters: - 0: OBJECT - vehicle - -Returns: - STRING - Key Classname - -Example: - [tank1] call ACE_VehicleLock_fnc_getVehicleSideKey; -*/ - + * Author: PabstMirror + * Returns the side specifc key for a vehicle + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * The vehicle's side key classname + * + * Example: + * [tank1] call ACE_VehicleLock_fnc_getVehicleSideKey; + * + * Public: No + */ #include "script_component.hpp" -private ["_veh","_vehConfigSide","_vehSide","_returnValue"]; +private ["_vehConfigSide","_vehSide","_returnValue"]; -_veh = [_this, 0, objNull, [objNull]] call bis_fnc_param; -if (isNull _veh) exitWith {["ACE_VehicleLock_fnc_getVehicleSideKey: null vehicle"] call BIS_fnc_error; ""}; +PARAMS_1(_veh); + +if (isNull _veh) exitWith {ERROR("null vehicle"); "error"}; _vehConfigSide = [_veh, true] call BIS_fnc_objectSide; _vehSide = _veh getVariable [QGVAR(lockSide), _vehConfigSide]; @@ -32,7 +30,7 @@ switch (_vehSide) do { case (west): {_returnValue = "ACE_key_west"}; case (east): {_returnValue = "ACE_key_east"}; case (resistance): {_returnValue = "ACE_key_indp"}; -case (civilian): {_returnValue = "ACE_key_civ"}; + default {_returnValue = "ACE_key_civ"}; }; _returnValue diff --git a/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf b/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf index a1c899edad..779f4a363e 100644 --- a/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf +++ b/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf @@ -1,31 +1,27 @@ /* -Name: ACE_VehicleLock_fnc_hasKeyForVehicle - -Author: Pabst Mirror - -Description: - Returns if user has a valid key for the vehicle - -Parameters: - 0: OBJECT - unit - 1: OBJECT - vehicle - -Returns: - BOOL - unit has key for vehicle - -Example: - [bob, car] call ACE_VehicleLock_fnc_hasKeyForVehicle; -*/ - + * Author: PabstMirror + * Returns if user has a valid key for the vehicle + * + * Arguments: + * 0: Unit + * 1: Vehicle + * + * Return Value: + * unit has key for vehicle + * + * Example: + * [bob, car] call ACE_VehicleLock_fnc_hasKeyForVehicle; + * + * Public: No + */ #include "script_component.hpp" -private ["_unit","_veh","_returnValue","_sideKeyName","_customKeys"]; +private ["_returnValue","_sideKeyName","_customKeys"]; -_unit = [_this, 0, objNull, [objNull]] call bis_fnc_param; -_veh = [_this, 1, objNull, [objNull]] call bis_fnc_param; +PARAMS_2(_unit,_veh); -if (isNull _unit) exitWith {["ACE_VehicleLock_fnc_hasKeyForVehicle: null unit"] call BIS_fnc_error; false}; -if (isNull _veh) exitWith {["ACE_VehicleLock_fnc_hasKeyForVehicle: null vehicle"] call BIS_fnc_error; false}; +if (isNull _unit) exitWith {ERROR("null unit"); false}; +if (isNull _veh) exitWith {ERROR("null vehicle"); false}; _returnValue = false; @@ -39,7 +35,7 @@ if (_sideKeyName in (items _unit)) then {_returnValue = true}; //Check custom keys _customKeys = _veh getVariable [QGVAR(customKeys), []]; { - if (_x in (magazinesDetail _unit)) then {_returnValue = true;}; + if (_x in (magazinesDetail _unit)) then {_returnValue = true;}; } forEach _customKeys; _returnValue diff --git a/addons/vehiclelock/functions/fnc_lockpick.sqf b/addons/vehiclelock/functions/fnc_lockpick.sqf index c6a6369515..4fee354824 100644 --- a/addons/vehiclelock/functions/fnc_lockpick.sqf +++ b/addons/vehiclelock/functions/fnc_lockpick.sqf @@ -1,79 +1,66 @@ /* -Name: ACE_VehicleLock_fnc_lockpick - -Author: Pabst Mirror - -Description: - Handles lockpick functionality from action menu. - -Parameters: - 0: OBJECT - unit - 1: OBJECT - vehicle - 2: STRING - function type - "canLockpick": returns BOOL if lockpick is possible - "startLockpick": starts the process - "finishLockpick": on completions, opens the lock - -Returns: - BOOL - -Example: - [ACE_player, ACE_Interaction_Target, 'canLockpick'] call ACE_VehicleLock_fnc_lockpick -*/ - + * Author: PabstMirror + * Handles lockpick functionality. Three different functions: + * "canLockpick": returns BOOL if lockpick is possible + * "startLockpick": starts the process + * "finishLockpick": on completions, opens the lock + * + * Arguments: + * 0: Unit (player) + * 1: Vehicle + * 2: Function Type + * + * Return Value: + * "canLockpick" + * + * Example: + * [ACE_player, ACE_Interaction_Target, 'canLockpick'] call ACE_VehicleLock_fnc_lockpick + * + * Public: No + */ #include "script_component.hpp" -private ["_unit","_veh","_funcType","_vehLockpickStrenth","_returnValue", "_condition"]; +private ["_vehLockpickStrenth","_condition","_returnValue"]; -_unit = [_this, 0, objNull, [objNull]] call bis_fnc_param; -_veh = [_this, 1, objNull, [objNull]] call bis_fnc_param; -_funcType = [_this, 2, "", [""]] call bis_fnc_param; +PARAMS_3(_unit,_veh,_funcType); -if (isNull _unit) exitWith { - ["ACE_VehicleLock_fnc_lockpick: null unit"] call BIS_fnc_error; - false -}; -if (isNull _veh) exitWith { - ["ACE_VehicleLock_fnc_lockpick: null vehicle"] call BIS_fnc_error; - false -}; +if (isNull _unit) exitWith {ERROR("null unit"); false}; +if (isNull _veh) exitWith {ERROR("null vehicle"); false}; //need lockpick item -if (!("ACE_key_lockpick" in (items _unit))) exitWith { - false -}; +if (!("ACE_key_lockpick" in (items _unit))) exitWith {false}; _vehLockpickStrenth = _veh getVariable[QGVAR(lockpickStrength), GVAR(DefaultLockpickStrength)]; -if (typeName _vehLockpickStrenth != "SCALAR") exitWith { - ["ACE_VehicleLock_fnc_lockpick: 'ACE_vehicleLock_LockpickStrength' invalid: (%1)", _veh] call BIS_fnc_error; - false -}; +if (typeName _vehLockpickStrenth != "SCALAR") exitWith {ERROR("ACE_vehicleLock_LockpickStrength invalid"); false}; //-1 indicates unpickable lock -if (_vehLockpickStrenth < 0) exitWith { - false +if (_vehLockpickStrenth < 0) exitWith {false}; + +//Condition check for progressBar +_condition = { + PARAMS_1(_args); + EXPLODE_2_PVT(_args,_unit,_veh); + ((_unit distance _veh) < 5) && {(speed _veh) < 0.1} }; +if (!([[_unit, _veh]] call _condition)) exitWith {false}; + _returnValue = false; - switch (true) do { case (_funcType == "canLockpick"): { - _returnValue = true; - }; -case (_funcType == "startLockpick"): { - _condition = { - PARAMS_1(_args); - EXPLODE_2_PVT(_args,_unit,_veh); - ([_unit, objNull, []] call EFUNC(common,canInteractWith)) && ((_unit distance _veh) < 5) && ((speed _veh) < 1) + _returnValue = true; + }; +case (_funcType == "startLockpick"): { + [_vehLockpickStrenth, [_unit, _veh, "finishLockpick"], {(_this select 0) call FUNC(lockpick)}, {}, (localize "STR_ACE_Vehicle_Action_LockpickInUse"), _condition] call EFUNC(common,progressBar); + _returnValue = true; }; - [_vehLockpickStrenth, [_unit, _veh, "finishLockpick"], {(_this select 0) call FUNC(lockpick)}, {}, (localize "STR_ACE_Vehicle_Action_LockpickInUse"), _condition] call EFUNC(common,progressBar); - }; case (_funcType == "finishLockpick"): { - ["SetVehicleLock", [_veh], [_veh, false]] call EFUNC(common,targetEvent); - }; - default { - ["ACE_VehicleLock_fnc_lockpick: bad function type"] call BIS_fnc_error; - }; + ["VehicleLock_SetVehicleLock", [_veh], [_veh, false]] call EFUNC(common,targetEvent); + _returnValue = true; + }; + default { + ERROR("bad function type"); + }; }; -_returnValue; +_returnValue diff --git a/addons/vehiclelock/functions/fnc_moduleInit.sqf b/addons/vehiclelock/functions/fnc_moduleInit.sqf index a344185ab0..c26e8aacbd 100644 --- a/addons/vehiclelock/functions/fnc_moduleInit.sqf +++ b/addons/vehiclelock/functions/fnc_moduleInit.sqf @@ -1,22 +1,20 @@ /* -Name: ACE_VehicleLock_fnc_moduleInit - -Author: Pabst Mirror - -Description: - Function for setup module. Sets default lockpick strength, auto handout keys, and default lock state. - -Parameters: - 0: OBJECT - logic - 1: ignored - 2: BOOL - Module Activated -Returns: - Nothing - -Example: - called from module -*/ - + * Author: PabstMirror + * Function for setup module. Sets default lockpick strength and default lock state. + * + * Arguments: + * 0: The Module Logic Object + * 1: synced objects + * 2: Activated + * + * Return Value: + * None + * + * Example: + * [fromModule] call ACE_VehicleLock_fnc_hasKeyForVehicle; + * + * Public: No + */ #include "script_component.hpp" private ["_sideKeysAssignment", "_setLockState", "_lock"]; @@ -24,28 +22,28 @@ private ["_sideKeysAssignment", "_setLockState", "_lock"]; PARAMS_3(_logic,_syncedUnits,_activated); if (!_activated) exitWith {WARNING("Vehicle Lock Init Module - placed but not active");}; +if (!isServer) exitWith {}; + +//Set the GVAR for default lockpick strength +[_logic, QGVAR(DefaultLockpickStrength), "DefaultLockpickStrength"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(LockVehicleInventory), "LockVehicleInventory"] call EFUNC(common,readSettingFromModule); -_sideKeysAssignment = _logic getVariable["SideKeysAssignment", 0]; _setLockState = _logic getVariable["SetLockState", 0]; - -if (isServer) then { - [_logic, QGVAR(DefaultLockpickStrength), "LockpickStrength"] call EFUNC(common,readSettingFromModule); -}; - -//Run at mission start (anyone besides JIPs) -if (isServer || {player == player}) then { - { - if ((local _x) && {(_x isKindOf "Car") || (_x isKindOf "Tank") || (_x isKindOf "Helicopter")}) then { - //set lock state (eliminates the ambigious 1-"Default" and 3-"Locked for Player" states) - _lock = switch (_setLockState) do { - case (0): {(locked _x) in [2, 3]}; - case (1):{true}; - case (2):{false}; - }; - if (((_lock) && {(locked _x) != 2}) || {(!_lock) && {(locked _x) != 0}}) then { - TRACE_3("Setting Lock State", _lock, (typeOf _x), _x); - ["SetVehicleLock", [_x, _lock]] call EFUNC(common,localEvent); - }; - }; - } forEach vehicles; -}; +[{ + PARAMS_1(_setLockState); + { + if ((_x isKindOf "Car") || {_x isKindOf "Tank"} || {_x isKindOf "Helicopter"}) then { + //set lock state (eliminates the ambigious 1-"Default" and 3-"Locked for Player" states) + _lock = switch (_setLockState) do { + case (0): {(locked _x) in [2, 3]}; + case (1):{true}; + case (2):{false}; + }; + if (((_lock) && {(locked _x) != 2}) || {(!_lock) && {(locked _x) != 0}}) then { + TRACE_3("Setting Lock State", _lock, (typeOf _x), _x); + ["VehicleLock_SetVehicleLock", [_x], [_x, _lock]] call EFUNC(common,targetEvent); + }; + }; + } forEach vehicles; + //Delay call until mission start (so everyone has the eventHandler's installed) +}, [_setLockState], 0.25, 0.25] call EFUNC(common,waitAndExecute); diff --git a/addons/vehiclelock/functions/fnc_moduleSync.sqf b/addons/vehiclelock/functions/fnc_moduleSync.sqf index 60c23c5195..feed42e3ab 100644 --- a/addons/vehiclelock/functions/fnc_moduleSync.sqf +++ b/addons/vehiclelock/functions/fnc_moduleSync.sqf @@ -1,22 +1,20 @@ /* -Name: ACE_VehicleLock_fnc_moduleSync - -Author: Pabst Mirror - -Description: - Function for sync module. Assigns keys for all synced vehicles to any players that are synced. - -Parameters: - 0: OBJECT - logic - 1: ARRAY - synced objects (only objects at mission start, so JIP without AI won't be present) - -Returns: - Nothing - -Example: - called from module -*/ - + * Author: PabstMirror + * Function for sync module. Assigns keys for all synced vehicles to any players that are synced. + * + * Arguments: + * 0: The Module Logic Object + * 1: synced objects + * 2: Activated + * + * Return Value: + * None + * + * Example: + * [fromModule] call ACE_VehicleLock_fnc_moduleSync; + * + * Public: No + */ #include "script_component.hpp" PARAMS_3(_logic,_syncedObjects,_activated); @@ -24,29 +22,28 @@ PARAMS_3(_logic,_syncedObjects,_activated); if !(_activated) exitWith {WARNING("Vehicle Lock Sync Module - placed but not active");}; if (!isServer) exitWith {}; -_addKeyAfterGearAssign = { - private ["_syncedObjects", "_listOfVehicles"]; - _syncedObjects = _this select 0; - _listOfVehicles = []; - { - if ((_x isKindOf "Car") || (_x isKindOf "Tank") || (_x isKindOf "Helicopter")) then { - _listOfVehicles pushBack _x; +[{ + private ["_listOfVehicles"]; + PARAMS_1(_syncedObjects); + _listOfVehicles = []; + { + if ((_x isKindOf "Car") || (_x isKindOf "Tank") || (_x isKindOf "Helicopter")) then { + _listOfVehicles pushBack _x; + }; + } forEach _syncedObjects; + + if ((count _listOfVehicles) == 0) exitWith { //Verbose error for mission makers (only shows on server) + ["ACE_VehicleLock_fnc_moduleSync: no vehicles synced"] call BIS_fnc_error; }; - } forEach _syncedObjects; - if ((count _listOfVehicles) == 0) exitWith { //Verbose error for mission makers - ["ACE_VehicleLock_fnc_moduleSync: no vehicles synced"] call BIS_fnc_error; - }; + { + _unit = _x; + if (_unit isKindOf "CAManBase") then { + { + [_unit, _x, true] call FUNC(addKeyForVehicle); + } forEach _listOfVehicles; + }; + } forEach _syncedObjects; - { - _unit = _x; - if (_unit isKindOf "CAManBase") then { - { - [_unit, _x, true] call FUNC(addKeyForVehicle); - } forEach _listOfVehicles; - }; - } forEach _syncedObjects; -}; - -//Wait to add keys until various gear assigns have finished (~5 seconds) -[_addKeyAfterGearAssign, [_syncedObjects], 5, 1] call EFUNC(common,waitAndExecute); + //Wait to add keys until various gear assigns have finished (~5 seconds) +}, [_syncedObjects], 5, 1] call EFUNC(common,waitAndExecute); diff --git a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf new file mode 100644 index 0000000000..55fee28cc6 --- /dev/null +++ b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf @@ -0,0 +1,40 @@ +/* + * Author: PabstMirror + * Handles the inventory opening. + * + * Arguments: + * 0: Unit + * 1: Container + * + * Return Value: + * Handeled + * + * Example: + * [player, car] call ACE_VehicleLock_fnc_onOpenInventory; + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_2(_unit,_container); + +//Only check for player: +if (_unit != ace_player) exitWith {false}; + +_handeled = false; + +if (GVAR(LockVehicleInventory) && //if setting not enabled + {(vehicle ace_player) == ace_player} && //Player dismounted + {(_container isKindOf "Car") || (_container isKindOf "Tank") || (_container isKindOf "Helicopter")} && //container is a lockable veh + {(locked _container) in [2,3]} && //Vehicle is locked + {!([ace_player, _container] call FUNC(hasKeyForVehicle))} //player doesn't have key + ) then { + //Give feedback that vehicle is locked + playSound "ACE_Sound_Click"; + //don't open the vehicles inventory + _handeled = true; + //Just opens a dummy groundContainer + ACE_player action ["Gear", objNull]; +}; + +_handeled diff --git a/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf b/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf index f9a420841e..9d8a396e31 100644 --- a/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf +++ b/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf @@ -1,22 +1,19 @@ - /* - Name: ACE_VehicleLock_fnc_serverSetupCustomKeyEH - - Author: Pabst Mirror - - Description: - Adds a key (magazineDetail name) to approved keys for a vehicle - - Parameters: - 0: OBJECT - vehicle - 1: STRING - Magazine Name - - Returns: - Nothing - - Example: - [tank1, "someMagainze [id xx:yy]"] call ACE_VehicleLock_fnc_serverSetupCustomKeyEH; -*/ - +/* + * Author: PabstMirror + * On the server: Adds a key (magazineDetail name) to approved keys for a vehicle. + * + * Arguments: + * 0: Vehicle + * 1: Magazine Name + * + * Return Value: + * None + * + * Example: + * [tank1, "someMagainze [id xx:yy]"] call ACE_VehicleLock_fnc_serverSetupCustomKeyEH + * + * Public: Yes + */ #include "script_component.hpp" private ["_currentKeys"]; @@ -24,6 +21,7 @@ private ["_currentKeys"]; PARAMS_2(_veh,_key); if (!isServer) exitWith {ERROR("only run on server");}; +if (isNull _veh) exitWith {ERROR("null vehicle");}; if (_key == "") exitWith {ERROR("empty key string");}; _currentKeys = _veh getVariable [QGVAR(customKeys), []]; diff --git a/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf b/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf index 7aaa9b154c..cb51cb27a8 100644 --- a/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf +++ b/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf @@ -1,33 +1,25 @@ /* - Name: ACE_VehicleLock_fnc_setVehicleLockEH - - Author: Pabst Mirror - - Description: - Sets a vehicle lock state because of a "SetVehicleLock" event - - Parameters: - 0: OBJECT - vehicle - 1: BOOL - new lock state - - Returns: - Nothing - - Example: - [tank1, false] call ACE_VehicleLock_fnc_setVehicleLockEH; -*/ - + * Author: PabstMirror + * Sets a vehicle lock state because of a "VehicleLock_SetVehicleLock" event + * + * Arguments: + * 0: Vehicle + * 1: New lock state + * + * Return Value: + * None + * + * Example: + * [tank1, false] call ACE_VehicleLock_fnc_setVehicleLockEH; + * + * Public: Yes + */ #include "script_component.hpp" -private ["_veh","_isLocked","_lockNumber"]; +private ["_lockNumber"]; -_veh = [_this, 0, objNull, [objNull]] call bis_fnc_param; -_isLocked = [_this, 1, false, [false]] call bis_fnc_param; +PARAMS_2(_veh,_isLocked); _lockNumber = if (_isLocked) then {2} else {0}; - TRACE_2("Setting Lock State", _veh, _lockNumber); - _veh lock _lockNumber; - -// _veh setVariable ["ACE_LockedInventory", _isLocked, true]; //todo inventory lock From f101d40450e21ae572f2de955a4dd4aa810e4222 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 15 Mar 2015 13:10:06 -0500 Subject: [PATCH 12/61] Readme cleanup --- addons/vehiclelock/readme.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/addons/vehiclelock/readme.md b/addons/vehiclelock/readme.md index a1bd223a52..b05248d5a8 100644 --- a/addons/vehiclelock/readme.md +++ b/addons/vehiclelock/readme.md @@ -5,7 +5,7 @@ Adds keys as an item, to lock and unlock vehicles. Primary target would be role play or TVT, but has uses in all game types, even co-ops (e.g.: DAC AI will steal unlocked vehicles) Two key modes (can be used together): -Simple Side based keys (e.g. "ACE_key_west" works on any hunter) +Simple Side based keys (e.g. "ACE_key_west" works on any [WEST] vehicle like the M-ATV//hunter) Custom keys (one key will only open a specific vehicle and nothing else) #### Items Added: @@ -18,24 +18,20 @@ Custom keys (one key will only open a specific vehicle and nothing else) `ACE_key_civ` #### Magazine added: -`ACE_key_customKeyMagazine` (should never be manualy added, needs to be 'programed' to work on a vehicle) +`ACE_key_customKeyMagazine` (should never be manualy added, needs to be "programed" to work on a vehicle, see `ACE_VehicleLock_fnc_addKeyForVehicle`) ## For Mission Makers: #### Modules: -* Vehicle Lock Setup - Settings for lockpick strength and initial vehicle lock state. -* Vehicle Key Assign - Sync with vehicles and players. Will handout custom keys to players for every synced vehicle. - -#### Global Variable: -* `ACE_VehicleLock_DefaultLockpickStrength` - Time in seconds to lock pick globaly, can also set per-vehicle (-1 would disable) +* Vehicle Lock Setup - Settings for locking inventory of locked vehicles, default lockpick time, and initial vehicle lock state. +* Vehicle Key Assign - Sync with vehicles and players. Will handout custom keys to players for every synced vehicle. Will NOT work for JIP units. #### Vehicle setVariables: * `ACE_VehicleLock_lockSide` - SIDE: overrides a vehicle's side, allows indfor to use little-bird's with indp keys * `ACE_vehicleLock_lockpickStrength` - NUMBER: secons, determines how long lockpicking with take, overrides ACE_VehicleLock_DefaultLockpickStrength -* `ACE_VehicleLock_customKeys` - ARRAY: array of strings of magazinesDetails, use the following function to modify -`[bob, car1, true] call ACE_VehicleLock_fnc_addKeyForVehicle;` -will add a `ACE_magazine_customKey` to bob and program it to work on car1 +#### Public Functions: +`[bob, car1, true] call ACE_VehicleLock_fnc_addKeyForVehicle;` - will add a `ACE_magazine_customKey` to bob and program it to work on car1 ## Maintainers From d4624982f651880cf2994f03f5a6aa028a59f7a1 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 15 Mar 2015 13:13:13 -0500 Subject: [PATCH 13/61] Update readme.md --- addons/vehiclelock/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/vehiclelock/readme.md b/addons/vehiclelock/readme.md index b05248d5a8..dc013145aa 100644 --- a/addons/vehiclelock/readme.md +++ b/addons/vehiclelock/readme.md @@ -5,8 +5,8 @@ Adds keys as an item, to lock and unlock vehicles. Primary target would be role play or TVT, but has uses in all game types, even co-ops (e.g.: DAC AI will steal unlocked vehicles) Two key modes (can be used together): -Simple Side based keys (e.g. "ACE_key_west" works on any [WEST] vehicle like the M-ATV//hunter) -Custom keys (one key will only open a specific vehicle and nothing else) +* Simple Side based keys (e.g. "ACE_key_west" works on any [WEST] vehicle like the M-ATV//hunter) +* Custom keys (one key will only open a specific vehicle and nothing else) #### Items Added: From 3030b78ea24c5c0c5cb2a7357187cac4cc1ab554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Tue, 17 Mar 2015 00:37:28 -0300 Subject: [PATCH 14/61] Refactor the interact_menu so options for multiple objects can coexist inside a single action point --- .../functions/fnc_collectActiveActionTree.sqf | 2 +- addons/interact_menu/functions/fnc_render.sqf | 4 ++-- .../functions/fnc_renderBaseMenu.sqf | 3 +-- .../interact_menu/functions/fnc_renderMenu.sqf | 18 ++++++++++-------- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf index 42f762de3f..7e8da46014 100644 --- a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf +++ b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf @@ -69,4 +69,4 @@ if ((count _activeChildren) == 0 && ((_origActionData select 3) isEqualTo {})) e [] }; -[_origActionData, _activeChildren] +[_origActionData, _activeChildren, _object] diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf index 3930068c25..bb902e849b 100644 --- a/addons/interact_menu/functions/fnc_render.sqf +++ b/addons/interact_menu/functions/fnc_render.sqf @@ -142,8 +142,8 @@ if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then { drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,.75], _pos, 0.6*SafeZoneW, 0.6*SafeZoneW, GVAR(rotationAngle), "", 0.5, 0.025, "TahomaB"]; _foundTarget = true; GVAR(actionSelected) = true; - GVAR(selectedTarget) = (_closest select 0) select 0; GVAR(selectedAction) = (_closest select 0) select 1; + GVAR(selectedTarget) = (GVAR(selectedAction)) select 2; GVAR(selectedStatement) = ((GVAR(selectedAction)) select 0) select 3; _misMatch = false; @@ -153,7 +153,7 @@ if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then { _misMatch = true; } else { { - if(_x != (_hoverPath select _forEachIndex)) exitWith { + if !(_x isEqualTo (_hoverPath select _forEachIndex)) exitWith { _misMatch = true; }; } forEach GVAR(lastPath); diff --git a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf index e3a8a0c9a4..fd3cc4d668 100644 --- a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf @@ -66,12 +66,11 @@ _activeActionTree = [ _object, _uid, 0.2 ] call EFUNC(common,cachedCall); - // Check if there's something left for rendering if (count _activeActionTree == 0) exitWith {false}; //EXPLODE_2_PVT(_activeActionTree,_actionData,_actionChildren); -[_object, _activeActionTree, _pos, [180,360]] call FUNC(renderMenu); +[[], _activeActionTree, _pos, [180,360]] call FUNC(renderMenu); true diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index ad604b9fa5..459287424c 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -3,7 +3,7 @@ * Render an interaction menu and it's children recursively * * Argument: - * 0: Object + * 0: Parent path * 1: Action data * 2: 3D position * 3: Angle range available for rendering @@ -15,16 +15,18 @@ */ #include "script_component.hpp" -private ["_menuInSelectedPath", "_path", "_menuDepth", "_currentRenderDepth", "_x", "_offset", "_newPos", "_forEachIndex"]; +private ["_menuInSelectedPath", "_localPath", "_path", "_menuDepth", "_currentRenderDepth", "_x", "_offset", "_newPos", "_forEachIndex"]; -EXPLODE_4_PVT(_this,_object,_action,_pos,_angles); -EXPLODE_2_PVT(_action,_actionData,_activeChildren); +EXPLODE_4_PVT(_this,_parentPath,_action,_pos,_angles); +EXPLODE_3_PVT(_action,_actionData,_activeChildren,_actionObject); EXPLODE_2_PVT(_angles,_centerAngle,_maxAngleSpan); _menuDepth = (count GVAR(menuDepthPath)) - 1; // Store path to action -_path = [_object] + (_actionData select 7); +_localPath = _actionData select 7; +_path = +_parentPath; +_path pushBack [_localPath select ((count _localPath) - 1), _actionObject]; // Check if the menu is on the selected path _menuInSelectedPath = true; @@ -32,7 +34,7 @@ _menuInSelectedPath = true; if (_forEachIndex >= (count GVAR(menuDepthPath))) exitWith { _menuInSelectedPath = false; }; - if (_x != (GVAR(menuDepthPath) select _forEachIndex)) exitWith { + if !(_x isEqualTo (GVAR(menuDepthPath) select _forEachIndex)) exitWith { _menuInSelectedPath = false; }; } forEach _path; @@ -63,7 +65,7 @@ if (_angleSpan >= 305) then { _angle = _centerAngle - _angleSpan / 2; { - _target = _object; + _target = _actionObject; _player = ACE_player; _mod = (0.15 max (0.15 * ((positionCameraToWorld [0, 0, 0]) distance _pos))) / GVAR(selfMenuScale); @@ -74,7 +76,7 @@ _angle = _centerAngle - _angleSpan / 2; //drawLine3D [_pos, _newPos, [1,0,0,0.5]]; - [_object, _x, _newPos, [_angle, 140]] call FUNC(renderMenu); + [_path, _x, _newPos, [_angle, 140]] call FUNC(renderMenu); if (_angleSpan == 360) then { _angle = _angle + _angleSpan / (count _activeChildren); From 17fd051c798f9c11313cc1296508198017d4c8ae Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 17 Mar 2015 07:53:35 +0100 Subject: [PATCH 15/61] Rename Bloodbag action to BloodIV --- addons/medical/ACE_Medical_Treatments.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index b34403148e..d07d4df1a5 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -41,7 +41,7 @@ class ACE_Medical_Actions { callbackSuccess = QUOTE(DFUNC(treatmentBasic_epipen)); animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; }; - class Bloodbag: Bandage { + class BloodIV: Bandage { displayName = "Blood Bag"; displayNameProgress = "Transfusing Blood ..."; requiredMedic = 1; From 056625f0fee2b37741180654237e9cb993752b14 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 17 Mar 2015 07:53:50 +0100 Subject: [PATCH 16/61] Check leg/arm damage in setHitPointDamage as well. --- .../functions/fnc_setHitPointDamage.sqf | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_setHitPointDamage.sqf b/addons/medical/functions/fnc_setHitPointDamage.sqf index 473852b159..a9505b2150 100644 --- a/addons/medical/functions/fnc_setHitPointDamage.sqf +++ b/addons/medical/functions/fnc_setHitPointDamage.sqf @@ -1,6 +1,6 @@ /* * Author: KoffeinFlummi - * My very own setHitPointDamage since BIS's one is buggy when affecting a remote unit. + * My very own setHitPointDamage since BIS' one is buggy when affecting a remote unit. * It also doesn't change the overall damage. This does. * * Arguments: @@ -16,6 +16,10 @@ */ #include "script_component.hpp" +#define LEGDAMAGETRESHOLD1 1 +#define LEGDAMAGETRESHOLD2 1.7 +#define ARMDAMAGETRESHOLD1 1 +#define ARMDAMAGETRESHOLD2 1.7 private ["_unit", "_selection", "_damage", "_selections", "_damages", "_damageOld", "_damageSumOld", "_damageNew", "_damageSumNew", "_damageFinal"]; @@ -76,3 +80,22 @@ _unit setDamage _damageNew; _damageFinal = (_damages select _forEachIndex); _unit setHitPointDamage [_x, _damageFinal]; } forEach _selections; + +// Leg Damage +_legdamage = (_unit getHitPointDamage "HitLeftLeg") + (_unit getHitPointDamage "HitRightLeg"); +if (_legdamage >= LEGDAMAGETRESHOLD1) then { + if (_unit getHitPointDamage "HitLegs" != 1) then {_unit setHitPointDamage ["HitLegs", 1]}; +} else { + if (_unit getHitPointDamage "HitLegs" != 0) then {_unit setHitPointDamage ["HitLegs", 0]}; +}; +// @ŧodo: force prone for completely fucked up legs. + + +// Arm Damage +_armdamage = (_unit getHitPointDamage "HitLeftArm") + (_unit getHitPointDamage "HitRightArm"); +if (_armdamage >= ARMDAMAGETRESHOLD1) then { + if (_unit getHitPointDamage "HitHands" != 1) then {_unit setHitPointDamage ["HitHands", 1]}; +} else { + if (_unit getHitPointDamage "HitHands" != 0) then {_unit setHitPointDamage ["HitHands", 0]}; +}; +// @todo: Drop weapon for full damage. From 8a3e3d4b52e2ae13e4357f3b7743eb8f367881fe Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 17 Mar 2015 08:02:55 +0100 Subject: [PATCH 17/61] Remove superfluous todo --- addons/medical/functions/fnc_treatmentBasic_bandage.sqf | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/medical/functions/fnc_treatmentBasic_bandage.sqf b/addons/medical/functions/fnc_treatmentBasic_bandage.sqf index 39b910d6e4..4b07e989aa 100644 --- a/addons/medical/functions/fnc_treatmentBasic_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_bandage.sqf @@ -32,6 +32,4 @@ if (_selection == "all") then { _damage = ((_target getHitPointDamage _point) - BANDAGEHEAL) max 0; [_target, _point, _damage] call FUNC(setHitPointDamage); - - // @todo: leg/arm damage - in setHitPointDamage? }; From b470276f7f6d80566f8f7a51962c77a984153da0 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 17 Mar 2015 08:03:11 +0100 Subject: [PATCH 18/61] Close dialogs when falling unconscious. --- addons/medical/functions/fnc_setUnconscious.sqf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index dbb0d115c3..8b93d50f33 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -35,6 +35,12 @@ if (!local _unit) exitwith { _unit setvariable ["ACE_isUnconscious", true, true]; _unit setUnconscious true; +// @todo: mute player? +if (_unit == ACE_player) then { + if (visibleMap) then {openMap false}; + closeDialog 0; +}; + // If a unit has the launcher out, it will sometimes start selecting the primairy weapon while unconscious, // therefor we force it to select the primairy weapon before going unconscious if ((vehicle _unit) isKindOf "StaticWeapon") then { From acd3ca0d566ed53c47664985a146fcb70fec0c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Thu, 19 Mar 2015 13:00:10 -0300 Subject: [PATCH 19/61] Interact menu: - Allow dynamically adding children actions just-in-time - Added optional custom parameters for actions --- addons/interact_menu/XEH_preInit.sqf | 1 + .../interact_menu/functions/fnc_addAction.sqf | 18 +++++- .../functions/fnc_addClassAction.sqf | 18 +++++- .../functions/fnc_collectActiveActionTree.sqf | 10 ++- .../functions/fnc_compileMenu.sqf | 10 ++- .../functions/fnc_compileMenuSelfAction.sqf | 14 +++-- .../functions/fnc_createAction.sqf | 63 +++++++++++++++++++ addons/interact_menu/functions/fnc_keyUp.sqf | 2 +- .../functions/fnc_keyUpSelfAction.sqf | 2 +- 9 files changed, 124 insertions(+), 14 deletions(-) create mode 100644 addons/interact_menu/functions/fnc_createAction.sqf diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index 487f1c017f..9d50eb0a1c 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -7,6 +7,7 @@ PREP(addClassAction); PREP(compileMenu); PREP(compileMenuSelfAction); PREP(collectActiveActionTree); +PREP(createAction); PREP(keyDown); PREP(keyDownSelfAction); PREP(keyUp); diff --git a/addons/interact_menu/functions/fnc_addAction.sqf b/addons/interact_menu/functions/fnc_addAction.sqf index c7dd6ecab3..ef3c2196e6 100644 --- a/addons/interact_menu/functions/fnc_addAction.sqf +++ b/addons/interact_menu/functions/fnc_addAction.sqf @@ -14,6 +14,8 @@ * 7: Condition * 8: Distance * 9: Other parameters (Optional) + * 10: Insert children code (Optional) + * 11: Action parameters (Optional) * * Return value: * The entry full path, which can be used to remove the entry, or add children entries . @@ -27,7 +29,7 @@ EXPLODE_9_PVT(_this,_object,_typeNum,_fullPath,_displayName,_icon,_position,_statement,_condition,_distance); -private ["_varName","_actions","_params","_entry"]; +private ["_varName","_actions","_params","_insertChildren","_parameters","_entry"]; _varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum; _actions = _object getVariable [_varName, []]; @@ -40,6 +42,16 @@ if (count _this > 9) then { _params = _this select 9; }; +_insertChildren = {}; +if (count _this > 10) then { + _insertChildren = _this select 10; +}; + +_parameters = []; +if (count _this > 11) then { + _parameters = _this select 11; +}; + _entry = [ [ _displayName, @@ -49,7 +61,9 @@ _entry = [ _condition, _distance, _params, - + _fullPath + + _fullPath, + _insertChildren, + _parameters ], [] ]; diff --git a/addons/interact_menu/functions/fnc_addClassAction.sqf b/addons/interact_menu/functions/fnc_addClassAction.sqf index 4931328af2..a389b5bd8b 100644 --- a/addons/interact_menu/functions/fnc_addClassAction.sqf +++ b/addons/interact_menu/functions/fnc_addClassAction.sqf @@ -14,6 +14,8 @@ * 7: Condition * 8: Distance * 9: Other parameters (Optional) + * 10: Insert children code (Optional) + * 11: Action parameters (Optional) * * Return value: * The entry full path, which can be used to remove the entry, or add children entries . @@ -34,7 +36,7 @@ if (_typeNum == 0) then { [_objectType] call FUNC(compileMenuSelfAction); }; -private ["_varName","_actions","_params","_entry", "_parentLevel", "_foundParentLevel", "_fnc_findFolder"]; +private ["_varName","_actions","_params","_insertChildren","_parameters","_entry", "_parentLevel", "_foundParentLevel", "_fnc_findFolder"]; _varName = format [[QGVAR(Act_%1), QGVAR(SelfAct_%1)] select _typeNum, _objectType]; _actions = missionNamespace getVariable [_varName, []]; @@ -47,6 +49,16 @@ if (count _this > 9) then { _params = _this select 9; }; +_insertChildren = {}; +if (count _this > 10) then { + _insertChildren = _this select 10; +}; + +_parameters = []; +if (count _this > 11) then { + _parameters = _this select 11; +}; + // Search the class action trees and find where to insert the entry _parentLevel = _actions; _foundParentLevel = false; @@ -84,7 +96,9 @@ _entry = [ _condition, _distance, _params, - + _fullPath + + _fullPath, + _insertChildren, + _parameters ], [] ]; diff --git a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf index 7e8da46014..ca6dadd44f 100644 --- a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf +++ b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf @@ -22,12 +22,17 @@ _target = _object; _player = ACE_player; // Return nothing if the action itself is not active -if !([_target, ACE_player] call (_origActionData select 4)) exitWith { +if !([_target, ACE_player, _origActionData select 9] call (_origActionData select 4)) exitWith { [] }; _activeChildren = []; +// If there's a statement to dynamically insert children then execute it +if (count _origActionData > 8 && {!({} isEqualTo (_origActionData select 8))}) then { + _activeChildren = [_target, ACE_player, _origActionData select 9] call (_origActionData select 8); +}; + // Collect children class actions { _action = [_object, _x] call FUNC(collectActiveActionTree); @@ -64,9 +69,12 @@ _activeChildren = []; // If the original action has no statement, and no children, don't display it +/* if ((count _activeChildren) == 0 && ((_origActionData select 3) isEqualTo {})) exitWith { // @todo: Account for showDisabled? [] }; +*/ +//diag_log [_origActionData, _activeChildren, _object]; [_origActionData, _activeChildren, _object] diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index e6a2744f03..46e74fb220 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -27,7 +27,7 @@ if !(isNil {missionNamespace getVariable [_actionsVarName, nil]}) exitWith {}; private "_recurseFnc"; _recurseFnc = { private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_selection", "_condition", "_showDisabled", - "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_fullPath"]; + "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_fullPath", "_insertChildren"]; EXPLODE_2_PVT(_this,_actionsCfg,_parentPath); _actions = []; @@ -46,7 +46,9 @@ _recurseFnc = { if (_condition == "") then {_condition = "true"}; // Add canInteract (including exceptions) and canInteractWith to condition - _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, _target, %1)] call EGVAR(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; + _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, _target, %1)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; + + _insertChildren = compile (getText (_entryCfg >> "insertChildren")); _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0; _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0; @@ -68,7 +70,9 @@ _recurseFnc = { _condition, _distance, [_showDisabled,_enableInside,_canCollapse,_runOnHover], - _fullPath + _fullPath, + _insertChildren, + [] ], _children ]; diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index 81f4a25ef1..5c613caec2 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -27,7 +27,7 @@ if !(isNil {missionNamespace getVariable [_actionsVarName, nil]}) exitWith {}; private "_recurseFnc"; _recurseFnc = { private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_selection", "_condition", "_showDisabled", - "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_fullPath"]; + "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_fullPath", "_insertChildren"]; EXPLODE_2_PVT(_this,_actionsCfg,_parentPath); _actions = []; @@ -43,7 +43,9 @@ _recurseFnc = { if (_condition == "") then {_condition = "true"}; // Add canInteract (including exceptions) and canInteractWith to condition - _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, objNull, %1)] call EGVAR(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; + _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, objNull, %1)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; + + _insertChildren = compile (getText (_entryCfg >> "insertChildren")); _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0; _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0; @@ -65,7 +67,9 @@ _recurseFnc = { _condition, 10, //distace [_showDisabled,_enableInside,_canCollapse,_runOnHover], - _fullPath + _fullPath, + _insertChildren, + [] ], _children ]; @@ -89,7 +93,9 @@ _actions = [ { true }, 10, [false,true,false], - ["ACE_SelfActions"] + ["ACE_SelfActions"], + {}, + [] ], [_actionsCfg, ["ACE_SelfActions"]] call _recurseFnc ] diff --git a/addons/interact_menu/functions/fnc_createAction.sqf b/addons/interact_menu/functions/fnc_createAction.sqf new file mode 100644 index 0000000000..e7d53dab03 --- /dev/null +++ b/addons/interact_menu/functions/fnc_createAction.sqf @@ -0,0 +1,63 @@ +/* + * Author: CAA-Picard + * Creates an isolated ACE action + * Note: This function is NOT global. + * + * Argument: + * 0: Action name + * 1: Name of the action shown in the menu + * 2: Icon + * 3: Position (Position or Selection Name) or + * 4: Statement + * 5: Condition + * 6: Distance + * 7: Other parameters (Optional) + * 8: Insert children code (Optional) + * 9: Action parameters (Optional) + * + * Return value: + * Action + * + * Example: + * [[VulcanPinch"],"Vulcan Pinch","",[0,0,0],{_target setDamage 1;},{true},100,{},[parameters]] call ace_interact_menu_fnc_addAction; + * + * Public: No + */ +#include "script_component.hpp" + +EXPLODE_7_PVT(_this,_fullPath,_displayName,_icon,_position,_statement,_condition,_distance); + +private ["_actions","_params","_insertChildren","_parameters","_entry"]; + +_params = [false,false,false,false]; +if (count _this > 7) then { + _params = _this select 7; +}; + +_insertChildren = {}; +if (count _this > 8) then { + _insertChildren = _this select 8; +}; + +_parameters = []; +if (count _this > 9) then { + _parameters = _this select 9; +}; + +_entry = [ + [ + _displayName, + _icon, + _position, + _statement, + _condition, + _distance, + _params, + + _fullPath, + _insertChildren, + _parameters + ], + [] + ]; + +_entry diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf index 716d6dafd8..fe60c438b6 100644 --- a/addons/interact_menu/functions/fnc_keyUp.sqf +++ b/addons/interact_menu/functions/fnc_keyUp.sqf @@ -16,7 +16,7 @@ if(GVAR(actionSelected)) then { this = GVAR(selectedTarget); _player = ACE_Player; _target = GVAR(selectedTarget); - [GVAR(selectedTarget), ACE_player] call GVAR(selectedStatement); + [GVAR(selectedTarget), ACE_player, (GVAR(selectedAction) select 0) select 9] call GVAR(selectedStatement); }; if (GVAR(keyDown)) then { diff --git a/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf b/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf index 6346696d53..4603479e87 100644 --- a/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf @@ -20,7 +20,7 @@ if(GVAR(actionSelected)) then { this = GVAR(selectedTarget); _player = ACE_Player; _target = GVAR(selectedTarget); - [GVAR(selectedTarget), ACE_player] call GVAR(selectedStatement); + [GVAR(selectedTarget), ACE_player, (GVAR(selectedAction) select 0) select 9] call GVAR(selectedStatement); }; if (GVAR(keyDownSelfAction)) then { From f96126153cc2ec4fbde87f1261b43a8bad982ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Thu, 19 Mar 2015 14:45:05 -0300 Subject: [PATCH 20/61] Reenable hiding useless actions --- addons/interact_menu/functions/fnc_collectActiveActionTree.sqf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf index ca6dadd44f..547d5bb707 100644 --- a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf +++ b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf @@ -69,12 +69,11 @@ if (count _origActionData > 8 && {!({} isEqualTo (_origActionData select 8))}) t // If the original action has no statement, and no children, don't display it -/* if ((count _activeChildren) == 0 && ((_origActionData select 3) isEqualTo {})) exitWith { // @todo: Account for showDisabled? [] }; -*/ + //diag_log [_origActionData, _activeChildren, _object]; [_origActionData, _activeChildren, _object] From a3b913ad8b2a0167f0a84117262debad16e5a9ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Thu, 19 Mar 2015 15:04:48 -0300 Subject: [PATCH 21/61] Interact menu usability improvements: - Submenu scale as a function of the number of children - Added menu expansion animation to better communicate where the options come from - Unused action point are faded as soon as the user hovers a certain action point --- addons/interact_menu/XEH_preInit.sqf | 1 + addons/interact_menu/functions/fnc_render.sqf | 1 + .../functions/fnc_renderMenu.sqf | 34 ++++++++++++++----- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index 9d50eb0a1c..2687cf781c 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -41,6 +41,7 @@ GVAR(lastPath) = []; GVAR(expanded) = false; GVAR(startHoverTime) = diag_tickTime; +GVAR(expandedTime) = diag_tickTime; GVAR(iconCtrls) = []; GVAR(iconCount) = 0; diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf index bb902e849b..361b7031cc 100644 --- a/addons/interact_menu/functions/fnc_render.sqf +++ b/addons/interact_menu/functions/fnc_render.sqf @@ -166,6 +166,7 @@ if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then { } else { if(!GVAR(expanded) && diag_tickTime-GVAR(startHoverTime) > 0.25) then { GVAR(expanded) = true; + GVAR(expandedTime) = diag_tickTime; GVAR(menuDepthPath) = +GVAR(lastPath); // Execute the current action if it's run on hover diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index 459287424c..c5615ce66a 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -21,7 +21,7 @@ EXPLODE_4_PVT(_this,_parentPath,_action,_pos,_angles); EXPLODE_3_PVT(_action,_actionData,_activeChildren,_actionObject); EXPLODE_2_PVT(_angles,_centerAngle,_maxAngleSpan); -_menuDepth = (count GVAR(menuDepthPath)) - 1; +_menuDepth = (count GVAR(menuDepthPath)); // Store path to action _localPath = _actionData select 7; @@ -44,7 +44,7 @@ _menuInSelectedPath = true; _color = "#FFFFFFFF"; if(!_menuInSelectedPath) then { //_menuDepth > 0 && if (_menuDepth > 0) then { - _color = format ["#%1FFFFFF", [255 * ((((count _path) - 2)/_menuDepth) max 0.25)] call EFUNC(common,toHex)]; + _color = format ["#%1FFFFFF", [255 * ((((count _path) - 1)/_menuDepth) max 0.25)] call EFUNC(common,toHex)]; } else { _color = format ["#%1FFFFFF", [255 * 0.75] call EFUNC(common,toHex)]; }; @@ -57,24 +57,42 @@ GVAR(currentOptions) pushBack [_this, _pos, _path]; // Exit without rendering children if it isn't if !(_menuInSelectedPath) exitWith {true}; -private ["_angleSpan","_angle"]; +private ["_angleSpan","_angle","_angleInterval","_scale"]; _angleSpan = _maxAngleSpan min (55 * ((count _activeChildren) - 1)); if (_angleSpan >= 305) then { _angleSpan = 360; }; +_angleInterval = 55; +if (_angleSpan < 360) then { + if (count _activeChildren > 1) then { + _angleInterval = _angleSpan / (count _activeChildren - 1); + }; +} else { + _angleSpan / (count _activeChildren); +}; +if (count _activeChildren == 1) then { + _angleInterval = 60; +}; + +// Scale menu based on distance +_scale = (0.15 max (0.15 * ((positionCameraToWorld [0, 0, 0]) distance _pos))) / GVAR(selfMenuScale); +// Scale menu based on the amount of children +_scale = _scale * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.4) max 0.5); +// Animate menu scale +if (_menuInSelectedPath && (_menuDepth == count _path)) then { + _scale = _scale * (0.3 + 0.7 * (((diag_tickTime - GVAR(expandedTime)) * 8) min 1)); +}; _angle = _centerAngle - _angleSpan / 2; { _target = _actionObject; _player = ACE_player; - _mod = (0.15 max (0.15 * ((positionCameraToWorld [0, 0, 0]) distance _pos))) / GVAR(selfMenuScale); - - _offset = ((GVAR(refSystem) select 1) vectorMultiply (-_mod * cos _angle)) vectorAdd - ((GVAR(refSystem) select 2) vectorMultiply (-_mod * sin _angle)); + _offset = ((GVAR(refSystem) select 1) vectorMultiply (-_scale * cos _angle)) vectorAdd + ((GVAR(refSystem) select 2) vectorMultiply (-_scale * sin _angle)); _newPos = ((_pos call EFUNC(common,positionToASL)) vectorAdd _offset) call EFUNC(common,ASLToPosition); - //drawLine3D [_pos, _newPos, [1,0,0,0.5]]; + //drawLine3D [_pos, _newPos, [1,0,0,0.8]]; [_path, _x, _newPos, [_angle, 140]] call FUNC(renderMenu); From 3dda70a4afcbfd7a93c01b44a61fbbbbc7305316 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Thu, 19 Mar 2015 21:14:42 +0100 Subject: [PATCH 22/61] fixed variable name --- addons/medical/functions/fnc_displayPatientInformation.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index b4d7cb0fcc..afb5c0965b 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -76,7 +76,7 @@ if (_show) then { }foreach _openWounds; } else { { - _selectionBloodLoss set [_forEachIndex, _unit getHitPointDamage _x]; + _selectionBloodLoss set [_forEachIndex, _target getHitPointDamage _x]; } forEach ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; // @todo Injury texts? From 69e0ebf107b19fd00ecb66767691556092b18ed7 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Thu, 19 Mar 2015 21:31:56 +0100 Subject: [PATCH 23/61] Add injury texts --- .../functions/fnc_displayPatientInformation.sqf | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index afb5c0965b..0387547720 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -77,9 +77,15 @@ if (_show) then { } else { { _selectionBloodLoss set [_forEachIndex, _target getHitPointDamage _x]; - } forEach ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; - // @todo Injury texts? + if (_target getHitPointDamage _x > 0.1) then { + // @todo localize + _allInjuryTexts pushBack format ["%1 %2", + ["Lightly wounded", "Heavily wounded"] select (_target getHitPointDamage _x > 0.5), + ["head", "torso", "left arm", "right arm", "left leg", "right leg"] select _forEachIndex + ]; + }; + } forEach ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; }; // Handle the body image coloring From 97082e4ce323a336930c7d07fac5dfeacdd47d17 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Thu, 19 Mar 2015 22:01:40 +0100 Subject: [PATCH 24/61] Simplify condition checking in canTreat. --- addons/medical/functions/fnc_canTreat.sqf | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/addons/medical/functions/fnc_canTreat.sqf b/addons/medical/functions/fnc_canTreat.sqf index 0c48222977..6a49652301 100644 --- a/addons/medical/functions/fnc_canTreat.sqf +++ b/addons/medical/functions/fnc_canTreat.sqf @@ -39,19 +39,16 @@ if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exi _locations = getArray (_config >> "treatmentLocations"); _return = true; -if (isText (_config >> "Condition")) then { - _condition = getText(_config >> "condition"); - if (_condition != "") then { - if (isnil _condition) then { - _condition = compile _condition; - } else { - _condition = missionNamespace getvariable _condition; - }; - if (typeName _condition == "BOOL") then { - _return = _condition; - } else { - _return = [_caller, _target, _selectionName, _className] call _condition; - }; +if (getText (_config >> "condition") != "") then { + if (isnil _condition) then { + _condition = compile _condition; + } else { + _condition = missionNamespace getvariable _condition; + }; + if (typeName _condition == "BOOL") then { + _return = _condition; + } else { + _return = [_caller, _target, _selectionName, _className] call _condition; }; }; if (!_return) exitwith {false}; From 5589b80c705b45548b2770c01cd3c4293a2c5bb0 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Thu, 19 Mar 2015 22:27:12 +0100 Subject: [PATCH 25/61] Rewrite and fix isMedic --- addons/medical/functions/fnc_isMedic.sqf | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/addons/medical/functions/fnc_isMedic.sqf b/addons/medical/functions/fnc_isMedic.sqf index d3ece4c8b0..619245ef70 100644 --- a/addons/medical/functions/fnc_isMedic.sqf +++ b/addons/medical/functions/fnc_isMedic.sqf @@ -18,18 +18,7 @@ private ["_unit","_class","_return"]; _unit = _this select 0; _medicN = if (count _this > 1) then {_this select 1} else {1}; -_return = false; -if (GVAR(medicSetting) >= 1) then { - _class = _unit getvariable [QGVAR(medicClass), 0]; - if (GVAR(medicSetting) == 1) then { - _return = _class > 0; - } else { - if (_class >= _medicN) then { - _return = true; - }; - }; -} else { - _return = true; -}; +_class = _unit getVariable [QGVAR(medicClass), + getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "attendant")]; -_return; +(_class min GVAR(medicSetting)) >= (_medicN min GVAR(medicSetting)) From 07570fccd4a07423c45be5d250b23b244d116ff0 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Thu, 19 Mar 2015 22:34:12 +0100 Subject: [PATCH 26/61] Make isMedic even prettier --- addons/medical/functions/fnc_isMedic.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/medical/functions/fnc_isMedic.sqf b/addons/medical/functions/fnc_isMedic.sqf index 619245ef70..cc07948f4b 100644 --- a/addons/medical/functions/fnc_isMedic.sqf +++ b/addons/medical/functions/fnc_isMedic.sqf @@ -1,5 +1,5 @@ /* - * Author: Glowbal + * Author: Glowbal, KoffeinFlummi * Check if a unit is any medical class * * Arguments: @@ -21,4 +21,4 @@ _medicN = if (count _this > 1) then {_this select 1} else {1}; _class = _unit getVariable [QGVAR(medicClass), getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "attendant")]; -(_class min GVAR(medicSetting)) >= (_medicN min GVAR(medicSetting)) +_class >= _medicN min GVAR(medicSetting) From 84bf44e0261f6f5700da241902ec188a123ddd04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Thu, 19 Mar 2015 23:32:44 -0300 Subject: [PATCH 27/61] Refactoring of interact_menu: - Reordering of action members - Removed full path from actions, so they can be mounted under different paths if needed - Added api for creating actions - Api for adding actions for objects or classes --- addons/interact_menu/XEH_preInit.sqf | 12 +- .../interact_menu/functions/fnc_addAction.sqf | 73 ------------ .../functions/fnc_addActionToClass.sqf | 45 ++++++++ .../functions/fnc_addActionToObject.sqf | 35 ++++++ .../functions/fnc_addClassAction.sqf | 108 ------------------ .../functions/fnc_collectActiveActionTree.sqf | 40 +++---- .../functions/fnc_compileMenu.sqf | 27 +++-- .../functions/fnc_compileMenuSelfAction.sqf | 35 +++--- .../functions/fnc_createAction.sqf | 83 ++++++++------ .../functions/fnc_findActionNode.sqf | 56 +++++++++ addons/interact_menu/functions/fnc_keyUp.sqf | 2 +- .../functions/fnc_keyUpSelfAction.sqf | 2 +- .../functions/fnc_removeActionFromClass.sqf | 39 +++++++ ...ion.sqf => fnc_removeActionFromObject.sqf} | 63 +++++----- .../functions/fnc_removeClassAction.sqf | 72 ------------ addons/interact_menu/functions/fnc_render.sqf | 16 +-- .../functions/fnc_renderBaseMenu.sqf | 20 ++-- .../functions/fnc_renderMenu.sqf | 7 +- .../interact_menu/functions/fnc_splitPath.sqf | 23 ++++ 19 files changed, 353 insertions(+), 405 deletions(-) delete mode 100644 addons/interact_menu/functions/fnc_addAction.sqf create mode 100644 addons/interact_menu/functions/fnc_addActionToClass.sqf create mode 100644 addons/interact_menu/functions/fnc_addActionToObject.sqf delete mode 100644 addons/interact_menu/functions/fnc_addClassAction.sqf create mode 100644 addons/interact_menu/functions/fnc_findActionNode.sqf create mode 100644 addons/interact_menu/functions/fnc_removeActionFromClass.sqf rename addons/interact_menu/functions/{fnc_removeAction.sqf => fnc_removeActionFromObject.sqf} (53%) delete mode 100644 addons/interact_menu/functions/fnc_removeClassAction.sqf create mode 100644 addons/interact_menu/functions/fnc_splitPath.sqf diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index 2687cf781c..478b5b578d 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -2,22 +2,24 @@ ADDON = false; -PREP(addAction); -PREP(addClassAction); +PREP(addActionToClass); +PREP(addActionToObject); PREP(compileMenu); PREP(compileMenuSelfAction); PREP(collectActiveActionTree); PREP(createAction); +PREP(findActionNode); PREP(keyDown); PREP(keyDownSelfAction); PREP(keyUp); PREP(keyUpSelfAction); -PREP(removeAction); -PREP(removeClassAction); +PREP(removeActionFromClass); +PREP(removeActionFromObject); PREP(render); -PREP(renderIcon); PREP(renderBaseMenu); +PREP(renderIcon); PREP(renderMenu); +PREP(splitPath); GVAR(keyDown) = false; GVAR(keyDownSelfAction) = false; diff --git a/addons/interact_menu/functions/fnc_addAction.sqf b/addons/interact_menu/functions/fnc_addAction.sqf deleted file mode 100644 index ef3c2196e6..0000000000 --- a/addons/interact_menu/functions/fnc_addAction.sqf +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Author: commy2, NouberNou and CAA-Picard - * Add an ACE action to an object, under a certain config path - * Note: This function is NOT global. - * - * Argument: - * 0: Object the action should be assigned to - * 1: Type of action, 0 for actions, 1 for self-actions - * 2: Full path of the new action - * 3: Name of the action shown in the menu - * 4: Icon - * 5: Position (Position or Selection Name) or - * 6: Statement - * 7: Condition - * 8: Distance - * 9: Other parameters (Optional) - * 10: Insert children code (Optional) - * 11: Action parameters (Optional) - * - * Return value: - * The entry full path, which can be used to remove the entry, or add children entries . - * - * Example: - * [cursorTarget,0,["ACE_TapShoulderRight","VulcanPinch"],"Vulcan Pinch","",[0,0,0],{_target setDamage 1;},{true},100] call ace_interact_menu_fnc_addAction; - * - * Public: No - */ -#include "script_component.hpp" - -EXPLODE_9_PVT(_this,_object,_typeNum,_fullPath,_displayName,_icon,_position,_statement,_condition,_distance); - -private ["_varName","_actions","_params","_insertChildren","_parameters","_entry"]; - -_varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum; -_actions = _object getVariable [_varName, []]; -if((count _actions) == 0) then { - _object setVariable [_varName, _actions]; -}; - -_params = [false,false,false,false]; -if (count _this > 9) then { - _params = _this select 9; -}; - -_insertChildren = {}; -if (count _this > 10) then { - _insertChildren = _this select 10; -}; - -_parameters = []; -if (count _this > 11) then { - _parameters = _this select 11; -}; - -_entry = [ - [ - _displayName, - _icon, - _position, - _statement, - _condition, - _distance, - _params, - + _fullPath, - _insertChildren, - _parameters - ], - [] - ]; - -_actions pushBack _entry; - -_fullPath diff --git a/addons/interact_menu/functions/fnc_addActionToClass.sqf b/addons/interact_menu/functions/fnc_addActionToClass.sqf new file mode 100644 index 0000000000..c93342cfda --- /dev/null +++ b/addons/interact_menu/functions/fnc_addActionToClass.sqf @@ -0,0 +1,45 @@ +/* + * Author: CAA-Picard + * Insert an ACE action to a class, under a certain path + * Note: This function is NOT global. + * + * Argument: + * 0: TypeOf of the class + * 1: Type of action, 0 for actions, 1 for self-actions + * 2: Parent path of the new action + * 3: Action + * + * Return value: + * The entry full path, which can be used to remove the entry, or add children entries . + * + * Example: + * [typeOf cursorTarget, 0, ["ACE_TapShoulderRight"],VulcanPinchAction] call ace_interact_menu_fnc_addActionToClass; + * + * Public: No + */ +#include "script_component.hpp" + +EXPLODE_4_PVT(_this,_objectType,_typeNum,_parentPath,_action); + +// Ensure the config menu was compiled first +if (_typeNum == 0) then { + [_objectType] call FUNC(compileMenu); +} else { + [_objectType] call FUNC(compileMenuSelfAction); +}; + +private ["_varName","_actionTrees", "_parentNode"]; +_varName = format [[QGVAR(Act_%1), QGVAR(SelfAct_%1)] select _typeNum, _objectType]; +_actionTrees = missionNamespace getVariable [_varName, []]; +if((count _actionTrees) == 0) then { + missionNamespace setVariable [_varName, _actionTrees]; +}; + +_parentNode = [_actionTrees, _parentPath] call FUNC(findActionNode); +if (isNil {_parentNode}) exitWith {}; + +// Add action node as children of the correct node of action tree +(_parentNode select 1) pushBack [_action,[]]; + +// Return the full path +(+ _parentPath) pushBack (_action select 0) diff --git a/addons/interact_menu/functions/fnc_addActionToObject.sqf b/addons/interact_menu/functions/fnc_addActionToObject.sqf new file mode 100644 index 0000000000..223247057a --- /dev/null +++ b/addons/interact_menu/functions/fnc_addActionToObject.sqf @@ -0,0 +1,35 @@ +/* + * Author: CAA-Picard + * Insert an ACE action to an object, under a certain config path + * Note: This function is NOT global. + * + * Argument: + * 0: Object the action should be assigned to + * 1: Type of action, 0 for actions, 1 for self-actions + * 2: Parent path of the new action + * 3: Action + * + * Return value: + * The entry full path, which can be used to remove the entry, or add children entries . + * + * Example: + * [typeOf cursorTarget, 0, ["ACE_TapShoulderRight"],VulcanPinchAction] call ace_interact_menu_fnc_addActionToClass; + * + * Public: No + */ +#include "script_component.hpp" + +EXPLODE_4_PVT(_this,_object,_typeNum,_parentPath,_action); + +private ["_varName","_actionList"]; +_varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum; +_actionList = _object getVariable [_varName, []]; +if((count _actionList) == 0) then { + _object setVariable [_varName, _actionList]; +}; + +// Add action and parent path to the list of object actions +_actionList pushBack [_action, +_parentPath]; + +// Return the full path +(+ _parentPath) pushBack (_action select 0) diff --git a/addons/interact_menu/functions/fnc_addClassAction.sqf b/addons/interact_menu/functions/fnc_addClassAction.sqf deleted file mode 100644 index a389b5bd8b..0000000000 --- a/addons/interact_menu/functions/fnc_addClassAction.sqf +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Author: CAA-Picard - * Add an ACE action to a class, under a certain path - * Note: This function is NOT global. - * - * Argument: - * 0: TypeOf of the class - * 1: Type of action, 0 for actions, 1 for self-actions - * 2: Full path of the new action - * 3: Name of the action shown in the menu - * 4: Icon - * 5: Position (Position or Selection Name) or - * 6: Statement - * 7: Condition - * 8: Distance - * 9: Other parameters (Optional) - * 10: Insert children code (Optional) - * 11: Action parameters (Optional) - * - * Return value: - * The entry full path, which can be used to remove the entry, or add children entries . - * - * Example: - * [typeOf cursorTarget, 0,["ACE_TapShoulderRight","VulcanPinch"],"Vulcan Pinch","",[0,0,0],{_target setDamage 1;},{true},100] call ace_interact_menu_fnc_addClassAction; - * - * Public: No - */ -#include "script_component.hpp" - -EXPLODE_9_PVT(_this,_objectType,_typeNum,_fullPath,_displayName,_icon,_position,_statement,_condition,_distance); - -// Ensure the config menu was compiled first -if (_typeNum == 0) then { - [_objectType] call FUNC(compileMenu); -} else { - [_objectType] call FUNC(compileMenuSelfAction); -}; - -private ["_varName","_actions","_params","_insertChildren","_parameters","_entry", "_parentLevel", "_foundParentLevel", "_fnc_findFolder"]; - -_varName = format [[QGVAR(Act_%1), QGVAR(SelfAct_%1)] select _typeNum, _objectType]; -_actions = missionNamespace getVariable [_varName, []]; -if((count _actions) == 0) then { - missionNamespace setVariable [_varName, _actions]; -}; - -_params = [false,false,false,false]; -if (count _this > 9) then { - _params = _this select 9; -}; - -_insertChildren = {}; -if (count _this > 10) then { - _insertChildren = _this select 10; -}; - -_parameters = []; -if (count _this > 11) then { - _parameters = _this select 11; -}; - -// Search the class action trees and find where to insert the entry -_parentLevel = _actions; -_foundParentLevel = false; - -_fnc_findFolder = { - EXPLODE_3_PVT(_this,_fullPath,_level,_classActions); - - if (count _fullPath == _level + 1) then { - _parentLevel = _classActions; - _foundParentLevel = true; - }; - - if (_foundParentLevel) exitWith {}; - - { - EXPLODE_2_PVT(_x,_actionData,_actionChildren); - if (((_actionData select 7) select _level) isEqualTo (_fullPath select _level)) exitWith { - // The action should go somewhere in here - [_fullPath, _level + 1, _actionChildren] call _fnc_findFolder; - }; - } forEach _classActions; -}; - -[_fullPath, 0, _actions] call _fnc_findFolder; - -// Exit if there's no entry point to insert this action -if (!_foundParentLevel) exitWith {}; - -_entry = [ - [ - _displayName, - _icon, - _position, - _statement, - _condition, - _distance, - _params, - + _fullPath, - _insertChildren, - _parameters - ], - [] - ]; - -_parentLevel pushBack _entry; - -_fullPath diff --git a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf index 547d5bb707..f4ae2ff5c1 100644 --- a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf +++ b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf @@ -5,6 +5,7 @@ * Argument: * 0: Object * 1: Original action tree + * 2: Parent path * * Return value: * Active children @@ -13,29 +14,32 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_object,_origAction); +EXPLODE_3_PVT(_this,_object,_origAction,_parentPath); EXPLODE_2_PVT(_origAction,_origActionData,_origActionChildren); -private ["_resultingAction","_target","_player","_activeChildren","_action","_actionData","_x"]; +private ["_target","_player","_fullPath","_activeChildren","_action","_actionData","_x"]; _target = _object; _player = ACE_player; // Return nothing if the action itself is not active -if !([_target, ACE_player, _origActionData select 9] call (_origActionData select 4)) exitWith { +if !([_target, ACE_player, _origActionData select 6] call (_origActionData select 4)) exitWith { [] }; _activeChildren = []; // If there's a statement to dynamically insert children then execute it -if (count _origActionData > 8 && {!({} isEqualTo (_origActionData select 8))}) then { - _activeChildren = [_target, ACE_player, _origActionData select 9] call (_origActionData select 8); +if !({} isEqualTo (_origActionData select 5)) then { + _activeChildren = [_target, ACE_player, _origActionData select 6] call (_origActionData select 5); }; +_fullPath = +_parentPath; +_fullPath pushBack (_origActionData select 0); + // Collect children class actions { - _action = [_object, _x] call FUNC(collectActiveActionTree); + _action = [_object, _x, _fullPath] call FUNC(collectActiveActionTree); if ((count _action) > 0) then { _activeChildren pushBack _action; }; @@ -43,26 +47,15 @@ if (count _origActionData > 8 && {!({} isEqualTo (_origActionData select 8))}) t // Collect children object actions { - _action = _x; - _actionData = _action select 0; + EXPLODE_2_PVT(_x,_actionData,_pPath); // Check if the action is children of the original action - if ((count (_actionData select 7)) == (count (_origActionData select 7) + 1)) then { + if (count _pPath == count _fullPath && + {_pPath isEqualTo _fullPath}) then { - // Compare parent path to see if it's a suitable child - private "_isChild"; - _isChild = true; - { - if !(_x isEqualTo ((_actionData select 7) select _forEachIndex)) exitWith { - _isChild = false; - }; - } forEach (_origActionData select 7); - - if (_isChild) then { - _action = [_object, _action] call FUNC(collectActiveActionTree); - if ((count _action) > 0) then { - _activeChildren pushBack _action; - }; + _action = [_object, _action, _fullPath] call FUNC(collectActiveActionTree); + if ((count _action) > 0) then { + _activeChildren pushBack _action; }; }; } forEach GVAR(objectActions); @@ -75,5 +68,4 @@ if ((count _activeChildren) == 0 && ((_origActionData select 3) isEqualTo {})) e }; -//diag_log [_origActionData, _activeChildren, _object]; [_origActionData, _activeChildren, _object] diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index 46e74fb220..0fd4f6adb4 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -27,8 +27,8 @@ if !(isNil {missionNamespace getVariable [_actionsVarName, nil]}) exitWith {}; private "_recurseFnc"; _recurseFnc = { private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_selection", "_condition", "_showDisabled", - "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_fullPath", "_insertChildren"]; - EXPLODE_2_PVT(_this,_actionsCfg,_parentPath); + "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren"]; + EXPLODE_1_PVT(_this,_actionsCfg); _actions = []; for "_i" from 0 to (count _actionsCfg) - 1 do { @@ -55,24 +55,21 @@ _recurseFnc = { _canCollapse = (getNumber (_entryCfg >> "canCollapse")) > 0; _runOnHover = (getNumber (_entryCfg >> "runOnHover")) > 0; - _fullPath = (+ _parentPath); - _fullPath pushBack (configName _entryCfg); - _condition = compile _condition; - _children = [_entryCfg, _fullPath] call _recurseFnc; + _children = [_entryCfg] call _recurseFnc; _entry = [ [ + configName _entryCfg, _displayName, _icon, - _selection, _statement, _condition, - _distance, - [_showDisabled,_enableInside,_canCollapse,_runOnHover], - _fullPath, _insertChildren, - [] + [], + _selection, + _distance, + [_showDisabled,_enableInside,_canCollapse,_runOnHover] ], _children ]; @@ -85,20 +82,22 @@ _recurseFnc = { private "_actionsCfg"; _actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_Actions"; -missionNamespace setVariable [_actionsVarName, [_actionsCfg, []] call _recurseFnc]; +missionNamespace setVariable [_actionsVarName, [_actionsCfg] call _recurseFnc]; /* [ [ [ + "MyAction", "My Action", "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa", - [0,0,0], { (_this select 0) setVelocity [0,0,10]; }, { true }, + {}, + [], + [0,0,0], 1, [false,false,false] - ["ACE_MainActions","TeamManagement","MyAction"] ], [children actions] ] diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index 5c613caec2..ebccc2ca42 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -27,8 +27,8 @@ if !(isNil {missionNamespace getVariable [_actionsVarName, nil]}) exitWith {}; private "_recurseFnc"; _recurseFnc = { private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_selection", "_condition", "_showDisabled", - "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_fullPath", "_insertChildren"]; - EXPLODE_2_PVT(_this,_actionsCfg,_parentPath); + "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren"]; + EXPLODE_1_PVT(_this,_actionsCfg); _actions = []; for "_i" from 0 to (count _actionsCfg) - 1 do { @@ -52,24 +52,21 @@ _recurseFnc = { _canCollapse = (getNumber (_entryCfg >> "canCollapse")) > 0; _runOnHover = (getNumber (_entryCfg >> "runOnHover")) > 0; - _fullPath = (+ _parentPath); - _fullPath pushBack (configName _entryCfg); - _condition = compile _condition; - _children = [_entryCfg, _fullPath] call _recurseFnc; + _children = [_entryCfg] call _recurseFnc; _entry = [ [ + configName _entryCfg, _displayName, _icon, - [0,0,0], _statement, _condition, - 10, //distace - [_showDisabled,_enableInside,_canCollapse,_runOnHover], - _fullPath, _insertChildren, - [] + [], + [0,0,0], + 10, //distace + [_showDisabled,_enableInside,_canCollapse,_runOnHover] ], _children ]; @@ -86,18 +83,18 @@ _actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_SelfActions"; _actions = [ [ [ + "ACE_SelfActions", "Self Actions", "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa", - "Spine3", - { true }, - { true }, - 10, - [false,true,false], - ["ACE_SelfActions"], {}, - [] + { true }, + {}, + [], + "Spine3", + 10, + [false,true,false] ], - [_actionsCfg, ["ACE_SelfActions"]] call _recurseFnc + [_actionsCfg] call _recurseFnc ] ]; diff --git a/addons/interact_menu/functions/fnc_createAction.sqf b/addons/interact_menu/functions/fnc_createAction.sqf index e7d53dab03..785db2c8b9 100644 --- a/addons/interact_menu/functions/fnc_createAction.sqf +++ b/addons/interact_menu/functions/fnc_createAction.sqf @@ -7,57 +7,68 @@ * 0: Action name * 1: Name of the action shown in the menu * 2: Icon - * 3: Position (Position or Selection Name) or - * 4: Statement - * 5: Condition - * 6: Distance - * 7: Other parameters (Optional) - * 8: Insert children code (Optional) - * 9: Action parameters (Optional) + * 3: Statement + * 4: Condition + * 5: Insert children code (Optional) + * 6: Action parameters (Optional) + * 7: Position (Position or Selection Name) or (Optional) + * 8: Distance (Optional) + * 9: Other parameters (Optional) * * Return value: - * Action + * Action * * Example: - * [[VulcanPinch"],"Vulcan Pinch","",[0,0,0],{_target setDamage 1;},{true},100,{},[parameters]] call ace_interact_menu_fnc_addAction; + * [VulcanPinch","Vulcan Pinch",{_target setDamage 1;},{true},{},[parameters], [0,0,0], 100] call ace_interact_menu_fnc_createAction; * * Public: No */ #include "script_component.hpp" -EXPLODE_7_PVT(_this,_fullPath,_displayName,_icon,_position,_statement,_condition,_distance); +EXPLODE_5_PVT(_this,_actionName,_displayName,_icon,_statement,_condition); -private ["_actions","_params","_insertChildren","_parameters","_entry"]; +private ["_insertChildren","_customParams","_position","_distance","_params"]; -_params = [false,false,false,false]; -if (count _this > 7) then { - _params = _this select 7; +_insertChildren = if (count _this > 5) then { + _this select 5 +} else { + {} }; -_insertChildren = {}; -if (count _this > 8) then { - _insertChildren = _this select 8; +_customParams = if (count _this > 6) then { + _this select 6 +} else { + [] }; -_parameters = []; -if (count _this > 9) then { - _parameters = _this select 9; +_position = if (count _this > 7) then { + _this select 7 +} else { + [0,0,0] }; -_entry = [ - [ - _displayName, - _icon, - _position, - _statement, - _condition, - _distance, - _params, - + _fullPath, - _insertChildren, - _parameters - ], - [] - ]; +_distance = if (count _this > 8) then { + _this select 8 +} else { + 2 +}; -_entry +_params = if (count _this > 9) then { + _this select 9 +} else { + [false,false,false,false] +}; + +[ + _actionName, + _displayName, + _icon, + _statement, + _condition, + + _insertChildren, + _customParams, + _position, + _distance, + _params +] diff --git a/addons/interact_menu/functions/fnc_findActionNode.sqf b/addons/interact_menu/functions/fnc_findActionNode.sqf new file mode 100644 index 0000000000..41dd32b7d8 --- /dev/null +++ b/addons/interact_menu/functions/fnc_findActionNode.sqf @@ -0,0 +1,56 @@ +/* + * Author: CAA-Picard + * Return action point from path + * Note: This function is NOT global. + * + * Argument: + * 0: List of Action Tree + * 1: Path + * + * Return value: + * Action node . + * + * Example: + * [_actionTree, ["ACE_TapShoulderRight","VulcanPinchAction"]] call ace_interact_menu_fnc_findActionNode; + * + * Public: No + */ +#include "script_component.hpp" + +EXPLODE_2_PVT(_this,_actionTreeList,_parentPath); + +private ["_parentNode", "_foundParentNode", "_fnc_findFolder"]; + +// Hack to make this work on the root node too +if (count _parentPath == 0) exitWith { + [[],_actionTreeList] +}; + +// Search the class action trees and find where to insert the entry +_parentNode = [[],_actionTreeList]; +_foundParentNode = false; + +_fnc_findFolder = { + EXPLODE_3_PVT(_this,_parentPath,_level,_actionNode); + + { + EXPLODE_2_PVT(_x,_actionData,_actionChildren); + if ((_actionData select 0) isEqualTo (_parentPath select _level)) exitWith { + + if (count _parentPath == _level + 1) exitWith { + _parentNode = _x; + _foundParentNode = true; + }; + + // The action should go somewhere in here + [_parentPath, _level + 1, _x] call _fnc_findFolder; + }; + } forEach (_actionNode select 1); +}; + +[_parentPath, 0, [[],_actionTreeList]] call _fnc_findFolder; + +// Exit if there's no entry point to insert this action +if (!_foundParentNode) exitWith {}; + +_parentNode diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf index fe60c438b6..69f9697449 100644 --- a/addons/interact_menu/functions/fnc_keyUp.sqf +++ b/addons/interact_menu/functions/fnc_keyUp.sqf @@ -16,7 +16,7 @@ if(GVAR(actionSelected)) then { this = GVAR(selectedTarget); _player = ACE_Player; _target = GVAR(selectedTarget); - [GVAR(selectedTarget), ACE_player, (GVAR(selectedAction) select 0) select 9] call GVAR(selectedStatement); + [GVAR(selectedTarget), ACE_player, (GVAR(selectedAction) select 0) select 6] call GVAR(selectedStatement); }; if (GVAR(keyDown)) then { diff --git a/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf b/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf index 4603479e87..dd54490532 100644 --- a/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf @@ -20,7 +20,7 @@ if(GVAR(actionSelected)) then { this = GVAR(selectedTarget); _player = ACE_Player; _target = GVAR(selectedTarget); - [GVAR(selectedTarget), ACE_player, (GVAR(selectedAction) select 0) select 9] call GVAR(selectedStatement); + [GVAR(selectedTarget), ACE_player, (GVAR(selectedAction) select 0) select 6] call GVAR(selectedStatement); }; if (GVAR(keyDownSelfAction)) then { diff --git a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf new file mode 100644 index 0000000000..aee1675fa7 --- /dev/null +++ b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf @@ -0,0 +1,39 @@ +/* + * Author: CAA-Picard + * Removes an action from a class + * + * Argument: + * 0: TypeOf of the class + * 1: Type of action, 0 for actions, 1 for self-actions + * 2: Full path of the new action + * + * Return value: + * None + * + * Example: + * [typeOf cursorTarget, 0,["ACE_TapShoulderRight","VulcanPinch"]] call ace_interact_menu_fnc_removeActionFromClass; + * + * Public: No + */ +#include "script_component.hpp" + +EXPLODE_3_PVT(_this,_objectType,_typeNum,_fullPath); + +private ["_res","_varName","_actionTrees"]; +_res = _fullPath call FUNC(splitPath); +EXPLODE_2_PVT(_res,_parentPath,_actionName); + +_varName = format [[QGVAR(Act_%1), QGVAR(SelfAct_%1)] select _typeNum, _objectType]; +_actionTrees = missionNamespace getVariable [_varName, []]; + +_parentNode = [_actionTrees, _parentPath] call FUNC(findActionNode); +if (isNil {_parentNode}) exitWith {}; + +// Iterate through children of the father +{ + if (((_x select 0) select 0) == _actionName) exitWith { + (_parentNode select 1) deleteAt _forEachIndex; + }; +} forEach (_parentNode select 1); + +_parentLevel deleteAt _actionIndex; diff --git a/addons/interact_menu/functions/fnc_removeAction.sqf b/addons/interact_menu/functions/fnc_removeActionFromObject.sqf similarity index 53% rename from addons/interact_menu/functions/fnc_removeAction.sqf rename to addons/interact_menu/functions/fnc_removeActionFromObject.sqf index 3c6988971d..dc5fdc05f0 100644 --- a/addons/interact_menu/functions/fnc_removeAction.sqf +++ b/addons/interact_menu/functions/fnc_removeActionFromObject.sqf @@ -1,30 +1,33 @@ -/* - * Author: commy2, NouberNou and CAA-Picard - * Remove an action from an object - * - * Argument: - * 0: Object the action is assigned to - * 1: Type of action, 0 for actions, 1 for self-actions - * 2: Full path of the action to remove - * - * Return value: - * None - * - * Example: - * [cursorTarget,0,["ACE_TapShoulderRight","VulcanPinch"]] call ace_interact_menu_fnc_removeAction; - * - * Public: No - */ -#include "script_component.hpp" - -EXPLODE_3_PVT(_this,_object,_typeNum,_fullPath); - -private ["_varName","_actions"]; -_varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum; -_actions = _object getVariable [_varName, []]; - -{ - if (((_x select 0) select 7) isEqualTo _fullPath) exitWith { - _actions deleteAt _forEachIndex; - }; -} forEach _actions; +/* + * Author: commy2, NouberNou and CAA-Picard + * Removes an action from an object + * + * Argument: + * 0: Object the action is assigned to + * 1: Type of action, 0 for actions, 1 for self-actions + * 2: Full path of the action to remove + * + * Return value: + * None + * + * Example: + * [cursorTarget,0,["ACE_TapShoulderRight","VulcanPinch"]] call ace_interact_menu_fnc_removeActionFromObject; + * + * Public: No + */ +#include "script_component.hpp" + +EXPLODE_3_PVT(_this,_object,_typeNum,_fullPath); + +private ["_res","_varName","_actionList"]; +_res = _fullPath call FUNC(splitPath); +EXPLODE_2_PVT(_res,_parentPath,_actionName); + +_varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum; +_actionList = _object getVariable [_varName, []]; +{ + if (((_x select 0) select 0) isEqualTo _actionName && + {(_x select 1) isEqualTo _parentPath}) exitWith { + _actionList deleteAt _forEachIndex; + }; +} forEach _actionList; diff --git a/addons/interact_menu/functions/fnc_removeClassAction.sqf b/addons/interact_menu/functions/fnc_removeClassAction.sqf deleted file mode 100644 index 9ba29cd357..0000000000 --- a/addons/interact_menu/functions/fnc_removeClassAction.sqf +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Author: CAA-Picard - * Removes a class action from a class - * Note: This function is NOT global. - * - * Argument: - * 0: TypeOf of the class - * 1: Type of action, 0 for actions, 1 for self-actions - * 2: Full path of the new action - * - * Return value: - * None - * - * Example: - * [typeOf cursorTarget, 0,["ACE_TapShoulderRight","VulcanPinch"]] call ace_interact_menu_fnc_removeClassAction; - * - * Public: No - */ -#include "script_component.hpp" - -EXPLODE_3_PVT(_this,_objectType,_typeNum,_fullPath); - -private ["_varName","_actions","_parentLevel", "_actionIndex", "_foundAction", "_fnc_findFolder"]; - -_varName = format [[QGVAR(Act_%1), QGVAR(SelfAct_%1)] select _typeNum, _objectType]; -_actions = missionNamespace getVariable [_varName, []]; - -// Search the class action trees and find where to insert the entry -_parentLevel = _actions; -_actionIndex = -1; -_foundAction = false; - -_fnc_findFolder = { - EXPLODE_3_PVT(_this,_fullPath,_level,_classActions); - - if (count _fullPath == _level + 1) then { - _parentLevel = _classActions; - }; - - { - EXPLODE_2_PVT(_x,_actionData,_actionChildren); - if (((_actionData select 7) select _level) isEqualTo (_fullPath select _level)) exitWith { - if (_level + 1 == count _fullPath) exitWith { - _actionIndex = _forEachIndex; - _foundAction = true; - }; - [_fullPath, _level + 1, _actionChildren] call _fnc_findFolder; - }; - if (_foundAction) exitWith {}; - } forEach _classActions; -}; - -[_fullPath, 0, _actions] call _fnc_findFolder; - -// Exit if the action was not found -if (!_foundAction) exitWith {}; - -_entry = [ - [ - _displayName, - _icon, - _position, - _statement, - _condition, - _distance, - _params, - + _fullPath - ], - [] - ]; - -_parentLevel deleteAt _actionIndex; diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf index 361b7031cc..922027e2a0 100644 --- a/addons/interact_menu/functions/fnc_render.sqf +++ b/addons/interact_menu/functions/fnc_render.sqf @@ -41,17 +41,17 @@ if (GVAR(keyDown)) then { // Iterate through object actions, find base level actions and render them if appropiate _actionsVarName = format [QGVAR(Act_%1), typeOf _target]; - GVAR(objectActions) = _target getVariable [QGVAR(actions), []]; + GVAR(objectActionList) = _target getVariable [QGVAR(actions), []]; { - _action = _x; // Only render them directly if they are base level actions - if (count ((_action select 0) select 7) == 1) then { + if (count (_x select 1) == 0) then { // Try to render the menu + _action = [_x,[]]; if ([_target, _action] call FUNC(renderBaseMenu)) then { _numInteractions = _numInteractions + 1; }; }; - } forEach GVAR(objectActions); + } forEach GVAR(objectActionList); // Iterate through base level class actions and render them if appropiate _classActions = missionNamespace getVariable [_actionsVarName, []]; @@ -80,7 +80,7 @@ if (GVAR(keyDown)) then { // Iterate through object actions, find base level actions and render them if appropiate _actionsVarName = format [QGVAR(SelfAct_%1), typeOf _target]; - GVAR(objectActions) = _target getVariable [QGVAR(selfActions), []]; + GVAR(objectActionList) = _target getVariable [QGVAR(selfActions), []]; /* { _action = _x; @@ -88,7 +88,7 @@ if (GVAR(keyDown)) then { if (count (_action select 7) == 1) then { [_target, _action, 0, [180, 360]] call FUNC(renderMenu); }; - } forEach GVAR(objectActions); + } forEach GVAR(objectActionList); */ // Iterate through base level class actions and render them if appropiate @@ -171,12 +171,12 @@ if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then { // Execute the current action if it's run on hover private "_runOnHover"; - _runOnHover = ((GVAR(selectedAction) select 0) select 6) select 3; + _runOnHover = ((GVAR(selectedAction) select 0) select 9) select 3; if (_runOnHover) then { this = GVAR(selectedTarget); _player = ACE_Player; _target = GVAR(selectedTarget); - [GVAR(selectedTarget), ACE_player] call GVAR(selectedStatement); + [GVAR(selectedTarget), ACE_player, (GVAR(selectedAction) select 0) select 6] call GVAR(selectedStatement); }; }; }; diff --git a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf index fd3cc4d668..da01fa804f 100644 --- a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf @@ -4,7 +4,7 @@ * * Argument: * 0: Object - * 1: Action data + * 1: Action node * 2: 3D position (Optional) * * Return value: @@ -16,25 +16,25 @@ private ["_distance","_pos","_weaponDir","_ref","_cameraPos","_sPos","_activeActionTree"]; -EXPLODE_2_PVT(_this,_object,_baseAction); -EXPLODE_1_PVT(_baseAction,_actionData); +EXPLODE_2_PVT(_this,_object,_baseActionNode); +EXPLODE_1_PVT(_baseActionNode,_actionData); -_distance = _actionData select 5; +_distance = _actionData select 8; // Obtain a 3D position for the action if((count _this) > 2) then { _pos = _this select 2; } else { - if(typeName (_actionData select 2) == "ARRAY") then { - _pos = _object modelToWorld (_actionData select 2); + if(typeName (_actionData select 7) == "ARRAY") then { + _pos = _object modelToWorld (_actionData select 7); } else { - if ((_actionData select 2) == "weapon") then { + if ((_actionData select 7) == "weapon") then { // Craft a suitable position for weapon interaction _weaponDir = _object weaponDirection currentWeapon _object; _ref = _weaponDir call EFUNC(common,createOrthonormalReference); _pos = (_object modelToWorld (_object selectionPosition "righthand")) vectorAdd ((_ref select 2) vectorMultiply 0.1); } else { - _pos = _object modelToWorld (_object selectionPosition (_actionData select 2)); + _pos = _object modelToWorld (_object selectionPosition (_actionData select 7)); }; }; // Compensate for movement during the frame to get rid of jittering @@ -59,9 +59,9 @@ if ((_sPos select 1) < safeZoneY || (_sPos select 1) > safeZoneY + safeZon // Collect active tree private "_uid"; -_uid = format [QGVAR(ATCache_%1), (_actionData select 7) select 0]; +_uid = format [QGVAR(ATCache_%1), _actionData select 0]; _activeActionTree = [ - [_object, _baseAction], + [_object, _baseActionNode, []], DFUNC(collectActiveActionTree), _object, _uid, 0.2 ] call EFUNC(common,cachedCall); diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index c5615ce66a..26b07dd475 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -private ["_menuInSelectedPath", "_localPath", "_path", "_menuDepth", "_currentRenderDepth", "_x", "_offset", "_newPos", "_forEachIndex"]; +private ["_menuInSelectedPath", "_path", "_menuDepth", "_currentRenderDepth", "_x", "_offset", "_newPos", "_forEachIndex"]; EXPLODE_4_PVT(_this,_parentPath,_action,_pos,_angles); EXPLODE_3_PVT(_action,_actionData,_activeChildren,_actionObject); @@ -24,9 +24,8 @@ EXPLODE_2_PVT(_angles,_centerAngle,_maxAngleSpan); _menuDepth = (count GVAR(menuDepthPath)); // Store path to action -_localPath = _actionData select 7; _path = +_parentPath; -_path pushBack [_localPath select ((count _localPath) - 1), _actionObject]; +_path pushBack [_actionData select 0,_actionObject]; // Check if the menu is on the selected path _menuInSelectedPath = true; @@ -49,7 +48,7 @@ if(!_menuInSelectedPath) then { //_menuDepth > 0 && _color = format ["#%1FFFFFF", [255 * 0.75] call EFUNC(common,toHex)]; }; }; -[_actionData select 0, _color, _pos, 1, 1, 0, _actionData select 1, 0.5, 0.025, "TahomaB"] call FUNC(renderIcon); +[_actionData select 1, _color, _pos, 1, 1, 0, _actionData select 2, 0.5, 0.025, "TahomaB"] call FUNC(renderIcon); // Add the action to current options GVAR(currentOptions) pushBack [_this, _pos, _path]; diff --git a/addons/interact_menu/functions/fnc_splitPath.sqf b/addons/interact_menu/functions/fnc_splitPath.sqf new file mode 100644 index 0000000000..0bbe643adf --- /dev/null +++ b/addons/interact_menu/functions/fnc_splitPath.sqf @@ -0,0 +1,23 @@ +/* + * Author: CAA-Picard + * Take full path and split it between parent path and action name + * + * Argument: + * Full path of the action to remove + * + * Return value: + * 0: Parent path + * 1: Action name + * + * Public: No + */ +#include "script_component.hpp" + +private ["_parentPath","_actionName"]; +_parentPath = []; +for "_i" from 0 to (count _this) - 1 do { + _parentPath pushBack (_this select _i); +}; +_actionName = _this select ((count _this) - 1); + +[_parentPath, _actionName] From b854db0195f52f5a29c6aba5dc8c12f97f458032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Thu, 19 Mar 2015 23:33:11 -0300 Subject: [PATCH 28/61] Updated interact_menu api calls on ace_dragging --- addons/dragging/functions/fnc_setCarryable.sqf | 7 +++++-- addons/dragging/functions/fnc_setDraggable.sqf | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/addons/dragging/functions/fnc_setCarryable.sqf b/addons/dragging/functions/fnc_setCarryable.sqf index d1dd9cf1a9..630f212b97 100644 --- a/addons/dragging/functions/fnc_setCarryable.sqf +++ b/addons/dragging/functions/fnc_setCarryable.sqf @@ -48,5 +48,8 @@ if (_type in _initializedClasses) exitWith {}; _initializedClasses pushBack _type; GVAR(initializedClasses_carry) = _initializedClasses; -[_type, 0, ["ACE_MainActions", QGVAR(carry)], localize "STR_ACE_Dragging_Carry", "", "", {[_player, _target] call FUNC(carryObject)}, {[_player, _target] call FUNC(canCarry)}, 2] call EFUNC(interact_menu,addClassAction); -[_type, 0, ["ACE_MainActions", QGVAR(drop_carry)], localize "STR_ACE_Dragging_Drop", "", "", {[_player, _target] call FUNC(dropObject_carry)}, {[_player, _target] call FUNC(canDrop_carry)}, 2] call EFUNC(interact_menu,addClassAction); +_carryAction = [QGVAR(drag), localize "STR_ACE_Dragging_Carry", "", {[_player, _target] call FUNC(carryObject)}, {[_player, _target] call FUNC(canCarry)}] call EFUNC(interact_menu,createAction); +_dropAction = [QGVAR(drop), localize "STR_ACE_Dragging_Drop", "", {[_player, _target] call FUNC(dropObject_carry)}, {[_player, _target] call FUNC(canDrop_carry)}] call EFUNC(interact_menu,createAction); + +[_type, 0, ["ACE_MainActions"], _carryAction] call EFUNC(interact_menu,addActionToClass); +[_type, 0, ["ACE_MainActions"], _dropAction] call EFUNC(interact_menu,addActionToClass); diff --git a/addons/dragging/functions/fnc_setDraggable.sqf b/addons/dragging/functions/fnc_setDraggable.sqf index 82ebc201e2..b6e26a6f0a 100644 --- a/addons/dragging/functions/fnc_setDraggable.sqf +++ b/addons/dragging/functions/fnc_setDraggable.sqf @@ -48,5 +48,8 @@ if (_type in _initializedClasses) exitWith {}; _initializedClasses pushBack _type; GVAR(initializedClasses) = _initializedClasses; -[_type, 0, ["ACE_MainActions", QGVAR(drag)], localize "STR_ACE_Dragging_Drag", "", "", {[_player, _target] call FUNC(startDrag)}, {[_player, _target] call FUNC(canDrag)}, 2] call EFUNC(interact_menu,addClassAction); -[_type, 0, ["ACE_MainActions", QGVAR(drop)], localize "STR_ACE_Dragging_Drop", "", "", {[_player, _target] call FUNC(dropObject)}, {[_player, _target] call FUNC(canDrop)}, 2] call EFUNC(interact_menu,addClassAction); +_dragAction = [QGVAR(drag), localize "STR_ACE_Dragging_Drag", "", {[_player, _target] call FUNC(startDrag)}, {[_player, _target] call FUNC(canDrag)}] call EFUNC(interact_menu,createAction); +_dropAction = [QGVAR(drop), localize "STR_ACE_Dragging_Drop", "", {[_player, _target] call FUNC(dropObject)}, {[_player, _target] call FUNC(canDrop)}] call EFUNC(interact_menu,createAction); + +[_type, 0, ["ACE_MainActions"], _dragAction] call EFUNC(interact_menu,addActionToClass); +[_type, 0, ["ACE_MainActions"], _dropAction] call EFUNC(interact_menu,addActionToClass); From 66731c9cdd228570e92f8bbcb807dce029ae051e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Fri, 20 Mar 2015 00:53:58 -0300 Subject: [PATCH 29/61] First rough implementation of the passengers menu, with mounted main actions --- addons/interaction/CfgVehicles.hpp | 63 ++++++++++++++++--- addons/interaction/XEH_preInit.sqf | 2 + addons/interaction/config.cpp | 2 +- .../functions/fnc_addPassengerActions.sqf | 32 ++++++++++ .../functions/fnc_addPassengersActions.sqf | 43 +++++++++++++ addons/interaction/stringtable.xml | 3 + 6 files changed, 137 insertions(+), 8 deletions(-) create mode 100644 addons/interaction/functions/fnc_addPassengerActions.sqf create mode 100644 addons/interaction/functions/fnc_addPassengersActions.sqf diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 1bd1e81be2..a3b6187c6c 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -412,7 +412,14 @@ class CfgVehicles { condition = "true"; }; }; - class ACE_SelfActions {}; + class ACE_SelfActions { + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call FUNC(addPassengersActions)); + }; + }; }; class Tank: LandVehicle { class ACE_Actions { @@ -423,7 +430,14 @@ class CfgVehicles { condition = "true"; }; }; - class ACE_SelfActions {}; + class ACE_SelfActions { + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call FUNC(addPassengersActions)); + }; + }; }; class Air; @@ -436,7 +450,14 @@ class CfgVehicles { condition = "true"; }; }; - class ACE_SelfActions {}; + class ACE_SelfActions { + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call FUNC(addPassengersActions)); + }; + }; }; class Plane: Air { class ACE_Actions { @@ -447,7 +468,14 @@ class CfgVehicles { condition = "true"; }; }; - class ACE_SelfActions {}; + class ACE_SelfActions { + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call FUNC(addPassengersActions)); + }; + }; }; class Ship; @@ -469,7 +497,14 @@ class CfgVehicles { }; }; }; - class ACE_SelfActions {}; + class ACE_SelfActions { + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call FUNC(addPassengersActions)); + }; + }; }; class StaticWeapon: LandVehicle { @@ -481,7 +516,14 @@ class CfgVehicles { condition = "true"; }; }; - class ACE_SelfActions {}; + class ACE_SelfActions { + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call FUNC(addPassengersActions)); + }; + }; }; class StaticMortar; @@ -494,7 +536,14 @@ class CfgVehicles { condition = "true"; }; }; - class ACE_SelfActions {}; + class ACE_SelfActions { + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call FUNC(addPassengersActions)); + }; + }; }; class thingX; diff --git a/addons/interaction/XEH_preInit.sqf b/addons/interaction/XEH_preInit.sqf index 6efa72778e..671535c36d 100644 --- a/addons/interaction/XEH_preInit.sqf +++ b/addons/interaction/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP(addPassengerActions); +PREP(addPassengersActions); PREP(addSelectableItem); PREP(applyButtons); PREP(canInteractWithCivilian); diff --git a/addons/interaction/config.cpp b/addons/interaction/config.cpp index a39e8f8bf5..d5d9d63d69 100644 --- a/addons/interaction/config.cpp +++ b/addons/interaction/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common"}; + requiredAddons[] = {"ace_interact_menu"}; author[] = {"commy2", "KoffeinFlummi", "CAA-Picard", "bux578"}; authorUrl = "https://github.com/commy2/"; VERSION_CONFIG; diff --git a/addons/interaction/functions/fnc_addPassengerActions.sqf b/addons/interaction/functions/fnc_addPassengerActions.sqf new file mode 100644 index 0000000000..83b702a98b --- /dev/null +++ b/addons/interaction/functions/fnc_addPassengerActions.sqf @@ -0,0 +1,32 @@ +/* + * Author: CAA-Picard + * Mount unit actions inside passenger submenu + * Note: This function is NOT global. + * + * Argument: + * 0: Vehicle + * 1: Player + * 3: Parameters + * + * Return value: + * Children actions + * + * Public: No + */ +#include "script_component.hpp" + +EXPLODE_3_PVT(_this,_vehicle,_player,_parameters); + +diag_log "addPassengerActions"; + +private ["_unit","_actions"]; +_unit = _parameters select 0; + +_varName = format [QEGVAR(interact_menu,Act_%1), typeOf _unit]; +_actionTrees = missionNamespace getVariable [_varName, []]; + +_actions = []; +// Mount unit MainActions menu +_actions pushBack (_actionTrees select 0); + +_actions diff --git a/addons/interaction/functions/fnc_addPassengersActions.sqf b/addons/interaction/functions/fnc_addPassengersActions.sqf new file mode 100644 index 0000000000..678cbc55db --- /dev/null +++ b/addons/interaction/functions/fnc_addPassengersActions.sqf @@ -0,0 +1,43 @@ +/* + * Author: CAA-Picard + * Create one action per passenger + * Note: This function is NOT global. + * + * Argument: + * 0: Vehicle + * 1: Player + * 3: Parameters + * + * Return value: + * Children actions + * + * Public: No + */ +#include "script_component.hpp" + +EXPLODE_3_PVT(_this,_vehicle,_player,_parameters); + +private ["_actions"]; +_actions = []; + +{ + _unit = _x; + if (_x != _player) then { + _actions pushBack + [ + [ + str(_unit), + [_unit, true] call EFUNC(common,getName), + "", + {systemChat "selected passenger"}, + {true}, + {_this call FUNC(addPassengerActions);}, + [_unit] + ] call EFUNC(interact_menu,createAction), + [], + _unit + ]; + }; +} forEach crew _vehicle; + +_actions \ No newline at end of file diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 76898cd227..4b82908f2f 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -650,5 +650,8 @@ Interakcja Interactuar + + Passengers >> + From 3e69123454a4598084377a80856019fe6d2ac56d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Fri, 20 Mar 2015 00:55:13 -0300 Subject: [PATCH 30/61] Make collectActiveActionTree follow mounts correctly --- .../functions/fnc_collectActiveActionTree.sqf | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf index f4ae2ff5c1..36d4dc548d 100644 --- a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf +++ b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf @@ -17,7 +17,7 @@ EXPLODE_3_PVT(_this,_object,_origAction,_parentPath); EXPLODE_2_PVT(_origAction,_origActionData,_origActionChildren); -private ["_target","_player","_fullPath","_activeChildren","_action","_actionData","_x"]; +private ["_target","_player","_fullPath","_activeChildren","_dynamicChildren","_action","_actionData","_x"]; _target = _object; _player = ACE_player; @@ -27,15 +27,22 @@ if !([_target, ACE_player, _origActionData select 6] call (_origActionData selec [] }; +_fullPath = +_parentPath; +_fullPath pushBack (_origActionData select 0); _activeChildren = []; // If there's a statement to dynamically insert children then execute it if !({} isEqualTo (_origActionData select 5)) then { - _activeChildren = [_target, ACE_player, _origActionData select 6] call (_origActionData select 5); -}; + _dynamicChildren = [_target, ACE_player, _origActionData select 6] call (_origActionData select 5); -_fullPath = +_parentPath; -_fullPath pushBack (_origActionData select 0); + // Collect dynamic children class actions + { + _action = [_x select 2, _x, _fullPath] call FUNC(collectActiveActionTree); + if ((count _action) > 0) then { + _activeChildren pushBack _action; + }; + } forEach _dynamicChildren; +}; // Collect children class actions { From 66078a047b4ce42c0685595755060af094cb9f3d Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Fri, 20 Mar 2015 07:52:41 +0100 Subject: [PATCH 31/61] Wut. --- addons/medical/functions/fnc_handleDamage_basic.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_handleDamage_basic.sqf b/addons/medical/functions/fnc_handleDamage_basic.sqf index d082a62a81..aafa615c08 100644 --- a/addons/medical/functions/fnc_handleDamage_basic.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic.sqf @@ -149,7 +149,7 @@ if (_legdamage >= LEGDAMAGETRESHOLD1) then { } else { if (_unit getHitPointDamage "HitLegs" != 0) then {_unit setHitPointDamage ["HitLegs", 0]}; }; -// @ŧodo: force prone for completely fucked up legs. +// @todo: force prone for completely fucked up legs. // Arm Damage From 9082712ff7ff982c1d12a084f63ab8d241664302 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Fri, 20 Mar 2015 17:54:26 +0100 Subject: [PATCH 32/61] Replace Original with English keys in stringtable --- addons/medical/stringtable.xml | 184 ++++++++++++++++----------------- 1 file changed, 92 insertions(+), 92 deletions(-) diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 6b63aaa416..41706aa077 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -3,71 +3,71 @@ - Minor + Minor - Delayed + Delayed - Immediate + Immediate - Deceased + Deceased - None + None - Normal breathing + Normal breathing Дыхание в норме Respiración normal Respiration Normale Normalny oddech - No breathing + No breathing Дыхания нет No respira Apnée Brak oddechu - Difficult breathing + Difficult breathing Дыхание затруднено Dificultad para respirar Difficultée Respiratoire Trudności z oddychaniem - Almost no breathing + Almost no breathing Дыхания почти нет Casi sin respirar Respiration Faible Prawie brak oddechu - Bleeding + Bleeding Кровотечение Sangrando Seignement Krwawienie zewnętrzne - In Pain + In Pain Испытывает боль Con Dolor A De La Douleur W bólu - Lost a lot of Blood + Lost a lot of Blood Большая кровопотеря Mucha Sangre perdida A Perdu Bcp de Sang Stracił dużo krwi - Tourniquet [CAT] + Tourniquet [CAT] Жгут Torniquete [CAT] Garot [CAT] @@ -76,483 +76,483 @@ - Bandage (Basic) + Bandage (Basic) Повязка (обычная) Vendaje (Básico) Bandage (Standard) Bandaż (jałowy) - Used to cover a wound + Used to cover a wound Для перевязки ран Utilizado para cubrir una herida Utilisé Pour Couvrir Une Blessure Używany w celu przykrycia i ochrony miejsca zranienia - A dressing, that is a particular material used to cover a wound, which is applied over the wound once bleeding has been stemmed. + A dressing, that is a particular material used to cover a wound, which is applied over the wound once bleeding has been stemmed. Повязка, накладываемая поверх раны после остановки кровотечения. Un apósito, material específico utilizado para cubrir una herida, se aplica sobre la herida una vez ha dejado de sangrar. C'est un bandage, qui est fait d'un matériel spécial utiliser pour couvrir une blessure, qui peut etre appliquer des que le seignement as ete stopper. Opatrunek materiałowy, używany do przykrywania ran, zakładany na ranę po zatamowaniu krwawienia. - Packing Bandage + Packing Bandage Тампонирующая повязка Vendaje Compresivo Bandage Mèche Bandaż (uciskowy) - Used to pack medium to large wounds and stem the bleeding + Used to pack medium to large wounds and stem the bleeding Для тампонирования ран среднего и большого размера и остановки кровотечения. Se utiliza para vendar heridas medianas y grandes y detener el sangrado Utiliser pour remplire la cavité créé dans une blessure moyenne et grande. Używany w celu opatrywania średnich i dużych ran oraz tamowania krwawienia. - A bandage used to pack the wound to stem bleeding and facilitate wound healing. Packing a wound is an option in large polytrauma injuries. + A bandage used to pack the wound to stem bleeding and facilitate wound healing. Packing a wound is an option in large polytrauma injuries. Повязка для тампонирования раны, остановки кровотечения и лучшего заживления. При тяжелых сочетанных ранениях возможно тампонирование раны. Se utiliza para detener la hemorragia de una herida y favorecer su cicatrización. Se usa en grandes lesiones o politraumatismos. Un bandage servent a etre inseré dans les blessure pour éponger le seignement et faciliter la guerrison. Ce bandage est une option pour soigner les lession de politrauma. Opatrunek stosowany w celu zatrzymania krwawienia i osłony większych ran. - Bandage (Elastic) + Bandage (Elastic) Повязка (давящая) Vendaje (Elástico) Bandage (Élastique) Bandaż (elastyczny) - Bandage kit, Elastic + Bandage kit, Elastic Давящая повязка Vendaje (Elástico) Bandage Compressif Élastique Zestaw bandaży elastycznych. - + Ce bandage peut etre utiliser pour compresser la plaie afin de ralentire le seignement et assurer la tenue du bandage lors de mouvment. Elastyczna opaska podtrzymująca opatrunek oraz usztywniająca okolice stawów. Brinda una compresión uniforme y ofrece soporte extra a una zona lesionada - Tourniquet (CAT) + Tourniquet (CAT) Жгут Torniquete (CAT) Garot (CAT) Staza (typ. CAT) - Slows down blood loss when bleeding + Slows down blood loss when bleeding Уменьшает кровопотерю при кровотечении. Reduce la velocidad de pérdida de sangre Ralentit le seignement Zmniejsza ubytek krwi z kończyn w przypadku krwawienia. - A constricting device used to compress venous and arterial circulation in effect inhibiting or slowing blood flow and therefore decreasing loss of blood. + A constricting device used to compress venous and arterial circulation in effect inhibiting or slowing blood flow and therefore decreasing loss of blood. Жгут используется для прижатия сосудов, приводящего к остановке или значительному уменьшению кровотечения и сокращению кровопотери. Dispositivo utilizado para eliminar el pulso distal y de ese modo controlar la pérdida de sangre Un appareil servent a compresser les artères et veines afin de reduire la perte de sang. Opaska zaciskowa CAT służy do tamowanie krwotoków w sytuacji zranienia kończyn z masywnym krwawieniem tętniczym lub żylnym. - Morphine auto-injector + Morphine auto-injector Морфин в автоматическом шприце Morfina auto-inyectable Auto-injecteur de Morphine Autostrzykawka z morfiną - Used to combat moderate to severe pain experiences + Used to combat moderate to severe pain experiences Для снятия средних и сильных болевых ощущений. Usado para combatir los estados dolorosos moderados a severos Utiliser pour contrer les douleurs modéré à severes. Morfina. Ma silne działanie przeciwbólowe. - An analgesic used to combat moderate to severe pain experiences. + An analgesic used to combat moderate to severe pain experiences. Анальгетик для снятия средних и сильных болевых ощущений. Analgésico usado para combatir los estados dolorosos de moderado a severo. Un Analgésique puissant servant a contrer les douleur modéré a severe. Organiczny związek chemiczny z grupy alkaloidów. Ma silne działanie przeciwbólowe. - Atropin auto-injector + Atropin auto-injector Атропин в автоматическом шприце Atropina auto-inyectable Auto-injecteur d'Atropine Autostrzykawka AtroPen - Used in NBC scenarios + Used in NBC scenarios Применяется для защиты от ОМП Usado en escenarios NBQ Utiliser en cas d'attaque CBRN Atropina. Stosowana jako lek rozkurczowy i środek rozszerzający źrenice. - A drug used by the Military in NBC scenarios. + A drug used by the Military in NBC scenarios. Препарат, используемый в войсках для защиты от оружия массового поражения. Medicamento usado por Militares en escenarios NBQ Médicament utilisé par l'armée en cas d'attaque CBRN Atropina. Stosowana jako lek rozkurczowy i środek rozszerzający źrenice. Środek stosowany w przypadku zagrożeń NBC. - Epinephrine auto-injector + Epinephrine auto-injector Адреналин в автоматическом шприце Epinefrina auto-inyectable Auto-injecteur d'épinéphrine Autostrzykawka EpiPen - Increase heart rate and counter effects given by allergic reactions + Increase heart rate and counter effects given by allergic reactions Стимулирует работу сердца и купирует аллергические реакции. Aumenta la frecuencia cardiaca y contraresta los efectos de las reacciones alérgicas Augmente la Fréquance cadiaque et contré les effet d'une reaction Anaphylactique Adrenalina. Zwiększa puls i przeciwdziała efektom wywołanym przez reakcje alergiczne - A drug that works on a sympathetic response to dilate the bronchi, increase heart rate and counter such effects given by allergic reactions (anaphylaxis). Used in sudden cardiac arrest scenarios with decreasing positive outcomes. + A drug that works on a sympathetic response to dilate the bronchi, increase heart rate and counter such effects given by allergic reactions (anaphylaxis). Used in sudden cardiac arrest scenarios with decreasing positive outcomes. Препарат, вызывающий симпатическую реакцию, приводящую к расширению бронхов, увеличению частоты сердечных сокращений и купированию аллергических реакций (анафилактического шока). Применяется при остановке сердца с уменьшением вероятности благоприятного исхода. Medicamento que dilata los bronquios, aumenta la frecuencia cardiaca y contrarresta los efectos de las reacciones alérgicas (anafilaxis). Se utiliza en caso de paros cardiacos repentinos. Un medicament qui fonctione sur le systeme sympatique créan une dilatation des bronches, augmente la fréquance cardiaque et contre les effet d'une reaction alergique (anaphylaxie). Utiliser lors d'arret cardio-respiratoire pour augmenté les chances retrouver un ryhtme. EpiPen z adrenaliną ma działanie sympatykomimetyczne, tj. pobudza receptory alfa- i beta-adrenergiczne. Pobudzenie układu współczulnego prowadzi do zwiększenia częstotliwości pracy serca, zwiększenia pojemności wyrzutowej serca i przyśpieszenia krążenia wieńcowego. Pobudzenie oskrzelowych receptorów beta-adrenergicznych wywołuje rozkurcz mięśni gładkich oskrzeli, co w efekcie zmniejsza towarzyszące oddychaniu świsty i duszności. - Plasma IV (1000ml) + Plasma IV (1000ml) Плазма для в/в вливания (1000 мл) Plasma Intravenoso (1000ml) Plasma Sanguin IV (1000ml) Osocze IV (1000ml) - A volume-expanding blood supplement. + A volume-expanding blood supplement. Дополнительный препарат, применяемый при возмещении объема крови. Suplemento para expandir el volumen sanguíneo. Supplement visant a remplacer les volume sanguin Składnik krwi, używany do zwiększenia jej objętości. - A volume-expanding blood supplement. + A volume-expanding blood supplement. Дополнительный препарат, применяемый при возмещении объема крови. Suplemento para expandir el volumen sanguíneo. Supplement visant a remplacer le volume sanguin et remplace les plaquettes. Składnik krwi, używany do zwiększenia jej objętości. - Plasma IV (500ml) + Plasma IV (500ml) Плазма для в/в вливания (500 мл) Plasma Intravenoso (500ml) Plasma Sanguin IV (500ml) Osocze IV (500ml) - Plasma IV (250ml) + Plasma IV (250ml) Плазма для в/в вливания (250 мл) Plasma Intravenoso (250ml) Plasma Sanguin (250ml) Osocze IV (250ml) - Blood IV (1000ml) + Blood IV (1000ml) Кровь для переливания (1000 мл) Sangre Intravenosa (1000ml) Cullot Sanguin IV (1000ml) Krew IV (1000ml) - Blood IV, for restoring a patients blood (keep cold) + Blood IV, for restoring a patients blood (keep cold) Пакет крови для возмещения объема потерянной крови (хранить в холодильнике) Sangre Intravenosa, para restarurar el volumen sanguíneo (mantener frío) Cullot Sanguin IV, pour remplacer le volume sanguin (garder Réfrigeré) Krew IV, używana do uzupełnienia krwi u pacjenta, trzymać w warunkach chłodniczych - O Negative infusion blood used in strict and rare events to replenish blood supply usually conducted in the transport phase of medical care. + O Negative infusion blood used in strict and rare events to replenish blood supply usually conducted in the transport phase of medical care. Кровь I группы, резус-отрицательная, применяется по жизненным показаниям для возмещения объема потерянной крови на догоспитальном этапе оказания медицинской помощи. Cullot Sanguin O- ,utiliser seulement lors de perte sanguine majeur afin de remplacer le volume sanguin perdu. Habituelment utiliser lors du transport ou dans un etablisement de soin. Krew 0 Rh-, używana w rzadkich i szczególnych przypadkach do uzupełnienia krwi u pacjenta, zazwyczaj w trakcie fazie transportu rannej osoby do szpitala. Utilice sólo durante gran pérdida de sangre para reemplazar el volumen de sangre perdido. Uso habitual durante el transporte de heridos. - Blood IV (500ml) + Blood IV (500ml) Кровь для переливания (500 мл) Sangre Intravenosa (500ml) Cullot Sanguin IV (500ml) Krew IV (500ml) - Blood IV (250ml) + Blood IV (250ml) Кровь для переливания (250 мл) Sangre Intravenosa (250ml) Cullot Sanguin IV (250ml) Krew IV (250ml) - Saline IV (1000ml) + Saline IV (1000ml) Физраствор для в/в вливания (1000 мл) Solución Salina Intravenosa (1000ml) solution Saline 0.9% IV (1000ml) Solanka 0,9% IV (1000ml) - Saline IV, for restoring a patients blood + Saline IV, for restoring a patients blood Пакет физраствора для возмещения объема потерянной крови Solución Salina Intravenosa, para restaurar el volumen sanguíneo Solution Saline 0.9% IV, pour retablir temporairement la tention arteriel Solanka 0,9%, podawana dożylnie (IV), używana w celu uzupełnienia krwi u pacjenta - A medical volume-replenishing agent introduced into the blood system through an IV infusion. + A medical volume-replenishing agent introduced into the blood system through an IV infusion. Пакет физиологического раствора для возмещения объема потерянной крови путем внутривенного вливания. Suero fisiológico inoculado al torrente sanguíneo de forma intravenosa. Un remplacment temporaire pour rétablir la tention artériel lors de perte sanguine, étant ajouter par intraveineuse Używany w medycynie w formie płynu infuzyjnego jako środek nawadniający i uzupełniający niedobór elektrolitów, podawany dożylnie (IV). - Saline IV (500ml) + Saline IV (500ml) Физраствор для в/в вливания (500 мл) Solución Salina Intravenosa (500ml) Solution Saline 0.9% IV (500ml) Solanka 0,9% IV (500ml) - Saline IV (250ml) + Saline IV (250ml) Физраствор для в/в вливания (250 мл) Solución Salina Intravenosa (250ml) Solution Saline 0.9% IV (250ml) Solanka 0,9% IV (250ml) - Basic Field Dressing (QuikClot) + Basic Field Dressing (QuikClot) Первичный перевязочный пакет (QuikClot) Vendaje Básico (Coagulante) Bandage Regulier (Coagulant) Opatrunek QuikClot - QuikClot bandage + QuikClot bandage Гемостатический пакет QuikClot Venda Coagulante Bandage coagulant Podstawowy opatrunek stosowany na rany - + Un bandage servant a coaguler les seignements mineur à moyen. Proszkowy opatrunek adsorbcyjny przeznaczony do tamowania zagrażających życiu krwawień średniej i dużej intensywności. Vendaje Hemostático con coagulante que detiene el sangrado. - Personal Aid Kit + Personal Aid Kit Аптечка Kit de Soporte Vital Avanzado Équipement de support Vitale Apteczka osobista - Includes various treatment kit needed for stitching or advanced treatment + Includes various treatment kit needed for stitching or advanced treatment Содержит различные материалы и инструменты для зашивания ран и оказания специальной медпомощи. Incluye material médico para tratamientos avanzados Inclue du matériel medical pour les traitement avancé, tel les point de suture. Zestaw środków medycznych do opatrywania ran i dodatkowego leczenia po-urazowego - + - Surgical Kit + Surgical Kit Хирургический набор Kit Quirúrgico - Surgical Kit for in field advanced medical treatment + Surgical Kit for in field advanced medical treatment Набор для хирургической помощи в полевых условиях Kit Quirúrgico para el tratamiento avanzado en el campo de batalla - Surgical Kit for in field advanced medical treatment + Surgical Kit for in field advanced medical treatment Набор для хирургической помощи в полевых условиях Kit Quirúrgico para el tratamiento avanzado en el campo de batalla - Bodybag + Bodybag Мешок для трупов Bolsa para cadáveres - A bodybag for dead bodies + A bodybag for dead bodies Мешок для упаковки трупов Bolsa para cadáveres - A bodybag for dead bodies + A bodybag for dead bodies Мешок для упаковки трупов Bolsa para cadáveres - Blood Pressure + Blood Pressure Артериальное давление Presión Arterial - Checking Blood Pressure.. + Checking Blood Pressure.. Проверка артериального давления... Comprobando Presión Arterial... - You checked %1 + You checked %1 Вы осмотрели раненого %1 Examinando a %1 - You find a blood pressure of %2/%3 + You find a blood pressure of %2/%3 Артериальное давление %2/%3 La Presión Arterial es %2/%3 - You find a low blood pressure + You find a low blood pressure Давление низкое La Presión Arterial es baja - You find a normal blood pressure + You find a normal blood pressure Давление нормальное La Presión Arterial es normal - You find a high blood pressure + You find a high blood pressure Давление высокое La Presión Arterial es alta - You find no blood pressure + You find no blood pressure Давления нет No hay Presión Arterial - You fail to find a blood pressure + You fail to find a blood pressure Артериальное давление не определяется No puedes encontrar Presión Arterial - Pulse + Pulse Пульс Pulso - Checking Heart Rate.. + Checking Heart Rate.. Проверка пульса... Comprobando Pulso... - You checked %1 + You checked %1 Вы осмотрели раненого %1 Examinando a %1 - You find a Heart Rate of %2 + You find a Heart Rate of %2 Пульс %2 уд./мин. El Pulso es %2 - You find a weak Heart Rate + You find a weak Heart Rate Пульс слабый El Pulso es débil - You find a strong Heart Rate + You find a strong Heart Rate Пульс учащенный El Pulso está acelerado - You find a normal Heart Rate + You find a normal Heart Rate Пульс в норме El Pulso es bueno - You find no Heart Rate + You find no Heart Rate Пульс не прощупывается No tiene Pulso - Response + Response Реакция Reacciona - You check response of patient + You check response of patient Вы проверяете реакцию раненого Compruebas si el paciente reacciona - %1 is responsive + %1 is responsive %1 реагирует на раздражители %1 ha reaccionado - %1 is not responsive + %1 is not responsive %1 не реагирует %1 no reacciona - You checked %1 + You checked %1 Вы осмотрели раненого %1 Examinas a %1 - Bandaging + Bandaging Перевязка... Vendando - Bandaged + Bandaged Повязка наложена Vendado - You bandage %1 (%2) + You bandage %1 (%2) Вы перевязали раненого %1 (%2) Aplicas vendaje a %1 en %2 - %1 is bandaging you + %1 is bandaging you %1 перевязывает вас %1 te está vendando - You start stitching injures from %1 (%2) + You start stitching injures from %1 (%2) Вы зашиваете ранения от %1 (%2) Estás suturando heridas de %1 en %2 - Stitching + Stitching Наложение швов Suturando - You treat the airway of %1 + You treat the airway of %1 Вы интубируете раненого %1 Estás intubando a %1 - Airway + Airway Дыхательные пути Vías Aéreas - %1 is treating your airway + %1 is treating your airway %1 проводит вам интубацию %1 te está intubando From 33d4bf2f5a6869e7880a8982affdfc99cb1fcc3e Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Fri, 20 Mar 2015 18:21:03 +0100 Subject: [PATCH 33/61] Add localization for basic treatments and actions --- addons/medical/ACE_Medical_Treatments.hpp | 17 +-- addons/medical/CfgVehicles.hpp | 12 +- addons/medical/stringtable.xml | 170 ++++++++++++++++++++++ 3 files changed, 184 insertions(+), 15 deletions(-) diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index d07d4df1a5..2aaa5cf3d8 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -1,10 +1,9 @@ class ACE_Medical_Actions { class Basic { - // @todo: localization class Bandage { - displayName = "Bandage"; - displayNameProgress = "Bandaging ..."; + displayName = "$STR_ACE_Medical_Bandage"; + displayNameProgress = "$STR_ACE_Medical_Bandaging"; treatmentLocations[] = {"All"}; requiredMedic = 0; @@ -25,16 +24,16 @@ class ACE_Medical_Actions { animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; }; class Morphine: Bandage { - displayName = "Morphine"; - displayNameProgress = "Injecting Morphine ..."; + displayName = "$STR_ACE_Medical_Inject_Morphine"; + displayNameProgress = "$STR_ACE_Medical_Injecting_Morphine"; treatmentTime = 2; items[] = {QGVAR(morphine)}; callbackSuccess = QUOTE(DFUNC(treatmentBasic_morphine)); animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; }; class Epipen: Bandage { - displayName = "Epinephrine"; - displayNameProgress = "Injecting Epinephrine ..."; + displayName = "$STR_ACE_Medical_Inject_Epinephrine"; + displayNameProgress = "$STR_ACE_Medical_Injecting_Epinephrine"; requiredMedic = 1; treatmentTime = 3; items[] = {QGVAR(epipen)}; @@ -42,8 +41,8 @@ class ACE_Medical_Actions { animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; }; class BloodIV: Bandage { - displayName = "Blood Bag"; - displayNameProgress = "Transfusing Blood ..."; + displayName = "$STR_ACE_Medical_Transfuse_Blood"; + displayNameProgress = "$STR_ACE_Medical_Transfusing_Blood"; requiredMedic = 1; treatmentTime = 20; items[] = {{QGVAR(bloodIV), QGVAR(bloodIV_500), QGVAR(bloodIV_250)}}; diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index f5e28a520e..90c8a4d3bf 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -352,7 +352,7 @@ class CfgVehicles { statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); class Bandage_Head { - displayName = "Bandage Head"; + displayName = "$STR_ACE_Medical_Bandage_HitHead"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(canTreat)); statement = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(treatment)); @@ -415,7 +415,7 @@ class CfgVehicles { hotkey = "M"; enableInside = 1; class Bandage_Torso { - displayName = "Bandage Torso"; + displayName = "$STR_ACE_Medical_Bandage_HitBody"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(canTreat)); statement = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(treatment)); @@ -488,7 +488,7 @@ class CfgVehicles { statement = QUOTE([ARR_3(_target, true, 2)] call DFUNC(displayPatientInformation)); class Bandage_LeftArm { - displayName = "Bandage Left Arm"; + displayName = "$STR_ACE_Medical_Bandage_HitLeftArm"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(canTreat)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(treatment)); @@ -609,7 +609,7 @@ class CfgVehicles { runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 3)] call DFUNC(displayPatientInformation)); class Bandage_RightArm { - displayName = "Bandage Right Arm"; + displayName = "$STR_ACE_Medical_Bandage_HitRightArm"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreat)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(treatment)); @@ -731,7 +731,7 @@ class CfgVehicles { runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 4)] call DFUNC(displayPatientInformation)); class Bandage_LeftLeg { - displayName = "Bandage Left Leg"; + displayName = "$STR_ACE_Medical_Bandage_HitLeftLeg"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(canTreat)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(treatment)); @@ -843,7 +843,7 @@ class CfgVehicles { runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 5)] call DFUNC(displayPatientInformation)); class Bandage_RightLeg { - displayName = "Bandage Right Leg"; + displayName = "STR_ACE_Medical_Bandage_HitRightLeg"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(canTreat)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(treatment)); diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 41706aa077..66aabe53b0 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -1,6 +1,176 @@ + + + Inject Morphine + Morphin injizieren + Inyectar Morfina + Wstrzyknij morfinę + Aplikovat Morfin + Ввести морфин + Morphine + Morfium + Injetar Morfina + Inietta Morfina + + + Inject Epinephrine + Epinephrine injizieren + Inyectar Epinefrina + Wtrzyknij adrenalinę + Aplikovat Adrenalin + Ввести андреналил + Adrénaline + Adrenalin + Injetar Epinefrina + Inietta Epinefrina + + + Transfuse Blood + Bluttransfusion + Transfundir sangre + Przetocz krew + Transfúze krve + Перелить кровь + Transfusion + Infúzió + Transfundir Sangue + Effettua Trasfusione + + + Bandage + Verbinden + Venda + Bandaż + Obvázat + Pansement + Benda + Kötözés + Atadura + Перевязать + + + Bandage Head + Kopf verbinden + Vendar la cabeza + Bandażuj głowę + Obvázat hlavu + Перевязать голову + Pansement Tête + Fej kötözése + Atar Cabeça + Benda la testa + + + Bandage Torso + Torso verbinden + Vendar el torso + Bandażuj tors + Obvázat hruď + Перевязать торс + Pansement Torse + Felsőtest kötözése + Atar Tronco + Benda il torso + + + Bandage Left Arm + Arm links verbinden + Vendar el brazo izquierdo + Bandażuj lewe ramię + Obvázat levou ruku + Перевязать левую руку + Pansement Bras Gauche + Bal kar kötözése + Atar Braço Esquerdo + Benda il braccio sinistro + + + Bandage Right Arm + Arm rechts verbinden + Vendar el brazo derecho + Bandażuj prawe ramię + Obvázat pravou ruku + Перевязать правую руку + Pansement Bras Droit + Jobb kar kötözése + Atar Braço Direito + Benda il braccio destro + + + Bandage Left Leg + Bein links verbinden + Vendar la pierna izquierda + Bandażuj lewą nogę + Obvázat levou nohu + Перевязать левую ногу + Pansement Jambe Gauche + Bal láb kötözése + Atar Perna Esquerda + Benda la gamba sinistra + + + Bandage Right Leg + Bein rechts verbinden + Vendar la pierna derecha + Bandażuj prawą nogę + Obvázat pravou nohu + Перевязать правую ногу + Pansement Jambe Droite + Jobb láb kötözése + Atar Perna Direita + Benda la gamba destra + + + Injecting Morphine ... + Morphin injizieren ... + Inyectando Morfina ... + Wstrzykiwanie morfiny ... + Aplikuju Morfin ... + Введение морфина... + Injection de Morphine... + Morfium beadása... + Injetando Morfina ... + Inietto la morfina ... + + + Injecting Epinephrine ... + Epinephrine injizieren ... + Inyectando Epinefrina ... + Wstrzykiwanie adrenaliny ... + Aplikuju Adrenalin ... + Введение андреналина + Injection d'Adrénaline ... + Adrenalin beadása... + Injetando Epinefrina ... + Inietto l'epinefrina ... + + + Transfusing Blood ... + Bluttransfusion ... + Realizando transfusión ... + Przetaczanie krwi ... + Probíhá transfúze krve ... + Переливание крови... + Transfusion Sanguine ... + Infúzió... + Transfundindo Sangue ... + Effettuo la trasfusione ... + + + Bandaging ... + Verbinden ... + Vendando ... + Bandażowanie ... + Obvazuji ... + Pansement ... + Sto applicando la benda ... + Bekötözés... + Atando ... + Перевязывание.... + + Minor From 6f8b5cc676cdbe664f475fbb7e43f3a18d953304 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Fri, 20 Mar 2015 23:53:25 +0100 Subject: [PATCH 34/61] Fix missing dollar sign --- addons/medical/CfgVehicles.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 90c8a4d3bf..caef067f65 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -843,7 +843,7 @@ class CfgVehicles { runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 5)] call DFUNC(displayPatientInformation)); class Bandage_RightLeg { - displayName = "STR_ACE_Medical_Bandage_HitRightLeg"; + displayName = "$STR_ACE_Medical_Bandage_HitRightLeg"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(canTreat)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(treatment)); From 88fb2765e39ac469576b90b8f4b8ff5cd596196f Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Sat, 21 Mar 2015 00:21:30 +0100 Subject: [PATCH 35/61] Standardize actions across basic and advanced --- addons/medical/ACE_Medical_Treatments.hpp | 4 +-- addons/medical/CfgVehicles.hpp | 13 +++---- addons/medical/CfgWeapons.hpp | 36 +++++++++---------- .../functions/fnc_handleDamage_basic.sqf | 3 +- .../functions/fnc_treatmentBasic_epipen.sqf | 1 - .../functions/fnc_treatmentBasic_morphine.sqf | 2 +- 6 files changed, 29 insertions(+), 30 deletions(-) diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index 2aaa5cf3d8..24a638ac5f 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -31,12 +31,12 @@ class ACE_Medical_Actions { callbackSuccess = QUOTE(DFUNC(treatmentBasic_morphine)); animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; }; - class Epipen: Bandage { + class Epinephrine: Bandage { displayName = "$STR_ACE_Medical_Inject_Epinephrine"; displayNameProgress = "$STR_ACE_Medical_Injecting_Epinephrine"; requiredMedic = 1; treatmentTime = 3; - items[] = {QGVAR(epipen)}; + items[] = {QGVAR(epinephrine)}; callbackSuccess = QUOTE(DFUNC(treatmentBasic_epipen)); animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; }; diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index caef067f65..e5aa486241 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -351,7 +351,7 @@ class CfgVehicles { runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); - class Bandage_Head { + class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitHead"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(canTreat)); @@ -414,7 +414,8 @@ class CfgVehicles { priority = 2; hotkey = "M"; enableInside = 1; - class Bandage_Torso { + + class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitBody"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(canTreat)); @@ -487,7 +488,7 @@ class CfgVehicles { runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 2)] call DFUNC(displayPatientInformation)); - class Bandage_LeftArm { + class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitLeftArm"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(canTreat)); @@ -608,7 +609,7 @@ class CfgVehicles { class ACE_ArmRight { runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 3)] call DFUNC(displayPatientInformation)); - class Bandage_RightArm { + class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitRightArm"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreat)); @@ -730,7 +731,7 @@ class CfgVehicles { class ACE_LegLeft { runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 4)] call DFUNC(displayPatientInformation)); - class Bandage_LeftLeg { + class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitLeftLeg"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(canTreat)); @@ -842,7 +843,7 @@ class CfgVehicles { class ACE_LegRight { runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 5)] call DFUNC(displayPatientInformation)); - class Bandage_RightLeg { + class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitRightLeg"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(canTreat)); diff --git a/addons/medical/CfgWeapons.hpp b/addons/medical/CfgWeapons.hpp index 3eb30929d7..81d9491d78 100644 --- a/addons/medical/CfgWeapons.hpp +++ b/addons/medical/CfgWeapons.hpp @@ -1,25 +1,25 @@ class CfgWeapons { - class ItemCore; - class InventoryItem_Base_F; - class InventoryFirstAidKitItem_Base_F; - class MedikitItem; - - // ITEMS - class FirstAidKit: ItemCore { - type = 0; - class ItemInfo: InventoryFirstAidKitItem_Base_F { - mass = 4; - type = 201; + class ItemCore; + class InventoryItem_Base_F; + class InventoryFirstAidKitItem_Base_F; + class MedikitItem; + + // ITEMS + class FirstAidKit: ItemCore { + type = 0; + class ItemInfo: InventoryFirstAidKitItem_Base_F { + mass = 4; + type = 201; + }; }; - }; - class Medikit: ItemCore { - type = 0; - class ItemInfo: MedikitItem { - mass = 60; - type = 201; + class Medikit: ItemCore { + type = 0; + class ItemInfo: MedikitItem { + mass = 60; + type = 201; + }; }; - }; // @todo localize class ACE_ItemCore; diff --git a/addons/medical/functions/fnc_handleDamage_basic.sqf b/addons/medical/functions/fnc_handleDamage_basic.sqf index aafa615c08..600101e7eb 100644 --- a/addons/medical/functions/fnc_handleDamage_basic.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic.sqf @@ -183,8 +183,7 @@ if (_selection == "" and _damageReturn < 1 and !(_unit getVariable [QGVAR(isUnconscious), False] )) then { - // random chance to kill AI instead of knocking them out - if (_unit getVariable [QGVAR(allowUnconscious), ([_unit] call EFUNC(common,isPlayer)) or random 1 > 0.5]) then { + if (_unit getVariable [QGVAR(allowUnconscious), ([_unit] call EFUNC(common,isPlayer)) or random 1 > 0.3]) then { [_unit, true] call FUNC(setUnconscious); } else { _damageReturn = 1; diff --git a/addons/medical/functions/fnc_treatmentBasic_epipen.sqf b/addons/medical/functions/fnc_treatmentBasic_epipen.sqf index e616327673..644e98c390 100644 --- a/addons/medical/functions/fnc_treatmentBasic_epipen.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_epipen.sqf @@ -15,7 +15,6 @@ */ #include "script_component.hpp" -#define BLOODBAGHEAL 70 private ["_caller", "_target","_className"]; _caller = _this select 0; diff --git a/addons/medical/functions/fnc_treatmentBasic_morphine.sqf b/addons/medical/functions/fnc_treatmentBasic_morphine.sqf index e52f598c49..d8d793d0bc 100644 --- a/addons/medical/functions/fnc_treatmentBasic_morphine.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_morphine.sqf @@ -23,7 +23,7 @@ _target = _this select 1; _className = _this select 3; // reduce pain, pain sensitivity -_morphine = (_target getVariable [QGVAR(morphine), 0] + MORPHINEHEAL) min 1; +_morphine = ((_target getVariable [QGVAR(morphine), 0]) + MORPHINEHEAL) min 1; _target setVariable [QGVAR(morphine), _morphine, true]; _pain = ((_target getVariable [QGVAR(pain), 0]) - MORPHINEHEAL) max 0; _target setVariable [QGVAR(pain), _pain, true]; From 510538bc53d0d6d5b8ac1b0b55a3153f5bcd91ae Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Sat, 21 Mar 2015 00:26:14 +0100 Subject: [PATCH 36/61] Remove superfluous todo --- addons/medical/CfgVehicles.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index e5aa486241..2106cbe781 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -346,7 +346,6 @@ class CfgVehicles { }; class ACE_Actions { - // @todo morphine, epi, bloodbag actions for basic class ACE_Head { runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); From b1ed80a23d3f2453a5345e2572bdfbd528c795c7 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Sat, 21 Mar 2015 00:28:19 +0100 Subject: [PATCH 37/61] Remove trailing whitespace in medical stringtable --- addons/medical/stringtable.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 66aabe53b0..6317f97b06 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -669,7 +669,6 @@ %1 is responsive %1 реагирует на раздражители %1 ha reaccionado - %1 is not responsive @@ -729,4 +728,4 @@ - + From a060e4bea56fdcf19d086d5bf96594384230710e Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Sat, 21 Mar 2015 00:31:47 +0100 Subject: [PATCH 38/61] Apply translations to epipen and morphine actions --- addons/medical/CfgVehicles.hpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 2106cbe781..ad9302a2e8 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -452,7 +452,7 @@ class CfgVehicles { statement = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(treatment)); }; class Morphine: fieldDressing { - displayName = "Morphine"; + displayName = "$STR_ACE_Medical_Inject_Morphine"; condition = QUOTE([ARR_4(_player, _target, 'body', 'Morphine')] call DFUNC(canTreat)); statement = QUOTE([ARR_4(_player, _target, 'body', 'Morphine')] call DFUNC(treatment)); }; @@ -462,7 +462,7 @@ class CfgVehicles { statement = QUOTE([ARR_4(_player, _target, 'body', 'Atropine')] call DFUNC(treatment)); }; class Epinephrine: Morphine { - displayName = "Epinephrine"; + displayName = "$STR_ACE_Medical_Inject_Epinephrine"; condition = QUOTE([ARR_4(_player, _target, 'body', 'Epinephrine')] call DFUNC(canTreat)); statement = QUOTE([ARR_4(_player, _target, 'body', 'Epinephrine')] call DFUNC(treatment)); }; @@ -530,7 +530,7 @@ class CfgVehicles { statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(treatment)); }; class Morphine: fieldDressing { - displayName = "Morphine"; + displayName = "$STR_ACE_Medical_Inject_Morphine"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(canTreat)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(treatment)); }; @@ -540,7 +540,7 @@ class CfgVehicles { statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call DFUNC(treatment)); }; class Epinephrine: Morphine { - displayName = "Epinephrine"; + displayName = "$STR_ACE_Medical_Inject_Epinephrine"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(canTreat)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(treatment)); }; @@ -651,7 +651,7 @@ class CfgVehicles { statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(treatment)); }; class Morphine: fieldDressing { - displayName = "Morphine"; + displayName = "$STR_ACE_Medical_Inject_Morphine"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(canTreat)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(treatment)); }; @@ -661,7 +661,7 @@ class CfgVehicles { statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Atropine')] call DFUNC(treatment)); }; class Epinephrine: Morphine { - displayName = "Epinephrine"; + displayName = "$STR_ACE_Medical_Inject_Epinephrine"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Epinephrine')] call DFUNC(canTreat)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Epinephrine')] call DFUNC(treatment)); }; @@ -774,7 +774,7 @@ class CfgVehicles { statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(treatment)); }; class Morphine: fieldDressing { - displayName = "Morphine"; + displayName = "$STR_ACE_Medical_Inject_Morphine"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(canTreat)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(treatment)); }; @@ -784,7 +784,7 @@ class CfgVehicles { statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call DFUNC(treatment)); }; class Epinephrine: Morphine { - displayName = "Epinephrine"; + displayName = "$STR_ACE_Medical_Inject_Epinephrine"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call DFUNC(canTreat)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call DFUNC(treatment)); }; @@ -886,7 +886,7 @@ class CfgVehicles { statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(treatment)); }; class Morphine: fieldDressing { - displayName = "Morphine"; + displayName = "$STR_ACE_Medical_Inject_Morphine"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(canTreat)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(treatment)); }; @@ -896,7 +896,7 @@ class CfgVehicles { statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Atropine')] call DFUNC(treatment)); }; class Epinephrine: Morphine { - displayName = "Epinephrine"; + displayName = "$STR_ACE_Medical_Inject_Epinephrine"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Epinephrine')] call DFUNC(canTreat)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Epinephrine')] call DFUNC(treatment)); }; From b3aa7c8970abcc69c5552f4a7723a0b907f5eed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Fri, 20 Mar 2015 22:44:25 -0300 Subject: [PATCH 39/61] Make collectActiveActionTree follow mounts correctly --- .../functions/fnc_collectActiveActionTree.sqf | 17 ++++++++++++----- .../functions/fnc_addPassengerActions.sqf | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf index f4ae2ff5c1..36d4dc548d 100644 --- a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf +++ b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf @@ -17,7 +17,7 @@ EXPLODE_3_PVT(_this,_object,_origAction,_parentPath); EXPLODE_2_PVT(_origAction,_origActionData,_origActionChildren); -private ["_target","_player","_fullPath","_activeChildren","_action","_actionData","_x"]; +private ["_target","_player","_fullPath","_activeChildren","_dynamicChildren","_action","_actionData","_x"]; _target = _object; _player = ACE_player; @@ -27,15 +27,22 @@ if !([_target, ACE_player, _origActionData select 6] call (_origActionData selec [] }; +_fullPath = +_parentPath; +_fullPath pushBack (_origActionData select 0); _activeChildren = []; // If there's a statement to dynamically insert children then execute it if !({} isEqualTo (_origActionData select 5)) then { - _activeChildren = [_target, ACE_player, _origActionData select 6] call (_origActionData select 5); -}; + _dynamicChildren = [_target, ACE_player, _origActionData select 6] call (_origActionData select 5); -_fullPath = +_parentPath; -_fullPath pushBack (_origActionData select 0); + // Collect dynamic children class actions + { + _action = [_x select 2, _x, _fullPath] call FUNC(collectActiveActionTree); + if ((count _action) > 0) then { + _activeChildren pushBack _action; + }; + } forEach _dynamicChildren; +}; // Collect children class actions { diff --git a/addons/interaction/functions/fnc_addPassengerActions.sqf b/addons/interaction/functions/fnc_addPassengerActions.sqf index 83b702a98b..d4a5da3788 100644 --- a/addons/interaction/functions/fnc_addPassengerActions.sqf +++ b/addons/interaction/functions/fnc_addPassengerActions.sqf @@ -27,6 +27,6 @@ _actionTrees = missionNamespace getVariable [_varName, []]; _actions = []; // Mount unit MainActions menu -_actions pushBack (_actionTrees select 0); +_actions pushBack [(_actionTrees select 0) select 0, (_actionTrees select 0) select 1, _unit]; _actions From 3d6660b115e65183793975b11a1774d8385a2e1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Fri, 20 Mar 2015 22:44:36 -0300 Subject: [PATCH 40/61] Debug stuff --- .../interact_menu/functions/fnc_renderBaseMenu.sqf | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf index da01fa804f..277f79c141 100644 --- a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf @@ -65,7 +65,18 @@ _activeActionTree = [ DFUNC(collectActiveActionTree), _object, _uid, 0.2 ] call EFUNC(common,cachedCall); - +/* +diag_log "Printing: _activeActionTree"; +_fnc_print = { + EXPLODE_2_PVT(_this,_level,_node); + EXPLODE_3_PVT(_node,_actionData,_children,_object); + diag_log text format ["Level %1 -> %2 on %3", _level, _actionData select 0, _object]; + { + [_level + 1, _x] call _fnc_print; + } forEach _children; +}; +[0, _activeActionTree] call _fnc_print; +*/ // Check if there's something left for rendering if (count _activeActionTree == 0) exitWith {false}; From b5c6e52416a62bd393e9e6b46b9623941e06a97a Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 21 Mar 2015 10:54:52 +0100 Subject: [PATCH 41/61] fixed #201 --- addons/medical/functions/fnc_handleDamage_fractures.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/medical/functions/fnc_handleDamage_fractures.sqf b/addons/medical/functions/fnc_handleDamage_fractures.sqf index 0a22365044..31fa1c8873 100644 --- a/addons/medical/functions/fnc_handleDamage_fractures.sqf +++ b/addons/medical/functions/fnc_handleDamage_fractures.sqf @@ -70,5 +70,5 @@ if (_amountOfDamage > 0.05) then { _fractureID = (_fractures select (_amountOf - 1) select 0) + 1; }; _fractures pushback [_fractureID, _fractureType, _bodyPartn, 1 /* percentage treated */]; - _unit setvariable [GVAR(fractures), _fractures, true]; -}; \ No newline at end of file + _unit setvariable [QGVAR(fractures), _fractures, true]; +}; From bc082783c903a5b3bdd9552103d1a8a808306980 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 21 Mar 2015 10:55:27 +0100 Subject: [PATCH 42/61] check if unit is in a vehicle before checking the vehicle --- addons/medical/functions/fnc_hasItem.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_hasItem.sqf b/addons/medical/functions/fnc_hasItem.sqf index d02abb9187..551d532ae4 100644 --- a/addons/medical/functions/fnc_hasItem.sqf +++ b/addons/medical/functions/fnc_hasItem.sqf @@ -32,7 +32,7 @@ if ([_medic, _item] call EFUNC(common,hasItem)) exitwith { }; _return = false; -if ([vehicle _medic] call FUNC(isMedicalVehicle) && {(vehicle _medic != _medic)}) then { +if ((vehicle _medic != _medic) && {[vehicle _medic] call FUNC(isMedicalVehicle)}) then { _crew = crew vehicle _medic; { if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {([_x, _item] call EFUNC(common,hasItem))}) exitwith { From 7c30127ffbeb952c1995e6b8edca5b5672624dd2 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 21 Mar 2015 10:55:40 +0100 Subject: [PATCH 43/61] Disabled unimplemented medical systems --- .../functions/fnc_handleDamage_advanced.sqf | 19 ++++++++++--------- .../functions/fnc_handleUnitVitals.sqf | 8 ++++---- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/addons/medical/functions/fnc_handleDamage_advanced.sqf b/addons/medical/functions/fnc_handleDamage_advanced.sqf index 0158608067..8d4f14315a 100644 --- a/addons/medical/functions/fnc_handleDamage_advanced.sqf +++ b/addons/medical/functions/fnc_handleDamage_advanced.sqf @@ -45,15 +45,16 @@ _unit setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; [_unit, _selectionName, _newDamage, _typeOfProjectile, _typeOfDamage] call FUNC(handleDamage_wounds); -if (GVAR(enableAirway)) then { - [_unit,_selectionName,_newDamage,_sourceOfDamage, _typeOfDamage] call FUNC(handleDamage_airway); -}; -if (GVAR(enableFractures)) then { - [_unit,_selectionName,_newDamage,_sourceOfDamage, _typeOfDamage] call FUNC(handleDamage_fractures); -}; -if (GVAR(enableInternalBleeding)) then { - [_unit,_selectionName,_newDamage,_sourceOfDamage, _typeOfDamage] call FUNC(handleDamage_internalInjuries); -}; +// TODO Disabled until implemented fully +//if (GVAR(enableAirway)) then { +// [_unit,_selectionName,_newDamage,_sourceOfDamage, _typeOfDamage] call FUNC(handleDamage_airway); +//}; +//if (GVAR(enableFractures)) then { +// [_unit,_selectionName,_newDamage,_sourceOfDamage, _typeOfDamage] call FUNC(handleDamage_fractures); +//}; +//if (GVAR(enableInternalBleeding)) then { +// [_unit,_selectionName,_newDamage,_sourceOfDamage, _typeOfDamage] call FUNC(handleDamage_internalInjuries); +//}; if (alive _unit && {!(_unit getvariable ["ACE_isUnconscious", false])}) then { [_unit, _newDamage] call FUNC(reactionToDamage); diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index e7c55d5d08..1828028f33 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -83,8 +83,9 @@ if (GVAR(level) >= 2) then { _bloodPressure = [_unit] call FUNC(getBloodPressure); _unit setvariable [QGVAR(bloodPressure), _bloodPressure, _syncValues]; + // TODO Disabled until implemented fully // Handle airway - if (GVAR(setting_allowAirwayInjuries)) then { + /*if (GVAR(setting_allowAirwayInjuries)) then { _airwayStatus = _unit getvariable [QGVAR(airwayStatus), 100]; if (((_unit getvariable [QGVAR(airwayOccluded), false]) || (_unit getvariable [QGVAR(airwayCollapsed), false])) && !((_unit getvariable [QGVAR(airwaySecured), false]))) then { if (_airwayStatus >= 0.5) then { @@ -103,12 +104,11 @@ if (GVAR(level) >= 2) then { [_unit, true] call FUNC(setDead); }; }; - }; + };*/ // Check vitals for medical status // TODO check for in revive state instead of variable - // TODO Implement cardiac arrest. - _bloodPressureL = _bloodPressure select 0; + _bloodPressureL = _bloodPressure select 0; _bloodPressureH = _bloodPressure select 1; if (!(_unit getvariable [QGVAR(inCardiacArrest),false])) then { From 4a8b5079a602dd0f15b4d97dda6d29e29064e8dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sat, 21 Mar 2015 09:37:01 -0300 Subject: [PATCH 44/61] Fix #211 --- addons/interact_menu/XEH_preInit.sqf | 1 + .../interact_menu/functions/fnc_isSubPath.sqf | 29 +++++++++++++++++++ addons/interact_menu/functions/fnc_render.sqf | 10 +++++-- .../interact_menu/functions/fnc_splitPath.sqf | 8 +++-- 4 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 addons/interact_menu/functions/fnc_isSubPath.sqf diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index 478b5b578d..2b5150a0ea 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -9,6 +9,7 @@ PREP(compileMenuSelfAction); PREP(collectActiveActionTree); PREP(createAction); PREP(findActionNode); +PREP(isSubPath); PREP(keyDown); PREP(keyDownSelfAction); PREP(keyUp); diff --git a/addons/interact_menu/functions/fnc_isSubPath.sqf b/addons/interact_menu/functions/fnc_isSubPath.sqf new file mode 100644 index 0000000000..e90aa12300 --- /dev/null +++ b/addons/interact_menu/functions/fnc_isSubPath.sqf @@ -0,0 +1,29 @@ +/* + * Author: CAA-Picard + * Check if the first path is a subpath of the other + * + * Argument: + * 0: LongPath + * 1: ShortPath + * + * Return value: + * Bool + * + * Public: No + */ +#include "script_component.hpp" + +EXPLODE_2_PVT(_this,_longPath,_shortPath); + +private ["_isSubPath","_i"]; +_isSubPath = true; + +if (count _shortPath > count _longPath) exitWith {false}; + +for [{_i = 0},{_i < (count _shortPath) - 1},{_i = _i + 1}] do { + if !((_longPath select _i) isEqualTo (_shortPath select _i)) exitWith { + _isSubPath = false; + }; +}; + +_isSubPath diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf index 922027e2a0..df97b232de 100644 --- a/addons/interact_menu/functions/fnc_render.sqf +++ b/addons/interact_menu/functions/fnc_render.sqf @@ -159,14 +159,18 @@ if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then { } forEach GVAR(lastPath); }; - if(_misMatch) then { - GVAR(lastPath) = _hoverPath; + if(_misMatch && {diag_tickTime-GVAR(expandedTime) > 0.25}) then { GVAR(startHoverTime) = diag_tickTime; + GVAR(lastPath) = _hoverPath; GVAR(expanded) = false; } else { if(!GVAR(expanded) && diag_tickTime-GVAR(startHoverTime) > 0.25) then { GVAR(expanded) = true; - GVAR(expandedTime) = diag_tickTime; + + // Start the expanding menu animation only if the user is not going up the menu + if !([GVAR(menuDepthPath),GVAR(lastPath)] call FUNC(isSubPath)) then { + GVAR(expandedTime) = diag_tickTime; + }; GVAR(menuDepthPath) = +GVAR(lastPath); // Execute the current action if it's run on hover diff --git a/addons/interact_menu/functions/fnc_splitPath.sqf b/addons/interact_menu/functions/fnc_splitPath.sqf index 0bbe643adf..87140d0482 100644 --- a/addons/interact_menu/functions/fnc_splitPath.sqf +++ b/addons/interact_menu/functions/fnc_splitPath.sqf @@ -15,9 +15,13 @@ private ["_parentPath","_actionName"]; _parentPath = []; -for "_i" from 0 to (count _this) - 1 do { +for [{_i = 0},{_i < (count _this) - 1},{_i = _i + 1}] do { _parentPath pushBack (_this select _i); }; -_actionName = _this select ((count _this) - 1); +_actionName = if (count _this > 0) then { + _this select ((count _this) - 1); +} else { + "" +}; [_parentPath, _actionName] From 83d9aa4bb615c1d52926a4e6760ae3fbad5bcd03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sat, 21 Mar 2015 10:23:36 -0300 Subject: [PATCH 45/61] Replace tap shoulder and check (others) ammo animations by PutDown --- addons/interaction/functions/fnc_tapShoulder.sqf | 2 +- addons/reload/functions/fnc_checkAmmo.sqf | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/interaction/functions/fnc_tapShoulder.sqf b/addons/interaction/functions/fnc_tapShoulder.sqf index 262012dbb9..297de3fff8 100644 --- a/addons/interaction/functions/fnc_tapShoulder.sqf +++ b/addons/interaction/functions/fnc_tapShoulder.sqf @@ -5,7 +5,7 @@ EXPLODE_3_PVT(_this,_tapper,_target,_shoulderNum); if (_target != ACE_player) exitWith { addCamShake [4, 0.5, 5]; - ACE_player playActionNow 'gestureAdvance'; + ACE_player playActionNow "PutDown"; if !(local _target) then { [[_tapper, _target, _shoulderNum], QUOTE(DFUNC(tapShoulder)), _target] call EFUNC(common,execRemoteFnc); }; diff --git a/addons/reload/functions/fnc_checkAmmo.sqf b/addons/reload/functions/fnc_checkAmmo.sqf index 7c24ff1ff3..2ab656fe47 100644 --- a/addons/reload/functions/fnc_checkAmmo.sqf +++ b/addons/reload/functions/fnc_checkAmmo.sqf @@ -31,6 +31,10 @@ if (count _this > 1) then { }; }; -_unit playActionNow "Gear"; +if (_unit == _target) then { + _unit playActionNow "Gear"; +} else { + _unit playActionNow "PutDown"; +}; [FUNC(displayAmmo), [_target], 1, 0.1] call EFUNC(common,waitAndExecute); From 75517f7ce4814f9c634a84bb2846b94064e07f69 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Sat, 21 Mar 2015 14:40:23 +0100 Subject: [PATCH 46/61] Replace setDamage with setDead --- addons/medical/functions/fnc_handleUnitVitals.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index b7c2aeac37..fc8522b93c 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -85,7 +85,7 @@ if (GVAR(level) == 1) then { [_unit, true] call FUNC(setUnconscious); }; if (_blood == 0) then { - _unit setDamage 1; + [_unit] call FUNC(setDead); }; }; }; From 77210581f504e4bc1938e3f89caf26b58bf009d7 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 21 Mar 2015 14:40:26 +0100 Subject: [PATCH 47/61] Added corners to triage card --- .../functions/fnc_dropDownTriageCard.sqf | 4 +--- addons/medical/ui/triage_card_corner_l.paa | Bin 0 -> 22016 bytes addons/medical/ui/triage_card_corner_r.paa | Bin 0 -> 22016 bytes addons/medical/ui/triagecard.hpp | 16 ++++++++++++++++ 4 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 addons/medical/ui/triage_card_corner_l.paa create mode 100644 addons/medical/ui/triage_card_corner_r.paa diff --git a/addons/medical/functions/fnc_dropDownTriageCard.sqf b/addons/medical/functions/fnc_dropDownTriageCard.sqf index c9a85d91af..5e763822db 100644 --- a/addons/medical/functions/fnc_dropDownTriageCard.sqf +++ b/addons/medical/functions/fnc_dropDownTriageCard.sqf @@ -24,11 +24,9 @@ _pos = [0,0,0,0]; if (_show) then { _pos = ctrlPosition (_display displayCtrl 2001); }; -for "_idc" from 2002 to 2006 step 1 do -{ +for "_idc" from 2002 to 2006 step 1 do { _pos set [1, (_pos select 1) + (_pos select 3)]; _ctrl = (_display displayCtrl _idc); _ctrl ctrlSetPosition _pos; _ctrl ctrlCommit 0; }; - diff --git a/addons/medical/ui/triage_card_corner_l.paa b/addons/medical/ui/triage_card_corner_l.paa new file mode 100644 index 0000000000000000000000000000000000000000..a713f43e2df6981becccc005180bb326140d253a GIT binary patch literal 22016 zcmeI4L2DC16vszdYdr*0P{=`{hhFyJ(Q}dtiJ^+3wRn*96ZjcyMJR{}h6*Y|Z-QRL zi@l0P`~dbK^cD|-AXs|QOU7B3#Lj;( z|3B7}bF@UD^esuiU+)y&(BH@#HLdq)MtqqM72cZuM&782zuWxt=1u%P<83&fBVV1S{x7#4l>RQ5 zH`W93x65DQopJp}o~D}k7t3GaZMna7^+5dd<-auKym{xxyYcslcz6BW;r$jJ58KCy ze>VQeducd*zr{9RT|DA%#$Vz6)i2&y55#{ue}%Va{f)d)6MvaM@{Wg(r28e9Ki_rL z`6F-N*6*zKS2g}s=Z*CeI)CDw5+8pb4V^#np3XZo{;uz@VZL3{zRmx{+pNEJ_2xSN zcpLUp9os+G<=6G&uJNb-&bPmH^;b53;%%2V)`M;S#JgPHw)qopw|E!LpLn~?J8%BP z+b`Z(`K!F&1bu%D^A(!beg0E<`~CM0q4CS=2l*54G^78zUy?Q7uDzdlSBp2+UrYQ3 z0IOH--~OB5_`&g$XFiYH9H+t1H2Pg+7Y7Ty!9uA17lAMO#WwJrH~MV?U-XOGH~+eN zMt?f(y8r%9dA_=4$k#Xj=yx?|znG7*`J>;Jg8i25zyC|F=e}jXw*8Cwimx8}yivB_ zqWw3&%Y04OBfP$%b=LmJ^~iO`Iu+( zj78SB0qP&*Wx{kCG98cc=Af)i&!-!In)jZaif>J}889AV)16OuyzxoSX9N6UJk+}L z4z{5T%Ag8%>k literal 0 HcmV?d00001 diff --git a/addons/medical/ui/triage_card_corner_r.paa b/addons/medical/ui/triage_card_corner_r.paa new file mode 100644 index 0000000000000000000000000000000000000000..5d095321b90b199a425af4dc19be50260da68964 GIT binary patch literal 22016 zcmeHP&ubGw6n@HDdJ*D5DD+Y=2z&ElE*_Fp*brh-v=%|AlAcZeh0=>4q9PR(1P_8x zFTJIALGW&G-l8BB#G51#vd(l_HE%J`ac1_{yug;c&di(lzVDkiyVEqM!d9!fez~>L z^Z;Nwo$eglx0-9x4#i8_t>%?L+9$*%?HfUGwISYbi|f94^XMADvvq)%HvvA2>)&77 z(nkaQu>G!jw|hZOCH}-&8y6q1bw$_*HG^`^jSIL6u+C{;Y?5>p_)I-Tu5^ zx=6{gvkHu0pnS8+aC^Q{+`AA#e97foo_0Bt`BbWkM+TN znAHQu$2Hq^J-EgZ1yH`p@y|9WZ1&-0npn{ItzKFsowHJ++^$U0u0->&{BJv79306+!mN8`tn zpm#1l*38?-RBgwz3hgJ=_S0&dziW8lWr*=uExA5${@AV~eUuFkoG)c#eH4AYQ2A2r z*O5LpN5!hARDP=McM67wYJRHyH*$`LYCgLCH!&XLY}bo!KDy&E9`&PeKTPp{OgDbh zU@ z0q~&m-fo$t9^=m-+R}~((}LqU8?Nn~54K*%#{^V9s_l4wY%d{vmOh&03(rT{iFgk6 z;-TiF+A9bjRsB%@RohkLQT4Cd|1^P5MH~f+?;7>q=+Wq*X%_a?{Nc0~kU#J3e1CX6 zwsCwo-$huI$D+G0M*Yc;-le~-_LC^A-RI-}q}E%G`+KsY0z7y)`Yzo3`gIh|Pk4tQ AjsO4v literal 0 HcmV?d00001 diff --git a/addons/medical/ui/triagecard.hpp b/addons/medical/ui/triagecard.hpp index 22cd9fcc51..f1b98f1e2d 100644 --- a/addons/medical/ui/triagecard.hpp +++ b/addons/medical/ui/triagecard.hpp @@ -20,6 +20,22 @@ class GVAR(triageCard) { colorBackground[] = {1,1,1,1}; text = ""; }; + class cornor_top_l: ACE_gui_backgroundBase { + idc = -1; + x = "10 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + font = "PuristaMedium"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorText[] = {1,1,0,1}; + colorBackground[] = {0,0,0,0}; + text = QUOTE(PATHTOF(ui\triage_card_corner_l.paa)); + }; + class cornor_top_r: cornor_top_l { + x = "20 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(ui\triage_card_corner_r.paa)); + }; class TriageCardLabel { idc = 199; From ff5c8e911d2162e28d924fd27988b75b908cac94 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 21 Mar 2015 14:40:51 +0100 Subject: [PATCH 48/61] Added InteractionMenuClosed event for closing the patient information display --- addons/medical/XEH_postInit.sqf | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index d23a02225f..235f235255 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -12,6 +12,7 @@ GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"]; ["Medical_treatmentCompleted", FUNC(onTreatmentCompleted)] call ace_common_fnc_addEventHandler; ["medical_propagateWound", FUNC(onPropagateWound)] call ace_common_fnc_addEventHandler; ["medical_woundUpdateRequest", FUNC(onWoundUpdateRequest)] call ace_common_fnc_addEventHandler; +["InteractionMenuClosed", {[objNull, false] call FUNC(displayPatientInformation); }] call ace_common_fnc_addEventHandler; // Initialize all effects _fnc_createEffect = { From 8de985d7549eb1bbd3ee54811efff2e90b7146cf Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 21 Mar 2015 15:45:35 +0100 Subject: [PATCH 49/61] Added medical icons --- addons/medical/ui/icons/icon_autoInjector.paa | Bin 0 -> 5625 bytes addons/medical/ui/icons/icon_bandage.paa | Bin 0 -> 5625 bytes addons/medical/ui/icons/icon_bodybag.paa | Bin 0 -> 5625 bytes addons/medical/ui/icons/icon_iv.paa | Bin 0 -> 5625 bytes addons/medical/ui/icons/icon_medical_cross.paa | Bin 0 -> 2897 bytes addons/medical/ui/icons/icon_packingBandage.paa | Bin 0 -> 5625 bytes addons/medical/ui/icons/icon_surgicalKit.paa | Bin 0 -> 5625 bytes addons/medical/ui/icons/icon_tourniquet.paa | Bin 0 -> 5625 bytes 8 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 addons/medical/ui/icons/icon_autoInjector.paa create mode 100644 addons/medical/ui/icons/icon_bandage.paa create mode 100644 addons/medical/ui/icons/icon_bodybag.paa create mode 100644 addons/medical/ui/icons/icon_iv.paa create mode 100644 addons/medical/ui/icons/icon_medical_cross.paa create mode 100644 addons/medical/ui/icons/icon_packingBandage.paa create mode 100644 addons/medical/ui/icons/icon_surgicalKit.paa create mode 100644 addons/medical/ui/icons/icon_tourniquet.paa diff --git a/addons/medical/ui/icons/icon_autoInjector.paa b/addons/medical/ui/icons/icon_autoInjector.paa new file mode 100644 index 0000000000000000000000000000000000000000..f1707d2b823641025354351bef4636a8cca5ba6c GIT binary patch literal 5625 zcmeHLZ)jUp6u&R+i|J-v3}&5cOT&yE&JIN|AXNH-(5_%Hu-vB5c4i&QkgoBAA4FCY z=U}3+>ZF2THuTd_v{UqbP;9#4Hnkf?!P=57t=g=aN|QNiJDTkJJMX@9U4}5B4x%~m z{+yThUhetb^E>BvpDJ2fy#B{p+P&qBvAMaqjfUUhZ6ja6$ZzpJ-b}uNjr{G+%};1J zk6=4sXYAlzj14*&JBRI`nZ`86@P?9=5GWzAj6fA@J>+gZRNkFtjC1a+cuwCF*P|y) zUt7NMKYC*M*7Hod{a}vbRaJ#G9uH@z7=Ni!~ z<9BBRU9-T$ud#9?pZ2-?Wj^`k)5Wtt%^rE9FU*H8H4&kJPau4CvHlOedve{SCc=Z*vt}>V zo7xG94=*}C-CKaq+Rk-+yMnCj>{uoSbf$n02S8gc zNlj|PFZwmrbIyIZQe37uJU#JzzM$Sz&yI#N`cslmOy$-K zAWLo_N&SgMMuK@hb*Dcc$1)+vPR25}&2}Z8K)z^N@h3>Z^lf-c;zRSR0-uJS-o20sVI0Rw49VIZixH;&cr1E6Ja5PpYQyVamGf!Jw&gaoTH~u3T+t>WtJI_zx_YXo zTH>WRcjg|*9uPxWA(j$Hr!&txFYAv^ywqm23GVZ)`gkxKhPklE%n3H-vuwk84P?H8 zK2^oG(Psv?(U#D*jGM7@VKeSGFWf5MPM-o5c88?lJtpnE<|uA@SR2wio+h;)MOrF~ zI#~CeUOO3nH%qjkG^ps8X;8Sj`MWS3scUMPR-aqr17~8*q0R)}M?kuM0xdVcGe$H3 zE%6W1TsYhejMf)zy`&D7NF8AsY|KWgdh7SN_Db)k6bAQ2luahvyNpFE_bY)F*@nj^ kSMa{vb;@Say{qW{HN8n1{%Qw z@6Rvi=HB}|_ndprd0N`gU~7J^p~a>lgv4SoUcpY=i-;)*;s)D6J7N`Fh!5NChd6le zhU-`rAs<&0;xiEPGh7=Jj&OuP5C2O+EwKBoU}q%QxrOb!TxGy7x)%KQvkRhj6V zlF@rXuzPlA4xNifB)}mmN7U?h#7`UO106yo0Pty#)W~IYMd^(Ly#GAdW4I>5?7?rj zJv686Zh68Z3nBz5NQN)|Qew(r_LjjT5*Nz0&xmB!XXE_#QM6}w-LGea+0*fH)bbpM zCfQQaEKhjm?e6(}{sUsGXhkPbya0I#qS_P=XE5@ij=#lUzm(QTX+k>f_xnk`_s*l% z5!@o=O4wq z5b(jK#vEMw)O%PzDS96C#m(-&KRY8a5`teCm>A)aN!kf26U6{!^TnaIyn^j`PEjd0BiuJL{yYqxSi~}~Ros)cZQ-$|9vVugbr`mz zpf7oZu6XJ4PMqHXv)P=Q!Dh$57@id4P-fzIK7%3a7!kywZ%IYU9&FnP1m^B}<*QU4 zN4x~`ug8}rJnWcL%9`}Hj`K0)@dx_;(dojD|5*F|Q7R8o9Phl@oX`KEeEugd6n1=T z^u8F6x!AU@QW+lq9j5YQWg^YrqgZ$^+B*RJ%g4O&tCf3|G#&EP^k<6Au7CdeZL7Dt zaGO-(0RnPcy{;p*ZE{)L=6c7g!cT$tk&%fJ9zc+8r@_t_UOUUe7}QT(37TfSvKP(m z;8N+P3-QbEK8Vskd*MwG&Av;fBgg2G10t`+xN}vbYd@B{G1gv0Ce>rj4IX4ku3^!lzG{)cED396yVeT(Y!FUG7_G zT`kCtv0>qQZ(K<_A?M(a+_rcmi!1UK(;G_9f$}>&JG6MdSpz#N*wY#L{I|G(SJrGB>|4H=YpE)zxKTxF~l4VhRm$e(wA{!~#5sU(3r|D8m06 z;MtN)$o5AF*=-=?5K zgp6MgSazM#uq56?Q%7X!DVOE48HL+b_{vy18-Y?H?arRSJ0Q7?wiyA?%BcUytUS^Wm3wZPSbPWq+`a-}*^{pDVSYV3( zwbh)K?X$AWRR`D$e1+5DeyTJfAI7(iQq3IB_cpkjf8P+yQ9hHu*~>8>pLdB~Yuua0 z_!7}<9%-`aEwX)7X~~C7Ux?ai$7Q{7WtcL)uy}d6684t@wkd3XqkL^j5~U}&{S84! zz*B$7!!hSG9CxFCM91eSd-pVaOZyqa$-Mu1@6pArUupYofi}|oAM?s(Q`eP;(I3&D z=~cmqYc>QI2du;FMJ(NdbCf!dXBFq;3ZyD9OwX|!^^hcqW2O&{!Jc~QN|**GIR~DM z@UNSB>DYo6ueu!f!(t;Oo)pxi7i^522kEZ$nE4&XBl}eC{1}7@s%$S^Rm0AsK}X1Y zp?Ni`m%@1j`!`f9;r22-Fl4VA{57M#FT}rh1O|PTORZLp-N8YhUZ0rAG4g%A;v^IX zs3swTz6I`^l0kF+1L4^JL zHc>&oWt^|>jgQXmK>x-4#iE3U6Ic;}{5DiBiQ1o|4EmU(N9;v@&3*NmL-r2(e(+aR za-6CRTmW~7`g21tRnhCRn)&y>pgRa(ujCl@uvo3um-{F+(VLSve`7TSH!vCbTP(Nd z7t8)p<{vfj+Wtz0dERwBp?-|VoG-G*c%0JauPlo0Z>;^X82M+yhI0E6+ibSK^&Sv{Z(C0u7tzC(?*KNhQ~XRb0Q#H=Lo9)vk;G z)Zg!%>B#gLi6AKDLcN#ojAm(1mQ!Hdb)Z<=IzSu4waBukp5EOh4-m83-cO}A93 zTHJa})Azsd_mN@wVAlIZ0V6SDQN$Yn_S?h#hU0c^wtvvs#M1O4K_Ky8%b9pBVrdPM zVx|wy*pZM~OLOpI8!|i>NqdrbJHF#;VZ6NT8Ew2ym-H)K+sy9BH3l@hrj-S(EcMh! z(;P3uX^5?0#A{03p~GLkw5v9am*tSPqGhNNx?$3reQOz_o7xUFSe{S2MqpVzI8=ss zh-cV(DQ$7nCuZ@qg7%z{3e9_ZX)ksD-WUnH;^dBFu8Zk!X=RcqN~3RG&oDJ`V@>FE z8(WW+0g*I}WseQg44)s<&^B*rDaQ?vma}#@HxFT(;=kH0XLLc00@pBHA8ujMGKKTK zLJIawgs{lcE~MGD*Jv9(UB2Ij=>gM(ihq&`PYZm0T)(keKaFFaCJw7u77jvLIOzMh z=$(Qj7t{zx>@2K;+|jbv2(zNzI6F2YJcxyuG?%q;#Za1qu>G()f6YN~31%PIo7Vw@ zib^ACju=P>4US2iJT`~fFN!cNYex9Q`871O-o3`j_*0Fcc6CMkfUc(X@ALB-I*2{0U`)W0}g=0xoZ4GuCiX+ueIh<;vGjzs|VDj%^#; z1}IlD_S2-%U~($kmZ56N2&*991d_mh7JVD~WS1!Dt#D-$GA_&CpQ6{spjqfTQ@lMp s)a>Q0+U_Pw$$L$q#%epmP=ibH5K%$TwC%Egj=Jm&P6JoNxiAvi9|BT1u>b%7 literal 0 HcmV?d00001 diff --git a/addons/medical/ui/icons/icon_iv.paa b/addons/medical/ui/icons/icon_iv.paa new file mode 100644 index 0000000000000000000000000000000000000000..ef7048dfd1b3066be53ea8ab6a6ee09bf4fb994b GIT binary patch literal 5625 zcmeHLZ%k8H6u+TM`8C_yF{$z%1V@`;f@5>fJbl@UEH>eQ`bKax2R5oy6<-<<; z())Y&-gE9b_x!o{u{1kdo4YMLPa8}KvD@vtWc;dj7h(#8I9t0j3o!!^;@w$UIUKYr z;Hi!v08W>6m;du~#7#>y4I|}B=npmOODyZL3 zFi)8Eh-=$tFc;wEE?Qh@q;PPnP!x;nj{;D-;ytn=k&SyMK5TH890fqZo95#yP_W(75&=>5^1$xK@5xKE)m@y z32(i!LGIUc+(t3w^yScdD-eVF53ELg>$*Y8DjC9l2FOL;`!cEYaH7mluMfP#KCr^s zF9f2ic~e&>?;mV0ulc>zePzoRUwQOf-*@D0u#3|34$v2-hWB-U^dkf}VhrkxQSk5M zqe(a(<6+J1GJ{xAH)KQoSwc1+G8?VcQV))Y?MD{Nik|8f4h#*OX{`wU%`lL-l;s)4 ze6b10gDEwN7AC0Ci_bfrkn@}}o>J79O!)Rgn!EGjh-oxawwF;nXW{v@Az_uZQfjLM zd+^J^9_8OnUZqYO?59!81M;rlDDpf%OMhQ%1A73zZ!fgZLU8%dCaKdTUBvMd6BCc! z7v4SYyh^9cbLelQDwWDdKgBX$`}{k$(P_uGv;4F+=i9$&lP|W>J$bWndwUznDFppn-Jm~8nInPX z>j09vXVBm-D;dZ5XBd|C>Z7!l8gCm3celY0`9l5R0;uYoqT;90_x~Ui#$tYEp#V@h zBqLy7AC3N7hL@NAk++0`&xHdn%*UWUOGT_|=(pz`K|w0jQtyA5g}Qr8QV8068Eik< zdo#UcysSj7e=N)T#J^EgktW`&KW2#e@H2kn$pbigFC8;cXC~(V-riozoK6|QmpR4` z(LIy@@Vw^H*T4QR6+Saf$1>@7E7sc+Jpb7Bf9X<(;kHm@MgNEN$LmKS@ToZg*9Y}{ z@Wx%l>sHsoc?cS+v)2?n)8AADCq+u@S9|b|G8u`wUpa%rVh8AWc6h24^DRWc zvbzri(DnWowFDN>5Dg*tg+U<={Gr3mK`B(W`#Ow9B^YNRnUt^EHr@mfLi2O0l#7di=HS`R?wMjmBS(3%{lC8qNGuRJl zn5^ymKHqvy-9HFnnd@_H{wICrlYgie?l@Ate9V1q5ASo0F^VZEkfmoVrmTl=UU@Ox z9YP%@3{%d-9R4-%EX2N^DW35MJDv4ZGQ(7($g+(gUU^sur+}w21Iunh!zr>c19BvF ztixk+a!gFJKfi~?@zP~+deAV0_QVbF%2QhYSZz0rhQQBPSCpxN$M@YrapHJ~D2<42 z)E311=qv9(umr|H^06CS^0`JVlden(g}I@$^mV28zsry8o@%C(hQDNKumr0ewW#-` z^`@_XnT@MmC_L$clC~{riOyxH z)G$1KX*tgX4K&aI{aq6XodfHf1Lcj(@ZCA^8BD6 z=9?p3bZi}UWGZ1+amRnWKi)a!GAFLb{!=I2y~YRoj}IlGa<~qV;E%c0L+EW$ zkWS*dS~B{ZrG7Mn9;k6Dz2r|}zZIhay7`~PYU9AkVi`j>9}F24>^Vxtp43DhOGh?Z HAVu2W9`xi| literal 0 HcmV?d00001 diff --git a/addons/medical/ui/icons/icon_medical_cross.paa b/addons/medical/ui/icons/icon_medical_cross.paa new file mode 100644 index 0000000000000000000000000000000000000000..656ebc000baa6685c07f4d17a9cb60b8a40b340f GIT binary patch literal 2897 zcmdT`!AiqG5FKp~MGxu4dq2Ss5Yiwt7ez!7KgWaMMf@A@3&mgX=r`o1hrl{-lV{72 zNouX23(3pO&UA~D8!if@baHcsLV=i+MRnVd4@xS5QJGze1!=K)dr`xz@S%b~mVf7eW-nM;M9mep< zbO5`wS!c1U*3&@V@)={U&!0Z5Co;b&l4o&Sf9eeRLqFzuo=}UsFl+Ok79LC&FNP32 z4)frteGX)9SE%-3NDIDyz#nb6%c%F@zW;qZz5T&8<$K~G^!wg_kH`Gb`g5N37Juqb zJ^EPWyobN-&wl#-(Z%{#cNKd)o2SpFNWNFkc@I6_uJYUZ&Sci?E}Bo)uG>iuW;7Zl zRB^WH`5fP0KBAU&xK?`NgJb8d4(hYDdc?MdalnO+^%`6&edzN-POyCTO>FhP`e&ZF zAs;g7b4Z>=t7GHW=Z_a?c)Y1h)1Fd!C~HRE?s8&9xi+5zGyM$$E1d<#SXVf=|4wa} vyOb*Bt9tb)P?zO6D_;+`HPIdEjB>4gT?dr0Jk)g@%NSc%q~mg#9-8NC+@k855=mybX$PY_GkZb6?+D!5KvqNOqFG zzTZ9f zhy`Nw0G6yLsmAvVI?)5dcu3RNn9#>!=_^f}_`(qt^~WScW85%QC9DMHCZN3Vj@UsO z?FxfEJOUvjJHZ}lb^FcUuz+!*^7{wVc;*k2I&p#2lJGC3Am%1;{1pwU6Xv{ z$a=P($P-dgFTLY}-Z($TwyjRs+vB`*qiL-X> zjR`-j%q=U6=zPTKoB`UC{IYVdcgmRq){~*YX>9j+1VQ88`O|RAem{KKRe53I-sFA{ z=o^%G?rdt(<%!U7k*dDUVI4OpXJufg@Iik%3pCVZYgZbSd>|d8ew5ZUr{d8QvUa6n z82L&P2V_-^(~@{7mQmB!h3&ZcGk%b=+J1=^A{L>6`I}@C7zT$iZDH{_O2gDqPrXYBDp>X0jOh28x;G2#uTh^l6>uLtUM=LQPcCIzLJ3ye+2o= zj$E%-yv-nwT`65&2_|EsIZ@1wx4t+EFvc%fSR}i@HSL2phJkPWnI4_!cunh1c+uNS zL-x8Q2~5Pj-^0pF7q>+;J)CCnT-s{#p?$>)i0>Z2ZuE1&AWZ>y4Rz;o7%wQp7Zik@ zUpXG*ABbmi!3*?aGY*ae^1f<9^3FD^E&1vx)=&8N@xr9|A0Ih~UCX;%S7RtY2Q;|8 zY)5J-*hwIUMhf`_#57zd)!QbO9AoTuOie2s>DXaqwXunO98pIntybnLf^}_F4N=Dn?;JTp3&kT3Yz;{``e{E zM~3GVCgdkhRKOO}^}zzoNU8_)^E`n1-LCOa%a8^BI}6x|jS&38ppgy!^wfea_X-!R zf}AJ$w&Sr6QOsFbnfiu30>>cWfwXt<+JK zzoK$Fn=j><$Fj4wasPV#*bmXqu|NWXiGZ+-9QpPK1DHZtZZK3eO>3*^X5HXgl94eb zV|9lVOlJ*H_Q5!All1H<)9dUSA$kPQ`=oWPog+jYl^GDdD~Y zN3Hwshuw_!6@K-itfJfCZRME;?l&|?gqC+ro-(;9yJdb)4ZRL60r|7s+)pUZeWUPdH4XMi96YC z_v?2a-|zQ*=bW$QX--bIG&3hZJDw17{`~nx3>RcSkC;M3oRdArg_wf}@e3~3Tmk;C zhNmWpkhez@vc*EkNqGKR6No?v%rMvn6&O_Dz9}&8h*IuV%Ewt%LS$LyE?-4#Glenv z`6A-FWDOtwiP;~}aQ!}p<20P{4#VwXEZ#Rq@6$wPAiK~}dKUe&Sa^Q=KxHo;URE`& zV>dKPLkryz56q6k9ufOMt`R@d94F}P{CmnI?>bvZ4@vyT^%zr$`j~;Mk34^f=D*L6ST4|Tm~X!UvwKXZ zha}Crt6da}40etS8n7T#(ZJ%czG)p9rntDy>s3AIAEi#UxHey&b0#B@L;GkW`Zup2 zH**Q-@u|(r;w4E^$eTOArhMUYce>ocLg3Fqi>~kUV`4_JQxy!@s#;R5C!={q+x+Z&l7@`Kd?|T`=>rKnZ2ghF6jsG}W@ea8+I;v4@X_&y5zWgC@lUn1TB7|~ zMjHA9ed%s?pf5)4$Umsl->O3R1N!R9t-$K ze*3Yf2=>DVZ3KiNB&`p~uMM^%mSs^)+3Kjcq?Dy${CVDDsr8{=n*tbr^A=fdXQw$$ zK)w?4{TL=8rxLaENaG)i*?9oVYxXc69fM=-5kBGm2K{0A82&pV<1rs(d3Ow65W)M~ z&@LAS=$g9YJ8dTlJna0u<^C`~R#1ldfqLKto?fh6h?0hOgFtAJ1lG z%jS4I_F&iZ?v-!`=)Oitiy4l5jhYlLbHe>2W#6CWm-q(GxADpFc=FnXS1SU(rT}6n z%OclG9TduV2x$swcoyAR*Sw*21onrrjf{E|=d&HevIG1VV)Y$$Nh$fzQ98~E{h{pU zX*1L?(AYItRUMfh%iR73^B!$IwC~zAbeA40O1eS^2vjdP-l?WOQTyUc*XCZC4spdY zsBlGF-uQ17v-hiDGx{S*qOi2h;Z}X!16UUFhO!qJ2%@fRv8twq23=WbRfmED`t{Sn zfhbtmk_HmV2=J#7%CZfavi$N#G|*lX{4S)AD42YgE6%~Sh5R{=mq+$fdX`&M7L?Fc1;P;pRs@!J3Q#we+?($ zPl2J7L)Yx^pqt4~OxyBw3hEHbO>`)jB(2X@aykh^PRZ4l8uRFkMf5@Y;Z(ZAt zpLfu-4!PmLQxA4k^%MbSVOucqP<)FrseNQ1mGy_OCkg(`P4sA4F{ULn4yt)*Nd(7F zo*WF)9}p9JqyMIF#*8XT$5h9SCl{x#?#}WI=`UKstk?k_ScZ<8Iy(|JBtWuq*;&WZ z>Na6XB#BrhC)X?GX|6pK-H>^XjOc~k@^~PJVQ|y-ey}M3*&1?_m#zEh^_uEvkrfXo XD(Ly_1!ZG=;1zEnsF%(Dz%BASCEq~? literal 0 HcmV?d00001 diff --git a/addons/medical/ui/icons/icon_tourniquet.paa b/addons/medical/ui/icons/icon_tourniquet.paa new file mode 100644 index 0000000000000000000000000000000000000000..6497420e54070ceb28abffa8e9bb58eefa241bd9 GIT binary patch literal 5625 zcmeHLZ%kWN6hE)@4N7Fxu^N|BEgNNVj0`oaOVIGp3`QKT#$McJAh1No$e{a3G=y%$ z7{3g4L1Q9waWN{IY$N#egO)BvmZ^!vg{`jAlFWabk|Hn)qwV#a_joOX8Uk6i#&D9? z*K^Oi=ic)>=bn4+6?sKPne(ZN>M}h5jE#+LR`}gzRm5{7;w#E_mJ=`FL;Q2)<+~*O z@5bjfBfzn>0G%d)U+`HPNgx5Bh80>tU$t^G3H#hq7>Vt9<>>cMPh{r5+?^RhSz~n@7$~n2=zeh_cTOpANPfo~HzS4h66+9#W z{eIMU#^P7;ai%;zHg0b`Wp8}cgZ7D{D5zFZLY@h*cQ$1vcu$y;a)J+%{Sv5 zhvIky!ZQKGAgkpg2nG`I09k_#Q|(bF#tQY8uzlTiIm>@wM&W7otoCBOv`3AE7h`uG zuZ>XoMm{cSvde@E+QN703gkw!YNue@5u!-%*h>EO4iBG1elz+`a80NV zB?%tmr^OxTJ%~pUd%kY29CTaRuVZbaGy>-}AzgR(Cz;>A+IppJQo+Z8aOl+amj z_1=otAOfbz2`@mvR(<(kqyklTh1B?2`U!(r zQKf&;&>4&Gbo3&vH>X3oyI>?4U0-RB$B&5dW4<_@9h3K&gG&4eCigVr!#g5s{Pb?gd^z&kaUkI<(|KL8ECJ!d&?MmH{Nc&vh5NAjOh*SFK@q>xEzdZ4$uc>{*Df`{12 z_EUEF&UIDEzPP~V+iMFD2IJ|Py*UG0a(z8&f60;h_Acg(;@R~?cu;N6P-?<`D=}q-`TSZ<%^BKB40t^|Ac@QtXQPSEkXvj7%iy)2~&a> z{^OW+yXLq4Gr7quA1LwQHpxsTadXh#uWl!~e{>g$x{{&1NFM=%+YW$t)cg^atv!~X zDGjkXb^UVZlX+UkG+(czEm1VFDoXP+u40abjR2CwW9SIHt_g(wfv;Ks_MTVEM5U}Y zT&`Omkh_etv!gSX`8?*p-l&(-Af8Gk>P=+DhpeFgL{@x~@rd^=Ww7Si;lRC;3G zz5g%%W28T^O~1~SV{ie@hswBZKWX#x2XvpefMLSj<>2EAdJ>LVIEu=8EWX+K#p`@4 z%970on-#L+Z!&pKS9$X*sFM64U>&jA$KU6Fy0#FHWZ+*YZ>v@o96i_3>g%1|7I9xx zr1)dSCz<}G%I}%CO&#mcIH+w)bWb3F0j~|zGGsgQOVxk7zcD8XEa@Pd)(_u$HORNIlpnfFrv5}+E@7vTc$Kn=8P|1p~WNyUU8YQeLEJ(kN9md-ZH4Kc%XFvuiG5N5q z!5uk4tLH_4jUOW~TYNMue&xt}Q!QFajR6}b!5cew;ds6}t;0-@85Qw73zd&-d-!do LxkgG8)w%r(;Z6Hd literal 0 HcmV?d00001 From 1d63e94fff12683ab1d52f83373f4aca946780f8 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 21 Mar 2015 16:33:14 +0100 Subject: [PATCH 50/61] canTreatCached --- addons/medical/CfgVehicles.hpp | 198 +++++++++--------- addons/medical/XEH_preInit.sqf | 1 + .../medical/functions/fnc_canTreatCached.sqf | 22 ++ 3 files changed, 122 insertions(+), 99 deletions(-) create mode 100644 addons/medical/functions/fnc_canTreatCached.sqf diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index ad9302a2e8..958c2bea84 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -353,7 +353,7 @@ class CfgVehicles { class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitHead"; distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(treatment)); showDisabled = 1; priority = 2; @@ -364,7 +364,7 @@ class CfgVehicles { class FieldDressing { displayName = "Field Dressing"; distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call DFUNC(treatment)); showDisabled = 0; priority = 2; @@ -373,32 +373,32 @@ class CfgVehicles { }; class PackingBandage: fieldDressing { displayName = "Packing Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(treatment)); }; class ElasticBandage: fieldDressing { displayName = "Elastic Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(treatment)); }; class QuikClot: fieldDressing { displayName = "QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(treatment)); }; class CheckPulse: fieldDressing { displayName = "Check Pulse"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(treatment)); }; class CheckBloodPressure: CheckPulse { displayName = "Check Blood Pressure"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call EFUNC(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(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckResponse')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckResponse')] call DFUNC(treatment)); }; }; @@ -417,7 +417,7 @@ class CfgVehicles { class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitBody"; distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(treatment)); showDisabled = 1; priority = 2; @@ -429,7 +429,7 @@ class CfgVehicles { class FieldDressing { displayName = "Field Dressing"; distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call DFUNC(treatment)); showDisabled = 0; priority = 2; @@ -438,47 +438,47 @@ class CfgVehicles { }; class PackingBandage: fieldDressing { displayName = "Packing Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(treatment)); }; class ElasticBandage: fieldDressing { displayName = "Elastic Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(treatment)); }; class QuikClot: fieldDressing { displayName = "QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(treatment)); }; class Morphine: fieldDressing { displayName = "$STR_ACE_Medical_Inject_Morphine"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'Morphine')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'body', 'Morphine')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'Morphine')] call DFUNC(treatment)); }; class Atropine: Morphine { displayName = "Atropine"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'Atropine')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'body', 'Atropine')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'Atropine')] call DFUNC(treatment)); }; class Epinephrine: Morphine { displayName = "$STR_ACE_Medical_Inject_Epinephrine"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'Epinephrine')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'body', 'Epinephrine')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'Epinephrine')] call DFUNC(treatment)); }; class SurgicalKit: fieldDressing { displayName = "Use Surgical Kit"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'SurgicalKit')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'body', 'SurgicalKit')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'SurgicalKit')] call DFUNC(treatment)); }; class PersonalAidKit: fieldDressing { displayName = "Use Personal Aid Kit"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(treatment)); }; class CPR: fieldDressing { displayName = "CPR"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'CPR')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'body', 'CPR')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'CPR')] call DFUNC(treatment)); }; }; @@ -490,7 +490,7 @@ class CfgVehicles { class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitLeftArm"; distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(treatment)); showDisabled = 1; priority = 2; @@ -502,7 +502,7 @@ class CfgVehicles { class FieldDressing { displayName = "Field Dressing"; distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call DFUNC(treatment)); showDisabled = 0; priority = 2; @@ -511,97 +511,97 @@ class CfgVehicles { }; class PackingBandage: fieldDressing { displayName = "Packing Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(treatment)); }; class ElasticBandage: fieldDressing { displayName = "Elastic Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(treatment)); }; class QuikClot: fieldDressing { displayName = "QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(treatment)); }; class Tourniquet: fieldDressing { displayName = "Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(treatment)); }; class Morphine: fieldDressing { displayName = "$STR_ACE_Medical_Inject_Morphine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(treatment)); }; class Atropine: Morphine { displayName = "Atropine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call DFUNC(treatment)); }; class Epinephrine: Morphine { displayName = "$STR_ACE_Medical_Inject_Epinephrine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(treatment)); }; class BloodIV: fieldDressing { displayName = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call DFUNC(treatment)); }; class BloodIV_500: BloodIV { displayName = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_500')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_500')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_500')] call DFUNC(treatment)); }; class BloodIV_250: BloodIV { displayName = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_250')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_250')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_250')] call DFUNC(treatment)); }; class PlasmaIV: BloodIV { displayName = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call DFUNC(treatment)); }; class PlasmaIV_500: PlasmaIV { displayName = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_500')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_500')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_500')] call DFUNC(treatment)); }; class PlasmaIV_250: PlasmaIV { displayName = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_250')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_250')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_250')] call DFUNC(treatment)); }; class SalineIV: BloodIV { displayName = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV')] call DFUNC(treatment)); }; class SalineIV_500: SalineIV { displayName = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_500')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_500')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_500')] call DFUNC(treatment)); }; class SalineIV_250: SalineIV { displayName = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_250')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_250')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_250')] call DFUNC(treatment)); }; class CheckPulse: fieldDressing { displayName = "Check Pulse"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(treatment)); }; class CheckBloodPressure: CheckPulse { displayName = "Check Blood Pressure"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(treatment)); }; class RemoveTourniquet: Tourniquet { displayName = "Remove Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(treatment)); }; }; @@ -611,7 +611,7 @@ class CfgVehicles { class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitRightArm"; distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(treatment)); showDisabled = 1; priority = 2; @@ -623,7 +623,7 @@ class CfgVehicles { class FieldDressing { displayName = "Field Dressing"; distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call DFUNC(treatment)); showDisabled = 0; priority = 2; @@ -632,97 +632,97 @@ class CfgVehicles { }; class PackingBandage: fieldDressing { displayName = "Packing Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(treatment)); }; class ElasticBandage: fieldDressing { displayName = "Elastic Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(treatment)); }; class QuikClot: fieldDressing { displayName = "QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(treatment)); }; class Tourniquet: fieldDressing { displayName = "Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(treatment)); }; class Morphine: fieldDressing { displayName = "$STR_ACE_Medical_Inject_Morphine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(treatment)); }; class Atropine: Morphine { displayName = "Atropine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Atropine')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Atropine')] call EFUNC(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(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Epinephrine')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Epinephrine')] call DFUNC(treatment)); }; class BloodIV: fieldDressing { displayName = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(treatment)); }; class BloodIV_500: BloodIV { displayName = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_500')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_500')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_500')] call DFUNC(treatment)); }; class BloodIV_250: BloodIV { displayName = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_250')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_250')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_250')] call DFUNC(treatment)); }; class PlasmaIV: BloodIV { displayName = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(treatment)); }; class PlasmaIV_500: PlasmaIV { displayName = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_500')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_500')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_500')] call DFUNC(treatment)); }; class PlasmaIV_250: PlasmaIV { displayName = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_250')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_250')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_250')] call DFUNC(treatment)); }; class SalineIV: BloodIV { displayName = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV')] call DFUNC(treatment)); }; class SalineIV_500: SalineIV { displayName = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_500')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_500')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_500')] call DFUNC(treatment)); }; class SalineIV_250: SalineIV { displayName = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_250')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_250')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_250')] call DFUNC(treatment)); }; class CheckPulse: fieldDressing { displayName = "Check Pulse"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(treatment)); }; class CheckBloodPressure: CheckPulse { displayName = "Check Blood Pressure"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(treatment)); }; class RemoveTourniquet: Tourniquet { displayName = "Remove Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(treatment)); }; @@ -733,7 +733,7 @@ class CfgVehicles { class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitLeftLeg"; distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(treatment)); showDisabled = 1; priority = 2; @@ -746,7 +746,7 @@ class CfgVehicles { class FieldDressing { displayName = "Field Dressing"; distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call DFUNC(treatment)); showDisabled = 0; priority = 2; @@ -755,87 +755,87 @@ class CfgVehicles { }; class PackingBandage: fieldDressing { displayName = "Packing Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(treatment)); }; class ElasticBandage: fieldDressing { displayName = "Elastic Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(treatment)); }; class QuikClot: fieldDressing { displayName = "QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(treatment)); }; class Tourniquet: fieldDressing { displayName = "Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(treatment)); }; class Morphine: fieldDressing { displayName = "$STR_ACE_Medical_Inject_Morphine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(treatment)); }; class Atropine: Morphine { displayName = "Atropine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call DFUNC(treatment)); }; class Epinephrine: Morphine { displayName = "$STR_ACE_Medical_Inject_Epinephrine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call DFUNC(treatment)); }; class BloodIV: fieldDressing { displayName = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(treatment)); }; class BloodIV_500: BloodIV { displayName = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_500')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_500')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_500')] call DFUNC(treatment)); }; class BloodIV_250: BloodIV { displayName = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_250')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_250')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_250')] call DFUNC(treatment)); }; class PlasmaIV: BloodIV { displayName = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(treatment)); }; class PlasmaIV_500: PlasmaIV { displayName = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_500')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_500')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_500')] call DFUNC(treatment)); }; class PlasmaIV_250: PlasmaIV { displayName = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_250')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_250')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_250')] call DFUNC(treatment)); }; class SalineIV: BloodIV { displayName = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV')] call DFUNC(treatment)); }; class SalineIV_500: SalineIV { displayName = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_500')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_500')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_500')] call DFUNC(treatment)); }; class SalineIV_250: SalineIV { displayName = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_250')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_250')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_250')] call DFUNC(treatment)); }; class RemoveTourniquet: Tourniquet { displayName = "Remove Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(treatment)); }; }; @@ -845,7 +845,7 @@ class CfgVehicles { class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitRightLeg"; distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(treatment)); showDisabled = 1; priority = 2; @@ -858,7 +858,7 @@ class CfgVehicles { class FieldDressing { displayName = "Field Dressing"; distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call DFUNC(treatment)); showDisabled = 0; priority = 2; @@ -867,87 +867,87 @@ class CfgVehicles { }; class PackingBandage: fieldDressing { displayName = "Packing Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(treatment)); }; class ElasticBandage: fieldDressing { displayName = "Elastic Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(treatment)); }; class QuikClot: fieldDressing { displayName = "QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(treatment)); }; class Tourniquet: fieldDressing { displayName = "Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(treatment)); }; class Morphine: fieldDressing { displayName = "$STR_ACE_Medical_Inject_Morphine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(treatment)); }; class Atropine: Morphine { displayName = "Atropine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Atropine')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Atropine')] call EFUNC(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(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Epinephrine')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Epinephrine')] call DFUNC(treatment)); }; class BloodIV: fieldDressing { displayName = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(treatment)); }; class BloodIV_500: BloodIV { displayName = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_500')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_500')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_500')] call DFUNC(treatment)); }; class BloodIV_250: BloodIV { displayName = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_250')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_250')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_250')] call DFUNC(treatment)); }; class PlasmaIV: BloodIV { displayName = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(treatment)); }; class PlasmaIV_500: PlasmaIV { displayName = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_500')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_500')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_500')] call DFUNC(treatment)); }; class PlasmaIV_250: PlasmaIV { displayName = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_250')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_250')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_250')] call DFUNC(treatment)); }; class SalineIV: BloodIV { displayName = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV')] call DFUNC(treatment)); }; class SalineIV_500: SalineIV { displayName = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_500')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_500')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_500')] call DFUNC(treatment)); }; class SalineIV_250: SalineIV { displayName = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_250')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_250')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_250')] call DFUNC(treatment)); }; class RemoveTourniquet: Tourniquet { displayName = "Remove Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(canTreat)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call EFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(treatment)); }; }; diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index a670244302..014e1645d0 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -18,6 +18,7 @@ PREP(addToTriageCard); PREP(addUnconsciousCondition); PREP(canAccessMedicalEquipment); PREP(canTreat); +PREP(canTreatCached); PREP(determineIfFatal); PREP(getBloodLoss); PREP(getBloodPressure); diff --git a/addons/medical/functions/fnc_canTreatCached.sqf b/addons/medical/functions/fnc_canTreatCached.sqf new file mode 100644 index 0000000000..f375e1417a --- /dev/null +++ b/addons/medical/functions/fnc_canTreatCached.sqf @@ -0,0 +1,22 @@ +/* + * Author: Glowbal + * Cached Check if the treatment action can be performed. + * + * Arguments: + * 0: The caller + * 1: The target + * 2: Selection name + * 3: ACE_Medical_Treatments Classname + * + * ReturnValue: + * Can Treat + * + * Public: No + */ + +#include "script_component.hpp" + +#define MAX_DURATION_CACHE 1.5 + +// parameters, function, namespace, uid +[_this, FUNC(canTreat), missionNamespace, format[QGVAR(canTreat_%1_%2), _this select 2, _this select 3], MAX_DURATION_CACHE] call EFUNC(common,canTreat); From d0b14286ff2bc750a4855f7639481f009953c449 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 21 Mar 2015 16:34:42 +0100 Subject: [PATCH 51/61] Wrong function name --- addons/medical/functions/fnc_canTreatCached.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_canTreatCached.sqf b/addons/medical/functions/fnc_canTreatCached.sqf index f375e1417a..20a19beb58 100644 --- a/addons/medical/functions/fnc_canTreatCached.sqf +++ b/addons/medical/functions/fnc_canTreatCached.sqf @@ -19,4 +19,4 @@ #define MAX_DURATION_CACHE 1.5 // parameters, function, namespace, uid -[_this, FUNC(canTreat), missionNamespace, format[QGVAR(canTreat_%1_%2), _this select 2, _this select 3], MAX_DURATION_CACHE] call EFUNC(common,canTreat); +[_this, FUNC(canTreat), missionNamespace, format[QGVAR(canTreat_%1_%2), _this select 2, _this select 3], MAX_DURATION_CACHE] call EFUNC(common,cachedCall); From 7ae45fbeff3ca348d63fe1a4846f4c4ce868d085 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 21 Mar 2015 16:47:51 +0100 Subject: [PATCH 52/61] Fixed canTreatCached --- addons/medical/CfgVehicles.hpp | 207 ++++++++---------- .../medical/functions/fnc_canTreatCached.sqf | 4 +- 2 files changed, 98 insertions(+), 113 deletions(-) diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 958c2bea84..6040772d07 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -353,7 +353,7 @@ class CfgVehicles { class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitHead"; distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call EFUNC(canTreatCached)); + 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; @@ -364,7 +364,7 @@ class CfgVehicles { class FieldDressing { displayName = "Field Dressing"; distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call EFUNC(canTreatCached)); + 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; @@ -373,32 +373,32 @@ class CfgVehicles { }; class PackingBandage: fieldDressing { displayName = "Packing Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(treatment)); }; class ElasticBandage: fieldDressing { displayName = "Elastic Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(treatment)); }; class QuikClot: fieldDressing { displayName = "QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(treatment)); }; class CheckPulse: fieldDressing { displayName = "Check Pulse"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(treatment)); }; class CheckBloodPressure: CheckPulse { displayName = "Check Blood Pressure"; - condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call EFUNC(canTreatCached)); + 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 EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckResponse')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckResponse')] call DFUNC(treatment)); }; }; @@ -417,7 +417,7 @@ class CfgVehicles { class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitBody"; distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call EFUNC(canTreatCached)); + 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; @@ -429,7 +429,7 @@ class CfgVehicles { class FieldDressing { displayName = "Field Dressing"; distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call EFUNC(canTreatCached)); + 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; @@ -438,47 +438,32 @@ class CfgVehicles { }; class PackingBandage: fieldDressing { displayName = "Packing Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(treatment)); }; class ElasticBandage: fieldDressing { displayName = "Elastic Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(treatment)); }; class QuikClot: fieldDressing { displayName = "QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(treatment)); }; - class Morphine: fieldDressing { - displayName = "$STR_ACE_Medical_Inject_Morphine"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'Morphine')] call EFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'body', 'Morphine')] call DFUNC(treatment)); - }; - class Atropine: Morphine { - displayName = "Atropine"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'Atropine')] call EFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'body', 'Atropine')] call DFUNC(treatment)); - }; - class Epinephrine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Epinephrine"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'Epinephrine')] call EFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'body', 'Epinephrine')] call DFUNC(treatment)); - }; class SurgicalKit: fieldDressing { displayName = "Use Surgical Kit"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'SurgicalKit')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'body', 'SurgicalKit')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'SurgicalKit')] call DFUNC(treatment)); }; class PersonalAidKit: fieldDressing { displayName = "Use Personal Aid Kit"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(treatment)); }; class CPR: fieldDressing { displayName = "CPR"; - condition = QUOTE([ARR_4(_player, _target, 'body', 'CPR')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'body', 'CPR')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'CPR')] call DFUNC(treatment)); }; }; @@ -490,7 +475,7 @@ class CfgVehicles { class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitLeftArm"; distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call EFUNC(canTreatCached)); + 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; @@ -502,7 +487,7 @@ class CfgVehicles { class FieldDressing { displayName = "Field Dressing"; distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call EFUNC(canTreatCached)); + 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; @@ -511,97 +496,97 @@ class CfgVehicles { }; class PackingBandage: fieldDressing { displayName = "Packing Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(treatment)); }; class ElasticBandage: fieldDressing { displayName = "Elastic Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(treatment)); }; class QuikClot: fieldDressing { displayName = "QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(treatment)); }; class Tourniquet: fieldDressing { displayName = "Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(treatment)); }; class Morphine: fieldDressing { displayName = "$STR_ACE_Medical_Inject_Morphine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(treatment)); }; class Atropine: Morphine { displayName = "Atropine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call DFUNC(treatment)); }; class Epinephrine: Morphine { displayName = "$STR_ACE_Medical_Inject_Epinephrine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(treatment)); }; class BloodIV: fieldDressing { displayName = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call DFUNC(treatment)); }; class BloodIV_500: BloodIV { displayName = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_500')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_250')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call DFUNC(treatment)); }; class PlasmaIV_500: PlasmaIV { displayName = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_500')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_250')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_500')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_250')] call EFUNC(canTreatCached)); + 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 = "Check Pulse"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(treatment)); }; class CheckBloodPressure: CheckPulse { displayName = "Check Blood Pressure"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call EFUNC(canTreatCached)); + 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 = "Remove Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(treatment)); }; }; @@ -611,7 +596,7 @@ class CfgVehicles { class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitRightArm"; distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call EFUNC(canTreatCached)); + 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; @@ -623,7 +608,7 @@ class CfgVehicles { class FieldDressing { displayName = "Field Dressing"; distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call EFUNC(canTreatCached)); + 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; @@ -632,97 +617,97 @@ class CfgVehicles { }; class PackingBandage: fieldDressing { displayName = "Packing Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(treatment)); }; class ElasticBandage: fieldDressing { displayName = "Elastic Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call EFUNC(canTreatCached)); + 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 = "QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call EFUNC(canTreatCached)); + 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 = "Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(treatment)); }; class Morphine: fieldDressing { displayName = "$STR_ACE_Medical_Inject_Morphine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(treatment)); }; class Atropine: Morphine { displayName = "Atropine"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Atropine')] call EFUNC(canTreatCached)); + 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 EFUNC(canTreatCached)); + 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 = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call EFUNC(canTreatCached)); + 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 BloodIV_500: BloodIV { displayName = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_500')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_250')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_500')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_250')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_500')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_250')] call EFUNC(canTreatCached)); + 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 = "Check Pulse"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(treatment)); }; class CheckBloodPressure: CheckPulse { displayName = "Check Blood Pressure"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call EFUNC(canTreatCached)); + 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 = "Remove Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(treatment)); }; @@ -733,7 +718,7 @@ class CfgVehicles { class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitLeftLeg"; distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call EFUNC(canTreatCached)); + 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; @@ -746,7 +731,7 @@ class CfgVehicles { class FieldDressing { displayName = "Field Dressing"; distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call EFUNC(canTreatCached)); + 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; @@ -755,87 +740,87 @@ class CfgVehicles { }; class PackingBandage: fieldDressing { displayName = "Packing Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(treatment)); }; class ElasticBandage: fieldDressing { displayName = "Elastic Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call EFUNC(canTreatCached)); + 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 = "QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call EFUNC(canTreatCached)); + 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 = "Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(treatment)); }; class Morphine: fieldDressing { displayName = "$STR_ACE_Medical_Inject_Morphine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(treatment)); }; class Atropine: Morphine { displayName = "Atropine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call DFUNC(treatment)); }; class Epinephrine: Morphine { displayName = "$STR_ACE_Medical_Inject_Epinephrine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call EFUNC(canTreatCached)); + 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 BloodIV_500: BloodIV { displayName = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_500')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_250')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_500')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_250')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_500')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_250')] call EFUNC(canTreatCached)); + 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 = "Remove Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(treatment)); }; }; @@ -845,7 +830,7 @@ class CfgVehicles { class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitRightLeg"; distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call EFUNC(canTreatCached)); + 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; @@ -858,7 +843,7 @@ class CfgVehicles { class FieldDressing { displayName = "Field Dressing"; distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call EFUNC(canTreatCached)); + 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; @@ -867,87 +852,87 @@ class CfgVehicles { }; class PackingBandage: fieldDressing { displayName = "Packing Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(treatment)); }; class ElasticBandage: fieldDressing { displayName = "Elastic Bandage"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call EFUNC(canTreatCached)); + 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 = "QuikClot"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call EFUNC(canTreatCached)); + 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 = "Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(treatment)); }; class Morphine: fieldDressing { displayName = "$STR_ACE_Medical_Inject_Morphine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(treatment)); }; class Atropine: Morphine { displayName = "Atropine"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Atropine')] call EFUNC(canTreatCached)); + 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 EFUNC(canTreatCached)); + 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 = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call EFUNC(canTreatCached)); + 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 BloodIV_500: BloodIV { displayName = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_500')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_250')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_500')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_250')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (1000ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (500ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_500')] call EFUNC(canTreatCached)); + 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 = "Give Blood IV (250ml)"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_250')] call EFUNC(canTreatCached)); + 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 = "Remove Tourniquet"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call EFUNC(canTreatCached)); + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(treatment)); }; }; diff --git a/addons/medical/functions/fnc_canTreatCached.sqf b/addons/medical/functions/fnc_canTreatCached.sqf index 20a19beb58..cdc4c10385 100644 --- a/addons/medical/functions/fnc_canTreatCached.sqf +++ b/addons/medical/functions/fnc_canTreatCached.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -#define MAX_DURATION_CACHE 1.5 +#define MAX_DURATION_CACHE 2 // parameters, function, namespace, uid -[_this, FUNC(canTreat), missionNamespace, format[QGVAR(canTreat_%1_%2), _this select 2, _this select 3], MAX_DURATION_CACHE] call EFUNC(common,cachedCall); +[_this, DFUNC(canTreat), _this select 0, format[QGVAR(canTreat_%1_%2), _this select 2, _this select 3], MAX_DURATION_CACHE] call EFUNC(common,cachedCall); From 82ec93b84ea65ff49b565237557f4cd890ebb1b6 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 21 Mar 2015 17:05:32 +0100 Subject: [PATCH 53/61] Medical icons --- addons/medical/CfgVehicles.hpp | 53 ++++++++++++++++++ ...icon_autoInjector.paa => autoInjector.paa} | Bin .../icons/{icon_bandage.paa => bandage.paa} | Bin .../icons/{icon_bodybag.paa => bodybag.paa} | Bin .../medical/ui/icons/{icon_iv.paa => iv.paa} | Bin ...on_medical_cross.paa => medical_cross.paa} | Bin ..._packingBandage.paa => packingBandage.paa} | Bin .../{icon_surgicalKit.paa => surgicalKit.paa} | Bin .../{icon_tourniquet.paa => tourniquet.paa} | Bin 9 files changed, 53 insertions(+) rename addons/medical/ui/icons/{icon_autoInjector.paa => autoInjector.paa} (100%) rename addons/medical/ui/icons/{icon_bandage.paa => bandage.paa} (100%) rename addons/medical/ui/icons/{icon_bodybag.paa => bodybag.paa} (100%) rename addons/medical/ui/icons/{icon_iv.paa => iv.paa} (100%) rename addons/medical/ui/icons/{icon_medical_cross.paa => medical_cross.paa} (100%) rename addons/medical/ui/icons/{icon_packingBandage.paa => packingBandage.paa} (100%) rename addons/medical/ui/icons/{icon_surgicalKit.paa => surgicalKit.paa} (100%) rename addons/medical/ui/icons/{icon_tourniquet.paa => tourniquet.paa} (100%) diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 6040772d07..c640d411f9 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -349,6 +349,7 @@ class CfgVehicles { class ACE_Head { runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); + icon = PATHTOF(UI\icons\medical_cross.paa); class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitHead"; @@ -359,6 +360,7 @@ class CfgVehicles { priority = 2; hotkey = "B"; enableInside = 1; + icon = PATHTOF(UI\icons\bandage.paa); }; // Advanced medical class FieldDressing { @@ -370,26 +372,31 @@ class CfgVehicles { priority = 2; hotkey = ""; enableInside = 1; + icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { displayName = "Packing Bandage"; 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 = "Elastic Bandage"; 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 = "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 = "Check Pulse"; 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 = "Check Blood Pressure"; @@ -413,6 +420,7 @@ class CfgVehicles { priority = 2; hotkey = "M"; enableInside = 1; + icon = PATHTOF(UI\icons\medical_cross.paa); class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitBody"; @@ -423,6 +431,7 @@ class CfgVehicles { priority = 2; hotkey = "B"; enableInside = 1; + icon = PATHTOF(UI\icons\bandage.paa); }; // Advanced medical @@ -435,42 +444,50 @@ class CfgVehicles { priority = 2; hotkey = ""; enableInside = 1; + icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { displayName = "Packing Bandage"; 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 = "Elastic Bandage"; 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 = "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', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] 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); class Bandage { displayName = "$STR_ACE_Medical_Bandage_HitLeftArm"; @@ -481,6 +498,7 @@ class CfgVehicles { priority = 2; hotkey = "B"; enableInside = 1; + icon = PATHTOF(UI\icons\bandage.paa); }; // Advanced medical @@ -493,46 +511,55 @@ class CfgVehicles { priority = 2; hotkey = ""; enableInside = 1; + icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { displayName = "Packing Bandage"; 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 = "Elastic Bandage"; 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 = "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 = "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 = "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 = "Give Blood IV (1000ml)"; 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 = "Give Blood IV (500ml)"; @@ -578,6 +605,7 @@ class CfgVehicles { displayName = "Check Pulse"; 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 = "Check Blood Pressure"; @@ -593,6 +621,8 @@ class CfgVehicles { class ACE_ArmRight { runOnHover = 1; 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; @@ -602,6 +632,7 @@ class CfgVehicles { priority = 2; hotkey = "B"; enableInside = 1; + icon = PATHTOF(UI\icons\bandage.paa); }; // Advanced medical @@ -614,11 +645,13 @@ class CfgVehicles { priority = 2; hotkey = ""; enableInside = 1; + icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { displayName = "Packing Bandage"; 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 = "Elastic Bandage"; @@ -634,11 +667,13 @@ class CfgVehicles { displayName = "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 = "Atropine"; @@ -654,6 +689,7 @@ class CfgVehicles { displayName = "Give Blood IV (1000ml)"; 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 = "Give Blood IV (500ml)"; @@ -699,6 +735,7 @@ class CfgVehicles { displayName = "Check Pulse"; 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 = "Check Blood Pressure"; @@ -715,6 +752,8 @@ class CfgVehicles { class ACE_LegLeft { runOnHover = 1; 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; @@ -724,6 +763,7 @@ class CfgVehicles { priority = 2; hotkey = "B"; enableInside = 1; + icon = PATHTOF(UI\icons\bandage.paa); }; @@ -737,11 +777,13 @@ class CfgVehicles { priority = 2; hotkey = ""; enableInside = 1; + icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { displayName = "Packing Bandage"; 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 = "Elastic Bandage"; @@ -757,6 +799,7 @@ class CfgVehicles { displayName = "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"; @@ -767,6 +810,7 @@ class CfgVehicles { displayName = "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"; @@ -777,6 +821,7 @@ class CfgVehicles { displayName = "Give Blood IV (1000ml)"; 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 = "Give Blood IV (500ml)"; @@ -827,6 +872,8 @@ class CfgVehicles { class ACE_LegRight { runOnHover = 1; 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; @@ -836,6 +883,7 @@ class CfgVehicles { priority = 2; hotkey = "B"; enableInside = 1; + icon = PATHTOF(UI\icons\bandage.paa); }; @@ -849,11 +897,13 @@ class CfgVehicles { priority = 2; hotkey = ""; enableInside = 1; + icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { displayName = "Packing Bandage"; 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 = "Elastic Bandage"; @@ -869,11 +919,13 @@ class CfgVehicles { displayName = "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 = "Atropine"; @@ -889,6 +941,7 @@ class CfgVehicles { displayName = "Give Blood IV (1000ml)"; 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 = "Give Blood IV (500ml)"; diff --git a/addons/medical/ui/icons/icon_autoInjector.paa b/addons/medical/ui/icons/autoInjector.paa similarity index 100% rename from addons/medical/ui/icons/icon_autoInjector.paa rename to addons/medical/ui/icons/autoInjector.paa diff --git a/addons/medical/ui/icons/icon_bandage.paa b/addons/medical/ui/icons/bandage.paa similarity index 100% rename from addons/medical/ui/icons/icon_bandage.paa rename to addons/medical/ui/icons/bandage.paa diff --git a/addons/medical/ui/icons/icon_bodybag.paa b/addons/medical/ui/icons/bodybag.paa similarity index 100% rename from addons/medical/ui/icons/icon_bodybag.paa rename to addons/medical/ui/icons/bodybag.paa diff --git a/addons/medical/ui/icons/icon_iv.paa b/addons/medical/ui/icons/iv.paa similarity index 100% rename from addons/medical/ui/icons/icon_iv.paa rename to addons/medical/ui/icons/iv.paa diff --git a/addons/medical/ui/icons/icon_medical_cross.paa b/addons/medical/ui/icons/medical_cross.paa similarity index 100% rename from addons/medical/ui/icons/icon_medical_cross.paa rename to addons/medical/ui/icons/medical_cross.paa diff --git a/addons/medical/ui/icons/icon_packingBandage.paa b/addons/medical/ui/icons/packingBandage.paa similarity index 100% rename from addons/medical/ui/icons/icon_packingBandage.paa rename to addons/medical/ui/icons/packingBandage.paa diff --git a/addons/medical/ui/icons/icon_surgicalKit.paa b/addons/medical/ui/icons/surgicalKit.paa similarity index 100% rename from addons/medical/ui/icons/icon_surgicalKit.paa rename to addons/medical/ui/icons/surgicalKit.paa diff --git a/addons/medical/ui/icons/icon_tourniquet.paa b/addons/medical/ui/icons/tourniquet.paa similarity index 100% rename from addons/medical/ui/icons/icon_tourniquet.paa rename to addons/medical/ui/icons/tourniquet.paa From 7d6afdf1a98d95eedf5a8435b04c5a8f7539b340 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 21 Mar 2015 17:30:49 +0100 Subject: [PATCH 54/61] Added triage card option --- addons/medical/CfgVehicles.hpp | 12 ++++++++++++ addons/medical/ui/icons/triageCard.paa | Bin 0 -> 5625 bytes 2 files changed, 12 insertions(+) create mode 100644 addons/medical/ui/icons/triageCard.paa diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index c640d411f9..af489e1d37 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -434,6 +434,18 @@ class CfgVehicles { icon = PATHTOF(UI\icons\bandage.paa); }; + 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); + }; + // Advanced medical class FieldDressing { displayName = "Field Dressing"; diff --git a/addons/medical/ui/icons/triageCard.paa b/addons/medical/ui/icons/triageCard.paa new file mode 100644 index 0000000000000000000000000000000000000000..0a1865fc9fd59d812bf5c4410d0a5038653d22dd GIT binary patch literal 5625 zcmc(j4QNwW6o5}&lA07-GqG4%p>Ote)0UxZS|$o6>iV-OD=x3mQ6ZMO4Z*eyD#~zu z&4zQrW+!xPZl$eG&_YoM7AL6D&8ln!H*A$f5?80ixvl=S(Y1MZ=e+d3_fjp^G15!^ zzIX1=Ip>~x?!B?Ik`j-1X-S301^`Dw(RCWH@~j|cScpqJ%ZrIE_$Ge6xcD_U{#Nk) zkqh9{X#h=G0GILoWW^0`0PJCciwnwjN@Y`FQ6GRT%a#NS=m3pTLy{Y8cXe(EcQ)I& ze1g>n24#&le2FSR78cTrim1{Pnn?P5m?KP7yXV_2T+Y~!svGNZCb{hMmUAAfKk9oT z%XsZ)WKYxl3~mo&n?eF8Zi6o#19(>VAJz9OhCj6SvagcY=l+;T+iC2v>`&;MmCyBM zY@JGr*x;i*e!tSnIm$W@3*cVQnXxEFj@8OpWlPj@x6yth`BRp?q{D=k49L9V&is9w z7XNlT*O%;fS`B>}yLc>-*b>^3y%+GOQGfbzd6tK4H zqI}_%Q|^llG#+21S3VX)zvD5~C1`Ns7w1SUy9>apaAxeKE)eX3!O8V$Lm=Bm%TsRe z=mE#Hzwh4AOzuGKZyCH9_XE)5Arkxiu;B0=<#NWh z^gBRs8q9x9u>IXd)o6cV4xV4^cKd8LO!~NRo;QaSOi5fz##V>YlXzFpz9iP{*XvV$ z#NH&x`f3mR3*y8%ZT*i*};6UA0%6}^YQUtRN=D!LWJ(VTrX6O36qN=&}!oR*{G$7Uw#DdGs$h(p6W-{`gK~?9 zU0`#=_LZ1TiBnv1ZlLkF1m5}%VDoH?ozbZeUEnzjqTFt*cTW&mN#a?gEcXw}XUSp` zi!v?8GxY2Kd8bYoEe?PhZ*ae<<#C_7)-Pe z4WaS%_ul3VQ!R7J-wl6b{Cg`>zW%4(PsINu)YgItkZGq}fZoDWh3#1Q{Pq^^POx?> z0!e2rUp69-)KBo6#0AuTh~im%L6`plLJ)p>gSWRr=`Rwdz}`Z#KlSV1@>Ee(7_X#< zKE(OQ{DaA_k@P88NV8|Kb2Pu0EO(6JvD!}s;cM!D#u^SJRw$(5~L{llUD;bFAT znKXVl@-Bei7%v>Ln~pJz6{~Iq&pl8UplQ>tDW)(Lah!4aV{5{Gx>O|FACAD3d8TXQ zmmwiNxWLfo*B-FiGe^w%&-OQLMdL#?!_EEL_@-lcI5PiK08L1YK*t_&vc= z4@QD@z@q()6OicAgHfw*QzBLykNwKF>ow?qH4wDT@cG*H@jbzS!@SLKzIlh;ZD9ks zp5PuA$)E|%349~>)i(4#uS`*cVBN*R0@ls5SIF5I=jLVamP#7}Kn+|bA#w6KnmWo)&T z-qD_`k(ke!pOvU>N)sawc>5(w@3&CJl zE@oC}y;iWW9pr8syrM13z-evwlpUD2+<0qgD|)AIV|CwG7}dC^VS?Ef51)vKHzAjo z`^#6hp>SjM2Zu;rw|77pIuXCLBjeIRw7)KgHk@z5$DWfn_9wLa E7a_Q*_W%F@ literal 0 HcmV?d00001 From 8a9ac4147f47338db80d22295f81190a6dad93dd Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 21 Mar 2015 12:14:38 -0500 Subject: [PATCH 55/61] Update $PBOPREFIX$ Only getting error on server, not client `Warning Message: Script z\ace\addons\gforces\XEH_preInit.sqf not found` --- addons/gforces/$PBOPREFIX$ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/gforces/$PBOPREFIX$ b/addons/gforces/$PBOPREFIX$ index 215e681d94..15f2f61c42 100644 --- a/addons/gforces/$PBOPREFIX$ +++ b/addons/gforces/$PBOPREFIX$ @@ -1 +1 @@ -z\ace\addons\hearing \ No newline at end of file +z\ace\addons\gforces From 054f21eedeb205bc3e030ed6ebc6185255be4a41 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 21 Mar 2015 12:18:19 -0500 Subject: [PATCH 56/61] +2more --- addons/maptools/$PBOPREFIX$ | 2 +- addons/smallarms/$PBOPREFIX$ | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/maptools/$PBOPREFIX$ b/addons/maptools/$PBOPREFIX$ index 11a24a58d8..15fe8ae13f 100644 --- a/addons/maptools/$PBOPREFIX$ +++ b/addons/maptools/$PBOPREFIX$ @@ -1 +1 @@ -z\ace\Addons\map \ No newline at end of file +z\ace\Addons\maptools \ No newline at end of file diff --git a/addons/smallarms/$PBOPREFIX$ b/addons/smallarms/$PBOPREFIX$ index 9d0480659e..9d177151a4 100644 --- a/addons/smallarms/$PBOPREFIX$ +++ b/addons/smallarms/$PBOPREFIX$ @@ -1 +1 @@ -z\ace\addons\switchunits \ No newline at end of file +z\ace\addons\smallarms \ No newline at end of file From dbb976503513158288f266d2aade4704443b2e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sat, 21 Mar 2015 14:28:17 -0300 Subject: [PATCH 57/61] Fix isSubPath --- addons/interact_menu/functions/fnc_isSubPath.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/interact_menu/functions/fnc_isSubPath.sqf b/addons/interact_menu/functions/fnc_isSubPath.sqf index e90aa12300..1f086fb809 100644 --- a/addons/interact_menu/functions/fnc_isSubPath.sqf +++ b/addons/interact_menu/functions/fnc_isSubPath.sqf @@ -20,7 +20,7 @@ _isSubPath = true; if (count _shortPath > count _longPath) exitWith {false}; -for [{_i = 0},{_i < (count _shortPath) - 1},{_i = _i + 1}] do { +for [{_i = 0},{_i < count _shortPath},{_i = _i + 1}] do { if !((_longPath select _i) isEqualTo (_shortPath select _i)) exitWith { _isSubPath = false; }; From 9578024693e778c19317f9b0de797b1e960fef70 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 21 Mar 2015 12:52:08 -0500 Subject: [PATCH 58/61] Dupe stringtable entry `Item STR_ACE_MEDICAL_BANDAGING listed twice` --- addons/medical/stringtable.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 6317f97b06..9942ef02c0 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -680,11 +680,6 @@ Вы осмотрели раненого %1 Examinas a %1 - - Bandaging - Перевязка... - Vendando - Bandaged Повязка наложена From f8ea603977dca2fc062e2f64bc6e93adec9faecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sat, 21 Mar 2015 15:32:32 -0300 Subject: [PATCH 59/61] Added dynamic actions to unload patients (unconscious) from vehicles --- .../functions/fnc_addPassengerActions.sqf | 1 - .../functions/fnc_addPassengersActions.sqf | 3 +- addons/medical/CfgVehicles.hpp | 94 +++++++++++++++++++ addons/medical/XEH_preInit.sqf | 1 + .../functions/fnc_addUnloadPatientActions.sqf | 48 ++++++++++ addons/medical/stringtable.xml | 3 + 6 files changed, 147 insertions(+), 3 deletions(-) create mode 100644 addons/medical/functions/fnc_addUnloadPatientActions.sqf diff --git a/addons/interaction/functions/fnc_addPassengerActions.sqf b/addons/interaction/functions/fnc_addPassengerActions.sqf index d4a5da3788..dfe3b2e9b6 100644 --- a/addons/interaction/functions/fnc_addPassengerActions.sqf +++ b/addons/interaction/functions/fnc_addPassengerActions.sqf @@ -1,7 +1,6 @@ /* * Author: CAA-Picard * Mount unit actions inside passenger submenu - * Note: This function is NOT global. * * Argument: * 0: Vehicle diff --git a/addons/interaction/functions/fnc_addPassengersActions.sqf b/addons/interaction/functions/fnc_addPassengersActions.sqf index 678cbc55db..de0c91e767 100644 --- a/addons/interaction/functions/fnc_addPassengersActions.sqf +++ b/addons/interaction/functions/fnc_addPassengersActions.sqf @@ -1,7 +1,6 @@ /* * Author: CAA-Picard * Create one action per passenger - * Note: This function is NOT global. * * Argument: * 0: Vehicle @@ -29,7 +28,7 @@ _actions = []; str(_unit), [_unit, true] call EFUNC(common,getName), "", - {systemChat "selected passenger"}, + {}, {true}, {_this call FUNC(addPassengerActions);}, [_unit] diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index ad9302a2e8..d347e28c66 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -1430,4 +1430,98 @@ class CfgVehicles { }; }; }; + + // Patient unload from vehicle actions + class LandVehicle; + class Car: LandVehicle { + class ACE_Actions { + class ACE_MainActions { + class ACE_UnloadPatients { + displayName = "$STR_ACE_Medical_UnloadPatient"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions)); + }; + }; + }; + }; + class Tank: LandVehicle { + class ACE_Actions { + class ACE_MainActions { + class ACE_UnloadPatients { + displayName = "$STR_ACE_Medical_UnloadPatient"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions)); + }; + }; + }; + }; + + class Air; + class Helicopter: Air { + class ACE_Actions { + class ACE_MainActions { + class ACE_UnloadPatients { + displayName = "$STR_ACE_Medical_UnloadPatient"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions)); + }; + }; + }; + }; + class Plane: Air { + class ACE_Actions { + class ACE_MainActions { + class ACE_UnloadPatients { + displayName = "$STR_ACE_Medical_UnloadPatient"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions)); + }; + }; + }; + }; + + class Ship; + class Ship_F: Ship { + class ACE_Actions { + class ACE_MainActions { + class ACE_UnloadPatients { + displayName = "$STR_ACE_Medical_UnloadPatient"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions)); + }; + }; + }; + }; + + class StaticWeapon: LandVehicle { + class ACE_Actions { + class ACE_MainActions { + class ACE_UnloadPatients { + displayName = "$STR_ACE_Medical_UnloadPatient"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions)); + }; + }; + }; + }; + + class StaticMortar; + class Mortar_01_base_F: StaticMortar { + class ACE_Actions { + class ACE_MainActions { + class ACE_UnloadPatients { + displayName = "$STR_ACE_Medical_UnloadPatient"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions)); + }; + }; + }; + }; }; diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index c6ddbf0783..45662898df 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -16,6 +16,7 @@ PREP(addToInjuredCollection); PREP(addToLog); PREP(addToTriageCard); PREP(addUnconsciousCondition); +PREP(addUnloadPatientActions); PREP(canAccessMedicalEquipment); PREP(canTreat); PREP(determineIfFatal); diff --git a/addons/medical/functions/fnc_addUnloadPatientActions.sqf b/addons/medical/functions/fnc_addUnloadPatientActions.sqf new file mode 100644 index 0000000000..1b2f874e18 --- /dev/null +++ b/addons/medical/functions/fnc_addUnloadPatientActions.sqf @@ -0,0 +1,48 @@ +/* + * Author: CAA-Picard + * Create one unload action per unconscious passenger + * + * Argument: + * 0: Vehicle + * 1: Player + * 3: Parameters + * + * Return value: + * Children actions + * + * Public: No + */ +#include "script_component.hpp" + +EXPLODE_3_PVT(_this,_vehicle,_player,_parameters); + +systemChat format ["Generating for %1 %2", _vehicle, _player]; + +private ["_actions"]; +_actions = []; + +{ + _unit = _x; + systemChat str(_unit); + if (_unit != _player && {(alive _unit) && {_unit getVariable ["ACE_isUnconscious", false]}}) then { + systemChat "Entered"; + _actions pushBack + [ + [ + str(_unit), + [_unit, true] call EFUNC(common,getName), + "", + {[_player, (_this select 2) select 0] call FUNC(actionUnloadUnit);}, + {true}, + {}, + [_unit] + ] call EFUNC(interact_menu,createAction), + [], + _unit + ]; + }; +} forEach crew _vehicle; + +systemChat str(count _actions); + +_actions diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 6317f97b06..b5269b2526 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -725,6 +725,9 @@ %1 проводит вам интубацию %1 te está intubando + + Unload patient >> + From 89daf840f6a9e0226cf673ea3f022b0f367a05c9 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 21 Mar 2015 20:08:52 +0100 Subject: [PATCH 60/61] fixed incorrect macro --- addons/medical/functions/fnc_onPropagateWound.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_onPropagateWound.sqf b/addons/medical/functions/fnc_onPropagateWound.sqf index 762afa762c..934899eac4 100644 --- a/addons/medical/functions/fnc_onPropagateWound.sqf +++ b/addons/medical/functions/fnc_onPropagateWound.sqf @@ -33,5 +33,5 @@ if (!local _unit) then { if (!_exists) then { _openWounds pushback _injury; }; - _unit setvariable [GVAR(openWounds), _openWounds]; + _unit setvariable [QGVAR(openWounds), _openWounds]; }; From ce3ed988a23973fd13c48d7f527a8770f277bcd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sat, 21 Mar 2015 16:33:59 -0300 Subject: [PATCH 61/61] Removed debug traces --- addons/medical/functions/fnc_addUnloadPatientActions.sqf | 4 ---- 1 file changed, 4 deletions(-) diff --git a/addons/medical/functions/fnc_addUnloadPatientActions.sqf b/addons/medical/functions/fnc_addUnloadPatientActions.sqf index 1b2f874e18..3a96c0b089 100644 --- a/addons/medical/functions/fnc_addUnloadPatientActions.sqf +++ b/addons/medical/functions/fnc_addUnloadPatientActions.sqf @@ -16,16 +16,12 @@ EXPLODE_3_PVT(_this,_vehicle,_player,_parameters); -systemChat format ["Generating for %1 %2", _vehicle, _player]; - private ["_actions"]; _actions = []; { _unit = _x; - systemChat str(_unit); if (_unit != _player && {(alive _unit) && {_unit getVariable ["ACE_isUnconscious", false]}}) then { - systemChat "Entered"; _actions pushBack [ [