ACE3/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf
Dedmen Miller 81e02a7336 Refactor private ARRAY to private keyword (#5598)
* Everything

* Fixed missing ;

* Fix missing ; and double private

* Fixed cannot isNull on number

* Turn _temparture back to isNil

* Fix error from merge
2017-10-10 09:39:59 -05:00

31 lines
711 B
Plaintext

/*
* Author: PabstMirror
* Handles clicking the setWP button from the waypoint application
*
* Arguments:
* The "SetWP" button <CONTROL>
*
* Return Value:
* None
*
* Example:
* [1234] call ace_microdagr_fnc_appWaypointsButtonSetWP
*
* Public: No
*/
#include "script_component.hpp"
disableSerialization;
params ["_wpButton"];
private _wpListBox = (ctrlParent _wpButton) displayCtrl 144501;
private _newWpIndex = lbCurSel _wpListBox;
private _waypoints = [] call FUNC(deviceGetWaypoints);
if ((_newWpIndex < 0) || (_newWpIndex > ((count _waypoints) - 1))) exitWith {
GVAR(currentWaypoint) = -1;
};
GVAR(currentWaypoint) = _newWpIndex;
[APP_MODE_COMPASS] call FUNC(saveCurrentAndSetNewMode);