Merge pull request #6434 from acemod/fix-restructure

Various fixes for the medical restructure branch
This commit is contained in:
Thomas Kooi 2018-07-16 12:34:39 +02:00 committed by GitHub
commit 81f1365a41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
55 changed files with 758 additions and 273 deletions

View File

@ -40,14 +40,14 @@ if (!isNull _instigator) then {
};
#ifdef DEBUG_TESTRESULTS
private _startDmg = +(_unit getVariable [QGVAR(bodyPartDamage), [-1]]);
private _startDmg = +(_unit getVariable [QGVAR(medical,bodyPartDamage), [-1]]);
private _startPain = GET_PAIN(_unit);
#endif
[QEGVAR(medical_engine,woundReceived), [_unit, _bodyPart, _damageToAdd, _instigator, _typeOfDamage]] call CBA_fnc_localEvent;
[QEGVAR(medical,woundReceived), [_unit, _bodyPart, _damageToAdd, _instigator, _typeOfDamage]] call CBA_fnc_localEvent;
#ifdef DEBUG_TESTRESULTS
private _endDmg = _unit getVariable [QGVAR(bodyPartDamage), [-1]];
private _endDmg = _unit getVariable [QGVAR(medical,bodyPartDamage), [-1]];
private _endPain = GET_PAIN(_unit);
private _typeOfDamageAdj = _typeOfDamage call EFUNC(medical_damage,getTypeOfDamage);
private _config = configFile >> "ACE_Medical_Injuries" >> "damageTypes" >> _typeOfDamageAdj;

View File

@ -63,7 +63,7 @@
// Damage:
private _damage = _unit getVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]];
private _limping = if (_unit getVariable [QEGVAR(medical_engine,isLimping), false]) then {"[<t color ='#FFCC22'> Limping </t>]"} else {""};
private _limping = if (_unit getVariable [QEGVAR(medical,isLimping), false]) then {"[<t color ='#FFCC22'> Limping </t>]"} else {""};
_return pushBack format ["Damage: [H: %1] [B: %2] %3", (_damage select 0) toFixed 2, (_damage select 1) toFixed 2, _limping];
_return pushBack format ["[LA:%1] [RA: %2] [LL:%3] [RL: %4]", (_damage select 2) toFixed 2, (_damage select 3) toFixed 2, (_damage select 4) toFixed 2, (_damage select 5) toFixed 2];

View File

@ -34,5 +34,5 @@ private _damageThreshold = if (isPlayer _unit) then {
};
if ((_headDamage > _damageThreshold / 2) || {_bodyDamage > _damageThreshold} || {(_painLevel >= PAIN_UNCONSCIOUS) && {random 1 < 0.1}}) then {
[QGVAR(CriticalInjury), _unit] call CBA_fnc_localEvent;
[QEGVAR(medical,CriticalInjury), _unit] call CBA_fnc_localEvent;
};

View File

@ -1,146 +0,0 @@
/*
* Author: Glowbal
* PFH logic for unconscious state
*
* Arguments:
* 0: PFEH - <ARRAY>
* 0: The unit that will be put in an unconscious state <OBJECT>
* 1: unitPos (stance) <STRING>
* 2: Starting Time <NUMBER>
* 3: Minimum Waiting Time <NUMBER>
* 4: Has Moved Out <BOOL>
* 5: Parachute Check <BOOL>
* 1: PFEH ID <NUMBER>
*
* Return Value:
* None
*
* Example:
* [[unit,"pos", 5, 5, true, false], 5], "classname"] call ace_medical_fnc_unconsciousPFH
*
* Public: yes
*/
#include "script_component.hpp"
params ["_args", "_idPFH"];
_args params ["_unit", "_originalPos", "_startingTime", "_minWaitingTime", "_hasMovedOut", "_parachuteCheck"];
TRACE_6("ACE_DEBUG_Unconscious_PFH",_unit, _originalPos, _startingTime, _minWaitingTime, _hasMovedOut, _parachuteCheck);
if (!alive _unit) exitWith {
if ("ACE_FakePrimaryWeapon" in (weapons _unit)) then {
TRACE_1("Removing fake weapon [on death]",_unit);
_unit removeWeapon "ACE_FakePrimaryWeapon";
};
if (GVAR(moveUnitsFromGroupOnUnconscious)) then {
[_unit, false, VAR_UNCON, side group _unit] call EFUNC(common,switchToGroupSide);
};
[_unit, "setHidden", "ace_unconscious", false] call EFUNC(common,statusEffect_set);
[_unit, false] call EFUNC(common,disableAI);
//_unit setUnitPos _originalPos;
[_unit, "isUnconscious"] call EFUNC(common,unmuteUnit);
["ace_unconscious", [_unit, false]] call CBA_fnc_globalEvent;
TRACE_3("ACE_DEBUG_Unconscious_Exit",_unit, (!alive _unit) , "ace_unconscious");
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
// In case the unit is no longer in an unconscious state, we are going to check if we can already reset the animation
if !IS_UNCONSCIOUS(_unit) exitWith {
TRACE_7("ACE_DEBUG_Unconscious_PFH",_unit, _args, [_unit] call EFUNC(medical_status,isBeingCarried), [_unit] call EFUNC(medical_status,isBeingDragged), _idPFH, _unit getVariable QGVAR(unconsciousArguments),animationState _unit);
// TODO, handle this with carry instead, so we can remove the PFH here.
// Wait until the unit isn't being carried anymore, so we won't end up with wierd animations
if !(([_unit] call EFUNC(medical_status,isBeingCarried)) || ([_unit] call EFUNC(medical_status,isBeingDragged))) then {
if ("ACE_FakePrimaryWeapon" in (weapons _unit)) then {
TRACE_1("Removing fake weapon [on wakeup]",_unit);
_unit removeWeapon "ACE_FakePrimaryWeapon";
};
if (vehicle _unit == _unit) then {
if (animationState _unit == "AinjPpneMstpSnonWrflDnon") then {
[_unit,"AinjPpneMstpSnonWrflDnon_rolltofront", 2] call EFUNC(common,doAnimation);
[_unit,"amovppnemstpsnonwnondnon", 1] call EFUNC(common,doAnimation);
} else {
[_unit,"amovppnemstpsnonwnondnon", 2] call EFUNC(common,doAnimation);
};
} else {
private _vehicle = vehicle _unit;
private _oldVehicleAnimation = _unit getVariable [QGVAR(vehicleAwakeAnim), []];
private _awakeInVehicleAnimation = "";
if (((count _oldVehicleAnimation) > 0) && {(_oldVehicleAnimation select 0) == _vehicle}) then {
_awakeInVehicleAnimation = _oldVehicleAnimation select 1;
};
//Make sure we have a valid, non-terminal animation:
if ((_awakeInVehicleAnimation != "") && {(getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> _awakeInVehicleAnimation >> "terminal")) == 0}) then {
[_unit, _awakeInVehicleAnimation, 2] call EFUNC(common,doAnimation);
} else {
//Don't have a valid animation saved, reset the unit animation with a moveInXXX
TRACE_1("No Valid Animation, doing seat reset", _awakeInVehicleAnimation);
private _slotInfo = [];
{if ((_x select 0) == _unit) exitWith {_slotInfo = _x;};} forEach (fullCrew _vehicle);
if (_slotInfo isEqualTo []) exitWith {ERROR("No _slotInfo?");};
//Move the unit out:
_unit setPosASL ((getPosASL _unit) vectorAdd [0,0,100]);
//Move the unit back into old seat:
if ((_slotInfo select 1) == "driver") then {
_unit moveInDriver _vehicle;
} else {
if ((_slotInfo select 1) == "cargo") then {
_unit moveInCargo [_vehicle, (_slotInfo select 2)];
} else {
_unit moveInTurret [_vehicle, (_slotInfo select 3)];
};
};
};
};
_unit setVariable [QGVAR(vehicleAwakeAnim), nil];
["ace_unconscious", [_unit, false]] call CBA_fnc_globalEvent;
// EXIT PFH
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
if (!_hasMovedOut) then {
// Reset the unit back to the previous captive state.
[_unit, "setHidden", "ace_unconscious", false] call EFUNC(common,statusEffect_set);
// Swhich the unit back to its original group
//Unconscious units shouldn't be put in another group #527:
if (GVAR(moveUnitsFromGroupOnUnconscious)) then {
[_unit, false, VAR_UNCON, side group _unit] call EFUNC(common,switchToGroupSide);
};
[_unit, false] call EFUNC(common,disableAI);
_unit setUnitPos _originalPos; // This is not position but stance (DOWN, MIDDLE, UP)
_unit setUnconscious false;
[_unit, "isUnconscious"] call EFUNC(common,unmuteUnit);
// ensure this statement runs only once
_args set [4, true];
};
};
if (_parachuteCheck) then {
if !(vehicle _unit isKindOf "ParachuteBase") then {
[_unit, [_unit] call EFUNC(common,getDeathAnim), 1, true] call EFUNC(common,doAnimation);
_args set [5, false];
};
};
if (!local _unit) exitWith {
TRACE_6("ACE_DEBUG_Unconscious_PFH",_unit, _args, _startingTime, _minWaitingTime, _idPFH, _unit getVariable QGVAR(unconsciousArguments));
_args set [3, _minWaitingTime - (CBA_missionTime - _startingTime)];
_unit setVariable [QGVAR(unconsciousArguments), _args, true];
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
// Ensure we are waiting at least a minimum period before checking if we can wake up the unit again, allows for temp knock outs
if ((CBA_missionTime - _startingTime) >= _minWaitingTime) exitWith {
TRACE_2("ACE_DEBUG_Unconscious_Temp knock outs",_unit, [_unit] call FUNC(getUnconsciousCondition));
if (!([_unit] call FUNC(getUnconsciousCondition))) then {
_unit setVariable [VAR_UNCON, false, true];
};
};

View File

@ -84,15 +84,15 @@
// - Unit Functions ---------------------------------------------------
// Retrieval macros for common unit values
// Defined for easy consistency and speed
#define GET_BLOOD_VOLUME(unit) (GETVAR(unit,VAR_BLOOD_VOL,DEFAULT_BLOOD_VOLUME))
#define GET_HEART_RATE(unit) (GETVAR(unit,VAR_HEART_RATE,DEFAULT_HEART_RATE))
#define GET_HEMORRHAGE(unit) (GETVAR(unit,VAR_HEMORRHAGE,0))
#define GET_PAIN(unit) (GETVAR(unit,VAR_PAIN,0))
#define GET_PAIN_SUPPRESS(unit) (GETVAR(unit,VAR_PAIN_SUPP,0))
#define IN_CRDC_ARRST(unit) (GETVAR(unit,VAR_CRDC_ARRST,false))
#define IS_BLEEDING(unit) (GETVAR(unit,VAR_IS_BLEEDING,false))
#define IS_IN_PAIN(unit) (GETVAR(unit,VAR_IN_PAIN,false))
#define IS_UNCONSCIOUS(unit) (GETVAR(unit,VAR_UNCON,false))
#define GET_BLOOD_VOLUME(unit) (unit getVariable [VAR_BLOOD_VOL,DEFAULT_BLOOD_VOLUME])
#define GET_HEART_RATE(unit) (unit getVariable [VAR_HEART_RATE,DEFAULT_HEART_RATE])
#define GET_HEMORRHAGE(unit) (unit getVariable [VAR_HEMORRHAGE,0])
#define GET_PAIN(unit) (unit getVariable [VAR_PAIN,0])
#define GET_PAIN_SUPPRESS(unit) (unit getVariable [VAR_PAIN_SUPP,0])
#define IN_CRDC_ARRST(unit) (unit getVariable [VAR_CRDC_ARRST,false])
#define IS_BLEEDING(unit) (unit getVariable [VAR_IS_BLEEDING,false])
#define IS_IN_PAIN(unit) (unit getVariable [VAR_IN_PAIN,false])
#define IS_UNCONSCIOUS(unit) (unit getVariable [VAR_UNCON,false])
// The following function calls are defined here just for consistency
#define GET_BLOOD_LOSS(unit) ([unit] call EFUNC(medical_status,getBloodLoss))

570
addons/medical/ui/menu.hpp Normal file
View File

@ -0,0 +1,570 @@
#include "\z\ace\addons\common\define.hpp"
class GVAR(medicalMenu) {
idd = 314412;
movingEnable = true;
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(medicalMenu), _this select 0)]; [_this select 0] call FUNC(onMenuOpen););
onUnload = QUOTE([] call FUNC(onMenuClose));
class controlsBackground {
class HeaderBackground: ACE_gui_backgroundBase {
idc = -1;
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
x = "1 * (((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 = "38 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
text = "#(argb,8,8,3)color(0,0,0,0)";
};
class CenterBackground: HeaderBackground {
y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
h = "16 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
text = "#(argb,8,8,3)color(0,0,0,0.8)";
colorText[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"};
colorBackground[] = {0,0,0,"(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"};
};
class BottomBackground: CenterBackground {
y = "(18.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))";
h = "9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
};
class controls {
class HeaderName {
idc = 1;
type = CT_STATIC;
x = "1 * (((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 = "38 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
style = ST_LEFT + ST_SHADOW;
font = "RobotoCondensed";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
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 = "";
};
class IconsBackGroundBar: ACE_gui_backgroundBase{
idc = -1;
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "3.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
text = QPATHTOF(data\background_img.paa);
colorText[] = {1, 1, 1, 0.0};
};
class CatagoryLeft: HeaderName {
x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
style = ST_CENTER;
colorText[] = {1, 1, 1.0, 0.9};
colorBackground[] = {0,0,0,0};
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)";
text = CSTRING(EXAMINE_TREATMENT);
};
class CatagoryCenter: CatagoryLeft {
x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
text = CSTRING(STATUS);
};
class CatagoryRight: CatagoryCenter{
x = "25.66 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
text = CSTRING(OVERVIEW);
};
class Line: ACE_gui_backgroundBase {
idc = -1;
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "3.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "37 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "0.03 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
text = "#(argb,8,8,3)color(1,1,1,0.5)";
};
class iconImg1: ACE_gui_backgroundBase {
idc = 111;
x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.1)";
colorBackground[] = {0,0,0,1};
colorPicture[] = {1,1,1,1};
colorText[] = {1,1,1,1};
text = QPATHTOF(data\icons\triage_card_small.paa);
};
class iconImg2: iconImg1 {
idc = 112;
x = "3 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
text = QPATHTOF(data\icons\examine_patient_small.paa);
};
class iconImg3: iconImg1 {
idc = 113;
x = "4.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
text = QPATHTOF(data\icons\bandage_fracture_small.paa);
};
class iconImg4: iconImg1 {
idc = 114;
x = "6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
text = QPATHTOF(data\icons\medication_small.paa);
};
class iconImg5: iconImg1 {
idc = 115;
x = "7.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
text = QPATHTOF(data\icons\airway_management_small.paa);
};
class iconImg6: iconImg1 {
idc = 116;
x = "9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
text = QPATHTOF(data\icons\advanced_treatment_small.paa);
};
class iconImg7: iconImg1 {
idc = 117;
x = "10.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
text = QPATHTOF(data\icons\icon_carry.paa);
};
class iconImg8: iconImg1 {
idc = 118;
x = "12 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
text = QPATHTOF(data\icons\toggle_self_small.paa);
};
class BtnIconLeft1: ACE_gui_buttonBase {
idc = 11;
x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.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(['triage'] call FUNC(handleUI_DisplayOptions););
};
class BtnIconLeft2: BtnIconLeft1 {
idc = 12;
x = "3 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
action = QUOTE(['examine'] call FUNC(handleUI_DisplayOptions););
};
class BtnIconLeft3: BtnIconLeft1 {
idc = 13;
x = "4.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
action = QUOTE(['bandage'] call FUNC(handleUI_DisplayOptions););
};
class BtnIconLeft4: BtnIconLeft1 {
idc = 14;
x = "6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
action = QUOTE(['medication'] call FUNC(handleUI_DisplayOptions););
};
class BtnIconLeft5: BtnIconLeft1 {
idc = 15;
x = "7.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
action = QUOTE(['airway'] call FUNC(handleUI_DisplayOptions););
};
class BtnIconLeft6: BtnIconLeft1 {
idc = 16;
x = "9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
action = QUOTE(['advanced'] call FUNC(handleUI_DisplayOptions););
};
class BtnIconLeft7: BtnIconLeft1 {
idc = 17;
x = "10.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
action = QUOTE(['drag'] call FUNC(handleUI_DisplayOptions););
};
class BtnIconLeft8: BtnIconLeft1 {
idc = 18;
x = "12 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
action = QUOTE(['toggle'] call FUNC(handleUI_DisplayOptions););
};
class TriageCardList: ACE_gui_listBoxBase {
idc = 212;
x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "5.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "12 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "10 * ((((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.0};
};
// Left side
class BtnMenu1: BtnIconLeft1 {
idc = 20;
y = "5.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "12 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
text = "";
size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.9)";
animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.8)";
animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)";
animTextureOver = "#(argb,8,8,3)color(1,1,1,1)";
animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)";
animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)";
animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)";
color[] = {1, 1, 1, 1};
color2[] = {0,0,0, 1};
colorBackgroundFocused[] = {1,1,1,1};
colorBackground[] = {1,1,1,1};
colorbackground2[] = {1,1,1,1};
colorDisabled[] = {0.5,0.5,0.5,0.8};
colorFocused[] = {0,0,0,1};
periodFocus = 1;
periodOver = 1;
action = "";
};
class BtnMenu2: BtnMenu1 {
idc = 21;
y = "6.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
text = "";
};
class BtnMenu3: BtnMenu1 {
idc = 22;
y = "7.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
text = "";
};
class BtnMenu4: BtnMenu1 {
idc = 23;
y = "8.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
text ="";
};
class BtnMenu5: BtnMenu1 {
idc = 24;
y = "9.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
text = "";
};
class BtnMenu6: BtnMenu1 {
idc = 25;
y = "10.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
text = "";
};
class BtnMenu7: BtnMenu1 {
idc = 26;
y = "12 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
text = "";
};
class BtnMenu8: BtnMenu1 {
idc = 27;
y = "13.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
text = "";
};
// center
class bodyImgBackground: ACE_gui_backgroundBase {
idc = -1;
x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "12.33 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)";
colorBackground[] = {1,1,1,1};
colorPicture[] = {1,1,1,1};
colorText[] = {1,1,1,1};
text = QPATHTOF(ui\ui\body_background.paa);
};
class bodyImgHead: bodyImgBackground {
idc = 50;
x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "12.33 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)";
colorBackground[] = {1,1,1,1};
colorPicture[] = {1,1,1,0.75};
colorText[] = {1,1,1,0.75};
text = QPATHTOF(ui\ui\body_head.paa);
};
class bodyImgTorso: bodyImgHead {
idc = 51;
text = QPATHTOF(ui\ui\body_torso.paa);
};
class bodyImgArms_l: bodyImgHead {
idc = 52;
text = QPATHTOF(ui\ui\body_arm_left.paa);
};
class bodyImgArms_r: bodyImgHead {
idc = 53;
text = QPATHTOF(ui\ui\body_arm_right.paa);
};
class bodyImgLegs_l: bodyImgHead {
idc = 54;
text = QPATHTOF(ui\ui\body_leg_left.paa);
};
class bodyImgLegs_r: bodyImgHead {
idc = 55;
text = QPATHTOF(ui\ui\body_leg_right.paa);
};
class selectHead: ACE_gui_buttonBase {
idc = 301;
x = "18.8 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "3.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "1.4 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.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(GVAR(selectedBodyPart) = 0;);
};
class selectTorso : selectHead {
idc = 302;
x = "18.4 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "5.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "2.2 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "4.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
action = QUOTE(GVAR(selectedBodyPart) = 1;);
};
class selectLeftArm: selectHead{
idc = 303;
x = "17.4 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "5.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "1.1 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "4.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
action = QUOTE(GVAR(selectedBodyPart) = 3;);
};
class selectRightArm: selectLeftArm{
idc = 304;
x = "20.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
action = QUOTE(GVAR(selectedBodyPart) = 2;);
};
class selectLeftLeg :selectHead {
idc = 305;
x = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "9.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "1.1 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
action = QUOTE(GVAR(selectedBodyPart) = 5;);
};
class selectRightLeg :selectLeftLeg {
idc = 306;
x = "19.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
action = QUOTE(GVAR(selectedBodyPart) = 4;);
};
class TriageTextBottom: HeaderName {
idc = 2000;
x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "16.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
style = ST_CENTER;
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 = "";
};
// Right side
class InjuryList: ACE_gui_listBoxBase {
idc = 213;
x = "25.66 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "10 * ((((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};
};
// bottom
class ActivityLogHeader: CatagoryLeft {
x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "18.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
style = ST_CENTER;
colorText[] = {0.6, 0.7, 1.0, 1};
colorBackground[] = {0,0,0,0};
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
text = CSTRING(ACTIVITY_LOG);
};
class QuickViewHeader: ActivityLogHeader {
x = "19.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
text = CSTRING(QUICK_VIEW);
};
class LineBottomHeaders: Line {
y = "19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
};
class ActivityLog: InjuryList {
idc = 214;
//style = 16;
//type = 102;
//rows=1;
colorBackground[] = {0, 0, 0, 0};
x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "(19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))";
w = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "6.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)";
//colorSelectBackground[] = {0, 0, 0, 0.0};
//colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.0};
//columns[] = {0.0, 0.08};
//canDrag=true;
//arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)";
// arrowFull = "#(argb,8,8,3)color(1,1,1,1)";
drawSideArrows = 0;
//idcLeft = -1;
//idcRight = -1;
};
class QuikViewLog: InjuryList {
idc = 215;
//style = 16;
//type = 102;
//rows=1;
colorBackground[] = {0, 0, 0, 0};
x = "21.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "(19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))";
w = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "6.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)";
colorSelectBackground[] = {0, 0, 0, 0.0};
colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.0};
//columns[] = {0.0, 0.08};
//canDrag=true;
//arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)";
// arrowFull = "#(argb,8,8,3)color(1,1,1,1)";
drawSideArrows = 0;
//idcLeft = -1;
//idcRight = -1;
};
class selectTriageStatus: ACE_gui_buttonBase {
idc = 2001;
x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "16.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
style = ST_CENTER;
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([] call FUNC(handleUI_dropDownTriageCard););
};
class selectTriageStatusNone: selectTriageStatus {
idc = 2002;
x = 0;
y = 0;
w = 0;
h = 0;
text = ECSTRING(Medical,Triage_Status_None);
style = ST_CENTER;
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([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),0)] call FUNC(setTriageStatus););
};
class selectTriageStatusMinor: selectTriageStatus {
idc = 2003;
x = 0;
y = 0;
w = 0;
h = 0;
text = ECSTRING(Medical,Triage_Status_Minor);
style = ST_CENTER;
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([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),1)] call FUNC(setTriageStatus););
};
class selectTriageStatusDelayed: selectTriageStatus {
idc = 2004;
x = 0;
y = 0;
w = 0;
h = 0;
text = ECSTRING(Medical,Triage_Status_Delayed);
style = ST_CENTER;
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([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),2)] call FUNC(setTriageStatus););
};
class selectTriageStatusImmediate: selectTriageStatus {
idc = 2005;
x = 0;
y = 0;
w = 0;
h = 0;
text = ECSTRING(Medical,Triage_Status_Immediate);
style = ST_CENTER;
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([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),3)] call FUNC(setTriageStatus););
};
class selectTriageStatusDeceased: selectTriageStatus {
idc = 2006;
x = 0;
y = 0;
w = 0;
h = 0;
text = ECSTRING(Medical,Triage_Status_Deceased);
style = ST_CENTER;
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([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),4)] call FUNC(setTriageStatus););
};
};
};

View File

@ -38,5 +38,5 @@ if (isServer) then {
private _stateMachine = [_listcode, true] call CBA_statemachine_fnc_create;
[_stateMachine, {call FUNC(onBleeding)}, {}, {}, "Bleeding"] call CBA_statemachine_fnc_addState;
[QEGVAR(medical_engine,woundReceived), FUNC(handleWoundReceived)] call CBA_fnc_addEventHandler;
[QEGVAR(medical,woundReceived), FUNC(handleWoundReceived)] call CBA_fnc_addEventHandler;
}] call CBA_fnc_addEventHandler;

View File

@ -14,20 +14,19 @@ addMissionEventHandler ["Loaded",{
call FUNC(parseConfigForInjuries);
}];
// decide which woundsHandler to use by whether the extension is present or not
// decide which woundsHandler to use by whether the extension is present or not
if ("ace_medical" callExtension "version" != "") then {
DFUNC(woundsHandlerActive) = LINKFUNC(woundsHandler);
} else {
DFUNC(woundsHandlerActive) = LINKFUNC(woundsHandlerSQF);
};
[QEGVAR(medical_engine,woundReceived), {
[QEGVAR(medical,woundReceived), {
params ["_unit", "_woundedHitPoint", "_receivedDamage", "", "_ammo"];
private _typeOfDamage = _ammo call FUNC(getTypeOfDamage);
[_unit, _woundedHitPoint, _receivedDamage, _typeOfDamage] call FUNC(woundsHandlerActive);
// Disable for now:
// [_unit, EGVAR(medical,STATE_MACHINE)] call EFUNC(medical,addStateHandler);
}] call CBA_fnc_addEventHandler;

View File

@ -24,7 +24,7 @@ if (_typeOfDamage isEqualTo "") then {
// Administration for open wounds and ids
private _openWounds = _unit getVariable [QEGVAR(medical,openWounds), []];
private _woundID = _unit getVariable [QGVAR(lastUniqueWoundID), 1]; // Unique wound ids are not used anywhere: ToDo Remove from openWounds array
private _woundID = _unit getVariable [QEGVAR(medical,lastUniqueWoundID), 1]; // Unique wound ids are not used anywhere: ToDo Remove from openWounds array
TRACE_4("extension call",_bodyPart,_damage,_typeOfDamage,_woundID);
private _extensionOutput = "ace_medical" callExtension format ["HandleDamageWounds,%1,%2,%3,%4", _bodyPart, _damage, _typeOfDamage, _woundID];

View File

@ -69,7 +69,7 @@ if (_highestPossibleSpot < 0) exitWith {};
// Administration for open wounds and ids
private _openWounds = _unit getVariable [QEGVAR(medical,openWounds), []];
private _woundID = _unit getVariable [QGVAR(lastUniqueWoundID), 1]; // Unique wound ids are not used anywhere: ToDo Remove from openWounds array
private _woundID = _unit getVariable [QEGVAR(medical,lastUniqueWoundID), 1]; // Unique wound ids are not used anywhere: ToDo Remove from openWounds array
private _painLevel = 0;
private _critialDamage = false;

View File

@ -21,7 +21,7 @@
}, nil, nil, true] call CBA_fnc_addClassEventHandler;
#ifdef DEBUG_MODE_FULL
[QGVAR(woundReceived), {
[QEGVAR(medical,woundReceived), {
params ["_unit", "_woundedHitPoint", "_receivedDamage", "_shooter", "_ammo"];
TRACE_5("wound",_unit,_woundedHitPoint, _receivedDamage, _shooter, _ammo);
//systemChat str _this;

View File

@ -39,6 +39,6 @@ switch (toLower _selection) do {
_unit setHitPointDamage ["HitHands", _damage];
};
case ("legs"): {
_unit setHitPointDamage ["HitLegs", _damage + ([0, LIMPING_MIN_DAMAGE] select (_unit getVariable [QGVAR(isLimping), false]))];
_unit setHitPointDamage ["HitLegs", _damage + ([0, LIMPING_MIN_DAMAGE] select (_unit getVariable [QEGVAR(medical,isLimping), false]))];
};
};

View File

@ -138,7 +138,7 @@ if (_hitPoint isEqualTo "ace_hdbracket") exitWith {
// Don't trigger for minor damage.
if (_receivedDamage > 1E-3) then {
[QGVAR(woundReceived), [_unit, _woundedHitPoint, _receivedDamage, _shooter, _ammo]] call CBA_fnc_localEvent;
[QEGVAR(medical,woundReceived), [_unit, _woundedHitPoint, _receivedDamage, _shooter, _ammo]] call CBA_fnc_localEvent;
};
0
@ -147,14 +147,14 @@ if (_hitPoint isEqualTo "ace_hdbracket") exitWith {
// Check for drowning damage.
// Don't change the third expression. Safe method for FLOATs.
if (_hitPoint isEqualTo "#structural" && {getOxygenRemaining _unit <= 0.5} && {_damage isEqualTo (_oldDamage + 0.005)}) exitWith {
[QGVAR(woundReceived), [_unit, "Body", _newDamage, _unit, "#drowning"]] call CBA_fnc_localEvent;
[QEGVAR(medical,woundReceived), [_unit, "Body", _newDamage, _unit, "#drowning"]] call CBA_fnc_localEvent;
0
};
// Handle vehicle crashes
if (_isCrash) exitWith {
[QGVAR(woundReceived), [_unit, "Body", _newDamage, _unit, "#vehiclecrash"]] call CBA_fnc_localEvent;
[QEGVAR(medical,woundReceived), [_unit, "Body", _newDamage, _unit, "#vehiclecrash"]] call CBA_fnc_localEvent;
0
};

View File

@ -22,7 +22,7 @@ if (!local _unit) exitWith {
ERROR("Unit not local or null");
};
_unit setVariable [QGVAR(isLimping), _isLimping, true];
_unit setVariable [QEGVAR(medical,isLimping), _isLimping, true];
// refresh
private _isDamaged = _unit getHitPointDamage "HitLegs" >= DAMAGED_MIN_THRESHOLD && {_unit getHitPointDamage "HitLegs" != LIMPING_MIN_DAMAGE};

View File

@ -1,6 +1,3 @@
class ACE_gui_backgroundBase;
class ACE_gui_listBoxBase;
class RscTitles {
class GVAR(DisplayInformation) {
duration = 10e10;

View File

@ -1,5 +1,3 @@
class ACE_gui_buttonBase;
class GVAR(triageCard) {
idd = 7010;
movingenable = 0;

View File

@ -5,45 +5,45 @@ class ACE_Medical_StateMachine {
skipNull = 1;
class Default {
onState = QFUNC(handleStateDefault);
onState = QUOTE(call FUNC(handleStateDefault));
class Injury {
targetState = "Injured";
events[] = {QGVAR(Injury)};
events[] = {QEGVAR(medical,Injury)};
};
class CriticalInjuryOrVitals {
targetState = "Unconscious";
events[] = {QGVAR(CriticalInjury), QGVAR(CriticalVitals), QGVAR(knockOut)};
events[] = {QEGVAR(medical,CriticalInjury), QEGVAR(medical,CriticalVitals), QEGVAR(medical,knockOut)};
};
class FatalVitals {
targetState = "CardiacArrest";
events[] = {QGVAR(FatalVitals)};
events[] = {QEGVAR(medical,FatalVitals)};
};
class FatalInjury {
targetState = "FatalInjury";
events[] = {QGVAR(FatalInjury)};
events[] = {QEGVAR(medical,FatalInjury)};
};
};
class Injured {
onState = QFUNC(handleStateInjured);
onState = QUOTE(call FUNC(handleStateInjured));
class FullHeal {
targetState = "Default";
events[] = {QGVAR(FullHeal)};
events[] = {QEGVAR(medical,FullHeal)};
};
class CriticalInjuryOrVitals {
targetState = "Unconscious";
events[] = {QGVAR(CriticalInjury), QGVAR(CriticalVitals), QGVAR(knockOut)};
events[] = {QEGVAR(medical,CriticalInjury), QEGVAR(medical,CriticalVitals), QEGVAR(medical,knockOut)};
};
class FatalVitals {
targetState = "CardiacArrest";
events[] = {QGVAR(FatalVitals)};
events[] = {QEGVAR(medical,FatalVitals)};
};
class FatalInjury {
targetState = "FatalInjury";
events[] = {QGVAR(FatalInjury)};
events[] = {QEGVAR(medical,FatalInjury)};
};
};
class Unconscious {
onState = QFUNC(handleStateUnconscious);
onState = QUOTE(call FUNC(handleStateUnconscious));
onStateEntered = QUOTE([ARR_2(_this,(true))] call EFUNC(medical,setUnconsciousStatemachine));
class DeathAI {
targetState = "Dead";
@ -52,61 +52,63 @@ class ACE_Medical_StateMachine {
class WakeUp {
targetState = "Injured";
condition = QUOTE(_this call EFUNC(medical_status,hasStableVitals));
events[] = {QGVAR(WakeUp)};
events[] = {QEGVAR(medical,WakeUp)};
onTransition = QUOTE([ARR_2(_this,(false))] call EFUNC(medical,setUnconsciousStatemachine));
};
class FatalTransitions {
targetState = "CardiacArrest";
events[] = {QGVAR(FatalVitals)};
events[] = {QEGVAR(medical,FatalVitals)};
};
class FatalInjury {
targetState = "FatalInjury";
events[] = {QGVAR(FatalInjury)};
events[] = {QEGVAR(medical,FatalInjury)};
};
};
class FatalInjury {
// Transition state for handling instant death
// This state raises the next transition in the same frame
onStateEntered = QFUNC(enteredStateFatalInjury);
onStateEntered = QUOTE(call FUNC(enteredStateFatalInjury));
class DeathAI {
events[] = {QGVAR(FatalInjuryInstantTransition)};
events[] = {QEGVAR(medical,FatalInjuryInstantTransition)};
targetState = "Dead";
condition = QUOTE(!isPlayer _this && {EGVAR(medical,fatalInjuryConditionAI)});
};
class SecondChance {
events[] = {QGVAR(FatalInjuryInstantTransition)};
events[] = {QEGVAR(medical,FatalInjuryInstantTransition)};
targetState = "CardiacArrest";
condition = QUOTE(EGVAR(medical,fatalInjuryCondition) > 0);
onTransition = QFUNC(transitionSecondChance);
onTransition = QUOTE(call FUNC(transitionSecondChance));
};
class Death {
events[] = {QGVAR(FatalInjuryInstantTransition)};
events[] = {QEGVAR(medical,FatalInjuryInstantTransition)};
targetState = "Dead";
condition = "true";
};
};
class CardiacArrest {
onStateEntered = QFUNC(enteredStateCardiacArrest);
onStateLeaving = QFUNC(leftStateCardiacArrest);
onStateEntered = QUOTE(call FUNC(enteredStateCardiacArrest));
onStateLeaving = QUOTE(call FUNC(leftStateCardiacArrest));
class DeathAI {
targetState = "Dead";
condition = QUOTE(!isPlayer _this && {EGVAR(medical,fatalInjuryConditionAI)});
};
class Timeout {
targetState = "Dead";
condition = QEFUNC(medical,conditionCardiacArrestTimer);
condition = QUOTE(call EFUNC(medical,conditionCardiacArrestTimer));
};
class Reanimation {
targetState = "Unconscious";
events[] = {QGVAR(CPRSucceeded)};
events[] = {QEGVAR(medical,CPRSucceeded)};
};
class Execution {
targetState = "Dead";
condition = QEFUNC(medical,conditionExecutionDeath);
events[] = {QGVAR(FatalInjury)};
condition = QUOTE(call EFUNC(medical,conditionExecutionDeath));
events[] = {QEGVAR(medical,FatalInjury)};
};
};
class Dead {
// TODO: this needs to be handled by a function instead of inline scripts
// Probably also needs additional logic to deal with edge cases
onStateEntered = "_this setDamage 1"; // killing a unit also exits the state machine for this unit
};
};

View File

@ -15,3 +15,4 @@ class CfgPatches {
};
#include "Statemachine.hpp"
#include "CfgEventHandlers.hpp"

View File

@ -13,4 +13,4 @@
#include "script_component.hpp"
params ["_unit"];
[QGVAR(FatalInjuryInstantTransition), _unit] call CBA_fnc_localEvent;
[QEGVAR(medical,FatalInjuryInstantTransition), _unit] call CBA_fnc_localEvent;

View File

@ -3,6 +3,8 @@
params ["_unit", "_stateName"];
TRACE_2("defaultState:", _unit, _stateName);
// If the unit died the loop is finished
if (!alive _unit) exitWith {};

View File

@ -24,17 +24,17 @@ if (_painLevel > 0) then {
// Handle spontaneous wakeup from unconsciousness
if (EGVAR(medical,spontaneousWakeUpChance) > 0) then {
if (_unit call EFUNC(medical_status,hasStableVitals)) then {
private _lastWakeUpCheck = _unit getVariable [QGVAR(lastWakeUpCheck), CBA_missionTime];
private _lastWakeUpCheck = _unit getVariable [EQGVAR(medical,lastWakeUpCheck), CBA_missionTime];
if (CBA_missionTime - _lastWakeUpCheck > SPONTANEOUS_WAKE_UP_INTERVAL) then {
TRACE_2("Checking for wake up",_unit,EGVAR(medical,spontaneousWakeUpChance));
_unit setVariable [QGVAR(lastWakeUpCheck), CBA_missionTime];
_unit setVariable [EQGVAR(medical,lastWakeUpCheck), CBA_missionTime];
if ((random 1) < EGVAR(medical,spontaneousWakeUpChance)) then {
TRACE_1("Spontaneous wake up!",_unit);
[QGVAR(WakeUp), _unit] call CBA_fnc_localEvent;
[QEGVAR(medical,WakeUp), _unit] call CBA_fnc_localEvent;
};
};
} else {
// Unstable vitals, procrastinate the next wakeup check
_unit setVariable [QGVAR(lastWakeUpCheck), CBA_missionTime];
_unit setVariable [EQGVAR(medical,lastWakeUpCheck), CBA_missionTime];
};
};

View File

@ -15,6 +15,6 @@
params ["_unit"];
_unit setVariable [VAR_CRDC_ARRST, false, true];
_unit setVariable [QGVAR(cardiacArrestStart), nil];
_unit setVariable [QEGVAR(medical,cardiacArrestStart), nil];
_unit setVariable [VAR_HEART_RATE, 40, true];
_unit setVariable [QGVAR(lastTimeUpdated), CBA_missionTime];

View File

@ -13,7 +13,7 @@
#include "script_component.hpp"
params ["_unit"];
_unit setVariable [QGVAR(deathBlocked), true];
_unit setVariable [QEGVAR(medical,deathBlocked), true];
[{
_this setVariable [QGVAR(deathBlocked), false];
_this setVariable [QEGVAR(medical,deathBlocked), false];
}, _unit, 1] call CBA_fnc_waitAndExecute;

View File

@ -14,7 +14,7 @@
#include "script_component.hpp"
params ["_unit", "_change", "_timeToMaxEffect", "_maxTimeInSystem"];
private _adjustments = GETVAR(_unit,VAR_HEART_RATE_ADJ,[]);
private _adjustments = _unit getVariable [VAR_HEART_RATE_ADJ,[]];
// The last number indicates the time the adjustment is already in the system
_adjustments pushBack [_change, _timeToMaxEffect, _maxTimeInSystem, 0];
_unit setVariable [VAR_HEART_RATE_ADJ, _adjustments];

View File

@ -17,14 +17,14 @@
params ["_unit"];
private _tourniquets = _unit getVariable [QGVAR(tourniquets), [0,0,0,0,0,0]];
private _tourniquets = _unit getVariable [QEGVAR(medical,tourniquets), [0,0,0,0,0,0]];
private _bodyPartBleeding = [0,0,0,0,0,0];
{
_x params ["", "", "_bodyPart", "_amountOf", "_bleeeding"];
if (_tourniquets select _bodyPart == 0) then {
_bodyPartBleeding set [_bodyPart, (_bodyPartBleeding select _bodyPart) + (_amountOf * _bleeeding)];
};
} forEach (_unit getVariable [QGVAR(openWounds), []]);
} forEach (_unit getVariable [QEGVAR(medical,openWounds), []]);
if (_bodyPartBleeding isEqualTo [0,0,0,0,0,0]) exitWith { 0 };

View File

@ -22,9 +22,9 @@ params ["_unit", "_deltaT", "_syncValues"];
private _bloodVolume = GET_BLOOD_VOLUME(_unit);
private _bloodVolumeChange = -_deltaT * GET_BLOOD_LOSS(_unit);
if (!isNil {_unit getVariable QGVAR(ivBags)}) then {
private _bloodBags = _unit getVariable [QGVAR(ivBags), []];
private _tourniquets = _unit getVariable [QGVAR(tourniquets), [0,0,0,0,0,0]];
if (!isNil {_unit getVariable QEGVAR(medical,ivBags)}) then {
private _bloodBags = _unit getVariable [QEGVAR(medical,ivBags), []];
private _tourniquets = _unit getVariable [QEGVAR(medical,tourniquets), [0,0,0,0,0,0]];
_bloodBags = _bloodBags apply {
_x params ["_bagVolumeRemaining", "_type", "_bodyPart"];
@ -45,9 +45,9 @@ if (!isNil {_unit getVariable QGVAR(ivBags)}) then {
_bloodBags = _bloodBags - [[]]; // remove empty bags
if (_bloodBags isEqualTo []) then {
_unit setVariable [QGVAR(ivBags), nil, true]; // no bags left - clear variable (always globaly sync this)
_unit setVariable [QEGVAR(medical,ivBags), nil, true]; // no bags left - clear variable (always globaly sync this)
} else {
_unit setVariable [QGVAR(ivBags), _bloodBags, _syncValues];
_unit setVariable [QEGVAR(medical,ivBags), _bloodBags, _syncValues];
};
};

View File

@ -22,4 +22,4 @@ private _index = ALL_BODY_PARTS find toLower _bodyPart;
if (_index < 0) exitWith { false };
((_target getVariable [QGVAR(tourniquets), [0,0,0,0,0,0]]) select _index) > 0
((_target getVariable [QEGVAR(medical,tourniquets), [0,0,0,0,0,0]]) select _index) > 0

View File

@ -39,43 +39,43 @@ _unit setVariable [VAR_PAIN_SUPP, 0, true];
_unit setVariable [VAR_PAIN_SUPP_ADJ, [], true];
// - Wounds -------------------------------------------------------------------
_unit setVariable [QGVAR(openWounds), [], true];
_unit setVariable [QGVAR(bandagedWounds), [], true];
_unit setVariable [QGVAR(stitchedWounds), [], true];
_unit setVariable [QEGVAR(medical_engine,isLimping), false, true];
_unit setVariable [QEGVAR(medical,openWounds), [], true];
_unit setVariable [QEGVAR(medical,bandagedWounds), [], true];
_unit setVariable [QEGVAR(medical,stitchedWounds), [], true];
_unit setVariable [QEGVAR(medical,isLimping), false, true];
// - Misc ---------------------------------------------------------------------
_unit setVariable [VAR_UNCON, false, true];
// - Treatments ---------------------------------------------------------------
_unit setVariable [QGVAR(tourniquets), [0,0,0,0,0,0], true];
_unit setVariable [QGVAR(occludedMedications), nil, true]; //Delayed Medications (from tourniquets)
_unit setVariable [QGVAR(ivBags), nil, true];
_unit setVariable [QGVAR(partialHealCounter), 0, true];
_unit setVariable [QEGVAR(medical,tourniquets), [0,0,0,0,0,0], true];
_unit setVariable [QEGVAR(medical,occludedMedications), nil, true]; //Delayed Medications (from tourniquets)
_unit setVariable [QEGVAR(medical,ivBags), nil, true];
_unit setVariable [QEGVAR(medical,partialHealCounter), 0, true];
// triage card and logs
_unit setVariable [QGVAR(triageLevel), 0, true];
_unit setVariable [QGVAR(triageCard), [], true];
_unit setVariable [QEGVAR(medical,triageLevel), 0, true];
_unit setVariable [QEGVAR(medical,triageCard), [], true];
// damage storage
_unit setVariable [QGVAR(bodyPartDamage), [0,0,0,0,0,0], true];
_unit setVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0], true];
#ifdef DEBUG_TESTRESULTS
_unit setVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true];
_unit setVariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0], true];
#endif
// medication
private _allUsedMedication = _unit getVariable [QGVAR(allUsedMedication), []];
private _allUsedMedication = _unit getVariable [QEGVAR(medical,allUsedMedication), []];
{
_unit setVariable [_x select 0, nil];
} forEach _allUsedMedication;
_unit setVariable [QGVAR(allUsedMedication), [], true];
_unit setVariable [QEGVAR(medical,allUsedMedication), [], true];
// TODO move to treatment
private _logs = _unit getVariable [QGVAR(allLogs), []];
private _logs = _unit getVariable [QEGVAR(medical,allLogs), []];
{
_unit setVariable [_x, nil];
} forEach _logs;
_unit setVariable [QGVAR(allLogs), [], true];
_unit setVariable [QEGVAR(medical,allLogs), [], true];
[{
params ["_unit"];

View File

@ -44,14 +44,14 @@ private _medicalFacility =
private _objects = (lineIntersectsWith [_unit modelToWorldVisual [0, 0, (_eyePos select 2)], _unit modelToWorldVisual [0, 0, (_eyePos select 2) +10], _unit]);
{
if (((typeOf _x) in _medicalFacility) || (_x getVariable [QGVAR(isMedicalFacility),false])) exitWith {
if (((typeOf _x) in _medicalFacility) || (_x getVariable [QEGVAR(medical,isMedicalFacility),false])) exitWith {
_isInBuilding = true;
};
} forEach _objects;
if (!_isInBuilding) then {
_objects = _unit nearObjects 7.5;
{
if (((typeOf _x) in _medicalFacility) || (_x getVariable [QGVAR(isMedicalFacility),false])) exitWith {
if (((typeOf _x) in _medicalFacility) || (_x getVariable [QEGVAR(medical,isMedicalFacility),false])) exitWith {
_isInBuilding = true;
};
} forEach _objects;

View File

@ -19,7 +19,7 @@
params ["_unit", ["_medicN", 1]];
private _class = _unit getVariable [QGVAR(medicClass), [0, 1] select (_unit getUnitTrait "medic")];
private _class = _unit getVariable [QEGVAR(medical,medicClass), [0, 1] select (_unit getUnitTrait "medic")];
if (_class >= _medicN min EGVAR(medical,medicSetting)) exitWith {true};
if (!EGVAR(medical,increaseTrainingInLocations)) exitWith {false};

View File

@ -17,4 +17,4 @@
params ["_vehicle"];
(_vehicle getVariable [QGVAR(medicClass), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant")]) > 0
(_vehicle getVariable [QEGVAR(medical,medicClass), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant")]) > 0

View File

@ -34,7 +34,7 @@ if ((isNull _unit) || {!alive _unit} || {!(_unit isKindOf "CAManBase")}) exitWit
false
};
if (!local _unit) exitWith {
[QGVAR(setUnconscious), [_unit, _knockOut], _unit] call CBA_fnc_targetEvent;
[QEGVAR(medical,setUnconscious), [_unit, _knockOut], _unit] call CBA_fnc_targetEvent;
true
};
if (_knockOut isEqualTo IS_UNCONSCIOUS(_unit)) exitWith {
@ -42,7 +42,7 @@ if (_knockOut isEqualTo IS_UNCONSCIOUS(_unit)) exitWith {
false
};
private _beforeState = [_unit, GVAR(STATE_MACHINE)] call CBA_statemachine_fnc_getCurrentState;
private _beforeState = [_unit, EGVAR(medical,STATE_MACHINE)] call CBA_statemachine_fnc_getCurrentState;
if (_knockOut) then {
@ -60,7 +60,7 @@ if (_knockOut) then {
}, [_unit], _minWaitingTime] call CBA_fnc_waitAndExecute;
};
if (EGVAR(medical,spontaneousWakeUpChance) > 0) then {
_unit setVariable [QGVAR(lastWakeUpCheck), CBA_missionTime + _minWaitingTime - SPONTANEOUS_WAKE_UP_INTERVAL];
_unit setVariable [QEGVAR(medical,lastWakeUpCheck), CBA_missionTime + _minWaitingTime - SPONTANEOUS_WAKE_UP_INTERVAL];
};
};
@ -69,7 +69,7 @@ if (_knockOut) then {
[QGVAR(WakeUp), _unit] call CBA_fnc_localEvent;
};
private _afterState = [_unit, GVAR(STATE_MACHINE)] call CBA_statemachine_fnc_getCurrentState;
private _afterState = [_unit, EGVAR(medical,STATE_MACHINE)] call CBA_statemachine_fnc_getCurrentState;
TRACE_2("state change",_beforeState,_afterState);
true

View File

@ -96,7 +96,7 @@ class GVAR(Actions) {
category = "medication";
items[] = {"ACE_morphine"};
condition = "";
treatmentTime = 9;
treatmentTime = 5;
callbackSuccess = QFUNC(treatmentMedication);
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
litter[] = { {"All", "", {"ACE_MedicalLitter_morphine"}} };

View File

@ -28,7 +28,7 @@ _target setVariable [QGVAR(occludedMedications), nil, true];
_target setVariable [QEGVAR(medical,openWounds), [], true];
_target setVariable [QEGVAR(medical,bandagedWounds), [], true];
_target setVariable [QEGVAR(medical,stitchedWounds), [], true];
_target setVariable [QEGVAR(medical_engine,isLimping), false, true];
_target setVariable [QEGVAR(medical,isLimping), false, true];
// vitals
_target setVariable [VAR_HEART_RATE, DEFAULT_HEART_RATE, true];

View File

@ -13,21 +13,22 @@
* Public: Yes
*/
#include "script_component.hpp"
#define MORPHINE_PAIN_SUPPRESSION 0.6
params ["_target", "_className", "_partIndex"];
TRACE_3("params",_target,_className,_partIndex);
if (!EGVAR(medical,advancedMedication)) exitWith {
TRACE_1("MedicalSettingAdvancedMedication is:", EGVAR(medical,advancedMedication));
if (_className == "Morphine") exitWith {
#define MORPHINE_PAIN_SUPPRESSION 0.6
private _painSupress = GET_PAIN_SUPPRESS(_target);
_target setVariable [VAR_PAIN_SUPP, (_painSupress + MORPHINE_PAIN_SUPPRESSION) min 1, true];
};
if (_className == "Epinephrine") exitWith {
[QEGVAR(medical,WakeUp), _target] call CBA_fnc_localEvent;
};
};
TRACE_1("Running treatmentMedicationLocal with Advanced configuration for", _target);
private _tourniquets = _target getVariable [QEGVAR(medical,tourniquets), [0,0,0,0,0,0]];
@ -80,21 +81,24 @@ if (alive _target) then {
// Adjust the heart rate based upon config entry
if (_heartRateChange != 0) then {
private _adjustments = GETVAR(_target,VAR_HEART_RATE_ADJ,[]);
TRACE_1("heartRateChange", _heartRateChange);
private _adjustments = _target getVariable [VAR_HEART_RATE_ADJ,[]];
_adjustments pushBack [_heartRateChange, _timeTillMaxEffect, _timeInSystem, 0];
_target setVariable [VAR_HEART_RATE_ADJ, _adjustments];
};
// Adjust the pain suppression based upon config entry
if (_painReduce > 0) then {
private _adjustments = GETVAR(_target,VAR_PAIN_SUPP_ADJ,[]);
TRACE_1("painReduce", _painReduce);
private _adjustments = _target getVariable [VAR_PAIN_SUPP_ADJ,[]];
_adjustments pushBack [_painReduce, _timeTillMaxEffect, _timeInSystem, 0];
_target setVariable [VAR_PAIN_SUPP_ADJ, _adjustments];
};
// Adjust the peripheral resistance based upon config entry
if (_viscosityChange != 0) then {
private _adjustments = GETVAR(_target,VAR_PERIPH_RES_ADJ,[]);
TRACE_1("viscosityChange", _viscosityChange);
private _adjustments = _target getVariable [VAR_PERIPH_RES_ADJ,[]];
_adjustments pushBack [_viscosityChange, _timeTillMaxEffect, _timeInSystem, 0];
_target setVariable [VAR_PERIPH_RES_ADJ, _adjustments];
};

View File

@ -13,3 +13,5 @@ class CfgPatches {
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"

View File

@ -52,7 +52,7 @@ private _bloodLoss = GET_BLOOD_LOSS(_unit);
if (_bloodLoss > 0) then {
_unit setVariable [QGVAR(bloodloss), _bloodLoss, _syncValues];
[QGVAR(Injury), _unit] call CBA_fnc_localEvent;
[QEGVAR(medical,Injury), _unit] call CBA_fnc_localEvent;
if !IS_BLEEDING(_unit) then {
_unit setVariable [VAR_IS_BLEEDING, true, true];
@ -70,7 +70,7 @@ if !(_inPain isEqualTo IS_IN_PAIN(_unit)) then {
// Handle pain due tourniquets, that have been applied more than 120 s ago
private _tourniquetPain = 0;
private _tourniquets = _unit getVariable [QGVAR(tourniquets), [0,0,0,0,0,0]];
private _tourniquets = _unit getVariable [QEGVAR(medical,tourniquets), [0,0,0,0,0,0]];
{
if (_x > 0 && {CBA_missionTime - _x > 120}) then {
_tourniquetPain = _tourniquetPain max (CBA_missionTime - _x - 120) * 0.001;
@ -87,7 +87,7 @@ _unit setVariable [VAR_BLOOD_PRESS, _bloodPressure, _syncValues];
private _cardiacOutput = [_unit] call EFUNC(medical_status,getCardiacOutput);
if (_bloodLoss > BLOOD_LOSS_KNOCK_OUT_THRESHOLD * _cardiacOutput) then {
[QGVAR(CriticalVitals), _unit] call CBA_fnc_localEvent;
[QEGVAR(medical,CriticalVitals), _unit] call CBA_fnc_localEvent;
};
#ifdef DEBUG_MODE_FULL
@ -98,10 +98,10 @@ if (!isPlayer _unit) then {
_bloodPressure params ["_bloodPressureL", "_bloodPressureH"];
if (_bloodPressureL < 40 || {_heartRate < 30}) then {
[QGVAR(CriticalVitals), _unit] call CBA_fnc_localEvent;
[QEGVAR(medical,CriticalVitals), _unit] call CBA_fnc_localEvent;
};
if ((_heartRate < 20) || {_heartRate > 220} || {_bloodPressureH < 50}) then {
[QGVAR(FatalVitals), _unit] call CBA_fnc_localEvent;
[QEGVAR(medical,FatalVitals), _unit] call CBA_fnc_localEvent;
};
END_COUNTER(Vitals);

View File

@ -21,7 +21,7 @@
params ["_unit", "_deltaT", "_syncValue"];
private _hrTargetAdjustment = 0;
private _adjustments = GETVAR(_unit,VAR_HEART_RATE_ADJ,[]);
private _adjustments = _unit getVariable [VAR_HEART_RATE_ADJ,[]];
if !(_adjustments isEqualTo []) then {
{

View File

@ -2,22 +2,21 @@ version: 2
jobs:
build:
docker:
- image: python:3-alpine
- image: acemod/armake
steps:
- checkout
- run:
name: Validate SQF And Config style
command: python tools/sqf_validator.py && python tools/config_style_checker.py
deployment:
docker:
- image: python:3-alpine
branch: master
requires:
- build
steps:
- checkout
- run:
name: Build
command: armake --version
- deploy:
name: Deploy
name: Update documentation and translation statistics
command: |
pip install pygithub pygithub3
python3 tools/deploy.py
if [ "${CIRCLE_BRANCH}" == "master" ] && [ "${CIRCLE_PROJECT_USERNAME}" == "acemod" ]; then
pip install pygithub pygithub3
python3 tools/deploy.py
else
echo "Skipping, not on acemod/ACE3 master branch..."
fi

View File

@ -354,6 +354,27 @@ Author:
------------------------------------------- */
#define MESSAGE_WITH_TITLE(TITLE,MESSAGE) LOG_SYS_FILELINENUMBERS(TITLE,MESSAGE)
/* -------------------------------------------
Macro: RETDEF()
If a variable is undefined, return the default value. Otherwise, return the
variable itself.
Parameters:
VARIABLE - the variable to check
DEFAULT_VALUE - the default value to use if variable is undefined
Example:
(begin example)
// _var is undefined
hintSilent format ["_var=%1", RETDEF(_var,5)]; // "_var=5"
_var = 7;
hintSilent format ["_var=%1", RETDEF(_var,5)]; // "_var=7"
(end example)
Author:
654wak654
------------------------------------------- */
#define RETDEF(VARIABLE,DEFAULT_VALUE) (if (isNil {VARIABLE}) then [{DEFAULT_VALUE}, {VARIABLE}])
/* -------------------------------------------
Macro: RETNIL()
If a variable is undefined, return the value nil. Otherwise, return the
@ -365,13 +386,13 @@ Parameters:
Example:
(begin example)
// _var is undefined
hintSilent format ["_var=%1", RETNIL(_var) ]; // "_var=any"
hintSilent format ["_var=%1", RETNIL(_var)]; // "_var=any"
(end example)
Author:
Alef (see CBA issue #8514)
------------------------------------------- */
#define RETNIL(VARIABLE) if (isNil{VARIABLE}) then {nil} else {VARIABLE}
#define RETNIL(VARIABLE) RETDEF(VARIABLE,nil)
/* -------------------------------------------
Macros: TRACE_n()
@ -1039,7 +1060,7 @@ Parameters:
Author:
Spooner
------------------------------------------- */
#define IS_META_SYS(VAR,TYPE) (if (isNil {VAR}) then { false } else { (VAR) isEqualType TYPE })
#define IS_META_SYS(VAR,TYPE) (if (isNil {VAR}) then {false} else {(VAR) isEqualType TYPE})
#define IS_ARRAY(VAR) IS_META_SYS(VAR,[])
#define IS_BOOL(VAR) IS_META_SYS(VAR,false)
#define IS_CODE(VAR) IS_META_SYS(VAR,{})
@ -1057,10 +1078,10 @@ Author:
#define IS_BOOLEAN(VAR) IS_BOOL(VAR)
#define IS_FUNCTION(VAR) IS_CODE(VAR)
#define IS_INTEGER(VAR) if ( IS_SCALAR(VAR) ) then { (floor(VAR) == (VAR)) } else { false }
#define IS_INTEGER(VAR) (if (IS_SCALAR(VAR)) then {floor (VAR) == (VAR)} else {false})
#define IS_NUMBER(VAR) IS_SCALAR(VAR)
#define FLOAT_TO_STRING(num) (str parseNumber (str (_this%_this) + str floor abs _this) + "." + (str (abs _this-floor abs _this) select [2]) + "0")
#define FLOAT_TO_STRING(num) (if (_this == 0) then {"0"} else {str parseNumber (str (_this % _this) + str floor abs _this) + "." + (str (abs _this - floor abs _this) select [2]) + "0"})
/* -------------------------------------------
Macro: SCRIPT()
@ -1173,6 +1194,9 @@ Author:
#define ELSTRING(var1,var2) QUOTE(TRIPLES(STR,DOUBLES(PREFIX,var1),var2))
#define CSTRING(var1) QUOTE(TRIPLES($STR,ADDON,var1))
#define ECSTRING(var1,var2) QUOTE(TRIPLES($STR,DOUBLES(PREFIX,var1),var2))
#define LLSTRING(var1) localize QUOTE(TRIPLES(STR,ADDON,var1))
#define LELSTRING(var1,var2) localize QUOTE(TRIPLES(STR,DOUBLES(PREFIX,var1),var2))
#endif
@ -1704,3 +1728,36 @@ Author:
commy2
------------------------------------------- */
#define IS_ADMIN_LOGGED serverCommandAvailable "#shutdown"
/* -------------------------------------------
Macro: FILE_EXISTS
Check if a file exists on machines with interface
Reports "false" if the file does not exist and throws an error in RPT.
Parameters:
FILE - Path to the file
Example:
(begin example)
// print "true" if file exists
systemChat str FILE_EXISTS("\A3\ui_f\data\igui\cfg\cursors\weapon_ca.paa");
(end)
Author:
commy2
------------------------------------------- */
#define FILE_EXISTS(FILE) (call {\
private _return = false;\
isNil {\
private _control = (uiNamespace getVariable ["RscDisplayMain", displayNull]) ctrlCreate ["RscHTML", -1];\
if (isNull _control) then {\
_return = loadFile (FILE) != "";\
} else {\
_control htmlLoad (FILE);\
_return = ctrlHTMLLoaded _control;\
ctrlDelete _control;\
};\
};\
_return\
})