ACE3/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp
mharis001 8d2bba4b35
Rewrite Medical GUI (#6831)
* Add a macro for the bloodloss scaling factor

* Adjust bloodloss threshold for red icon

* Remove bloodloss color scaling factor

The issue is actually the other way round, the factor of 20 would
instantly make bodyparts red on taking a wound.

* Implemet 10 color steps provided by ShackTac

This replaces the old method of colouring the interaction menu icons
and body image selections with a new method that has 10 distinct color
steps (matching across the icons and the body image).

* Use macros for constants

* Implement blue damage colouring

This re-adds visualisation for colouring based on damage. The case where
a limb has a tourniquet will hopefully be handled by an overlayed icon.

* Tidy up file structure

* Move patient information display to medical_ui

* Make common colour conversion code into functions

* Add tourniquet icon overlay to body image

* Fix mispelling I forgot to commit

* Update icon paths to new white cross icon

* Clean mess after rebase

* Add new medical menu gui

* Add updating injury list and body image

* Add updating treatment category buttons

* Update onMenuClose function

* Delete unused functions

* Add action buttons and triage card to menu

* Move medical menu PFH to separate function

* Move setTriageStatus to treatment

* Add triage select dropdown

* Add toggle button action

* Fix mouse moving randomly when opening

* Add logs list update and remove unused functions

* Hide tourniquet icons by default

* Remove CfgInGameUI (already in feedback)

* Update patient info display

* Update triage card display

* Add settings to control interact menu actions

* Cleanup files/paths

* Move triage status update to common function

* Add icons for interact menu actions

* Modify icon color for interact menu actions

* Update canOpenMenu for new setting

* Hide pain information for unconscious

* Stringtable cleanup

* Use switch for pain text

* Change minor triage status to minimal

* Fix injury list to use new stringtable entry names

* Fix medical actions check when disabled

* Skip distance check in same vehicle

* More cleanup

* Fix CI error

* Requested changes

* Fix INJURIES string

* Fix include after comment block

* Fix missing ;

Co-Authored-By: mharis001 <34453221+mharis001@users.noreply.github.com>
2019-03-24 18:17:48 -04:00

305 lines
13 KiB
C++

class GVAR(Actions) {
// --- bandages
class BasicBandage {
displayName = CSTRING(Bandage);
displayNameProgress = CSTRING(Bandaging);
icon = QPATHTOEF(medical_gui,ui\bandage.paa);
category = "bandage";
treatmentLocations[] = {"All"};
allowedSelections[] = {"All"};
allowSelfTreatment = 1;
requiredMedic = 0;
treatmentTime = QFUNC(getBandageTime);
treatmentTimeSelfCoef = 1;
items[] = {{"ACE_fieldDressing", "ACE_packingBandage", "ACE_elasticBandage", "ACE_quikclot"}};
condition = QUOTE(!GVAR(advancedBandages));
itemConsumed = 1;
callbackSuccess = QFUNC(treatmentBandage);
callbackFailure = "";
callbackProgress = "";
animationCaller = "AinvPknlMstpSlayW[wpn]Dnon_medicOther";
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther";
animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic";
animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
litter[] = {
{"All", "_bloodLossOnBodyPart > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_bloodLossOnBodyPart <= 0", {"ACE_MedicalLitter_clean"}}
};
};
class FieldDressing: BasicBandage {
displayName = CSTRING(Actions_FieldDressing);
items[] = {"ACE_fieldDressing"};
condition = QGVAR(advancedBandages);
litter[] = {
{"All", "_bloodLossOnBodyPart > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_bloodLossOnBodyPart <= 0", {"ACE_MedicalLitter_clean"}}
};
};
class PackingBandage: BasicBandage {
displayName = CSTRING(Actions_PackingBandage);
icon = QPATHTOEF(medical_gui,ui\packing_bandage.paa);
items[] = {"ACE_packingBandage"};
condition = QGVAR(advancedBandages);
litter[] = {
{"All", "", {"ACE_MedicalLitter_packingBandage"}},
{"All", "_bloodLossOnBodyPart > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_bloodLossOnBodyPart <= 0", {"ACE_MedicalLitter_clean"}}
};
};
class ElasticBandage: BasicBandage {
displayName = CSTRING(Actions_ElasticBandage);
items[] = {"ACE_elasticBandage"};
condition = QGVAR(advancedBandages);
litter[] = {
{"All", "_bloodLossOnBodyPart > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_bloodLossOnBodyPart <= 0", {"ACE_MedicalLitter_clean"}}
};
};
class QuikClot: BasicBandage {
displayName = CSTRING(Actions_QuikClot);
items[] = {"ACE_quikclot"};
condition = QGVAR(advancedBandages);
litter[] = {
{"All", "", {"ACE_MedicalLitter_QuickClot"}},
{"All", "_bloodLossOnBodyPart > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_bloodLossOnBodyPart <= 0", {"ACE_MedicalLitter_clean"}}
};
};
// --- tourniquet
class Tourniquet: BasicBandage {
displayName = CSTRING(Apply_Tourniquet);
displayNameProgress = CSTRING(Applying_Tourniquet);
icon = QPATHTOEF(medical_gui,ui\tourniquet.paa);
allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"};
items[] = {"ACE_tourniquet"};
treatmentTime = 7;
callbackSuccess = QFUNC(treatmentTourniquet);
condition = QUOTE(!([ARR_2(_target,_bodyPart)] call FUNC(hasTourniquetAppliedTo)));
litter[] = {};
};
class RemoveTourniquet: Tourniquet {
displayName = CSTRING(Actions_RemoveTourniquet);
displayNameProgress = CSTRING(RemovingTourniquet);
items[] = {};
callbackSuccess = QFUNC(treatmentTourniquetRemove);
condition = QUOTE([ARR_2(_target,_bodyPart)] call FUNC(hasTourniquetAppliedTo));
};
// --- syringes
class Morphine: FieldDressing {
displayName = CSTRING(Inject_Morphine);
displayNameProgress = CSTRING(Injecting_Morphine);
icon = QPATHTOEF(medical_gui,ui\auto_injector.paa);
allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"};
category = "medication";
items[] = {"ACE_morphine"};
condition = "";
treatmentTime = 5;
callbackSuccess = QFUNC(treatmentMedication);
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
litter[] = { {"All", "", {"ACE_MedicalLitter_morphine"}} };
sounds[] = {{QPATHTO_R(sounds\Inject.ogg),1,1,50}};
};
class Adenosine: Morphine {
displayName = CSTRING(Inject_Adenosine);
displayNameProgress = CSTRING(Injecting_Adenosine);
condition = QGVAR(advancedMedication);
items[] = {"ACE_adenosine"};
litter[] = { {"All", "", {"ACE_MedicalLitter_adenosine"}} };
};
class Atropine: Morphine {
displayName = CSTRING(Inject_Atropine);
displayNameProgress = CSTRING(Injecting_Atropine);
condition = QGVAR(advancedMedication);
items[] = {"ACE_atropine"};
litter[] = { {"All", "", {"ACE_MedicalLitter_atropine"}} };
};
class Epinephrine: Morphine {
displayName = CSTRING(Inject_Epinephrine);
displayNameProgress = CSTRING(Injecting_Epinephrine);
requiredMedic = QEGVAR(medical,medicSetting_Epi);
items[] = {"ACE_epinephrine"};
litter[] = { {"All", "", {"ACE_MedicalLitter_epinephrine"}} };
treatmentLocations[] = {QEGVAR(medical,useLocation_Epi)};
};
// --- iv bags
class BloodIV: BasicBandage {
displayName = CSTRING(Actions_Blood4_1000);
displayNameProgress = CSTRING(Transfusing_Blood);
icon = QPATHTOEF(medical_gui,ui\iv.paa);
allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"};
allowSelfTreatment = QGVAR(allowSelfIV);
category = "advanced";
requiredMedic = 1;
treatmentTime = 12;
items[] = {"ACE_bloodIV"};
condition = "";
callbackSuccess = QFUNC(treatmentIV);
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
litter[] = {};
};
class BloodIV_500: BloodIV {
displayName = CSTRING(Actions_Blood4_500);
items[] = {"ACE_bloodIV_500"};
};
class BloodIV_250: BloodIV {
displayName = CSTRING(Actions_Blood4_250);
items[] = {"ACE_bloodIV_250"};
};
class PlasmaIV: BloodIV {
displayName = CSTRING(Actions_Plasma4_1000);
displayNameProgress = CSTRING(Transfusing_Plasma);
items[] = {"ACE_plasmaIV"};
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
};
class PlasmaIV_500: PlasmaIV {
displayName = CSTRING(Actions_Plasma4_500);
items[] = {"ACE_plasmaIV_500"};
};
class PlasmaIV_250: PlasmaIV {
displayName = CSTRING(Actions_Plasma4_250);
items[] = {"ACE_plasmaIV_250"};
};
class SalineIV: BloodIV {
displayName = CSTRING(Actions_Saline4_1000);
displayNameProgress = CSTRING(Transfusing_Saline);
items[] = {"ACE_salineIV"};
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
};
class SalineIV_500: SalineIV {
displayName = CSTRING(Actions_Saline4_500);
items[] = {"ACE_salineIV_500"};
};
class SalineIV_250: SalineIV {
displayName = CSTRING(Actions_Saline4_250);
items[] = {"ACE_salineIV_250"};
};
// --- diagnose
class Diagnose: BasicBandage {
displayName = CSTRING(Actions_Diagnose);
displayNameProgress = CSTRING(Actions_Diagnosing);
icon = "";
category = "examine";
treatmentLocations[] = {"All"};
allowedSelections[] = {"Head", "Body"};
requiredMedic = 0;
treatmentTime = 2.5;
items[] = {};
condition = QUOTE(!GVAR(advancedDiagnose));
callbackSuccess = QFUNC(actionDiagnose);
callbackFailure = "";
callbackProgress = "";
animationCaller = ""; // TODO
itemConsumed = 0;
litter[] = {};
};
class CheckPulse: Diagnose {
displayName = CSTRING(Actions_CheckPulse);
displayNameProgress = CSTRING(Check_Pulse_Content);
allowedSelections[] = {"All"};
condition = QGVAR(advancedDiagnose);
callbackSuccess = QFUNC(actionCheckPulse);
animationCallerProne = "";
animationCallerSelfProne = "";
};
class CheckBloodPressure: CheckPulse {
displayName = CSTRING(Actions_CheckBloodPressure);
displayNameProgress = CSTRING(Check_Bloodpressure_Content);
allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"};
callbackSuccess = QFUNC(actionCheckBloodPressure);
};
class CheckResponse: CheckPulse {
displayName = CSTRING(Check_Response);
displayNameProgress = CSTRING(Check_Response_Content);
allowedSelections[] = {"Head"};
allowSelfTreatment = 0;
callbackSuccess = QFUNC(actionCheckResponse);
};
// --- misc
class BodyBag: BasicBandage {
displayName = CSTRING(PlaceInBodyBag);
displayNameProgress = CSTRING(PlacingInBodyBag);
icon = QPATHTOEF(medical_gui,ui\bodybag.paa);
category = "advanced";
treatmentLocations[] = {"All"};
allowSelfTreatment = 0;
requiredMedic = 0;
treatmentTime = 15;
items[] = {"ACE_bodyBag"};
condition = "!alive _target";
callbackSuccess = QFUNC(actionPlaceInBodyBag);
callbackFailure = "";
callbackProgress = "";
itemConsumed = 1;
litter[] = {};
};
class CPR: BasicBandage {
displayName = CSTRING(Actions_CPR);
displayNameProgress = CSTRING(Actions_PerformingCPR);
icon = "";
category = "advanced";
treatmentLocations[] = {"All"};
allowedSelections[] = {"Body"};
allowSelfTreatment = 0;
requiredMedic = 0;
treatmentTime = 15;
items[] = {};
condition = QUOTE(!(_target call EFUNC(common,isAwake)) && {!(_target getVariable [ARR_2('GVAR(receiveCPR)', false)])});
callbackSuccess = QFUNC(treatmentCPR);
callbackFailure = QFUNC(treatmentCPR_failure);
callbackProgress = QFUNC(treatmentCPR_progress);
callbackStart = QFUNC(treatmentCPR_start);
animationCaller = "AinvPknlMstpSlayW[wpn]Dnon_medic";
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
animationCallerSelf = "";
animationCallerSelfProne = "";
itemConsumed = 0;
litter[] = {};
};
class SurgicalKit: FieldDressing {
displayName = CSTRING(Use_SurgicalKit);
displayNameProgress = CSTRING(Stitching);
icon = QPATHTOEF(medical_gui,ui\surgical_kit.paa);
category = "advanced";
items[] = {"ACE_surgicalKit"};
treatmentLocations[] = {QEGVAR(medical,useLocation_SurgicalKit)};
allowSelfTreatment = 0;
requiredMedic = QEGVAR(medical,medicSetting_SurgicalKit);
treatmentTime = QUOTE(count (_target getVariable [ARR_2('EGVAR(medical,bandagedWounds)',[])]) * 5);
callbackSuccess = "";
callbackProgress = QFUNC(treatmentSurgicalKit_onProgress);
itemConsumed = QEGVAR(medical,consumeItem_SurgicalKit);
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"} }};
};
class PersonalAidKit: BasicBandage {
displayName = CSTRING(Use_Aid_Kit);
displayNameProgress = CSTRING(TreatmentAction);
icon = "";
category = "advanced";
condition = QUOTE(_target call EFUNC(medical_status,isInStableCondition));
items[] = {"ACE_personalAidKit"};
treatmentLocations[] = {QEGVAR(medical,useLocation_PAK)};
requiredMedic = QEGVAR(medical,medicSetting_PAK);
treatmentTime = QUOTE(_target call FUNC(healTime));
callbackSuccess = QFUNC(treatmentFullHeal);
itemConsumed = QEGVAR(medical,consumeItem_PAK);
animationCaller = "AinvPknlMstpSlayW[wpn]Dnon_medicOther";
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther";
animationCallerSelf = "";
animationCallerSelfProne = "";
litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"}},
{"All", "_bloodLossOnBodyPart > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_bloodLossOnBodyPart > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_bloodLossOnBodyPart <= 0", {"ACE_MedicalLitter_clean"}}
};
};
};