Skip to content

Commit

Permalink
Medical Treatment - Modernize and Cleanup (#6933)
Browse files Browse the repository at this point in the history
* Modernize and cleanup medical_treatment

* One line for each old public function

* Fix litterCleanupDelay name

* Improve adjustment calcs / wound blood loss / medications

fix func descriptions

Calc wound blood loss on events

reorder includes so scritpmacroMed has global effect

trivial optimization for getCardiacOutput

Fix var

Fix wounds not reopening (nil _category)

Fix surgical kit inherting canBandage conditional

debug hitpoints

Update ACE_Medical_Treatment_Actions.hpp

Use woundBleeding for IS_BLEEDING macro

rework medication vars

comments

Reset var in init / fullHeal

Update addons/medical_treatment/functions/fnc_onMedicationUsage.sqf

Co-Authored-By: PabstMirror <[email protected]>

* Change wound data array

Drop unique id and merge classId and category

* Splinting and treatment and gui

* Add arm fractures and aim effects

* localizations and event

* fix

* fix merge for renamed files

* Fixes and code review changes

* Move medical logs clearing to treatment

* More cleanup work

* cleanup

* Apply suggestions from code review

Co-Authored-By: PabstMirror <[email protected]>

* formating, rename bone images

* Fix args for setDead call in actionPlaceInBodyBag

* Apply suggestions from code review

Co-Authored-By: PabstMirror <[email protected]>

* disable calls to extension

* Update fnc_onMedicationUsage.sqf

* Medical - Skip unneeded setVars on initUnit (#6949)

*  Medical - Transfer state machine state on locality (#6950)

* Medical - Transfer state machine state on locality

* Fix feedback isUnconscious var

* Exclude AI

* Make UAV excludes consistant, formating

* Update fnc_treatmentFullHealLocal.sqf

* reset fractures on respawn

* Fix merge

* Add PAK time coefficient setting

* Fix medication

* Add ace_medical_replacementItems config array

* checkItems performance improvement

* Treatment - cap max animation speed (#6995)

* Treatment - cap max animation speed

and add lock to prevent AF from reseting anim

* Update fnc_getBandageTime.sqf

* Use local version of setAnimSpeedCoef

* Revert "Use local version of setAnimSpeedCoef"

This reverts commit 36c22a9.

* Move replacementItems compiling to preInit

* Improve replacementItems compiling

* Cleanup splint functions, use macros for fractures

* Rename splintCondition to canSplint

* Add cprCreatesPulse setting

* Cleanup remaining functions

* Capitalize stringtable entry names

* getStitchTime function and fix treatment locations

* Update addons/medical_treatment/functions/fnc_getHealTime.sqf

Co-Authored-By: SilentSpike <[email protected]>
  • Loading branch information
2 people authored and PabstMirror committed Jun 3, 2019
1 parent d684a80 commit 44050df
Show file tree
Hide file tree
Showing 147 changed files with 2,705 additions and 3,206 deletions.
1 change: 1 addition & 0 deletions addons/advanced_fatigue/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ PREP_RECOMPILE_END;

GVAR(staminaBarWidth) = 10 * (((safezoneW / safezoneH) min 1.2) / 40);
GVAR(dutyList) = [[], []];
GVAR(setAnimExclusions) = [];

ADDON = true;
10 changes: 7 additions & 3 deletions addons/advanced_fatigue/functions/fnc_handleEffects.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ if (GVAR(ppeBlackoutLast) == 1) then {

// - Physical effects ---------------------------------------------------------
if (GVAR(isSwimming)) exitWith {
_unit setAnimSpeedCoef linearConversion [0.7, 0.9, _fatigue, 1, 0.5, true];

if (GVAR(setAnimExclusions) isEqualTo []) then {
_unit setAnimSpeedCoef linearConversion [0.7, 0.9, _fatigue, 1, 0.5, true];
};
if ((isSprintAllowed _unit) && {_fatigue > 0.7}) then {
[_unit, "blockSprint", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
} else {
Expand All @@ -69,7 +70,10 @@ if (GVAR(isSwimming)) exitWith {
};
};
if ((getAnimSpeedCoef _unit) != 1) then {
_unit setAnimSpeedCoef 1;
if (GVAR(setAnimExclusions) isEqualTo []) then {
TRACE_1("reset",getAnimSpeedCoef _unit);
_unit setAnimSpeedCoef 1;
};
};

if (_overexhausted) then {
Expand Down
2 changes: 1 addition & 1 deletion addons/common/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@
<Korean>기본</Korean>
</Key>
<Key ID="STR_ACE_Common_Vehicle">
<English>Medical vehicles</English>
<English>Medical Vehicles</English>
<Russian>В медицинском транспорте</Russian>
<Polish>Pojazdy medyczne</Polish>
<Spanish>Vehiculos médicos</Spanish>
Expand Down
41 changes: 39 additions & 2 deletions addons/medical/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,44 @@ PREP_RECOMPILE_END;
// Add warning for old functions that were technically public, Remove at 3.14.0
{
missionNamespace setVariable [_x, compileFinal format ['diag_log text "ACE Medical WARNING: Formerly public function [%1] has no effect in medical rewrite."; nil', _x]];
} forEach ["ace_medical_fnc_actionPlaceInBodyBag","ace_medical_fnc_actionRemoveTourniquet","ace_medical_fnc_addHeartRateAdjustment","ace_medical_fnc_addToLog","ace_medical_fnc_addToTriageCard
","ace_medical_fnc_addUnconsciousCondition","ace_medical_fnc_addVitalLoop","ace_medical_fnc_canAccessMedicalEquipment","ace_medical_fnc_canTreat","ace_medical_fnc_displayTriageCard","ace_medical_fnc_dropDownTriageCard","ace_medical_fnc_getTriageStatus","ace_medical_fnc_getUnconsciousCondition","ace_medical_fnc_hasItem","ace_medical_fnc_hasItems","ace_medical_fnc_hasTourniquetAppliedTo","ace_medical_fnc_isInMedicalFacility","ace_medical_fnc_isInMedicalVehicle","ace_medical_fnc_isMedic","ace_medical_fnc_isMedicalVehicle","ace_medical_fnc_itemCheck","ace_medical_fnc_selectionNameToNumber","ace_medical_fnc_setCardiacArrest","ace_medical_fnc_setDead","ace_medical_fnc_setHitPointDamage","ace_medical_fnc_showBloodEffect","ace_medical_fnc_treatment","ace_medical_fnc_treatmentAdvanced_bandage","ace_medical_fnc_treatmentAdvanced_CPR","ace_medical_fnc_treatmentAdvanced_CPRLocal","ace_medical_fnc_treatmentAdvanced_medication","ace_medical_fnc_treatmentAdvanced_medicationLocal","ace_medical_fnc_treatmentIV","ace_medical_fnc_treatmentIVLocal","ace_medical_fnc_unconsciousPFH","ace_medical_fnc_useItem","ace_medical_fnc_useItems"];
} forEach [
QFUNC(actionPlaceInBodyBag),
QFUNC(actionRemoveTourniquet),
QFUNC(addHeartRateAdjustment),
QFUNC(addToLog),
QFUNC(addToTriageCard),
QFUNC(addUnconsciousCondition),
QFUNC(addVitalLoop),
QFUNC(canAccessMedicalEquipment),
QFUNC(canTreat),
QFUNC(displayTriageCard),
QFUNC(dropDownTriageCard),
QFUNC(getTriageStatus),
QFUNC(getUnconsciousCondition),
QFUNC(hasItem),
QFUNC(hasItems),
QFUNC(hasTourniquetAppliedTo),
QFUNC(isInMedicalFacility),
QFUNC(isInMedicalVehicle),
QFUNC(isMedic),
QFUNC(isMedicalVehicle),
QFUNC(itemCheck),
QFUNC(selectionNameToNumber),
QFUNC(setCardiacArrest),
QFUNC(setDead),
QFUNC(setHitPointDamage),
QFUNC(showBloodEffect),
QFUNC(treatment),
QFUNC(treatmentAdvanced_bandage),
QFUNC(treatmentAdvanced_CPR),
QFUNC(treatmentAdvanced_CPRLocal),
QFUNC(treatmentAdvanced_medication),
QFUNC(treatmentAdvanced_medicationLocal),
QFUNC(treatmentIV),
QFUNC(treatmentIVLocal),
QFUNC(unconsciousPFH),
QFUNC(useItem),
QFUNC(useItems)
];

ADDON = true;
5 changes: 2 additions & 3 deletions addons/medical/dev/watchVariable.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
_return pushBack format ["Hitpoints: [HHed:%1] [HBod: %2]", (_unit getHitPointDamage "HitHead") toFixed 2, (_unit getHitPointDamage "HitBody") toFixed 2];
_return pushBack format ["[HHnd:%1] [HLeg: %2] %3", (_unit getHitPointDamage "HitHands") toFixed 2, (_unit getHitPointDamage "HitLegs") toFixed 2, _limping];

private _fractures = _unit getVariable [QEGVAR(medical,fractures), [0,0,0,0,0,0]];
private _fractures = GET_FRACTURES(_unit);
private _canSprint = if (isSprintAllowed _unit) then {""} else {"[<t color ='#FFCC22'>Sprint Blocked</t>]"};
_return pushBack format ["Fractures: %1 %2", _fractures, _canSprint];

Expand All @@ -75,7 +75,7 @@
_return pushBack format ["%1 [Time On: %2]", ALL_SELECTIONS select _tPartNum, (CBA_missionTime - _x) toFixed 1];
};
{
_x params ["", "_medClassname", "_medPartNum"];
_x params ["_medPartNum", "_medClassname"];
if (_medPartNum == _tPartNum) then {
_return pushBack format [" - Occluded Med: %1", _medClassname];
};
Expand Down Expand Up @@ -154,4 +154,3 @@
// Return:
_return joinString "<br/>"
}, [40]] call EFUNC(common,watchVariable);

3 changes: 1 addition & 2 deletions addons/medical/functions/fnc_setUnconscious.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/*
* Author: Glowbal
* Sets a unit in the unconscious state.
* For Public Use
*
* Arguments:
* 0: The unit that will be put in an unconscious state <OBJECT>
Expand All @@ -17,7 +16,7 @@
* [bob, true] call ace_medical_fnc_setUnconscious;
* [player, true, 5, true] call ace_medical_fnc_setUnconscious;
*
* Public: yes
* Public: Yes
*/

// only run this after the settings are initialized
Expand Down
2 changes: 1 addition & 1 deletion addons/medical/initSettings.sqf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// CBA Settings [ADDON: ace_medical]:

private _categoryArray = [LELSTRING(medical,Category_DisplayName), "?"];
private _categoryArray = [LELSTRING(medical,Category), "?"];

// todo: Check the description is still accurate
[
Expand Down
2 changes: 1 addition & 1 deletion addons/medical/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define COMPONENT_BEAUTIFIED Medical Core
#include "\z\ace\addons\main\script_mod.hpp"

// #define DEBUG_MODE_FULL
#define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define ENABLE_PERFORMANCE_COUNTERS

Expand Down
17 changes: 1 addition & 16 deletions addons/medical/stringtable.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="Medical">
<Key ID="STR_ACE_Medical_Category_DisplayName">
<Key ID="STR_ACE_Medical_Category">
<English>ACE Medical</English>
<Russian>ACE: медицина</Russian>
<Polish>ACE Opcje medyczne</Polish>
Expand Down Expand Up @@ -440,21 +440,6 @@
<Chinesesimp>设定当距离超过%1将不能使用治疗动作</Chinesesimp>
<Chinese>設定當距離超過%1將不能使用治療動作</Chinese>
</Key>
<Key ID="STR_ACE_Medical_CanNotLoaded">
<English>This person (%1) is awake and cannot be loaded</English>
<German>Diese Person (%1) ist wach und kann nicht verladen werden</German>
<Polish>Ta osoba (%1) jest przytomna i nie może zostać załadowana</Polish>
<Spanish>Esta persona (%1) está despierto y no puede ser cargado</Spanish>
<Russian>Боец (%1) в сознании и не может быть погружен</Russian>
<Portuguese>Esta pessoa (%1) está acordada e não pode ser carregada</Portuguese>
<Czech>Tato osoba (%1) je vzhůru a nemůže být naložena</Czech>
<Italian>Questa persona (%1) è sveglia e non può essere caricata.</Italian>
<French>%1 est conscient et ne peut être embarqué.</French>
<Japanese>患者 (%1) は意識があり、積み込めない</Japanese>
<Korean>이 사람 (%1) 은(는) 의식이 있어 태우지 못합니다</Korean>
<Chinesesimp>此人(%1)是清醒且不能被装载</Chinesesimp>
<Chinese>此人(%1)是清醒且不能被裝載</Chinese>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_spontaneousWakeUpChance_DisplayName">
<English>Unconscious Wake Up Chance</English>
<Japanese>気絶から覚醒する可能性</Japanese>
Expand Down
2 changes: 1 addition & 1 deletion addons/medical_ai/functions/fnc_playTreatmentAnim.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private _animConfig = if (_isBandage) then {
configFile >> "ACE_Medical_Actions" >> "Basic" >> "Morphine";
};

private _configProperty = "animationCaller";
private _configProperty = "animationMedic";
if (_isSelfTreatment) then {
_configProperty = _configProperty + "Self";
};
Expand Down
2 changes: 1 addition & 1 deletion addons/medical_blood/initSettings.sqf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// CBA Settings [ADDON: ace_medical_blood]:

private _categoryArray = [LELSTRING(medical,Category_DisplayName), LLSTRING(subCategory)];
private _categoryArray = [LELSTRING(medical,Category), LLSTRING(subCategory)];

[
QGVAR(enabledFor), "LIST",
Expand Down
4 changes: 2 additions & 2 deletions addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ private _bodyPartVisParams = [_unit, false, false, false, false]; // params arra
case (_causeFracture && {EGVAR(medical,fractures) > 0} && {_bodyPartNToAdd > 1} && {_woundDamage > FRACTURE_DAMAGE_THRESHOLD}): {
TRACE_1("limb fracture",_bodyPartNToAdd);
// todo: play sound?
private _fractures = _unit getVariable [QEGVAR(medical,fractures), [0,0,0,0,0,0]];
private _fractures = GET_FRACTURES(_unit);
_fractures set [_bodyPartNToAdd, 1];
_unit setVariable [QEGVAR(medical,fractures), _fractures, true];
_unit setVariable [VAR_FRACTURES, _fractures, true];
[QEGVAR(medical,fracture), [_unit, _bodyPartNToAdd]] call CBA_fnc_localEvent; // local event for fracture
_updateDamageEffects = true;
};
Expand Down
2 changes: 1 addition & 1 deletion addons/medical_damage/initSettings.sqf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// CBA Settings [ADDON: ace_medical_damage]:

private _categoryArray = [LELSTRING(medical,Category_DisplayName), LLSTRING(subCategory)];
private _categoryArray = [LELSTRING(medical,Category), LLSTRING(subCategory)];

[
QEGVAR(medical,playerDamageThreshold), "SLIDER",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (!local _unit) exitWith { ERROR("Unit not local or null"); };
private _isLimping = false;

if (EGVAR(medical,fractures) > 0) then {
private _fractures = _unit getVariable [QEGVAR(medical,fractures), [0,0,0,0,0,0]];
private _fractures = GET_FRACTURES(_unit);
TRACE_1("",_fractures);
if (((_fractures select 4) == 1) || {(_fractures select 5) == 1}) then {
TRACE_1("limping because of fracture",_fractures);
Expand Down
34 changes: 20 additions & 14 deletions addons/medical_engine/script_macros_medical.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// #define DISABLE_COMPILE_CACHE
// #define ENABLE_PERFORMANCE_COUNTERS


#define ALL_BODY_PARTS ["head", "body", "leftarm", "rightarm", "leftleg", "rightleg"]
#define ALL_SELECTIONS ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"]
#define ALL_HITPOINTS ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]
Expand Down Expand Up @@ -97,6 +96,8 @@

#define DEFAULT_TOURNIQUET_VALUES [0,0,0,0,0,0]

#define DEFAULT_FRACTURE_VALUES [0,0,0,0,0,0]

// Triage colors, for consistency across UIs and functions
#define TRIAGE_COLOR_NONE 0, 0, 0, 0.9
#define TRIAGE_COLOR_MINIMAL 0, 0.5, 0, 0.9
Expand All @@ -110,25 +111,29 @@
#define TRIAGE_TEXT_COLOR_IMMEDIATE 1, 1, 1, 1
#define TRIAGE_TEXT_COLOR_DECEASED 1, 1, 1, 1

// Medical activity logs
#define MED_LOG_MAX_ENTRIES 8
#define MED_LOG_VARNAME(type) (format [QEGVAR(medical,log_%1), type])

// - Unit Variables ----------------------------------------------------
// These variables get stored in object space and used across components
// Defined here for easy consistency with GETVAR/SETVAR (also a list for reference)
#define VAR_BLOOD_PRESS QEGVAR(medical,bloodPressure)
#define VAR_BLOOD_VOL QEGVAR(medical,bloodVolume)
#define VAR_BLOOD_PRESS QEGVAR(medical,bloodPressure)
#define VAR_BLOOD_VOL QEGVAR(medical,bloodVolume)
#define VAR_WOUND_BLEEDING QEGVAR(medical,woundBleeding)
#define VAR_CRDC_ARRST QEGVAR(medical,inCardiacArrest)
#define VAR_HEART_RATE QEGVAR(medical,heartRate)
#define VAR_PAIN QEGVAR(medical,pain)
#define VAR_PAIN_SUPP QEGVAR(medical,painSuppress)
#define VAR_PERIPH_RES QEGVAR(medical,peripheralResistance)
#define VAR_UNCON "ACE_isUnconscious"
#define VAR_CRDC_ARRST QEGVAR(medical,inCardiacArrest)
#define VAR_HEART_RATE QEGVAR(medical,heartRate)
#define VAR_PAIN QEGVAR(medical,pain)
#define VAR_PAIN_SUPP QEGVAR(medical,painSuppress)
#define VAR_PERIPH_RES QEGVAR(medical,peripheralResistance)
#define VAR_UNCON "ACE_isUnconscious"
// These variables track gradual adjustments (from medication, etc.)
#define VAR_MEDICATIONS QEGVAR(medical,medications)
#define VAR_MEDICATIONS QEGVAR(medical,medications)
// These variables track the current state of status values above
#define VAR_HEMORRHAGE QEGVAR(medical,hemorrhage)
#define VAR_IN_PAIN QEGVAR(medical,inPain)
#define VAR_TOURNIQUET QEGVAR(medical,tourniquets)

#define VAR_HEMORRHAGE QEGVAR(medical,hemorrhage)
#define VAR_IN_PAIN QEGVAR(medical,inPain)
#define VAR_TOURNIQUET QEGVAR(medical,tourniquets)
#define VAR_FRACTURES QEGVAR(medical,fractures)

// - Unit Functions ---------------------------------------------------
// Retrieval macros for common unit values
Expand All @@ -140,6 +145,7 @@
#define GET_PAIN(unit) (unit getVariable [VAR_PAIN,0])
#define GET_PAIN_SUPPRESS(unit) (unit getVariable [VAR_PAIN_SUPP,0])
#define GET_TOURNIQUETS(unit) (unit getVariable [VAR_TOURNIQUET, DEFAULT_TOURNIQUET_VALUES])
#define GET_FRACTURES(unit) (unit getVariable [VAR_FRACTURES, DEFAULT_FRACTURE_VALUES])
#define IN_CRDC_ARRST(unit) (unit getVariable [VAR_CRDC_ARRST,false])
#define IS_BLEEDING(unit) (GET_WOUND_BLEEDING(unit) > 0)
#define IS_IN_PAIN(unit) (unit getVariable [VAR_IN_PAIN,false])
Expand Down
2 changes: 1 addition & 1 deletion addons/medical_feedback/initSettings.sqf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// CBA Settings [ADDON: ace_medical_feedback]:

private _categoryArray = [LELSTRING(medical,Category_DisplayName), LLSTRING(subCategory)];
private _categoryArray = [LELSTRING(medical,Category), LLSTRING(subCategory)];

[
QGVAR(painEffectType),
Expand Down
6 changes: 3 additions & 3 deletions addons/medical_gui/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ class CfgVehicles {
#include "InteractionBodyParts.hpp"
#undef ACTION_CONDITION
};
class ACE_LoadPatient {
class ACE_LoadPatient {
displayName = CSTRING(LoadPatient);
condition = QUOTE(_target getVariable [ARR_2('ACE_isUnconscious',false)] && {alive _target} && {vehicle _target == _target});
exceptions[] = {"isNotDragging", "isNotCarrying"};
statement = QUOTE([ARR_2(_player, _target)] call EFUNC(medical_treatment,actionLoadUnit));
statement = QUOTE([ARR_2(_player, _target)] call EFUNC(medical_treatment,loadUnit));
icon = QPATHTOF(ui\cross.paa);
insertChildren = QUOTE(call DEFUNC(medical_treatment,addLoadPatientActions));
};
class ACE_UnloadPatient {
displayName = CSTRING(UnloadPatient);
condition = QUOTE(_target getVariable [ARR_2('ACE_isUnconscious',false)] && {vehicle _target != _target} && {vehicle _player == _player});
exceptions[] = {"isNotDragging", "isNotCarrying", "isNotInside"};
statement = QUOTE([ARR_2(_player, _target)] call EFUNC(medical_treatment,actionUnloadUnit));
statement = QUOTE([ARR_2(_player, _target)] call EFUNC(medical_treatment,unloadUnit));
icon = QPATHTOF(ui\cross.paa);
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if (isNull _display) then {

// Update activity log
private _ctrlActivityLog = _display displayCtrl IDC_ACTIVITY;
private _activityLog = _target getVariable [QEGVAR(medical,logFile_activity_view), []];
private _activityLog = _target getVariable [MED_LOG_VARNAME("activity"), []];
[_ctrlActivityLog, _activityLog] call FUNC(updateLogList);

// Update triage status
Expand Down
4 changes: 2 additions & 2 deletions addons/medical_gui/functions/fnc_menuPFH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ private _ctrlBodyImage = _display displayCtrl IDC_BODY_GROUP;

// Update activity and quick view logs
private _ctrlActivityLog = _display displayCtrl IDC_ACTIVITY;
private _activityLog = GVAR(target) getVariable [QEGVAR(medical,logFile_activity_view), []];
private _activityLog = GVAR(target) getVariable [MED_LOG_VARNAME("activity"), []];
[_ctrlActivityLog, _activityLog] call FUNC(updateLogList);

private _ctrlQuickView = _display displayCtrl IDC_QUICKVIEW;
private _quickView = GVAR(target) getVariable [QEGVAR(medical,logFile_quick_view), []];
private _quickView = GVAR(target) getVariable [MED_LOG_VARNAME("quick_view"), []];
[_ctrlQuickView, _quickView] call FUNC(updateLogList);

// Update triage status
Expand Down
13 changes: 7 additions & 6 deletions addons/medical_gui/functions/fnc_updateBodyImage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ params ["_ctrlGroup", "_target"];

// Get tourniquets, damage, and blood loss for target
private _tourniquets = GET_TOURNIQUETS(_target);
private _fractures = _target getVariable [QEGVAR(medical,fractures), [0,0,0,0,0,0]];
private _fractures = GET_FRACTURES(_target);
private _bodyPartDamage = _target getVariable [QEGVAR(medical,bodyPartDamage), [0, 0, 0, 0, 0, 0]];
private _bodyPartBloodLoss = [0, 0, 0, 0, 0, 0];

Expand All @@ -38,18 +38,19 @@ private _bodyPartBloodLoss = [0, 0, 0, 0, 0, 0];
private _ctrlTourniquet = _ctrlGroup controlsGroupCtrl _tourniquetIDC;
_ctrlTourniquet ctrlShow _hasTourniquet;
};

// Show or hide fractrue/bones
if (_fractureIDC != -1) then {
private _ctrlBone = _ctrlGroup controlsGroupCtrl _fractureIDC;
switch (_fractures select _forEachIndex) do {
case (0): {
case 0: {
_ctrlBone ctrlShow false;
};
case (1): {
case 1: {
_ctrlBone ctrlShow true;
_ctrlBone ctrlSetTextColor [1, 0, 0, 1];
};
case (-1): {
case -1: {
if (EGVAR(medical,fractures) == 2) then {
_ctrlBone ctrlShow true;
_ctrlBone ctrlSetTextColor [0, 0, 1, 1];
Expand All @@ -74,8 +75,8 @@ private _bodyPartBloodLoss = [0, 0, 0, 0, 0, 0];
} forEach [
[IDC_BODY_HEAD],
[IDC_BODY_TORSO],
[IDC_BODY_ARMLEFT, IDC_BODY_ARMLEFT_T, IDC_BODY_ARMLEFT_B],
[IDC_BODY_ARMLEFT, IDC_BODY_ARMLEFT_T, IDC_BODY_ARMLEFT_B],
[IDC_BODY_ARMRIGHT, IDC_BODY_ARMRIGHT_T, IDC_BODY_ARMRIGHT_B],
[IDC_BODY_LEGLEFT, IDC_BODY_LEGLEFT_T, IDC_BODY_LEGLEFT_B],
[IDC_BODY_LEGLEFT, IDC_BODY_LEGLEFT_T, IDC_BODY_LEGLEFT_B],
[IDC_BODY_LEGRIGHT, IDC_BODY_LEGRIGHT_T, IDC_BODY_LEGRIGHT_B]
];
Loading

0 comments on commit 44050df

Please sign in to comment.