Browse Source

Fix progress bar showing, and increment event not firing

m3ales 4 years ago
parent
commit
9b50bd5699

+ 8 - 0
addons - Copy/RD501_Main/XEH_postinit.sqf

@@ -51,6 +51,14 @@ rd501_medical_ccp_classes = ["Land_Medevac_house_V1_F"];
 rd501_medical_ccp_stitchDurationSeconds = 10;
 rd501_medical_ccp_bandageDurationSeconds = 10;
 
+["rd501_medical_ccp_incrementStitch",{ 
+	_this call rd501_fnc_incrementStitchProgress 
+}] call CBA_fnc_addEventHandler;
+
+["rd501_medical_ccp_incrementBandage",{
+	_this call rd501_fnc_incrementBandageProgress
+}] call CBA_fnc_addEventHandler;
+
 ["rd501_medical_ccp_deployCCPLocal", {
 	_this call rd501_fnc_deployCCPLocal;
 }] call CBA_fnc_addEventHandler;

+ 3 - 3
addons - Copy/RD501_Main/functions/medical_ccp/fnc_bandageAllNearbyCCP.sqf

@@ -46,7 +46,7 @@ private _onFinish = {
 private _onFailure = {
     params["_args", "_progress", "_errorCode"];
     _args params["_healer","_nearbyPatients", "_building"];
-    [_healer, "AmovPknlMstpSrasWrflDnon", 1] call ace_common_fnc_doAnimation;
+    [_healer, "", 1] call ace_common_fnc_doAnimation;
     _bandagers = _building getVariable ["rd501_medical_ccp_bandageMembers", []];
     if(count _bandagers <= 1) then {
         _building setVariable ["rd501_medical_ccp_bandageProgress", -1, true];
@@ -86,13 +86,13 @@ else
         _args params ["_healer", "_nearbyPatients", "_origin"];
         _progress = _origin getVariable ["rd501_medical_ccp_bandageProgress", -1];
         _progressComplete = _origin getVariable ["rd501_medical_ccp_bandageProgressComplete", 100];
-        if(_progress >= _progressComplete || _progress < 0) exitWith {
+        if( _progress < 0 || _progress >= _progressComplete) exitWith {
             [_handle] call CBA_fnc_removePerFrameHandler;
         };
         if!(_healer getVariable ["ACE_Unconscious", false]) exitWith {
             ["rd501_medical_ccp_incrementBandage",[_origin, _healer]] call CBA_fnc_serverEvent;
         };
-    }, 
+    },
     1,
     _args
 ] call CBA_fnc_addPerFrameHandler;

+ 1 - 1
addons - Copy/RD501_Main/functions/medical_ccp/fnc_stitchAllWoundsNearbyCCP.sqf

@@ -95,7 +95,7 @@ else
             ["rd501_medical_ccp_incrementStitch",[_origin, _healer]] call CBA_fnc_serverEvent;
         };
     },
-    0.5,
+    1,
     _args
 ] call CBA_fnc_addPerFrameHandler;
 

+ 2 - 1
addons - Copy/RD501_Main/functions/medical_ccp/fnc_valueProgressBar.sqf

@@ -96,6 +96,7 @@ _ctrlPos set [1, ((0 + 29 * ace_common_settingProgressBarLocation) * ((((safezon
             };
         };
     } else {
-        (uiNamespace getVariable "ace_common_ctrlProgressBar") progressSetPosition _progress / _progressComplete;
+        private _progressResult = ((_progress / _progressComplete)) min 1;
+        (uiNamespace getVariable "ace_common_ctrlProgressBar") progressSetPosition _progressResult;
     };
 }, 0, [_progressVar, _progressCompleteVar, _args, _onFinish, _onFail, _condition, _player, _building, _exceptions]] call CBA_fnc_addPerFrameHandler;