#include "..\..\script_macros.hpp"
/*
Author: Yuri Zoko
Discord: Yuri Zoko#9511
Terms of use:
- This file is forbidden unless you have permission from the author. If you have this file without permission to use it please do not use it and do not share it.
- If you have permission to use this file, you can use it on your server however it is strictly forbidden to share it.
- Out of respect for the author please do not delete this information.
*/
params [
["_unit",objNull,[objNull]]
];
disableSerialization;
//close the esc dialog
if (dialog) then {
closeDialog 0;
};
sleep 5;
if(!(player getVariable ["ACE_isUnconscious",false])) exitWith {};
createDialog "DeathScreen";
(findDisplay 7300) displaySetEventHandler ["KeyDown","if ((_this select 1) isEqualTo 1) then {true}"]; //Block the ESC menu
//Create a thread for something?
_unit spawn {
private ["_maxTime","_RespawnBtn","_Timer"];
disableSerialization;
_RespawnBtn = ((findDisplay 7300) displayCtrl 7302);
_Timer = ((findDisplay 7300) displayCtrl 7301);
if (LIFE_SETTINGS(getNumber,"respawn_timer") < 5) then {
_maxTime = time + 5;
} else {
_maxTime = time + LIFE_SETTINGS(getNumber,"respawn_timer");
};
_RespawnBtn ctrlEnable false;
waitUntil {
_Timer ctrlSetText format [localize "STR_Medic_Respawn",[(_maxTime - time),"MM:SS"] call BIS_fnc_secondsToString];
round(_maxTime - time) <= 0 || isNull _this
};
_RespawnBtn ctrlEnable true;
_Timer ctrlSetText localize "STR_Medic_Respawn_2";
};
_unit spawn {
disableSerialization;
private _requestBtn = ((findDisplay 7300) displayCtrl 7303);
_requestBtn ctrlEnable false;
private _requestTime = time + 5;
waitUntil {round(_requestTime - time) <= 0 || isNull _this};
_requestBtn ctrlEnable true;
};
[] spawn life_fnc_deathScreen;
//Create a thread to follow with some what precision view of the corpse.
life_save_gear = [player] call life_fnc_fetchDeadGear;