From 1415adc2bde1b418c3581c63166a590e6536ea40 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 25 Apr 2015 12:35:07 +0200 Subject: [PATCH] removed local diagnose action. Added localization --- addons/medical/XEH_preInit.sqf | 1 - .../medical/functions/fnc_actionDiagnose.sqf | 23 ++++++++++- .../functions/fnc_actionDiagnoseLocal.sqf | 40 ------------------- addons/medical/stringtable.xml | 22 ++++++++++ 4 files changed, 44 insertions(+), 42 deletions(-) delete mode 100644 addons/medical/functions/fnc_actionDiagnoseLocal.sqf diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index c9c149d2a6..b6deca4033 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -8,7 +8,6 @@ PREP(actionCheckPulse); PREP(actionCheckPulseLocal); PREP(actionCheckResponse); PREP(actionDiagnose); -PREP(actionDiagnoseLocal); PREP(actionPlaceInBodyBag); PREP(actionRemoveTourniquet); PREP(actionLoadUnit); diff --git a/addons/medical/functions/fnc_actionDiagnose.sqf b/addons/medical/functions/fnc_actionDiagnose.sqf index 7ac4bfd5a5..234cc6d303 100644 --- a/addons/medical/functions/fnc_actionDiagnose.sqf +++ b/addons/medical/functions/fnc_actionDiagnose.sqf @@ -17,4 +17,25 @@ private ["_caller","_target","_title","_content"]; _caller = _this select 0; _target = _this select 1; -[[_caller, _target], QUOTE(DFUNC(actionDiagnoseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ + +_genericMessages = ["STR_ACE_MEDICAL_diagnoseMessage"]; + +_genericMessages pushBack ([_target] call EFUNC(common,getName)); +if (alive _target) then { + _genericMessages pushback "STR_ACE_MEDICAL_diagnoseAlive"; +} else { + _genericMessages pushback "STR_ACE_MEDICAL_diagnoseDead"; +}; +if (_target getvariable[QGVAR(hasLostBlood), false]) then { + _genericMessages pushback "STR_ACE_MEDICAL_lostBlood"; +} else { + _genericMessages pushback "STR_ACE_MEDICAL_noBloodloss"; +}; + +if (_target getvariable[QGVAR(hasPain), false]) then { + _genericMessages pushback "STR_ACE_MEDICAL_inPain"; +} else { + _genericMessages pushback "STR_ACE_MEDICAL_noPain"; +}; + +["displayTextStructured", [_caller], [_genericMessages, 3.0, _caller]] call EFUNC(common,targetEvent); diff --git a/addons/medical/functions/fnc_actionDiagnoseLocal.sqf b/addons/medical/functions/fnc_actionDiagnoseLocal.sqf deleted file mode 100644 index 58c50638bf..0000000000 --- a/addons/medical/functions/fnc_actionDiagnoseLocal.sqf +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Author: Glowbal - * Local callback for checking the pulse of a patient - * - * Arguments: - * 0: The medic - * 1: The patient - * - * Return Value: - * NONE - * - * Public: No - */ - -#include "script_component.hpp" - -_caller = _this select 0; -_unit = _this select 1; - -_genericMessages = ["Patient %1
is %2.
%3.
%4"]; - -_genericMessages pushBack ([_unit] call EFUNC(common,getName)); -if (alive _unit) then { - _genericMessages pushback "alive"; -} else { - _genericMessages pushback "dead"; -}; -if (_target getvariable[QGVAR(hasLostBlood), false]) then { - _genericMessages pushback "He's lost some blood"; -} else { - _genericMessages pushback "He hasn't lost blood"; -}; - -if (_target getvariable[QGVAR(hasPain), false]) then { - _genericMessages pushback "He is in pain"; -} else { - _genericMessages pushback "He is not in pain"; -}; -diag_log _genericMessages; -["displayTextStructured", [_caller], [format _genericMessages, 3.0, _caller]] call EFUNC(common,targetEvent); diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 53c587bec0..9220eb6671 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -1322,6 +1322,28 @@ Megnézted %1-t Hai controllato %1 + + Patient %1<br/>is %2.<br/>%3.<br/>%4 + + + alive + + + dead + + + He's lost some blood + + + He hasn't lost blood + + + He is in pain + + + He is not in pain + + Bandaged Bandé