ACE3/addons/parachute/functions/fnc_handleInfoDisplayChanged.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

38 lines
942 B
Plaintext

/*
* Author: commy2
* Hides the height and velocity display while freefalling or parachuting on higher difficulties.
*
* Arguments:
* Stuff from infoDisplayChanged eventhandler.
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
params ["_dialog", "_type"];
// don't do anything in noob mode
if (cadetMode) exitWith {};
switch (_type) do {
case ("Parachute"): {
{
(_dialog displayCtrl _x) ctrlShow false;
} forEach [121, 122, 1004, 1005, 1006, 1014];
};
case ("Soldier"): {
{
private _control = (_dialog displayCtrl _x);
// these reset ctrlShow every frame by the engine. Set height/width to 0 as work around.
_control ctrlSetPosition [0,0,0,0];
_control ctrlCommit 0;
} forEach [380, 382];
};
};
nil // switch might return true if no case was found. Just to make sure the return value matches