From 514ac6765026ec1299590747f35dadd9b6d56803 Mon Sep 17 00:00:00 2001 From: icomrade Date: Sun, 25 Sep 2016 20:31:38 -0400 Subject: [PATCH] Better OnPause --- .../Configs/RscDisplay/RscPlayerUI.hpp | 2 +- SQF/dayz_code/compile/player_onPause.sqf | 26 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/SQF/dayz_code/Configs/RscDisplay/RscPlayerUI.hpp b/SQF/dayz_code/Configs/RscDisplay/RscPlayerUI.hpp index 2905f327a..28921a120 100644 --- a/SQF/dayz_code/Configs/RscDisplay/RscPlayerUI.hpp +++ b/SQF/dayz_code/Configs/RscDisplay/RscPlayerUI.hpp @@ -589,7 +589,7 @@ class RscTitles class RSC_DZ_Messages { idd = 4099999; movingEnable = 0; - fadein = 1; + fadein = 0; fadeout = 5; duration = 6; onLoad = "uinamespace setvariable ['DZ_Messages',_this select 0]"; diff --git a/SQF/dayz_code/compile/player_onPause.sqf b/SQF/dayz_code/compile/player_onPause.sqf index d19c00a3e..47aeb5282 100644 --- a/SQF/dayz_code/compile/player_onPause.sqf +++ b/SQF/dayz_code/compile/player_onPause.sqf @@ -26,11 +26,14 @@ while {(!isNull _display) && !r_player_dead} do { _inCombat = if (_timeout >= diag_tickTime) then {true} else {false}; _playerCheck = if ({isPlayer _x} count (player nearEntities ["AllVehicles",5]) > 1) then {true} else {false}; _zedCheck = if ((count (player nearEntities ["zZombie_Base",10]) > 0) && !_isPZombie) then {true} else {false}; - + _gearDisplay = findDisplay 106; + if (!isNull _gearDisplay) then { + _gearDisplay closeDisplay 0; + }; switch true do { case (_playerCheck) : { _btnAbort ctrlEnable false; - _btnAbort ctrlSetText format["%1 (in 30)", _btnAbortText]; + _btnAbort ctrlSetText format["%1 (in 10)", _btnAbortText]; [localize "str_abort_playerclose",1] call dayz_rollingMessages; }; case (_zedCheck) : { @@ -46,25 +49,22 @@ while {(!isNull _display) && !r_player_dead} do { _btnAbort ctrlEnable false; [localize "str_epoch_player_12",1] call dayz_rollingMessages; }; + case (((diag_tickTime - _testTime) < 10) && !TimeOutDisplayed) : { + _btnAbort ctrlEnable false; + _btnAbort ctrlSetText format["%1 (in %2)",_btnAbortText, str(ceil (((_testTime + 10) - diag_tickTime)*10)/10)]; + }; default { - _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; - }; + if (!TimeOutDisplayed && (!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 + if (isNull _display) then { //this prevents the timeout from being skipped if the menu is quickly re-opened TimeOutDisplayed = false; }; - uiSleep 1; + uiSleep 0.1; }; TimeOutDisplayed = false;