mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Indentation
This commit is contained in:
parent
239ffdc4d2
commit
657cf14515
@ -21,7 +21,7 @@ _caller = _this select 0;
|
||||
_target = _this select 1;
|
||||
|
||||
if ([_target] call EFUNC(common,isAwake)) exitwith {
|
||||
// TODO localization
|
||||
// TODO localization
|
||||
["displayTextStructured", [_caller], [["This person (%1) is awake and cannot be loaded", [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent);
|
||||
};
|
||||
|
||||
|
@ -22,129 +22,129 @@ GVAR(currentSelectedSelectionN) = if (count _this > 2) then {_this select 2} els
|
||||
GVAR(displayPatientInformationTarget) = if (_show) then {_target} else {ObjNull};
|
||||
|
||||
if (_show) then {
|
||||
("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutRsc [QGVAR(DisplayInformation),"PLAIN"];
|
||||
("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutRsc [QGVAR(DisplayInformation),"PLAIN"];
|
||||
|
||||
[{
|
||||
private ["_target", "_display", "_alphaLevel", "_damaged", "_availableSelections", "_openWounds", "_selectionBloodLoss", "_red", "_green", "_blue", "_alphaLevel", "_allInjuryTexts", "_lbCtrl", "_genericMessages"];
|
||||
_target = (_this select 0) select 0;
|
||||
if (GVAR(displayPatientInformationTarget) != _target) exitwith {
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
[{
|
||||
private ["_target", "_display", "_alphaLevel", "_damaged", "_availableSelections", "_openWounds", "_selectionBloodLoss", "_red", "_green", "_blue", "_alphaLevel", "_allInjuryTexts", "_lbCtrl", "_genericMessages"];
|
||||
_target = (_this select 0) select 0;
|
||||
if (GVAR(displayPatientInformationTarget) != _target) exitwith {
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
disableSerialization;
|
||||
_display = uiNamespace getvariable QGVAR(DisplayInformation);
|
||||
if (isnil "_display") exitwith {
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
disableSerialization;
|
||||
_display = uiNamespace getvariable QGVAR(DisplayInformation);
|
||||
if (isnil "_display") exitwith {
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
_allInjuryTexts = [];
|
||||
_genericMessages = [];
|
||||
if (_target getvariable[QGVAR(isBleeding), false]) then {
|
||||
_genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_BLEEDING", [1, 1, 1, 1]];
|
||||
};
|
||||
if (_target getvariable[QGVAR(hasLostBlood), false]) then {
|
||||
_genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_LOST_BLOOD", [1, 0.1, 0.1, 1]];
|
||||
};
|
||||
_allInjuryTexts = [];
|
||||
_genericMessages = [];
|
||||
if (_target getvariable[QGVAR(isBleeding), false]) then {
|
||||
_genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_BLEEDING", [1, 1, 1, 1]];
|
||||
};
|
||||
if (_target getvariable[QGVAR(hasLostBlood), false]) then {
|
||||
_genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_LOST_BLOOD", [1, 0.1, 0.1, 1]];
|
||||
};
|
||||
|
||||
if (((_target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]) select GVAR(currentSelectedSelectionN)) > 0) then {
|
||||
_genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_TOURNIQUET_APPLIED", [0.5, 0.5, 0, 1]];
|
||||
};
|
||||
if (((_target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]) select GVAR(currentSelectedSelectionN)) > 0) then {
|
||||
_genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_TOURNIQUET_APPLIED", [0.5, 0.5, 0, 1]];
|
||||
};
|
||||
|
||||
_selectionBloodLoss = [0,0,0,0,0,0];
|
||||
if (GVAR(level) >= 2) then {
|
||||
_openWounds = _target getvariable [QGVAR(openWounds), []];
|
||||
private "_amountOf";
|
||||
{
|
||||
_amountOf = _x select 3;
|
||||
// Find how much this bodypart is bleeding
|
||||
_selectionBloodLoss set [(_x select 2), (_selectionBloodLoss select (_x select 2)) + (15 * ((_x select 4) * _amountOf))];
|
||||
if (GVAR(currentSelectedSelectionN) == (_x select 2)) then {
|
||||
// Collect the text to be displayed for this injury [ Select injury class type definition - select the classname DisplayName (6th), amount of injuries for this]
|
||||
if (_amountOf > 0) then {
|
||||
if (_amountOf >= 1) then {
|
||||
// TODO localization
|
||||
_allInjuryTexts pushback format["%2x %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6, _amountOf];
|
||||
} else {
|
||||
// TODO localization
|
||||
_allInjuryTexts pushback format["Partial %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6];
|
||||
};
|
||||
};
|
||||
};
|
||||
}foreach _openWounds;
|
||||
} else {
|
||||
// TODO handle basic medical colors for body part selections here
|
||||
_selectionBloodLoss = [0,0,0,0,0,0];
|
||||
if (GVAR(level) >= 2) then {
|
||||
_openWounds = _target getvariable [QGVAR(openWounds), []];
|
||||
private "_amountOf";
|
||||
{
|
||||
_amountOf = _x select 3;
|
||||
// Find how much this bodypart is bleeding
|
||||
_selectionBloodLoss set [(_x select 2), (_selectionBloodLoss select (_x select 2)) + (15 * ((_x select 4) * _amountOf))];
|
||||
if (GVAR(currentSelectedSelectionN) == (_x select 2)) then {
|
||||
// Collect the text to be displayed for this injury [ Select injury class type definition - select the classname DisplayName (6th), amount of injuries for this]
|
||||
if (_amountOf > 0) then {
|
||||
if (_amountOf >= 1) then {
|
||||
// TODO localization
|
||||
_allInjuryTexts pushback format["%2x %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6, _amountOf];
|
||||
} else {
|
||||
// TODO localization
|
||||
_allInjuryTexts pushback format["Partial %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6];
|
||||
};
|
||||
};
|
||||
};
|
||||
}foreach _openWounds;
|
||||
} else {
|
||||
// TODO handle basic medical colors for body part selections here
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
// Handle the body image coloring
|
||||
_damaged = [false, false, false, false, false, false];
|
||||
_availableSelections = [50,51,52,53,54,55];
|
||||
{
|
||||
private ["_red", "_green", "_blue"];
|
||||
_total = _x;
|
||||
// Handle the body image coloring
|
||||
_damaged = [false, false, false, false, false, false];
|
||||
_availableSelections = [50,51,52,53,54,55];
|
||||
{
|
||||
private ["_red", "_green", "_blue"];
|
||||
_total = _x;
|
||||
|
||||
_red = 1;
|
||||
_green = 1;
|
||||
_blue = 1;
|
||||
if (_total >0) then {
|
||||
_green = 0.9 - _total;
|
||||
if (_green < 0.0) then {
|
||||
_green = 0.0;
|
||||
};
|
||||
_blue = _green;
|
||||
_damaged set[_foreachIndex, true];
|
||||
};
|
||||
(_display displayCtrl (_availableSelections select _foreachIndex)) ctrlSetTextColor [_red, _green, _blue, 1.0];
|
||||
}foreach _selectionBloodLoss;
|
||||
_red = 1;
|
||||
_green = 1;
|
||||
_blue = 1;
|
||||
if (_total >0) then {
|
||||
_green = 0.9 - _total;
|
||||
if (_green < 0.0) then {
|
||||
_green = 0.0;
|
||||
};
|
||||
_blue = _green;
|
||||
_damaged set[_foreachIndex, true];
|
||||
};
|
||||
(_display displayCtrl (_availableSelections select _foreachIndex)) ctrlSetTextColor [_red, _green, _blue, 1.0];
|
||||
}foreach _selectionBloodLoss;
|
||||
|
||||
// TODO fill the lb with the appropiate information for the patient
|
||||
_lbCtrl = (_display displayCtrl 200);
|
||||
lbClear _lbCtrl;
|
||||
{
|
||||
_lbCtrl lbAdd (_x select 0);
|
||||
_lbCtrl lbSetColor [_foreachIndex, _x select 1];
|
||||
}foreach _genericMessages;
|
||||
{
|
||||
_lbCtrl lbAdd _x;
|
||||
}foreach _allInjuryTexts;
|
||||
if (count _genericMessages == 0 && {count _allInjuryTexts == 0}) then {
|
||||
_lbCtrl lbAdd "No injuries on this bodypart..";
|
||||
};
|
||||
// TODO fill the lb with the appropiate information for the patient
|
||||
_lbCtrl = (_display displayCtrl 200);
|
||||
lbClear _lbCtrl;
|
||||
{
|
||||
_lbCtrl lbAdd (_x select 0);
|
||||
_lbCtrl lbSetColor [_foreachIndex, _x select 1];
|
||||
}foreach _genericMessages;
|
||||
{
|
||||
_lbCtrl lbAdd _x;
|
||||
}foreach _allInjuryTexts;
|
||||
if (count _genericMessages == 0 && {count _allInjuryTexts == 0}) then {
|
||||
_lbCtrl lbAdd "No injuries on this bodypart..";
|
||||
};
|
||||
|
||||
_logCtrl = (_display displayCtrl 302);
|
||||
lbClear _logCtrl;
|
||||
_logCtrl = (_display displayCtrl 302);
|
||||
lbClear _logCtrl;
|
||||
|
||||
private ["_logs", "_log", "_message", "_moment", "_arguments", "_lbCtrl"];
|
||||
_logs = _unit getvariable [QGVAR(allLogs), []];
|
||||
{
|
||||
_log = _unit getvariable [_x, []];
|
||||
{
|
||||
// [_message,_moment,_type, _arguments]
|
||||
_message = _x select 0;
|
||||
_moment = _x select 1;
|
||||
_arguments = _x select 3;
|
||||
if (isLocalized _message) then {
|
||||
_message = localize _message;
|
||||
};
|
||||
private ["_logs", "_log", "_message", "_moment", "_arguments", "_lbCtrl"];
|
||||
_logs = _unit getvariable [QGVAR(allLogs), []];
|
||||
{
|
||||
_log = _unit getvariable [_x, []];
|
||||
{
|
||||
// [_message,_moment,_type, _arguments]
|
||||
_message = _x select 0;
|
||||
_moment = _x select 1;
|
||||
_arguments = _x select 3;
|
||||
if (isLocalized _message) then {
|
||||
_message = localize _message;
|
||||
};
|
||||
|
||||
{
|
||||
if (typeName _x == "STRING" && {isLocalized _x}) then {
|
||||
_arguments set [_foreachIndex, localize _x];
|
||||
};
|
||||
}foreach _arguments;
|
||||
{
|
||||
if (typeName _x == "STRING" && {isLocalized _x}) then {
|
||||
_arguments set [_foreachIndex, localize _x];
|
||||
};
|
||||
}foreach _arguments;
|
||||
|
||||
_message = format([_message] + _arguments);
|
||||
_logCtrl lbAdd format["%1 %2", _moment, _message];
|
||||
}foreach _log;
|
||||
}foreach _logs;
|
||||
_message = format([_message] + _arguments);
|
||||
_logCtrl lbAdd format["%1 %2", _moment, _message];
|
||||
}foreach _log;
|
||||
}foreach _logs;
|
||||
|
||||
_triageStatus = [_target] call FUNC(getTriageStatus);
|
||||
(_display displayCtrl 303) ctrlSetText (_triageStatus select 0);
|
||||
(_display displayCtrl 303) ctrlSetBackgroundColor (_triageStatus select 2);
|
||||
_triageStatus = [_target] call FUNC(getTriageStatus);
|
||||
(_display displayCtrl 303) ctrlSetText (_triageStatus select 0);
|
||||
(_display displayCtrl 303) ctrlSetBackgroundColor (_triageStatus select 2);
|
||||
|
||||
}, 0, [_target]] call CBA_fnc_addPerFrameHandler;
|
||||
}, 0, [_target]] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
} else {
|
||||
("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
|
||||
("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
|
||||
};
|
@ -29,7 +29,7 @@ _returnDamage = _this select 5;
|
||||
|
||||
// Most likely taking exessive fire damage. Lets exit.
|
||||
if (isNull _sourceOfDamage && (_selectionName == "head" || isBurning _unit) && _typeOfProjectile == "" && vehicle _unit == _unit) exitwith {
|
||||
0
|
||||
0
|
||||
};
|
||||
|
||||
_typeOfDamage = [_typeOfProjectile] call FUNC(getTypeOfDamage);
|
||||
@ -60,7 +60,7 @@ if (alive _unit && {!(_unit getvariable ["ACE_isUnconscious", false])}) then {
|
||||
|
||||
// If it reaches this, we can assume that the hit did not kill this unit, as this function is called 3 frames after the damage has been passed.
|
||||
if ([_unit, _part, if (_part > 1) then {_newDamage * 1.3} else {_newDamage * 2}] call FUNC(determineIfFatal)) then {
|
||||
[_unit] call FUNC(setUnconscious);
|
||||
[_unit] call FUNC(setUnconscious);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -22,12 +22,12 @@ _return = false;
|
||||
if (GVAR(medicSetting) >= 1) then {
|
||||
_class = _unit getvariable [QGVAR(medicClass), 0];
|
||||
if (GVAR(medicSetting) == 1) then {
|
||||
_return = _class > 0;
|
||||
_return = _class > 0;
|
||||
} else {
|
||||
if (_class >= _medicN) then {
|
||||
_return = true;
|
||||
};
|
||||
};
|
||||
if (_class >= _medicN) then {
|
||||
_return = true;
|
||||
};
|
||||
};
|
||||
} else {
|
||||
_return = true;
|
||||
};
|
||||
|
@ -19,19 +19,19 @@ _unit = _this select 0;
|
||||
_injury = _this select 1;
|
||||
|
||||
if (!local _unit) then {
|
||||
_openWounds = _unit getvariable[QGVAR(openWounds), []];
|
||||
_injuryID = _injury select 0;
|
||||
_openWounds = _unit getvariable[QGVAR(openWounds), []];
|
||||
_injuryID = _injury select 0;
|
||||
|
||||
_exists = false;
|
||||
{
|
||||
if (_x select 0 == _injuryID) exitwith {
|
||||
_exists = true;
|
||||
_openWounds set [_foreachIndex, _injury];
|
||||
};
|
||||
}foreach _openWounds;
|
||||
_exists = false;
|
||||
{
|
||||
if (_x select 0 == _injuryID) exitwith {
|
||||
_exists = true;
|
||||
_openWounds set [_foreachIndex, _injury];
|
||||
};
|
||||
}foreach _openWounds;
|
||||
|
||||
if (!_exists) then {
|
||||
_openWounds pushback _injury;
|
||||
};
|
||||
_unit setvariable [GVAR(openWounds), _openWounds];
|
||||
if (!_exists) then {
|
||||
_openWounds pushback _injury;
|
||||
};
|
||||
_unit setvariable [GVAR(openWounds), _openWounds];
|
||||
};
|
||||
|
@ -21,7 +21,7 @@ _originOfrequest = _this select 2;
|
||||
|
||||
_openWounds = _unit getvariable [QGVAR(openWounds), []];
|
||||
if (count _openWounds > _lastId) then {
|
||||
{
|
||||
["medical_propagateWound", [_originOfrequest], [_unit, _x]] call EFUNC(common,targetEvent);
|
||||
}foreach _openWounds;
|
||||
{
|
||||
["medical_propagateWound", [_originOfrequest], [_unit, _x]] call EFUNC(common,targetEvent);
|
||||
}foreach _openWounds;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user