ACE3/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf

47 lines
1.2 KiB
Plaintext
Raw Normal View History

/*
* Author: Ruthberg
* Shows and starts the target speed assist timer
*
* Arguments:
* Nothing
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_fnc_target_speed_assist_timer
*
* Public: No
*/
#include "script_component.hpp"
2015-04-07 21:09:32 +00:00
if !(ctrlVisible 9000) then {
2015-04-11 12:51:40 +00:00
false call FUNC(show_target_speed_assist);
true call FUNC(show_target_speed_assist_timer);
2015-04-07 21:09:32 +00:00
2015-04-16 17:52:20 +00:00
ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 9002);
[{
private ["_args", "_startTime"];
_args = _this select 0;
_startTime = _args select 0;
if (!(GVAR(speedAssistTimer))) exitWith {
GVAR(speedAssistTimer) = true;
ctrlSetText [8006, Str(Round((ACE_time - _startTime) * 10) / 10)];
[] call FUNC(calculate_target_speed_assist);
2015-04-11 12:51:40 +00:00
false call FUNC(show_target_speed_assist_timer);
true call FUNC(show_target_speed_assist);
2015-11-30 15:45:20 +00:00
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
ctrlSetText [9001, Str(Round((ACE_time - _startTime) * 10) / 10)];
}, 0.1, [ACE_time]] call CBA_fnc_addPerFrameHandler;
};