ACE3/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf
Glowbal b489750d5b Minor optimizations using private, params, and isEqualType (#4323)
* Optimizations with private, params, and isEqualType

* Fixed tab being used instead of space

* Fixed tabs inserted by notepad++

* More usage of new private syntax and params

- changed a few checks for an array being empty to `_arr isEqualTo []`
rather than `count _arr == 0`
- added more uses of `private` on the same line as the variable is
declared
- added more uses of params to assign variables passed as parameters
- removed unnecessary parentheses
- removed several unnecessary variable declarations with private array
syntax

* clean up and formatting
2016-09-04 16:44:22 +02:00

46 lines
1.1 KiB
Plaintext

/*
* 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"
if !(ctrlVisible 9000) then {
false call FUNC(show_target_speed_assist);
true call FUNC(show_target_speed_assist_timer);
ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 9002);
[{
params ["_args"];
_args params ["_startTime"];
if (!(GVAR(speedAssistTimer))) exitWith {
GVAR(speedAssistTimer) = true;
ctrlSetText [8006, Str(Round((CBA_missionTime - _startTime) * 10) / 10)];
[] call FUNC(calculate_target_speed_assist);
false call FUNC(show_target_speed_assist_timer);
true call FUNC(show_target_speed_assist);
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
ctrlSetText [9001, Str(Round((CBA_missionTime - _startTime) * 10) / 10)];
}, 0.1, [CBA_missionTime]] call CBA_fnc_addPerFrameHandler;
};