mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Add more debug
This commit is contained in:
parent
604ba50a4a
commit
9139a52a38
@ -33,6 +33,55 @@ if (!hasInterface) exitWith {};
|
||||
}] call EFUNC(common,arithmeticSetSource);
|
||||
|
||||
#ifdef DEBUG_MODE_FULL
|
||||
|
||||
["medical", {
|
||||
private _unit = cursorTarget;
|
||||
private _return = [];
|
||||
|
||||
if (!(_unit isKindOf "CAManBase")) then {_unit = cursorObject};
|
||||
if (!(_unit isKindOf "CAManBase")) then {_unit = player};
|
||||
|
||||
if (_unit isKindOf "CAManBase") then {
|
||||
// Header:
|
||||
_return pushBack format ["<t color='#%1'>%2 [%3]</t>", (["00FF00", "0000FF"] select (_unit == player)), [_unit] call EFUNC(common,getName), typeOf _unit];
|
||||
_return pushBack "";
|
||||
|
||||
// State:
|
||||
private _hasStableVitals = [_unit] call FUNC(hasStableVitals);
|
||||
private _targetState = [_unit, GVAR(STATE_MACHINE)] call CBA_statemachine_fnc_getCurrentState;
|
||||
private _color = switch (_targetState) do {case "Default": {"33FF33"}; case "Injured": {"FF3333"}; case "Unconscious": {"FF8833"}; case "CardiacArrest": {"FF33A"}; default {"333333"}};
|
||||
_return pushBack format ["<t color='#%1'>State: %2</t> [Stable Vitals: %3]", _color, _targetState, _hasStableVitals];
|
||||
|
||||
// Blood:
|
||||
private _bloodVolume = _unit getVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME];
|
||||
private _bloodLoss = [_unit] call FUNC(getBloodLoss);
|
||||
private _secondsToHeartstop = if (_bloodLoss != 0) then {format ["[Time Left: %1]", (((_bloodVolume - BLOOD_VOLUME_CLASS_4_HEMORRHAGE) max 0) / _bloodLoss) toFixed 1]} else {""};
|
||||
_return pushBack format ["Blood: %1 [Loss: %2] %3", _bloodVolume toFixed 3, _bloodLoss toFixed 5, _secondsToHeartstop];
|
||||
|
||||
// Vitals:
|
||||
private _cardiacOutput = [_unit] call FUNC(getCardiacOutput);
|
||||
private _heartRate = _unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE];
|
||||
([_unit] call FUNC(getBloodPressure)) params ["_bpLow", "_bpHigh"];
|
||||
_return pushBack format ["Output %1 [HR: %2] [BP: %3 / %4]", _cardiacOutput toFixed 4, _heartRate toFixed 1, _bpLow toFixed 1, _bpHigh toFixed 1];
|
||||
|
||||
// Pain:
|
||||
private _pain = _unit getVariable [QGVAR(pain), 0];
|
||||
private _painSuppress = _unit getVariable [QGVAR(painSuppress), 0];
|
||||
private _painLevel = [_unit] call FUNC(getPainLevel);
|
||||
_return pushBack format ["Effective Pain: %1 [pain: %2] [suppress: %3]", _painLevel toFixed 4, _pain toFixed 3, _painSuppress toFixed 3];
|
||||
|
||||
// Tourniquets:
|
||||
private _tourniquets = _unit getVariable [QGVAR(tourniquets), [0,0,0,0,0,0]];
|
||||
{
|
||||
if (_x != 0) then {
|
||||
_return pushBack ["Tourniquet on %1 [Time On: %2]", GVAR(SELECTIONS) select _forEachIndex, (CBA_missionTime - _x)];
|
||||
};
|
||||
} forEach _tourniquets;
|
||||
};
|
||||
_return joinString "<br/>";
|
||||
}, [10]] call ace_common_fnc_watchVariable;
|
||||
|
||||
|
||||
[{!isNull findDisplay 46}, {
|
||||
INFO("Creating Debug Display");
|
||||
if (!isNull (uiNamespace getVariable [QGVAR(debugControl), controlNull])) then {
|
||||
|
@ -9,6 +9,9 @@
|
||||
* 0: BloodPressure Low <NUMBER>
|
||||
* 1: BloodPressure High <NUMBER>
|
||||
*
|
||||
* Example:
|
||||
* [player] call ace_medical_fnc_getBloodPressure
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user