diff --git a/addons/advanced_fatigue/XEH_postInit.sqf b/addons/advanced_fatigue/XEH_postInit.sqf index 6716fca96d..e3c17173f5 100644 --- a/addons/advanced_fatigue/XEH_postInit.sqf +++ b/addons/advanced_fatigue/XEH_postInit.sqf @@ -48,7 +48,7 @@ if (!hasInterface) exitWith {}; linearConversion [0, 1, (_this getVariable [QEGVAR(medical,pain), 0]), 1, 1.1, true]; }] call FUNC(addDutyFactor); [QEGVAR(medical,bloodVolume), { // 100->1.0, 90->1.1, 80->1.2 - linearConversion [100, 0, (_this getVariable [QEGVAR(medical,bloodVolume), 100]), 1, 2, true]; + linearConversion [6, 0, (_this getVariable [QEGVAR(medical,bloodVolume), 100]), 1, 2, true]; }] call FUNC(addDutyFactor); }; if (["ACE_Dragging"] call EFUNC(common,isModLoaded)) then { diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index febac24fa5..b5c1c80d1a 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -221,14 +221,6 @@ class ACE_Settings { typeName = "SCALAR"; value = 0.1; }; - class GVAR(painEffectType) { - category = CSTRING(Category_Medical); - displayName = CSTRING(painEffectType); - typeName = "SCALAR"; - value = 0; - values[] = {CSTRING(painEffect_Flash), CSTRING(painEffect_Chroma)}; - isClientSettable = 1; - }; class GVAR(allowUnconsciousAnimationOnTreatment) { category = CSTRING(Category_Medical); displayName = CSTRING(MedicalSettings_allowUnconsciousAnimationOnTreatment_DisplayName); diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index b418601593..dbf1e2114e 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -403,22 +403,6 @@ class CfgVehicles { typeName = "SCALAR"; defaultValue = 0.1; }; - class painEffectType { - displayName = CSTRING(painEffectType); - typeName = "SCALAR"; - isClientSettable = 1; - class values { - class flash { - name = CSTRING(painEffect_Flash); - value = 0; - default = 1; - }; - class chroma { - name = CSTRING(painEffect_Chroma); - value = 1; - }; - }; - }; class allowUnconsciousAnimationOnTreatment { displayName = CSTRING(MedicalSettings_allowUnconsciousAnimationOnTreatment_DisplayName); description = CSTRING(MedicalSettings_allowUnconsciousAnimationOnTreatment_Description); diff --git a/addons/medical/functions/fnc_moduleMedicalSettings.sqf b/addons/medical/functions/fnc_moduleMedicalSettings.sqf index 8aa6efcb46..8c518ac37d 100644 --- a/addons/medical/functions/fnc_moduleMedicalSettings.sqf +++ b/addons/medical/functions/fnc_moduleMedicalSettings.sqf @@ -48,7 +48,6 @@ if !(_activated) exitWith {}; [_logic, QGVAR(useLocation_PAK), "useLocation_PAK"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(useLocation_SurgicalKit), "useLocation_SurgicalKit"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(remainingDamage_Medkit), "remainingDamage_Medkit"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(painEffectType), "painEffectType"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(allowUnconsciousAnimationOnTreatment), "allowUnconsciousAnimationOnTreatment"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(menuTypeStyle), "menuTypeStyle"] call EFUNC(common,readSettingFromModule); diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 2422404c38..2df1e6d80e 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -2676,48 +2676,6 @@ 包帯は体力を完全に回復する 붕대를 감은후 체력을 회복함 - - Pain Effect Type - Schmerzeffekt-Typ - Rodzaj efektu bólu - Визуальный эффект боли - Pain Effect Type - Tipo de efecto de dolor - Type d'effet de douleur - Fájdalom-effekt típusa - Tipo do efeito de dor - Typ bolesti - efekt - 痛みの種類 - 고통 효과 종류 - - - Colour Flashing - Farbblinken - Pulsujące kolory - Пульсирующий свет - Colore lampeggiante - Parpadeo de color - Flash de couleur - Színvillódzás - Flash de cor - Blikající barva - 色の点滅 - 색 반짝임 - - - Chromatic Aberration - Chromatische Aberration - Aberracja chromatyczna - Хроматическая аберрация - Aberrazione cromatica - Aberración cromática - Aberration chromatique - Kromatikus aberráció - Chromatická aberace - Aberração Cromática - 色の収差 - 색수차 - Style of menu (Medical) Styl menu medycznego diff --git a/addons/medical_damage/script_component.hpp b/addons/medical_damage/script_component.hpp index e38fd550bb..0d1bc54e7e 100644 --- a/addons/medical_damage/script_component.hpp +++ b/addons/medical_damage/script_component.hpp @@ -4,7 +4,6 @@ #define DEBUG_MODE_FULL #define DISABLE_COMPILE_CACHE -#define CBA_DEBUG_SYNCHRONOUS //#define ENABLE_PERFORMANCE_COUNTERS #ifdef DEBUG_ENABLED_MEDICAL_DAMAGE diff --git a/addons/medical_engine/functions/fnc_playInjuredSound.sqf b/addons/medical_engine/functions/fnc_playInjuredSound.sqf index 53e092da2f..08ec6c3bbc 100644 --- a/addons/medical_engine/functions/fnc_playInjuredSound.sqf +++ b/addons/medical_engine/functions/fnc_playInjuredSound.sqf @@ -22,7 +22,7 @@ #define TIME_OUT_MOAN 5 params [["_unit", objNull, [objNull]], ["_type", "hit", [""]], ["_severity", 0, [0]]]; -TRACE_3("",_unit,_type,_severity); +// TRACE_3("",_unit,_type,_severity); if (!local _unit) exitWith { ERROR("Unit not local or null"); diff --git a/addons/medical_engine/script_component.hpp b/addons/medical_engine/script_component.hpp index 6cdaddc84b..4ae38a8b6e 100644 --- a/addons/medical_engine/script_component.hpp +++ b/addons/medical_engine/script_component.hpp @@ -4,7 +4,6 @@ #define DEBUG_MODE_FULL #define DISABLE_COMPILE_CACHE -#define CBA_DEBUG_SYNCHRONOUS //#define ENABLE_PERFORMANCE_COUNTERS #ifdef DEBUG_ENABLED_MEDICAL_ENGINE diff --git a/addons/medical_ui/XEH_postInit.sqf b/addons/medical_ui/XEH_postInit.sqf index bdb2db1094..a90c04ae70 100644 --- a/addons/medical_ui/XEH_postInit.sqf +++ b/addons/medical_ui/XEH_postInit.sqf @@ -2,9 +2,10 @@ if (!hasInterface) exitWith {}; -[] call FUNC(initEffects); -[FUNC(handleEffects), 1, []] call CBA_fnc_addPerFrameHandler; -[FUNC(effectHeartBeat), 0, []] call CBA_fnc_addPerFrameHandler; +GVAR(heartBeatEffectRunning) = false; + +[false] call FUNC(initEffects); +[LINKFUNC(handleEffects), 1, []] call CBA_fnc_addPerFrameHandler; ["ace_unconscious", { params ["_unit", "_unconscious"]; diff --git a/addons/medical_ui/XEH_preInit.sqf b/addons/medical_ui/XEH_preInit.sqf index 23c047367d..1cdc5f20be 100644 --- a/addons/medical_ui/XEH_preInit.sqf +++ b/addons/medical_ui/XEH_preInit.sqf @@ -7,7 +7,7 @@ ADDON = false; [ QGVAR(painEffectType), "LIST", - ["Pain effect type", "Selects the used pain effect type"], //@todo + [localize LSTRING(painEffectType), "Selects the used pain effect type"], //@todo "ACE Medical", // @todo [ [0, 1], @@ -15,7 +15,11 @@ ADDON = false; 0 ], false, - {} // TODO! + { + if (isNil QGVAR(ppPain)) exitWith {TRACE_1("Before Post-Init",_this)}; + TRACE_1("reseting ppEffect type",_this); + [true] call FUNC(initEffects); + } ] call CBA_Settings_fnc_init; GVAR(lastHeartBeatSound) = 0; diff --git a/addons/medical_ui/functions/fnc_effectBloodVolume.sqf b/addons/medical_ui/functions/fnc_effectBloodVolume.sqf index 28103c86a4..92dfbbed74 100644 --- a/addons/medical_ui/functions/fnc_effectBloodVolume.sqf +++ b/addons/medical_ui/functions/fnc_effectBloodVolume.sqf @@ -12,7 +12,7 @@ #include "script_component.hpp" params ["_enable", "_intensity"]; -if (!_enable) exitWith { +if ((!_enable) || {_intensity == 0}) exitWith { GVAR(ppBloodVolume) ppEffectEnable false; }; GVAR(ppBloodVolume) ppEffectEnable true; diff --git a/addons/medical_ui/functions/fnc_effectHeartBeat.sqf b/addons/medical_ui/functions/fnc_effectHeartBeat.sqf index a44f1740b3..ac77904359 100644 --- a/addons/medical_ui/functions/fnc_effectHeartBeat.sqf +++ b/addons/medical_ui/functions/fnc_effectHeartBeat.sqf @@ -11,18 +11,22 @@ #include "script_component.hpp" private _heartRate = ACE_player getVariable [QEGVAR(medical,heartRate), DEFAULT_HEART_RATE]; -if (_heartRate == 0) exitWith {}; +if (_heartRate == 0) exitWith {GVAR(heartBeatEffectRunning) = false;}; + private _waitTime = 60 / _heartRate; -if (CBA_missionTime - GVAR(lastHeartBeatSound) > _waitTime) then { - GVAR(lastHeartBeatSound) = CBA_missionTime; +switch (true) do { + case (_heartRate > 160): { + playSound SND_HEARBEAT_FAST; + [DFUNC(effectHeartBeat), [], _waitTime] call CBA_fnc_waitAndExecute; + }; + case (_heartRate < 60): { + playSound SND_HEARBEAT_SLOW; + [DFUNC(effectHeartBeat), [], _waitTime] call CBA_fnc_waitAndExecute; - switch (true) do { - case (_heartRate > 160): { - playSound SND_HEARBEAT_FAST; - }; - case (_heartRate < 60): { - playSound SND_HEARBEAT_SLOW; - }; + }; + default { + TRACE_1("Ending heart beat effect",_heartRate); + GVAR(heartBeatEffectRunning) = false; }; }; diff --git a/addons/medical_ui/functions/fnc_effectPain.sqf b/addons/medical_ui/functions/fnc_effectPain.sqf index 3a543c166e..aac0bad017 100644 --- a/addons/medical_ui/functions/fnc_effectPain.sqf +++ b/addons/medical_ui/functions/fnc_effectPain.sqf @@ -12,7 +12,7 @@ #include "script_component.hpp" params ["_enable", "_intensity"]; -if (!_enable) exitWith { +if (!_enable || {_intensity == 0}) exitWith { GVAR(ppPain) ppEffectEnable false; }; GVAR(ppPain) ppEffectEnable true; @@ -38,6 +38,8 @@ if (GVAR(painEffectType) == 0) then { GVAR(ppPain) ppEffectAdjust _initialAdjust; GVAR(ppPain) ppEffectCommit FX_PAIN_FADE_IN; [{ - GVAR(ppPain) ppEffectAdjust _this; + params ["_adjust", "_painEffectType"]; + if (GVAR(painEffectType) != _painEffectType) exitWith {TRACE_1("Effect type changed",_this);}; + GVAR(ppPain) ppEffectAdjust _adjust; GVAR(ppPain) ppEffectCommit FX_PAIN_FADE_OUT; -}, _delayedAdjust, FX_PAIN_FADE_IN] call CBA_fnc_waitAndExecute; +}, [_delayedAdjust, GVAR(painEffectType)], FX_PAIN_FADE_IN] call CBA_fnc_waitAndExecute; diff --git a/addons/medical_ui/functions/fnc_handleEffects.sqf b/addons/medical_ui/functions/fnc_handleEffects.sqf index 490cb6ab81..7efdf88de2 100644 --- a/addons/medical_ui/functions/fnc_handleEffects.sqf +++ b/addons/medical_ui/functions/fnc_handleEffects.sqf @@ -11,8 +11,7 @@ */ #include "script_component.hpp" -private _disableAll = (!isNull curatorCamera) || {!alive ACE_player}; -if (_disableAll) exitWith { +if (EGVAR(common,OldIsCamera) || {!alive ACE_player}) exitWith { [false, 0] call FUNC(effectUnconscious); [false] call FUNC(effectPain); [false] call FUNC(effectBloodVolume); @@ -21,12 +20,18 @@ if (_disableAll) exitWith { // - Current state info ------------------------------------------------------- private _bleedingStrength = [ACE_player] call EFUNC(medical,getBloodloss); -private _bleeding = _bleedingStrength > 0; +// private _bleeding = _bleedingStrength > 0; private _bloodVolume = ACE_player getVariable [QEGVAR(medical,bloodVolume), DEFAULT_BLOOD_VOLUME]; private _unconscious = ACE_player getVariable [QEGVAR(medical,isUnconscious), false]; private _heartRate = ACE_player getVariable [QEGVAR(medical,heartRate), DEFAULT_HEART_RATE]; private _pain = [ACE_player] call EFUNC(medical,getPainLevel); +if ((!GVAR(heartBeatEffectRunning)) && {_heartRate != 0} && {(_heartRate > 160) || {_heartRate < 60}}) then { + TRACE_1("Starting heart beat effect",_heartRate); + GVAR(heartBeatEffectRunning) = true; + [] call FUNC(effectHeartBeat); +}; + // - Visual effects ----------------------------------------------------------- [_unconscious, 2] call FUNC(effectUnconscious); [ diff --git a/addons/medical_ui/functions/fnc_initEffects.sqf b/addons/medical_ui/functions/fnc_initEffects.sqf index e84ef6a1b6..fb7b82b17a 100644 --- a/addons/medical_ui/functions/fnc_initEffects.sqf +++ b/addons/medical_ui/functions/fnc_initEffects.sqf @@ -10,6 +10,10 @@ */ #include "script_component.hpp" +params [["_justPain", false]]; + +TRACE_1("initEffects",_justPain); + private _fnc_createEffect = { params ["_type", "_layer", "_default"]; @@ -21,6 +25,28 @@ private _fnc_createEffect = { _effect }; +// - Pain --------------------------------------------------------------------- +if (!isNil QGVAR(ppPain)) then { + TRACE_1("delete pain",GVAR(ppPain)); + ppEffectDestroy GVAR(ppPain) +}; +if (GVAR(painEffectType) == 0) then { + GVAR(ppPain) = [ + "ColorCorrections", + 13502, + [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]] + ] call _fnc_createEffect; +} else { + GVAR(ppPain) = [ + "RadialBlur", // "Will not do anything if RADIAL BLUR is disabled in Video Options." + 13502, + [0, 0, 0.3, 0.39] + ] call _fnc_createEffect; +}; +TRACE_1("created pain",GVAR(ppPain)); + +if (_justPain) exitWith {}; + // - Unconscious -------------------------------------------------------------- GVAR(ppUnconsciousBlur) = [ "DynamicBlur", @@ -34,20 +60,6 @@ GVAR(ppUnconsciousBlackout) = [ [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]] ] call _fnc_createEffect; -// - Pain --------------------------------------------------------------------- -if (GVAR(painEffectType) == 0) then { - GVAR(ppPain) = [ - "ColorCorrections", - 13502, - [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]] - ] call _fnc_createEffect; -} else { - GVAR(ppPain) = [ - "RadialBlur", - 13502, - [0, 0, 0.3, 0.39] - ] call _fnc_createEffect; -}; // - Blood volume ------------------------------------------------------------- GVAR(ppBloodVolume) = [ diff --git a/addons/medical_ui/script_component.hpp b/addons/medical_ui/script_component.hpp index 574f97a301..01618de018 100644 --- a/addons/medical_ui/script_component.hpp +++ b/addons/medical_ui/script_component.hpp @@ -4,7 +4,6 @@ // #define DEBUG_MODE_FULL #define DISABLE_COMPILE_CACHE -// #define CBA_DEBUG_SYNCHRONOUS // #define ENABLE_PERFORMANCE_COUNTERS #ifdef DEBUG_ENABLED_MEDICAL_UI diff --git a/addons/medical_ui/stringtable.xml b/addons/medical_ui/stringtable.xml new file mode 100644 index 0000000000..76883319c2 --- /dev/null +++ b/addons/medical_ui/stringtable.xml @@ -0,0 +1,19 @@ + + + + + Pain Effect Type + Schmerzeffekt-Typ + Rodzaj efektu bólu + Визуальный эффект боли + Pain Effect Type + Tipo de efecto de dolor + Type d'effet de douleur + Fájdalom-effekt típusa + Tipo do efeito de dor + Typ bolesti - efekt + 痛みの種類 + 고통 효과 종류 + + +