diff --git a/addons/medical/functions/fnc_addDamageToUnit.sqf b/addons/medical/functions/fnc_addDamageToUnit.sqf index 4fc8afac9ab..bf7f9deedd6 100644 --- a/addons/medical/functions/fnc_addDamageToUnit.sqf +++ b/addons/medical/functions/fnc_addDamageToUnit.sqf @@ -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; diff --git a/addons/medical/functions/fnc_dev_watchMedicalStats.sqf b/addons/medical/functions/fnc_dev_watchMedicalStats.sqf index 3a7bb4e47c0..30335eb1b0d 100644 --- a/addons/medical/functions/fnc_dev_watchMedicalStats.sqf +++ b/addons/medical/functions/fnc_dev_watchMedicalStats.sqf @@ -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 {"[ Limping ]"} else {""}; + private _limping = if (_unit getVariable [QEGVAR(medical,isLimping), false]) then {"[ Limping ]"} 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]; diff --git a/addons/medical/functions/fnc_handleIncapacitation.sqf b/addons/medical/functions/fnc_handleIncapacitation.sqf index 6bb9703c734..3fe4de67bec 100644 --- a/addons/medical/functions/fnc_handleIncapacitation.sqf +++ b/addons/medical/functions/fnc_handleIncapacitation.sqf @@ -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; }; diff --git a/addons/medical/functions/fnc_unconsciousPFH.sqf b/addons/medical/functions/fnc_unconsciousPFH.sqf deleted file mode 100644 index 64ff336b664..00000000000 --- a/addons/medical/functions/fnc_unconsciousPFH.sqf +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Author: Glowbal - * PFH logic for unconscious state - * - * Arguments: - * 0: PFEH - - * 0: The unit that will be put in an unconscious state - * 1: unitPos (stance) - * 2: Starting Time - * 3: Minimum Waiting Time - * 4: Has Moved Out - * 5: Parachute Check - * 1: PFEH ID - * - * 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]; - }; -}; diff --git a/addons/medical/script_macros_medical.hpp b/addons/medical/script_macros_medical.hpp index 0770b516d15..4fc990fe56d 100644 --- a/addons/medical/script_macros_medical.hpp +++ b/addons/medical/script_macros_medical.hpp @@ -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)) diff --git a/addons/medical_gui/ui/ui/items/adenosine_x_ca.paa b/addons/medical/ui/items/adenosine_x_ca.paa similarity index 100% rename from addons/medical_gui/ui/ui/items/adenosine_x_ca.paa rename to addons/medical/ui/items/adenosine_x_ca.paa diff --git a/addons/medical_gui/ui/ui/items/atropine_x_ca.paa b/addons/medical/ui/items/atropine_x_ca.paa similarity index 100% rename from addons/medical_gui/ui/ui/items/atropine_x_ca.paa rename to addons/medical/ui/items/atropine_x_ca.paa diff --git a/addons/medical_gui/ui/ui/items/bloodIV_x_ca.paa b/addons/medical/ui/items/bloodiv_x_ca.paa similarity index 100% rename from addons/medical_gui/ui/ui/items/bloodIV_x_ca.paa rename to addons/medical/ui/items/bloodiv_x_ca.paa diff --git a/addons/medical_gui/ui/ui/items/bodybag_x_ca.paa b/addons/medical/ui/items/bodybag_x_ca.paa similarity index 100% rename from addons/medical_gui/ui/ui/items/bodybag_x_ca.paa rename to addons/medical/ui/items/bodybag_x_ca.paa diff --git a/addons/medical_gui/ui/ui/items/elasticBandage_x_ca.paa b/addons/medical/ui/items/elasticbandage_x_ca.paa similarity index 100% rename from addons/medical_gui/ui/ui/items/elasticBandage_x_ca.paa rename to addons/medical/ui/items/elasticbandage_x_ca.paa diff --git a/addons/medical_gui/ui/ui/items/epinephrine_x_ca.paa b/addons/medical/ui/items/epinephrine_x_ca.paa similarity index 100% rename from addons/medical_gui/ui/ui/items/epinephrine_x_ca.paa rename to addons/medical/ui/items/epinephrine_x_ca.paa diff --git a/addons/medical_gui/ui/ui/items/fieldDressing_x_ca.paa b/addons/medical/ui/items/fielddressing_x_ca.paa similarity index 100% rename from addons/medical_gui/ui/ui/items/fieldDressing_x_ca.paa rename to addons/medical/ui/items/fielddressing_x_ca.paa diff --git a/addons/medical_gui/ui/ui/items/morphine_x_ca.paa b/addons/medical/ui/items/morphine_x_ca.paa similarity index 100% rename from addons/medical_gui/ui/ui/items/morphine_x_ca.paa rename to addons/medical/ui/items/morphine_x_ca.paa diff --git a/addons/medical_gui/ui/ui/items/packingBandage_x_ca.paa b/addons/medical/ui/items/packingbandage_x_ca.paa similarity index 100% rename from addons/medical_gui/ui/ui/items/packingBandage_x_ca.paa rename to addons/medical/ui/items/packingbandage_x_ca.paa diff --git a/addons/medical_gui/ui/ui/items/personal_aid_kit_x_ca.paa b/addons/medical/ui/items/personal_aid_kit_x_ca.paa similarity index 100% rename from addons/medical_gui/ui/ui/items/personal_aid_kit_x_ca.paa rename to addons/medical/ui/items/personal_aid_kit_x_ca.paa diff --git a/addons/medical_gui/ui/ui/items/plasmaIV_x_ca.paa b/addons/medical/ui/items/plasmaiv_x_ca.paa similarity index 100% rename from addons/medical_gui/ui/ui/items/plasmaIV_x_ca.paa rename to addons/medical/ui/items/plasmaiv_x_ca.paa diff --git a/addons/medical_gui/ui/ui/items/quickclot_x_ca.paa b/addons/medical/ui/items/quickclot_x_ca.paa similarity index 100% rename from addons/medical_gui/ui/ui/items/quickclot_x_ca.paa rename to addons/medical/ui/items/quickclot_x_ca.paa diff --git a/addons/medical_gui/ui/ui/items/salineIV_x_ca.paa b/addons/medical/ui/items/salineiv_x_ca.paa similarity index 100% rename from addons/medical_gui/ui/ui/items/salineIV_x_ca.paa rename to addons/medical/ui/items/salineiv_x_ca.paa diff --git a/addons/medical_gui/ui/ui/items/surgicalKit_x_ca.paa b/addons/medical/ui/items/surgicalkit_x_ca.paa similarity index 100% rename from addons/medical_gui/ui/ui/items/surgicalKit_x_ca.paa rename to addons/medical/ui/items/surgicalkit_x_ca.paa diff --git a/addons/medical_gui/ui/ui/items/tourniquet_x_ca.paa b/addons/medical/ui/items/tourniquet_x_ca.paa similarity index 100% rename from addons/medical_gui/ui/ui/items/tourniquet_x_ca.paa rename to addons/medical/ui/items/tourniquet_x_ca.paa diff --git a/addons/medical/ui/menu.hpp b/addons/medical/ui/menu.hpp new file mode 100644 index 00000000000..30a94e96c75 --- /dev/null +++ b/addons/medical/ui/menu.hpp @@ -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);); + }; + }; +}; diff --git a/addons/medical_blood/XEH_postInit.sqf b/addons/medical_blood/XEH_postInit.sqf index 78bf5c43f92..1bb563fb15e 100644 --- a/addons/medical_blood/XEH_postInit.sqf +++ b/addons/medical_blood/XEH_postInit.sqf @@ -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; diff --git a/addons/medical_damage/XEH_preInit.sqf b/addons/medical_damage/XEH_preInit.sqf index c2a5055e762..4d07495808a 100644 --- a/addons/medical_damage/XEH_preInit.sqf +++ b/addons/medical_damage/XEH_preInit.sqf @@ -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; diff --git a/addons/medical_damage/functions/fnc_woundsHandler.sqf b/addons/medical_damage/functions/fnc_woundsHandler.sqf index f6e455cf91f..95b2b3393d6 100644 --- a/addons/medical_damage/functions/fnc_woundsHandler.sqf +++ b/addons/medical_damage/functions/fnc_woundsHandler.sqf @@ -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]; diff --git a/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf b/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf index 10377411ed3..87985af16bd 100644 --- a/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf +++ b/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf @@ -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; diff --git a/addons/medical_engine/XEH_postInit.sqf b/addons/medical_engine/XEH_postInit.sqf index 7382eef0df7..f0d4bcd26cc 100644 --- a/addons/medical_engine/XEH_postInit.sqf +++ b/addons/medical_engine/XEH_postInit.sqf @@ -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; diff --git a/addons/medical_engine/functions/fnc_damageBodyPart.sqf b/addons/medical_engine/functions/fnc_damageBodyPart.sqf index a1d9b4ba30a..1215fdc1cd1 100644 --- a/addons/medical_engine/functions/fnc_damageBodyPart.sqf +++ b/addons/medical_engine/functions/fnc_damageBodyPart.sqf @@ -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]))]; }; }; diff --git a/addons/medical_engine/functions/fnc_handleDamage.sqf b/addons/medical_engine/functions/fnc_handleDamage.sqf index 1e00d07fdf0..b13d25e4334 100644 --- a/addons/medical_engine/functions/fnc_handleDamage.sqf +++ b/addons/medical_engine/functions/fnc_handleDamage.sqf @@ -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 }; diff --git a/addons/medical_engine/functions/fnc_setLimping.sqf b/addons/medical_engine/functions/fnc_setLimping.sqf index 2e507953eda..14ce200b553 100644 --- a/addons/medical_engine/functions/fnc_setLimping.sqf +++ b/addons/medical_engine/functions/fnc_setLimping.sqf @@ -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}; diff --git a/addons/medical_gui/ui/ui/RscTitles.hpp b/addons/medical_gui/ui/ui/RscTitles.hpp index bd689f48e03..7c4588b4926 100644 --- a/addons/medical_gui/ui/ui/RscTitles.hpp +++ b/addons/medical_gui/ui/ui/RscTitles.hpp @@ -1,6 +1,3 @@ -class ACE_gui_backgroundBase; -class ACE_gui_listBoxBase; - class RscTitles { class GVAR(DisplayInformation) { duration = 10e10; diff --git a/addons/medical_gui/ui/ui/triagecard.hpp b/addons/medical_gui/ui/ui/triagecard.hpp index f674fd8e088..ed940fe5e19 100644 --- a/addons/medical_gui/ui/ui/triagecard.hpp +++ b/addons/medical_gui/ui/ui/triagecard.hpp @@ -1,5 +1,3 @@ -class ACE_gui_buttonBase; - class GVAR(triageCard) { idd = 7010; movingenable = 0; diff --git a/addons/medical_statemachine/Statemachine.hpp b/addons/medical_statemachine/Statemachine.hpp index afbecb5afc9..92182357df0 100644 --- a/addons/medical_statemachine/Statemachine.hpp +++ b/addons/medical_statemachine/Statemachine.hpp @@ -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 }; }; diff --git a/addons/medical_statemachine/config.cpp b/addons/medical_statemachine/config.cpp index cb126f9b40d..073de2434bd 100644 --- a/addons/medical_statemachine/config.cpp +++ b/addons/medical_statemachine/config.cpp @@ -15,3 +15,4 @@ class CfgPatches { }; #include "Statemachine.hpp" +#include "CfgEventHandlers.hpp" diff --git a/addons/medical_statemachine/functions/fnc_enteredStateFatalInjury.sqf b/addons/medical_statemachine/functions/fnc_enteredStateFatalInjury.sqf index 2f9cbb654c8..6c99129eccc 100644 --- a/addons/medical_statemachine/functions/fnc_enteredStateFatalInjury.sqf +++ b/addons/medical_statemachine/functions/fnc_enteredStateFatalInjury.sqf @@ -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; diff --git a/addons/medical_statemachine/functions/fnc_handleStateDefault.sqf b/addons/medical_statemachine/functions/fnc_handleStateDefault.sqf index 5156670201b..35baf775c23 100644 --- a/addons/medical_statemachine/functions/fnc_handleStateDefault.sqf +++ b/addons/medical_statemachine/functions/fnc_handleStateDefault.sqf @@ -3,6 +3,8 @@ params ["_unit", "_stateName"]; +TRACE_2("defaultState:", _unit, _stateName); + // If the unit died the loop is finished if (!alive _unit) exitWith {}; diff --git a/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf b/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf index d939f00fa20..6a22b9fdcd5 100644 --- a/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf +++ b/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf @@ -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]; }; }; diff --git a/addons/medical_statemachine/functions/fnc_leftStateCardiacArrest.sqf b/addons/medical_statemachine/functions/fnc_leftStateCardiacArrest.sqf index a88ad1b3d11..de1ae289e54 100644 --- a/addons/medical_statemachine/functions/fnc_leftStateCardiacArrest.sqf +++ b/addons/medical_statemachine/functions/fnc_leftStateCardiacArrest.sqf @@ -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]; diff --git a/addons/medical_statemachine/functions/fnc_transitionSecondChance.sqf b/addons/medical_statemachine/functions/fnc_transitionSecondChance.sqf index 6fcfd0ac084..1a70c089117 100644 --- a/addons/medical_statemachine/functions/fnc_transitionSecondChance.sqf +++ b/addons/medical_statemachine/functions/fnc_transitionSecondChance.sqf @@ -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; diff --git a/addons/medical_status/functions/fnc_addHeartRateAdjustment.sqf b/addons/medical_status/functions/fnc_addHeartRateAdjustment.sqf index 42dd64fb454..45383316177 100644 --- a/addons/medical_status/functions/fnc_addHeartRateAdjustment.sqf +++ b/addons/medical_status/functions/fnc_addHeartRateAdjustment.sqf @@ -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]; diff --git a/addons/medical_status/functions/fnc_getBloodLoss.sqf b/addons/medical_status/functions/fnc_getBloodLoss.sqf index 3ce1790e8bc..1cc22317e2a 100644 --- a/addons/medical_status/functions/fnc_getBloodLoss.sqf +++ b/addons/medical_status/functions/fnc_getBloodLoss.sqf @@ -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 }; diff --git a/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf b/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf index 431a043aa00..ecbff35ef38 100644 --- a/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf +++ b/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf @@ -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]; }; }; diff --git a/addons/medical_status/functions/fnc_hasTourniquetAppliedTo.sqf b/addons/medical_status/functions/fnc_hasTourniquetAppliedTo.sqf index 6d7b65caa46..10607f56b5f 100644 --- a/addons/medical_status/functions/fnc_hasTourniquetAppliedTo.sqf +++ b/addons/medical_status/functions/fnc_hasTourniquetAppliedTo.sqf @@ -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 diff --git a/addons/medical_status/functions/fnc_initUnit.sqf b/addons/medical_status/functions/fnc_initUnit.sqf index 8416e2b385f..76f243f699d 100644 --- a/addons/medical_status/functions/fnc_initUnit.sqf +++ b/addons/medical_status/functions/fnc_initUnit.sqf @@ -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"]; diff --git a/addons/medical_status/functions/fnc_isInMedicalFacility.sqf b/addons/medical_status/functions/fnc_isInMedicalFacility.sqf index 52b5ec01c82..4648b0e3c81 100644 --- a/addons/medical_status/functions/fnc_isInMedicalFacility.sqf +++ b/addons/medical_status/functions/fnc_isInMedicalFacility.sqf @@ -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; diff --git a/addons/medical_status/functions/fnc_isMedic.sqf b/addons/medical_status/functions/fnc_isMedic.sqf index 4de3b3c1055..6fc86b6bdc6 100644 --- a/addons/medical_status/functions/fnc_isMedic.sqf +++ b/addons/medical_status/functions/fnc_isMedic.sqf @@ -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}; diff --git a/addons/medical_status/functions/fnc_isMedicalVehicle.sqf b/addons/medical_status/functions/fnc_isMedicalVehicle.sqf index 92539feaa2e..c0118397a26 100644 --- a/addons/medical_status/functions/fnc_isMedicalVehicle.sqf +++ b/addons/medical_status/functions/fnc_isMedicalVehicle.sqf @@ -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 diff --git a/addons/medical_status/functions/fnc_setUnconscious.sqf b/addons/medical_status/functions/fnc_setUnconscious.sqf index c87d3fd1c84..d4bdbd3e941 100644 --- a/addons/medical_status/functions/fnc_setUnconscious.sqf +++ b/addons/medical_status/functions/fnc_setUnconscious.sqf @@ -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 diff --git a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp index bc2210e6b6f..c4acc5ae499 100644 --- a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp +++ b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp @@ -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"}} }; diff --git a/addons/medical_treatment/functions/fnc_treatmentFullHealLocal.sqf b/addons/medical_treatment/functions/fnc_treatmentFullHealLocal.sqf index 4fe65dc8bf3..db27d446a84 100644 --- a/addons/medical_treatment/functions/fnc_treatmentFullHealLocal.sqf +++ b/addons/medical_treatment/functions/fnc_treatmentFullHealLocal.sqf @@ -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]; diff --git a/addons/medical_treatment/functions/fnc_treatmentMedicationLocal.sqf b/addons/medical_treatment/functions/fnc_treatmentMedicationLocal.sqf index a7b1c4f5008..3adb1399c70 100644 --- a/addons/medical_treatment/functions/fnc_treatmentMedicationLocal.sqf +++ b/addons/medical_treatment/functions/fnc_treatmentMedicationLocal.sqf @@ -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]; }; diff --git a/addons/medical_vitals/config.cpp b/addons/medical_vitals/config.cpp index e2b494b65a3..74b18f2184d 100644 --- a/addons/medical_vitals/config.cpp +++ b/addons/medical_vitals/config.cpp @@ -13,3 +13,5 @@ class CfgPatches { VERSION_CONFIG; }; }; + +#include "CfgEventHandlers.hpp" diff --git a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf index 1748e757469..fa1c8b44e78 100644 --- a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf @@ -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); diff --git a/addons/medical_vitals/functions/fnc_updateHeartRate.sqf b/addons/medical_vitals/functions/fnc_updateHeartRate.sqf index 73d008cb45f..bd0fe211ec2 100644 --- a/addons/medical_vitals/functions/fnc_updateHeartRate.sqf +++ b/addons/medical_vitals/functions/fnc_updateHeartRate.sqf @@ -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 { { diff --git a/circle.yml b/circle.yml index 7616e4912c9..2cdec68b4aa 100644 --- a/circle.yml +++ b/circle.yml @@ -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 diff --git a/tools/cba/addons/main/script_macros_common.hpp b/tools/cba/addons/main/script_macros_common.hpp index a847909490e..644d2f1da8d 100644 --- a/tools/cba/addons/main/script_macros_common.hpp +++ b/tools/cba/addons/main/script_macros_common.hpp @@ -354,6 +354,27 @@ Macro: MESSAGE_WITH_TITLE() ------------------------------------------- */ #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 @@ Macro: RETNIL() 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 @@ Macros: IS_x() 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 @@ Macros: IS_x() #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 @@ Macro: xSTRING() #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 @@ Macro: IS_ADMIN_LOGGED 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\ +})