More work done on medical

Added TODOs for remoteFuncExecs to be replaced by event system
Added usage of displayTextStructed events
Fixed useItem calls instead of useItems
This commit is contained in:
Glowbal 2015-02-28 13:17:17 +01:00
parent 65137b347b
commit cff3e23d38
19 changed files with 34 additions and 33 deletions

View File

@ -53,8 +53,7 @@ if ([_caller] call FUNC(isMedic)) then {
}; };
}; };
// TODO build support in displayText for sending it across to a different client with localization + format support. ["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)], 1.5, _caller]] call EFUNC(common,targetEvent);
// [format[_output, [_target] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)]] call EFUNC(common,displayTextStructured);
if (_logOutPut != "") then { if (_logOutPut != "") then {
[_target,"examine", format["%1 checked Blood Pressure: %2", [_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); [_target,"examine", format["%1 checked Blood Pressure: %2", [_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog);

View File

@ -18,4 +18,4 @@ private ["_caller","_target","_title","_content"];
_caller = _this select 0; _caller = _this select 0;
_target = _this select 1; _target = _this select 1;
[[_caller, _target], QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); [[_caller, _target], QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */

View File

@ -19,7 +19,7 @@ _caller = _this select 0;
_unit = _this select 1; _unit = _this select 1;
_heartRate = [_unit,QGVAR(heartRate)] call EFUNC(common,getDefinedVariable); _heartRate = _unit getvariable [QGVAR(heartRate), 80];
if (!alive _unit) then { if (!alive _unit) then {
_heartRate = 0; _heartRate = 0;
}; };
@ -47,8 +47,7 @@ if (_heartRate > 1.0) then {
}; };
_content = ["STR_ACE_CHECK_PULSE_CHECKED_MEDIC",_heartRateOutput]; _content = ["STR_ACE_CHECK_PULSE_CHECKED_MEDIC",_heartRateOutput];
// TODO build support in displayText for sending it across to a different client with localization + format support. ["displayTextStructured", [_caller], [[_content, [_unit] call EFUNC(common,getName), round(_heartRate)], 1.5, _caller]] call EFUNC(common,targetEvent);
// [format[_content, [_unit] call EFUNC(common,getName), round(_heartRate)]] call EFUNC(common,displayTextStructured);
if (_logOutPut != "") then { if (_logOutPut != "") then {
[_unit,"examine",format["%1 checked Heart Rate: %2",[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToLog); [_unit,"examine",format["%1 checked Heart Rate: %2",[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToLog);

View File

@ -20,10 +20,11 @@ _target = _this select 1;
_output = ""; _output = "";
if ([_target] call EFUNC(common,isAwake)) then { if ([_target] call EFUNC(common,isAwake)) then {
_output = format[localize "STR_ACE_CHECK_REPONSE_RESPONSIVE",[_target] call EFUNC(common,getName)]; _output = ["STR_ACE_CHECK_REPONSE_RESPONSIVE",[_target] call EFUNC(common,getName)];
} else { } else {
_output = format[localize "STR_ACE_CHECK_REPONSE_UNRESPONSIVE",[_target] call EFUNC(common,getName)]; _output = ["STR_ACE_CHECK_REPONSE_UNRESPONSIVE",[_target] call EFUNC(common,getName)];
}; };
[_output] call EFUNC(common,displayTextStructured); ["displayTextStructured", [_caller], [_output, 1.5, _caller]] call EFUNC(common,targetEvent);
[_target,"examine",_output] call FUNC(addToLog); [_target,"examine",_output] call FUNC(addToLog);

View File

@ -34,6 +34,6 @@ _bodyBagCreated = createVehicle ["ACE_bodyBag", _onPosition, [], 0, "NONE"];
_bodyBagCreated setPos _onPosition; _bodyBagCreated setPos _onPosition;
// TODO Does this need to be something with QUOTE(DEFUNC)? // TODO Does this need to be something with QUOTE(DEFUNC)?
[[_bodyBagCreated], QEFUNC(common,revealObject), true] call call EFUNC(common,execRemoteFnc); [[_bodyBagCreated], QEFUNC(common,revealObject), true] call call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
_bodyBagCreated; _bodyBagCreated;

View File

@ -15,7 +15,7 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_caller","_target","_part","_selectionName","_removeItem","_tourniquets"]; private ["_caller","_target","_part","_selectionName","_removeItem","_tourniquets", "_output"];
_caller = _this select 0; _caller = _this select 0;
_target = _this select 1; _target = _this select 1;
_selectionName = _this select 2; _selectionName = _this select 2;
@ -27,7 +27,8 @@ _tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]];
// Check if there is a tourniquet on this bodypart // Check if there is a tourniquet on this bodypart
if ((_tourniquets select _part) == 0) exitwith { if ((_tourniquets select _part) == 0) exitwith {
// TODO localization // TODO localization
["There is no tourniquet on this body part!"] call EFUNC(common,displayTextStructured); _output = "There is no tourniquet on this body part!";
["displayTextStructured", [_caller], [_output, 1.5, _caller]] call EFUNC(common,targetEvent);
}; };
// Removing the tourniquet // Removing the tourniquet

View File

@ -18,4 +18,4 @@ private ["_caller","_target"];
_caller = _this select 0; _caller = _this select 0;
_target = _this select 1; _target = _this select 1;
[[_caller, _target], QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); [[_caller, _target], QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */

View File

@ -16,7 +16,7 @@
private "_unit"; private "_unit";
_unit = _this select 0; _unit = _this select 0;
if !(local _unit) exitwith{ if !(local _unit) exitwith{
[[_unit], QUOTE(DFUNC(addToInjuredCollection)), _unit] call EFUNC(common,execRemoteFnc); [[_unit], QUOTE(DFUNC(addToInjuredCollection)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
}; };
if !(_unit getvariable[QGVAR(addedToUnitLoop),false]) then{ if !(_unit getvariable[QGVAR(addedToUnitLoop),false]) then{

View File

@ -23,7 +23,7 @@ _message = _this select 2;
_arguments = _this select 3; _arguments = _this select 3;
if (!local _unit) exitwith { if (!local _unit) exitwith {
[_this, QUOTE(DFUNC(addToLog)), _unit] call EFUNC(common,execRemoteFnc); [_this, QUOTE(DFUNC(addToLog)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
}; };
_lastNumber = date select 4; _lastNumber = date select 4;

View File

@ -19,7 +19,7 @@ _unit = _this select 0;
_newItem = _this select 1; _newItem = _this select 1;
if (!local _unit) exitwith { if (!local _unit) exitwith {
[_this, QUOTE(DFUNC(addToTriageList)), _unit] call EFUNC(common,execRemoteFnc); [_this, QUOTE(DFUNC(addToTriageList)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
}; };
_log = _unit getvariable [QGVAR(triageCard), []]; _log = _unit getvariable [QGVAR(triageCard), []];

View File

@ -22,7 +22,7 @@ if (count _this >= 2) then {
if (!alive _unit) exitwith{}; if (!alive _unit) exitwith{};
if (!local _unit) exitwith { if (!local _unit) exitwith {
[[_unit, _force], QUOTE(DFUNC(setDead)), _unit, false] call EFUNC(common,execRemoteFnc); [[_unit, _force], QUOTE(DFUNC(setDead)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
}; };
if (missionName getVariable [QGVAR(enableRevive), false]) exitwith { if (missionName getVariable [QGVAR(enableRevive), false]) exitwith {

View File

@ -25,7 +25,7 @@ if !(!(isNull _unit) && {(_unit isKindOf "CaManBase") && ([_unit] call EFUNC(com
// We only want this function to work on local machines // We only want this function to work on local machines
if (!local _unit) exitwith { if (!local _unit) exitwith {
[[_unit], QUOTE(DFUNC(setUnconsciousState)), _unit, false] call EFUNC(common,execRemoteFnc); [[_unit], QUOTE(DFUNC(setUnconsciousState)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
}; };
// Get rid of the object we are carrying, before we go unconscious. // Get rid of the object we are carrying, before we go unconscious.

View File

@ -24,6 +24,6 @@ _className = _this select 3;
_items = _this select 4; _items = _this select 4;
// TODO replace by event system instead // TODO replace by event system instead
[[_caller, _target], QUOTE(DFUNC(treatmentAdvanced_CPRLocal)), _target] call EFUNC(common,execRemoteFnc); [[_caller, _target], QUOTE(DFUNC(treatmentAdvanced_CPRLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
true; true;

View File

@ -26,8 +26,8 @@ _items = _this select 4;
if (count _items == 0) exitwith {}; if (count _items == 0) exitwith {};
if ([_caller, _target, _items] call FUNC(useItem)) then { if ([_caller, _target, _items] call FUNC(useItems)) then {
[[_target, _className], QUOTE(DFUNC(treatmentBandageLocal)), _target] call EFUNC(common,execRemoteFnc); [[_target, _className], QUOTE(DFUNC(treatmentBandageLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
{ {
if (_x != "") then { if (_x != "") then {
[_target, _x] call FUNC(addToTriageCard); [_target, _x] call FUNC(addToTriageCard);

View File

@ -18,6 +18,6 @@ _className = _this select 3;
_items = _this select 4; _items = _this select 4;
// TODO replace by event system // TODO replace by event system
[[_caller, _target], QUOTE(DFUNC(treatmentAdvanced_fullHealLocal)), _target] call EFUNC(common,execRemoteFnc); [[_caller, _target], QUOTE(DFUNC(treatmentAdvanced_fullHealLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
true; true;

View File

@ -26,8 +26,8 @@ _items = _this select 4;
if (count _items == 0) exitwith {}; if (count _items == 0) exitwith {};
if ([_caller, _target, _items] call FUNC(useItem)) then { if ([_caller, _target, _items] call FUNC(useItems)) then {
[[_target, _className], QUOTE(DFUNC(treatmentMedicationLocal)), _target] call EFUNC(common,execRemoteFnc); [[_target, _className], QUOTE(DFUNC(treatmentMedicationLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
{ {
if (_x != "") then { if (_x != "") then {
[_target, _x] call FUNC(addToTriageCard); [_target, _x] call FUNC(addToTriageCard);

View File

@ -26,9 +26,9 @@ _items = _this select 4;
if (count _items == 0) exitwith {}; if (count _items == 0) exitwith {};
if ([_caller, _target, _items] call FUNC(useItem)) then { if ([_caller, _target, _items] call FUNC(useItems)) then {
_removeItem = _items select 0; _removeItem = _items select 0;
[[_target, _removeItem], QUOTE(DFUNC(treatmentIVLocal)), _target] call EFUNC(common,execRemoteFnc); [[_target, _removeItem], QUOTE(DFUNC(treatmentIVLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent; ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent;
[_target, _removeItem] call FUNC(addToTriageCard); [_target, _removeItem] call FUNC(addToTriageCard);
[_target, "activity", "STR_ACE_HAS_GIVEN_IV_ACTIVITY", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); [_target, "activity", "STR_ACE_HAS_GIVEN_IV_ACTIVITY", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog);

View File

@ -17,7 +17,7 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_caller","_target","_part","_selectionName","_removeItem", "_tourniquets", "_items"]; private ["_caller","_target","_part","_selectionName","_removeItem", "_tourniquets", "_items", "_output"];
_caller = _this select 0; _caller = _this select 0;
_target = _this select 1; _target = _this select 1;
_selectionName = _this select 2; _selectionName = _this select 2;
@ -34,13 +34,14 @@ if (_part == 0 || _part == 1) exitwith {
_tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; _tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]];
if ((_tourniquets select _part) > 0) exitwith { if ((_tourniquets select _part) > 0) exitwith {
// [_caller,"There is already a tourniquet on this body part!"] call EFUNC(common,sendHintTo); // display message _output = "There is already a tourniquet on this body part!"; // TODO localization
["displayTextStructured", [_caller], [_output, 1.5, _caller]] call EFUNC(common,targetEvent);
false; false;
}; };
if ([_caller, _target, _items] call FUNC(useItem)) then { if ([_caller, _target, _items] call FUNC(useItems)) then {
_removeItem = _items select 0; _removeItem = _items select 0;
[[_target, _removeItem], QUOTE(DFUNC(treatmentTourniquetLocal)), _target] call EFUNC(common,execRemoteFnc); [[_target, _removeItem], QUOTE(DFUNC(treatmentTourniquetLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent; ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent;
[_target, _removeItem] call FUNC(addToTriageCard); [_target, _removeItem] call FUNC(addToTriageCard);
[_target, "activity", "STR_ACE_HAS_APPLIED_TOURNIQUET_ACTIVITY", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); [_target, "activity", "STR_ACE_HAS_APPLIED_TOURNIQUET_ACTIVITY", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog);

View File

@ -25,12 +25,12 @@ if (isnil QGVAR(setting_allowSharedEquipment)) then {
}; };
if (GVAR(setting_allowSharedEquipment) && {[_patient, _item] call EFUNC(common,hasItem)}) exitwith { if (GVAR(setting_allowSharedEquipment) && {[_patient, _item] call EFUNC(common,hasItem)}) exitwith {
[[_patient, _item], QUOTE(EFUNC(common,useItem)), _patient] call EFUNC(common,execRemoteFnc); [[_patient, _item], QUOTE(EFUNC(common,useItem)), _patient] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
true; true;
}; };
if ([_medic, _item] call EFUNC(common,hasItem)) exitwith { if ([_medic, _item] call EFUNC(common,hasItem)) exitwith {
[[_medic, _item], QUOTE(EFUNC(common,useItem)), _medic] call EFUNC(common,execRemoteFnc); [[_medic, _item], QUOTE(EFUNC(common,useItem)), _medic] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
true; true;
}; };
@ -40,7 +40,7 @@ if ([vehicle _medic] call FUNC(isMedicalVehicle) && {vehicle _medic != _medic})
{ {
if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {([_x, _item] call EFUNC(common,hasItem))}) exitwith { if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {([_x, _item] call EFUNC(common,hasItem))}) exitwith {
_return = true; _return = true;
[[_x, _item], QUOTE(EFUNC(common,useItem)), _x] call EFUNC(common,execRemoteFnc); [[_x, _item], QUOTE(EFUNC(common,useItem)), _x] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
}; };
}foreach _crew; }foreach _crew;
}; };