First draft of triage card

This commit is contained in:
Glowbal 2015-03-10 21:12:35 +01:00
parent 45dbb0524c
commit 1da67d7b48
6 changed files with 291 additions and 1 deletions

View File

@ -79,6 +79,8 @@ PREP(treatmentTourniquetLocal);
PREP(useItem);
PREP(useItems);
PREP(displayPatientInformation);
PREP(displayTriageCard);
PREP(dropDownTriageCard);
PREP(moduleMedicalSettings);
PREP(moduleAssignMedicRoles);
PREP(moduleAssignMedicalVehicle);

View File

@ -20,3 +20,4 @@ class CfgPatches {
#include "ACE_Medical_Treatments.hpp"
#include "ACE_Settings.hpp"
#include "UI\RscTitles.hpp"
#include "UI\triagecard.hpp"

View File

@ -149,4 +149,4 @@ if (_show) then {
} else {
("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
};
};

View File

@ -0,0 +1,78 @@
/*
* Author: Glowbal
* Display triage card for a unit
*
* Arguments:
* 0: The unit <OBJECT>
*
* 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;
};

View File

@ -0,0 +1,34 @@
/*
* Author: Glowbal
* Display triage card for a unit
*
* Arguments:
* 0: The unit <OBJECT>
*
* 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;
};

View File

@ -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)];);
};
};
};