mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
New variant of the medical information display
This commit is contained in:
parent
3a40a21433
commit
199cd05aa0
@ -22,11 +22,10 @@ GVAR(currentSelectedSelectionN) = if (count _this > 2) then {_this select 2} els
|
||||
GVAR(displayPatientInformationTarget) = if (_show) then {_target} else {ObjNull};
|
||||
|
||||
if (_show) then {
|
||||
|
||||
("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutRsc [QGVAR(DisplayInformation),"PLAIN"];
|
||||
|
||||
[{
|
||||
private ["_target", "_display", "_alphaLevel", "_damaged", "_availableSelections", "_openWounds", "_selectionBloodLoss", "_red", "_green", "_blue", "_alphaLevel", "_allInjuryTexts", "_lbCtrl"];
|
||||
private ["_target", "_display", "_alphaLevel", "_damaged", "_availableSelections", "_openWounds", "_selectionBloodLoss", "_red", "_green", "_blue", "_alphaLevel", "_allInjuryTexts", "_lbCtrl", "_genericMessages"];
|
||||
_target = (_this select 0) select 0;
|
||||
if (GVAR(displayPatientInformationTarget) != _target) exitwith {
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
@ -38,25 +37,48 @@ if (_show) then {
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
_alphaLevel = 1.0;
|
||||
_damaged = [false, false, false, false, false, false];
|
||||
_availableSelections = [50,51,52,53,54,55];
|
||||
_openWounds = _target getvariable [QGVAR(openWounds), []];
|
||||
|
||||
_allInjuryTexts = [];
|
||||
_genericMessages = [];
|
||||
if (_target getvariable[QGVAR(isBleeding), false]) then {
|
||||
_genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_BLEEDING", [1, 1, 1, 1]];
|
||||
};
|
||||
if (_target getvariable[QGVAR(hasLostBlood), false]) then {
|
||||
_genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_LOST_BLOOD", [1, 0.1, 0.1, 1]];
|
||||
};
|
||||
|
||||
if (((_target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]) select GVAR(currentSelectedSelectionN)) > 0) then {
|
||||
_genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_TOURNIQUET_APPLIED", [0.5, 0.5, 0, 1]];
|
||||
};
|
||||
|
||||
_selectionBloodLoss = [0,0,0,0,0,0];
|
||||
{
|
||||
// Find how much this bodypart is bleeding
|
||||
_selectionBloodLoss set [(_x select 2), (_selectionBloodLoss select (_x select 2)) + ((_x select 4) * (_x select 3))];
|
||||
if (GVAR(currentSelectedSelectionN) == (_x select 2)) 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 (_x select 3 > 0) then {
|
||||
_allInjuryTexts pushback format["%2x %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6, _x select 3];
|
||||
if (GVAR(level) >= 1) then {
|
||||
_openWounds = _target getvariable [QGVAR(openWounds), []];
|
||||
private "_amountOf";
|
||||
{
|
||||
_amountOf = _x select 3;
|
||||
// Find how much this bodypart is bleeding
|
||||
_selectionBloodLoss set [(_x select 2), (_selectionBloodLoss select (_x select 2)) + (15 * ((_x select 4) * _amountOf))];
|
||||
if (GVAR(currentSelectedSelectionN) == (_x select 2)) 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 {
|
||||
_allInjuryTexts pushback format["%2x %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6, _amountOf];
|
||||
} else {
|
||||
// TODO localization
|
||||
_allInjuryTexts pushback format["Partial %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}foreach _openWounds;
|
||||
}foreach _openWounds;
|
||||
} else {
|
||||
// TODO handle basic medical colors for body part selections here
|
||||
|
||||
|
||||
};
|
||||
|
||||
// Handle the body image coloring
|
||||
_damaged = [false, false, false, false, false, false];
|
||||
_availableSelections = [50,51,52,53,54,55];
|
||||
{
|
||||
private ["_red", "_green", "_blue"];
|
||||
_total = _x;
|
||||
@ -65,28 +87,32 @@ if (_show) then {
|
||||
_green = 1;
|
||||
_blue = 1;
|
||||
if (_total >0) then {
|
||||
_green = 0.9 - (15*(_total));
|
||||
_green = 0.9 - _total;
|
||||
if (_green < 0.0) then {
|
||||
_green = 0.0;
|
||||
};
|
||||
_blue = _green;
|
||||
_damaged set[_foreachIndex, true];
|
||||
};
|
||||
(_display displayCtrl (_availableSelections select _foreachIndex)) ctrlSetTextColor [_red, _green, _blue, _alphaLevel];
|
||||
(_display displayCtrl (_availableSelections select _foreachIndex)) ctrlSetTextColor [_red, _green, _blue, 1.0];
|
||||
}foreach _selectionBloodLoss;
|
||||
|
||||
// TODO fill the lb with the appropiate information for the patient
|
||||
_lbCtrl = (_display displayCtrl 200);
|
||||
lbClear _lbCtrl;
|
||||
{
|
||||
_lbCtrl lbAdd (_x select 0);
|
||||
_lbCtrl lbSetColor [_foreachIndex, _x select 1];
|
||||
}foreach _genericMessages;
|
||||
{
|
||||
_lbCtrl lbAdd _x;
|
||||
}foreach _allInjuryTexts;
|
||||
if (count _allInjuryTexts == 0) then {
|
||||
if (count _genericMessages == 0 && {count _allInjuryTexts == 0}) then {
|
||||
_lbCtrl lbAdd "No injuries on this bodypart..";
|
||||
};
|
||||
|
||||
}, 0, [_target]] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
} else {
|
||||
("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutRsc ["","PLAIN"];
|
||||
("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
|
||||
};
|
@ -1,6 +1,64 @@
|
||||
<?xml version="1.0"encoding="UTF-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="Medical">
|
||||
<Container name="CfgWeapons">
|
||||
<Key ID="STR_ACE_MEDICAL_NORMAL_BREATHING">
|
||||
<Original>Normal breathing</Original>
|
||||
<Russian>Дыхание в норме</Russian>
|
||||
<Spanish>Respiración normal</Spanish>
|
||||
<French>Respiration Normale</French>
|
||||
<Polish>Normalny oddech</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_MEDICAL_NO_BREATHING">
|
||||
<Original>No breathing</Original>
|
||||
<Russian>Дыхания нет</Russian>
|
||||
<Spanish>No respira</Spanish>
|
||||
<French>Apnée</French>
|
||||
<Polish>Brak oddechu</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_MEDICAL_DIFFICULT_BREATHING">
|
||||
<Original>Difficult breathing</Original>
|
||||
<Russian>Дыхание затруднено</Russian>
|
||||
<Spanish>Dificultad para respirar</Spanish>
|
||||
<French>Difficultée Respiratoire</French>
|
||||
<Polish>Trudności z oddychaniem</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_MEDICAL_ALMOST_NO_BREATHING">
|
||||
<Original>Almost no breathing</Original>
|
||||
<Russian>Дыхания почти нет</Russian>
|
||||
<Spanish>Casi sin respirar</Spanish>
|
||||
<French>Respiration Faible</French>
|
||||
<Polish>Prawie brak oddechu</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_MEDICAL_STATUS_BLEEDING">
|
||||
<Original>Bleeding</Original>
|
||||
<Russian>Кровотечение</Russian>
|
||||
<Spanish>Sangrando</Spanish>
|
||||
<French>Seignement</French>
|
||||
<Polish>Krwawienie zewnętrzne</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_MEDICAL_STATUS_PAIN">
|
||||
<Original>in Pain</Original>
|
||||
<Russian>Испытывает боль</Russian>
|
||||
<Spanish>Con Dolor</Spanish>
|
||||
<French>A De La Douleur</French>
|
||||
<Polish>W bólu</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_MEDICAL_STATUS_LOST_BLOOD">
|
||||
<Original>Lost a lot of Blood</Original>
|
||||
<Russian>Большая кровопотеря</Russian>
|
||||
<Spanish>Mucha Sangre perdida</Spanish>
|
||||
<French>A Perdu Bcp de Sang</French>
|
||||
<Polish>Stracił dużo krwi</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_MEDICAL_STATUS_TOURNIQUET_APPLIED">
|
||||
<Original>Tourniquet [CAT]</Original>
|
||||
<Russian>Жгут</Russian>
|
||||
<Spanish>Torniquete [CAT]</Spanish>
|
||||
<French>Garot [CAT]</French>
|
||||
<Polish>Opaska uciskowa [CAT]</Polish>
|
||||
</Key>
|
||||
</Container>
|
||||
<Container name="CfgWeapons">
|
||||
<Key ID="STR_ACE_MEDICAL_BANDAGE_BASIC_DISPLAY">
|
||||
<Original>Bandage (Basic)</Original>
|
||||
|
@ -48,6 +48,20 @@ class Rsctitles {
|
||||
idc = 55;
|
||||
text = QUOTE(PATHTOF(ui\body_leg_right.paa));
|
||||
};
|
||||
class InjuryListLabel {
|
||||
idc = 199;
|
||||
type = CT_STATIC;
|
||||
x = "safezoneX + (2 * (((safezoneW / safezoneH) min 1.2) / 40))";
|
||||
y = "10.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + safezoneY";
|
||||
w = "8.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 = 0x00 + 0x100; // ST_LEFT + ST_SHADOW
|
||||
font = "PuristaMedium";
|
||||
colorText[] = {0.95, 0.95, 0.95, 0.75};
|
||||
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"};
|
||||
text = "INJURIES";
|
||||
};
|
||||
class InjuryList: ACE_gui_listBoxBase {
|
||||
idc = 200;
|
||||
x = "safezoneX + (2 * (((safezoneW / safezoneH) min 1.2) / 40))";
|
||||
@ -64,6 +78,34 @@ class Rsctitles {
|
||||
colorSelectBackground[] = {0, 0, 0, 0.0};
|
||||
colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.5};
|
||||
};
|
||||
class LogName {
|
||||
idc = 301;
|
||||
type = CT_STATIC;
|
||||
x = "safezoneX + (2 * (((safezoneW / safezoneH) min 1.2) / 40))";
|
||||
y = "20.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + safezoneY";
|
||||
w = "8.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 = 0x00 + 0x100; // ST_LEFT + ST_SHADOW
|
||||
font = "PuristaMedium";
|
||||
colorText[] = {0.95, 0.95, 0.95, 0.75};
|
||||
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"};
|
||||
text = "ACTIVITY LOG";
|
||||
};
|
||||
class ActivityLog: InjuryList {
|
||||
idc = 302;
|
||||
y = "21.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + safezoneY";
|
||||
h = "7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)";
|
||||
rowHeight = 0.03;
|
||||
colorBackground[] = {0, 0, 0, 0.2};
|
||||
colorText[] = {1,1, 1, 1.0};
|
||||
colorScrollbar[] = {0.95, 0.95, 0.95, 1};
|
||||
colorSelect[] = {0.95, 0.95, 0.95, 1};
|
||||
colorSelect2[] = {0.95, 0.95, 0.95, 1};
|
||||
colorSelectBackground[] = {0, 0, 0, 0.0};
|
||||
colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.5};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user