diff --git a/addons/atragmx/config.cpp b/addons/atragmx/config.cpp index 125d4a488e..ce2483baa1 100644 --- a/addons/atragmx/config.cpp +++ b/addons/atragmx/config.cpp @@ -17,4 +17,3 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" -#include "RscTitles.hpp" diff --git a/addons/medical/XEH_PREP.hpp b/addons/medical/XEH_PREP.hpp index ddeae1d87f..6295eec15f 100644 --- a/addons/medical/XEH_PREP.hpp +++ b/addons/medical/XEH_PREP.hpp @@ -4,6 +4,8 @@ PREP(addStateHandler); PREP(adjustPainLevel); PREP(conditionCardiacArrestTimer); PREP(conditionExecutionDeath); +PREP(displayPatientInformation); +PREP(displayTriageCard); PREP(enteredStateCardiacArrest); PREP(enteredStateFatalInjury); PREP(getBloodLoss); @@ -38,4 +40,4 @@ PREP(setCardiacArrest); PREP(setDead); PREP(setUnconscious); PREP(showBloodEffect); -PREP(transitionSecondChance); \ No newline at end of file +PREP(transitionSecondChance); diff --git a/addons/medical/config.cpp b/addons/medical/config.cpp index 17ff62dbac..1ac00f09aa 100644 --- a/addons/medical/config.cpp +++ b/addons/medical/config.cpp @@ -23,6 +23,9 @@ class CfgPatches { #include "CfgFactionClasses.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" +#include "UI\CfgInGameUI.hpp" +#include "UI\RscTitles.hpp" +#include "UI\triagecard.hpp" class ACE_Extensions { extensions[] += {"ace_medical"}; diff --git a/addons/medical_treatment/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf similarity index 64% rename from addons/medical_treatment/functions/fnc_displayPatientInformation.sqf rename to addons/medical/functions/fnc_displayPatientInformation.sqf index 357ee6f65e..acd7f5c570 100644 --- a/addons/medical_treatment/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -76,71 +76,89 @@ if (_show == 1) then { _genericMessages pushback [format[localize ELSTRING(medical,receivingIvVolume), floor _totalIvVolume], [1, 1, 1, 1]]; }; - private _damaged = [false, false, false, false, false, false]; - private _selectionBloodLoss = [0,0,0,0,0,0]; + private _selectionTourniquet = _target getVariable [QEGVAR(medical,tourniquets), [0,0,0,0,0,0]]; + private _selectionBloodLoss = [0, 0, 0, 0, 0, 0]; + private _selectionDamage = [0, 0, 0, 0, 0, 0]; + private _allInjuryTexts = []; - private _openWounds = _target getVariable [QEGVAR(medical,openWounds), []]; { - _x params ["", "_x1", "_selectionX", "_amountOf", "_x4"]; - // Find how much this bodypart is bleeding - if (_amountOf > 0) then { - _damaged set [_selectionX, true]; - _selectionBloodLoss set [_selectionX, (_selectionBloodLoss select _selectionX) + (20 * (_x4 * _amountOf))]; - - if (_selectionN == _selectionX) then { - // Collect the text to be displayed for this injury [ Select injury class type definition - select the classname DisplayName (6th), amount of injuries for this] - if (_amountOf >= 1) then { - // TODO localization - _allInjuryTexts pushback [format["%2x %1", (EGVAR(medical_damage,woundsData) select _x1) select 6, ceil _amountOf], [1,1,1,1]]; - } else { - // TODO localization - _allInjuryTexts pushback [format["Partial %1", (EGVAR(medical_damage,woundsData) select _x1) select 6], [1,1,1,1]]; - }; - }; - }; - } foreach _openWounds; - - private _bandagedwounds = _target getVariable [QEGVAR(medical,bandagedWounds), []]; - { - _x params ["", "", "_selectionX", "_amountOf", "_x4"]; - // Find how much this bodypart is bleeding - if !(_damaged select _selectionX) then { - _selectionBloodLoss set [_selectionX, (_selectionBloodLoss select _selectionX) + (20 * (_x4 * _amountOf))]; - }; - if (_selectionN == _selectionX) then { + _x params ["", "_woundClassID", "_bodyPartN", "_amountOf", "_bleeding", "_damage"]; + _selectionBloodLoss set [_bodyPartN, (_selectionBloodLoss select _bodyPartN) + (20 * (_bleeding * _amountOf))]; + _selectionDamage set [_bodyPartN, (_selectionDamage select _bodyPartN) + _damage]; + if (_selectionN == _bodyPartN) then { // Collect the text to be displayed for this injury [ Select injury class type definition - select the classname DisplayName (6th), amount of injuries for this] if (_amountOf > 0) then { if (_amountOf >= 1) then { // TODO localization - _allInjuryTexts pushback [format["[B] %2x %1", (EGVAR(medical_damage,woundsData) select (_x select 1)) select 6, ceil _amountOf], [0.88,0.7,0.65,1]]; + _allInjuryTexts pushBack [format["%2x %1", (EGVAR(medical_damage,woundsData) select _woundClassID) select 6, ceil _amountOf], [1,1,1,1]]; } else { // TODO localization - _allInjuryTexts pushback [format["[B] Partial %1", (EGVAR(medical_damage,woundsData) select (_x select 1)) select 6], [0.88,0.7,0.65,1]]; + _allInjuryTexts pushBack [format["Partial %1", (EGVAR(medical_damage,woundsData) select _woundClassID) select 6], [1,1,1,1]]; }; }; }; - } foreach _bandagedwounds; + } forEach (_target getVariable [QEGVAR(medical,openWounds), []]); + + { + _x params ["", "_woundClassID", "_bodyPartN", "_amountOf", "_bleeding", "_damage"]; + _selectionDamage set [_bodyPartN, (_selectionDamage select _bodyPartN) + _damage]; + if (_selectionN == _bodyPartN) then { + // Collect the text to be displayed for this injury [ Select injury class type definition - select the classname DisplayName (6th), amount of injuries for this] + if (_amountOf > 0) then { + if (_amountOf >= 1) then { + // TODO localization + _allInjuryTexts pushBack [format ["[B] %2x %1", (EGVAR(medical_damage,woundsData) select _woundClassID) select 6, ceil _amountOf], [0.88,0.7,0.65,1]]; + } else { + // TODO localization + _allInjuryTexts pushBack [format ["[B] Partial %1", (EGVAR(medical_damage,woundsData) select _woundClassID) select 6], [0.88,0.7,0.65,1]]; + }; + }; + }; + } forEach (_target getVariable [QEGVAR(medical,bandagedWounds), []]); + + { + _x params ["", "_woundClassID", "_bodyPartN", "_amountOf", "_bleeding", "_damage"]; + _selectionDamage set [_bodyPartN, (_selectionDamage select _bodyPartN) + _damage]; + if (_selectionN == _bodyPartN) then { + // Collect the text to be displayed for this injury [ Select injury class type definition - select the classname DisplayName (6th), amount of injuries for this] + if (_amountOf > 0) then { + if (_amountOf >= 1) then { + // TODO localization + _allInjuryTexts pushBack [format ["[S] %2x %1", (EGVAR(medical_damage,woundsData) select _woundClassID) select 6, ceil _amountOf], [0.7,0.7,0.7,1]]; + } else { + // TODO localization + _allInjuryTexts pushBack [format ["[S] Partial %1", (EGVAR(medical_damage,woundsData) select _woundClassID) select 6], [0.7,0.7,0.7,1]]; + }; + }; + }; + } forEach (_target getVariable [QEGVAR(medical,stitchedWounds), []]); // Handle the body image coloring - private _availableSelections = [50,51,52,53,54,55]; + private _availableSelections = [50, 51, 52, 53, 54, 55]; { - private _total = _x; private _red = 1; private _green = 1; private _blue = 1; - if (_total > 0) then { - if (_damaged select _forEachIndex) then { - _green = (0.9 - _total) max 0; + private _torniquet = _selectionTourniquet select _forEachIndex; + if (_torniquet > 0) then { + _red = 0.77; + _green = 0.51; + _blue = 0.08; + } else { + private _bloodLoss = _selectionBloodLoss select _forEachIndex; + if (_bloodLoss > 0) then { + _green = 0 max (0.9 - _bloodLoss); _blue = _green; } else { - _green = (0.9 - _total) max 0; + private _damage = _selectionDamage select _forEachIndex; + _green = 0 max (0.9 - _damage); _red = _green; - //_blue = _green; }; }; - (_display displayCtrl (_availableSelections select _foreachIndex)) ctrlSetTextColor [_red, _green, _blue, 1.0]; - } foreach _selectionBloodLoss; + + (_display displayCtrl _x) ctrlSetTextColor [_red, _green, _blue, 1.0]; + } forEach _availableSelections; private _lbCtrl = (_display displayCtrl 200); lbClear _lbCtrl; diff --git a/addons/medical_treatment/functions/fnc_displayTriageCard.sqf b/addons/medical/functions/fnc_displayTriageCard.sqf similarity index 100% rename from addons/medical_treatment/functions/fnc_displayTriageCard.sqf rename to addons/medical/functions/fnc_displayTriageCard.sqf diff --git a/addons/medical/functions/fnc_init.sqf b/addons/medical/functions/fnc_init.sqf index d5884f329a..f88c33285c 100644 --- a/addons/medical/functions/fnc_init.sqf +++ b/addons/medical/functions/fnc_init.sqf @@ -39,9 +39,8 @@ _unit setVariable [QGVAR(bloodPressure), [80, 120]]; _unit setVariable [QGVAR(peripheralResistance), 100]; // triage card and logs -// TODO move to treatment -//_unit setVariable [QGVAR(triageLevel), 0, true]; -//_unit setVariable [QGVAR(triageCard), [], true]; +_unit setVariable [QGVAR(triageLevel), 0, true]; +_unit setVariable [QGVAR(triageCard), [], true]; // IVs _unit setVariable [QGVAR(ivBags), nil, true]; diff --git a/addons/medical_menu/InteractionBodyParts.hpp b/addons/medical_menu/InteractionBodyParts.hpp index 56d6f3bfd2..c84a41af0c 100644 --- a/addons/medical_menu/InteractionBodyParts.hpp +++ b/addons/medical_menu/InteractionBodyParts.hpp @@ -2,7 +2,7 @@ class ACE_Head { displayName = ECSTRING(interaction,Head); icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); exceptions[] = {"isNotInside", "isNotSitting"}; - statement = QUOTE([ARR_3(_target,1,0)] call EFUNC(medical_treatment,displayPatientInformation)); + statement = QUOTE([ARR_3(_target,1,0)] call EFUNC(medical,displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,0,_this select 3)] call FUNC(modifyAction)); condition = "true"; runOnHover = 1; @@ -13,7 +13,7 @@ class ACE_Torso { condition = "true"; runOnHover = 1; exceptions[] = {"isNotInside", "isNotSitting"}; - statement = QUOTE([ARR_3(_target,1,1)] call EFUNC(medical_treatment,displayPatientInformation)); + statement = QUOTE([ARR_3(_target,1,1)] call EFUNC(medical,displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,1,_this select 3)] call FUNC(modifyAction)); showDisabled = 1; priority = 2; @@ -23,7 +23,7 @@ class ACE_ArmLeft { displayName = ECSTRING(interaction,ArmLeft); runOnHover = 1; exceptions[] = {"isNotInside", "isNotSitting"}; - statement = QUOTE([ARR_3(_target,1,2)] call EFUNC(medical_treatment,displayPatientInformation)); + statement = QUOTE([ARR_3(_target,1,2)] call EFUNC(medical,displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,2,_this select 3)] call FUNC(modifyAction)); condition = "true"; icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); @@ -32,7 +32,7 @@ class ACE_ArmRight { displayName = ECSTRING(interaction,ArmRight); runOnHover = 1; exceptions[] = {"isNotInside", "isNotSitting"}; - statement = QUOTE([ARR_3(_target,1,3)] call EFUNC(medical_treatment,displayPatientInformation)); + statement = QUOTE([ARR_3(_target,1,3)] call EFUNC(medical,displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,3,_this select 3)] call FUNC(modifyAction)); condition = "true"; icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); @@ -41,7 +41,7 @@ class ACE_LegLeft { displayName = ECSTRING(interaction,LegLeft); runOnHover = 1; exceptions[] = {"isNotInside", "isNotSitting"}; - statement = QUOTE([ARR_3(_target,1,4)] call EFUNC(medical_treatment,displayPatientInformation)); + statement = QUOTE([ARR_3(_target,1,4)] call EFUNC(medical,displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,4,_this select 3)] call FUNC(modifyAction)); condition = "true"; icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); @@ -50,7 +50,7 @@ class ACE_LegRight { displayName = ECSTRING(interaction,LegRight); runOnHover = 1; exceptions[] = {"isNotInside", "isNotSitting"}; - statement = QUOTE([ARR_3(_target,1,5)] call EFUNC(medical_treatment,displayPatientInformation)); + statement = QUOTE([ARR_3(_target,1,5)] call EFUNC(medical,displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,5,_this select 3)] call FUNC(modifyAction)); condition = "true"; icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); diff --git a/addons/medical_treatment/XEH_PREP.hpp b/addons/medical_treatment/XEH_PREP.hpp index 0b0fb88e95..0a7f916447 100644 --- a/addons/medical_treatment/XEH_PREP.hpp +++ b/addons/medical_treatment/XEH_PREP.hpp @@ -38,8 +38,6 @@ PREP(addToLog); PREP(addToTriageCard); PREP(addUnloadPatientActions); PREP(canAccessMedicalEquipment); -PREP(displayPatientInformation); -PREP(displayTriageCard); PREP(dropDownTriageCard); PREP(getTriageStatus); PREP(handleBandageOpening);