From 2d1f166f5a15d4ec369b5b6233ec553df87866b9 Mon Sep 17 00:00:00 2001 From: mharis001 Date: Sat, 4 Jan 2020 15:43:51 -0500 Subject: [PATCH 1/3] Medical - Combine advancedBandages and woundReopening settings --- .../functions/fnc_updateInjuryList.sqf | 59 ++++++++---------- .../functions/fnc_bandageLocal.sqf | 4 +- .../functions/fnc_canBandage.sqf | 2 +- .../functions/fnc_getBandageTime.sqf | 7 ++- addons/medical_treatment/initSettings.sqf | 19 ++---- addons/medical_treatment/stringtable.xml | 61 +++++++------------ 6 files changed, 57 insertions(+), 95 deletions(-) diff --git a/addons/medical_gui/functions/fnc_updateInjuryList.sqf b/addons/medical_gui/functions/fnc_updateInjuryList.sqf index de5b22df3eb..ef186242544 100644 --- a/addons/medical_gui/functions/fnc_updateInjuryList.sqf +++ b/addons/medical_gui/functions/fnc_updateInjuryList.sqf @@ -104,45 +104,34 @@ if (_totalIvVolume >= 1) then { // Add entries for open, bandaged, and stitched wounds private _woundEntries = []; -private _fnc_getWoundDescription = { - private _classIndex = _woundClassID / 10; - private _category = _woundClassID % 10; - private _className = EGVAR(medical_damage,woundsData) select _classIndex select 6; - private _suffix = ["Minor", "Medium", "Large"] select _category; - private _woundName = localize format [ELSTRING(medical_damage,%1_%2), _className, _suffix]; - if (_amountOf >= 1) then { - format ["%1x %2", ceil _amountOf, _woundName]; - } else { - format [localize LSTRING(PartialX), _woundName]; - }; -}; +private _fnc_processWounds = { + params ["_wounds", "_format", "_color"]; -{ - _x params ["_woundClassID", "_bodyPartN", "_amountOf"]; - if (_selectionN == _bodyPartN) then { - if (_amountOf > 0) then { - _woundEntries pushBack [call _fnc_getWoundDescription, [1, 1, 1, 1]]; - } else { - if !(EGVAR(medical_treatment,advancedBandages) && {EGVAR(medical_treatment,woundReopening)}) then { - _woundEntries pushBack [format ["[B] %1", call _fnc_getWoundDescription], [0.7, 0.7, 0.7, 1]]; + { + _x params ["_woundClassID", "_bodyPartN", "_amountOf"]; + + if (_selectionN == _bodyPartN && {_amountOf > 0}) then { + private _classIndex = _woundClassID / 10; + private _category = _woundClassID % 10; + + private _className = EGVAR(medical_damage,woundsData) select _classIndex select 6; + private _suffix = ["Minor", "Medium", "Large"] select _category; + private _woundName = localize format [ELSTRING(medical_damage,%1_%2), _className, _suffix]; + + private _woundDescription = if (_amountOf >= 1) then { + format ["%1x %2", ceil _amountOf, _woundName] + } else { + format [localize LSTRING(PartialX), _woundName] }; - }; - }; -} forEach GET_OPEN_WOUNDS(_target); -{ - _x params ["_woundClassID", "_bodyPartN", "_amountOf"]; - if (_selectionN == _bodyPartN && {_amountOf > 0}) then { - _woundEntries pushBack [format ["[B] %1", call _fnc_getWoundDescription], [0.88, 0.7, 0.65, 1]]; - }; -} forEach GET_BANDAGED_WOUNDS(_target); + _woundEntries pushBack [format [_format, _woundDescription], _color]; + }; + } forEach _wounds; +}; -{ - _x params ["_woundClassID", "_bodyPartN", "_amountOf"]; - if (_selectionN == _bodyPartN && {_amountOf > 0}) then { - _woundEntries pushBack [format ["[S] %1", call _fnc_getWoundDescription], [0.7, 0.7, 0.7, 1]]; - }; -} forEach GET_STITCHED_WOUNDS(_target); +[GET_OPEN_WOUNDS(_target), "%1", [1, 1, 1, 1]] call _fnc_processWounds; +[GET_BANDAGED_WOUNDS(_target), "[B] %1", [0.88, 0.7, 0.65, 1]] call _fnc_processWounds; +[GET_STITCHED_WOUNDS(_target), "[S] %1", [0.7, 0.7, 0.7, 1]] call _fnc_processWounds; // Handle no wound entries if (_woundEntries isEqualTo []) then { diff --git a/addons/medical_treatment/functions/fnc_bandageLocal.sqf b/addons/medical_treatment/functions/fnc_bandageLocal.sqf index 30de3e1995e..61f1d695b5a 100644 --- a/addons/medical_treatment/functions/fnc_bandageLocal.sqf +++ b/addons/medical_treatment/functions/fnc_bandageLocal.sqf @@ -46,12 +46,12 @@ _patient setVariable [VAR_OPEN_WOUNDS, _openWounds, true]; [_patient] call EFUNC(medical_status,updateWoundBloodLoss); // Handle the reopening of bandaged wounds -if (_impact > 0 && {GVAR(advancedBandages) && {GVAR(woundReopening)}}) then { +if (_impact > 0 && {GVAR(advancedBandages) == 2}) then { [_patient, _impact, _partIndex, _woundIndex, _wound, _bandage] call FUNC(handleBandageOpening); }; // Check if we fixed limping from this treatment -if ((EGVAR(medical,limping) == 1) && {_partIndex > 3} && {_amountOf <= 0} && {_patient getVariable [QEGVAR(medical,isLimping), false]}) then { +if (EGVAR(medical,limping) == 1 && {_partIndex > 3} && {_amountOf <= 0} && {_patient getVariable [QEGVAR(medical,isLimping), false]}) then { [_patient] call EFUNC(medical_engine,updateDamageEffects); }; diff --git a/addons/medical_treatment/functions/fnc_canBandage.sqf b/addons/medical_treatment/functions/fnc_canBandage.sqf index f60836f38c2..0908e469b20 100644 --- a/addons/medical_treatment/functions/fnc_canBandage.sqf +++ b/addons/medical_treatment/functions/fnc_canBandage.sqf @@ -22,7 +22,7 @@ params ["_medic", "_patient", "_bodyPart", "_bandage"]; // Bandage type and bandage setting XNOR to show only active actions -if ((_bandage == "BasicBandage") isEqualTo GVAR(advancedBandages)) exitWith {false}; +if ((_bandage == "BasicBandage") isEqualTo (GVAR(advancedBandages) != 0)) exitWith {false}; private _index = ALL_BODY_PARTS find toLower _bodyPart; private _canBandage = false; diff --git a/addons/medical_treatment/functions/fnc_getBandageTime.sqf b/addons/medical_treatment/functions/fnc_getBandageTime.sqf index d66a8515aef..8a6248e3b59 100644 --- a/addons/medical_treatment/functions/fnc_getBandageTime.sqf +++ b/addons/medical_treatment/functions/fnc_getBandageTime.sqf @@ -28,7 +28,7 @@ _targetWound params ["_wound", "_woundIndex", "_effectiveness"]; TRACE_3("findMostEffectiveWound",_wound,_woundIndex,_effectiveness); // Everything is patched up on this body part already -if (_wound isEqualTo EMPTY_WOUND) exitWith { 0 }; +if (_wound isEqualTo EMPTY_WOUND) exitWith {0}; _wound params ["_classID", "", "_amountOf", "_bloodloss", "_damage"]; private _category = (_classID % 10); @@ -37,8 +37,9 @@ private _category = (_classID % 10); private _bandageTime = [BANDAGE_TIME_S, BANDAGE_TIME_M, BANDAGE_TIME_L] select _category; // Scale bandage time based on amount left and effectiveness (less time if only a little wound left) -if (GVAR(advancedBandages)) then { // basicBandage will have a very high effectiveness and can be ignored - _bandageTime = _bandageTime * (linearConversion [0, _effectiveness, _amountOf, 0.666, 1, true]); +// Basic bandage treatment will have a very high effectiveness and can be ignored +if (GVAR(advancedBandages) != 0) then { + _bandageTime = _bandageTime * linearConversion [0, _effectiveness, _amountOf, 0.666, 1, true]; }; // Medics are more practised at applying bandages diff --git a/addons/medical_treatment/initSettings.sqf b/addons/medical_treatment/initSettings.sqf index a4f81915634..f847c6d0d97 100644 --- a/addons/medical_treatment/initSettings.sqf +++ b/addons/medical_treatment/initSettings.sqf @@ -7,15 +7,6 @@ true ] call CBA_settings_fnc_init; -[ - QGVAR(advancedBandages), - "CHECKBOX", - [LSTRING(AdvancedBandages_DisplayName), LSTRING(AdvancedBandages_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], - true, - true -] call CBA_settings_fnc_init; - [ QGVAR(advancedMedication), "CHECKBOX", @@ -25,14 +16,12 @@ true ] call CBA_settings_fnc_init; -// todo: verify that this setting does not require a restart -// todo: this setting requires advanced bandages to be enabled, they should be independent [ - QGVAR(woundReopening), - "CHECKBOX", - [LSTRING(WoundReopening_DisplayName), LSTRING(WoundReopening_Description)], + QGVAR(advancedBandages), + "LIST", + [LSTRING(AdvancedBandages_DisplayName), LSTRING(AdvancedBandages_Description)], [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], - false, + [[0, 1, 2], [ELSTRING(common,Disabled), ELSTRING(common,Enabled), LSTRING(AdvancedBandages_EnabledCanReopen)], 1], true ] call CBA_settings_fnc_init; diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index e9df8c966b2..072fc663f10 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -43,6 +43,25 @@ Abilita le azioni di controllo del polso, controllo della pressione sanguigna e controllo della risposta al trattamento invece dell'azione generica Diagnose.\ Se disabilitata, l'azione di RCP sarà mostrata solo quando l'esecuzione della RCP è appropriata.\Le azioni abilitate da questa impostazione sono necessarie per determinare se una persona è in stato di incoscienza o in arresto cardiaco. Povoluje kontrolu srdečního tepu, krevního tlaku a reakce pacienta namísto univerzální diagnózy.\nKdyž je tato možnost vypnuta, CPR akce bude dostupná pouze pokud je vhodné ji provést.\nAkce které tato možnost zapíná jsou nutné k určení zda je pacient v bezvědomí nebo má srdeční zástavu. + + Advanced Medication + Erweiterte Medikamente + アドバンスド医薬品 + Расширенные Лекарства + Médication avancée + Medicação Avançada + 進階醫療用品 + Pokročilé léky + + + Enables extended, more in-depth medication handling. Also, enables the use of Adenosine. + Устанавливает расширенное использование лекарств + 有効化するともっと多くの多様な機能を持つ医薬品を使えます。また、アデノシンとアトロピンが利用可能になります。 + Permet une manipulation étendue et plus appronfondie des médicaments.\nEn outre, permet l'utilisation d'adénosine et d'atropine. + Ativa a manipulação avançada de medicações. Também permite o uso de Adenosina e Atropina. + 是否擴展藥物管控使其更深度化。並且,啟用腺苷以及阿托品的使用次數 + Povoluje hlubší a rozšířené zacházení s léčivy. Také aktivuje Adenosin a Atropin. + Advanced Bandages Erweiterte Bandagen @@ -55,7 +74,7 @@ Pokročilé obvazy - Enables treatment actions for different bandage types instead of the generic Bandage action. + Enables treatment actions for different bandage types instead of the generic Bandage action.\nAdditionally, the reopening of bandaged wounds can also be enabled. 有効化すると通常の包帯動作に代わり、様々な種類がある包帯で治療ができます。 Active différents types de bandages, à choisir judicieusement en fonction des plaies. Включает действия для разных типов повязок, вместо общего действия «Перевязка». @@ -64,44 +83,8 @@ Permette azioni di trattamento per diversi tipi di bendaggio al posto del bendaggio generico. Povoluje specifické obvazy s různými vlastnostmi namísto jednoho univerzálního obvazu. - - Advanced Medication - Erweiterte Medikamente - アドバンスド医薬品 - Расширенные Лекарства - Médication avancée - Medicação Avançada - 進階醫療用品 - Pokročilé léky - - - Enables extended, more in-depth medication handling. Also, enables the use of Adenosine. - Устанавливает расширенное использование лекарств - 有効化するともっと多くの多様な機能を持つ医薬品を使えます。また、アデノシンとアトロピンが利用可能になります。 - Permet une manipulation étendue et plus appronfondie des médicaments.\nEn outre, permet l'utilisation d'adénosine et d'atropine. - Ativa a manipulação avançada de medicações. Também permite o uso de Adenosina e Atropina. - 是否擴展藥物管控使其更深度化。並且,啟用腺苷以及阿托品的使用次數 - Povoluje hlubší a rozšířené zacházení s léčivy. Také aktivuje Adenosin a Atropin. - - - Wound Reopening - 創傷再開放 - Réouverture des plaies - Повторное открытие ран - Reabrir Feridas - 傷口再度裂開 - Riapertura della ferita - Znovuotevření ran - - - Enables the reopening of bandaged wounds. Requires Advanced Bandages to be enabled. - 有効化すると治療をした創傷を再開放します。アドバンスド包帯を有効化している必要があります。 - Permet la réouverture des plaies pansées.\nNécessite que l'option "pansements avancés" soit activée. - Разрешает повторное открытие перевязанных ран. Требуются опция «Расширенная Перевязка». - Permite que ferimentos atados possam reabrir. Requer Ataduras Avançadas para funcionar. - 啟用包紮過的傷口是否會再度裂開。需要啟用「進階包紮」之功能。 - Povoluje znovuotevírání obvázaných zranění. Vyžaduje zapnuté Pokročilé obvazy. - Permette la riapertura delle ferite fasciate. Richiede l'abilitazione di Bende Avanzate. + + Enabled & Can Reopen Clear Trauma After Bandage From 770860fe1a270778c0faeeba95595b66599b4b84 Mon Sep 17 00:00:00 2001 From: mharis001 <34453221+mharis001@users.noreply.github.com> Date: Sun, 5 Jan 2020 03:29:57 -0500 Subject: [PATCH 2/3] Improve German translation Co-Authored-By: Jo David --- addons/medical_treatment/stringtable.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index 072fc663f10..c9f16be5554 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -45,7 +45,7 @@ Advanced Medication - Erweiterte Medikamente + Erweiterte Medikation アドバンスド医薬品 Расширенные Лекарства Médication avancée From 57932ce04faccfd9dcbfd46d765a684eb401af32 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 9 Jan 2020 14:51:07 -0600 Subject: [PATCH 3/3] restore strings lost in merge --- addons/medical_treatment/stringtable.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index 74a06998c53..23a3eeff179 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -58,15 +58,18 @@ Medicação Avançada 進階醫療用品 Pokročilé léky + Medicazione avanzata Enables extended, more in-depth medication handling. Also, enables the use of Adenosine. Устанавливает расширенное использование лекарств 有効化するともっと多くの多様な機能を持つ医薬品を使えます。また、アデノシンとアトロピンが利用可能になります。 - Permet une manipulation étendue et plus appronfondie des médicaments.\nEn outre, permet l'utilisation d'adénosine et d'atropine. + Permet une manipulation étendue et plus approfondie des médicaments.\nEn outre, permet l'utilisation d'adénosine. Ativa a manipulação avançada de medicações. Também permite o uso de Adenosina e Atropina. 是否擴展藥物管控使其更深度化。並且,啟用腺苷以及阿托品的使用次數 Povoluje hlubší a rozšířené zacházení s léčivy. Také aktivuje Adenosin a Atropin. + Abilita una gestione della medicazione più estesa e approfondita. Permette inoltre l'utilizzo dell'Adenosina. + Ermöglicht erweiterte, mehr tiefgründigere Anwendung von Medikationen. Ebenso ermöglicht es die Benutzung von Adenosin. Advanced Bandages @@ -82,6 +85,7 @@ Enables treatment actions for different bandage types instead of the generic Bandage action.\nAdditionally, the reopening of bandaged wounds can also be enabled. + Ermöglicht Behandlungsaktionen für verschiedene Bandagentypen anstelle der gewöhnlichen Bandageaktionen. 有効化すると通常の包帯動作に代わり、様々な種類がある包帯で治療ができます。 Active différents types de bandages, à choisir judicieusement en fonction des plaies. Включает действия для разных типов повязок, вместо общего действия «Перевязка». @@ -90,7 +94,6 @@ Permette azioni di trattamento per diversi tipi di bendaggio al posto del bendaggio generico. Povoluje specifické obvazy s různými vlastnostmi namísto jednoho univerzálního obvazu. Umożliwia wybranie konkretnego rodzaju bandaża zamiast ogólnej akcji bandażowania. - Ermöglicht Behandlungsaktionen für verschiedene Bandagentypen anstelle der gewöhnlichen Bandageaktionen. Enabled & Can Reopen