From 40d419e47573a7aacad913a95470772bb2dfa76e Mon Sep 17 00:00:00 2001 From: icomrade Date: Fri, 23 Sep 2016 19:10:39 -0400 Subject: [PATCH] Re-add abort timeout Timeout is no longer restarted when you click abort and the loop now closes the gear menu so the player cannot attempt to dupe with the gear menu and abort menu open at the same time. --- SQF/dayz_code/compile/player_onPause.sqf | 15 ++++++++++++++- SQF/dayz_code/init/variables.sqf | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/SQF/dayz_code/compile/player_onPause.sqf b/SQF/dayz_code/compile/player_onPause.sqf index 39b5f5a9d..d19c00a3e 100644 --- a/SQF/dayz_code/compile/player_onPause.sqf +++ b/SQF/dayz_code/compile/player_onPause.sqf @@ -47,12 +47,25 @@ while {(!isNull _display) && !r_player_dead} do { [localize "str_epoch_player_12",1] call dayz_rollingMessages; }; default { - waitUntil {_btnAbort ctrlSetText format["%1%2%3%4",_btnAbortText," (", str(10 - ((diag_tickTime - _testTime))), ")"]; uiSleep 0.1; ((diag_tickTime - _testTime) >= 10);}; + _gearDisplay = findDisplay 106; + if (!isNull _gearDisplay) then { + _gearDisplay closeDisplay 0; + }; + if (!TimeOutDisplayed) then { + waitUntil {_btnAbort ctrlSetText format["%1%2%3%4",_btnAbortText," (", str(ceil (((_testTime + 10) - diag_tickTime)*10)/10), ")"]; uiSleep 0.1; ((diag_tickTime - _testTime) >= 10);}; + if (!isNull _display) then { + TimeOutDisplayed = true; + }; + }; _btnAbort ctrlEnable true; _btnAbort ctrlSetText _btnAbortText; }; }; + if (!isNull _display) then { //this prevents the timeout from being skipped if the menu is quickly re-opened + TimeOutDisplayed = false; + }; uiSleep 1; }; +TimeOutDisplayed = false; if (r_player_dead) exitWith {_btnAbort ctrlEnable true;}; \ No newline at end of file diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index ac901f4da..2bb6f3d47 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -555,6 +555,7 @@ if (isNil "DZE_selfTransfuse_Values") then {DZE_selfTransfuse_Values = [12000,15 if (isNil "DZE_PlotPole") then {DZE_PlotPole = [30,45];}; DZE_maintainRange = ((DZE_PlotPole select 0)+20); if (isNil "DZE_slowZombies") then {DZE_slowZombies = false;}; +TimeOutDisplayed = false; if (isServer) then { dead_bodyCleanup = [];