2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-03-09 15:46:59 +00:00
|
|
|
/*
|
|
|
|
* Author: PabstMirror
|
2015-03-11 07:06:07 +00:00
|
|
|
* Handles clicking the setWP button from the waypoint application
|
2015-03-09 15:46:59 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2015-03-11 07:06:07 +00:00
|
|
|
* The "SetWP" button <CONTROL>
|
2015-03-09 15:46:59 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2015-08-26 03:31:33 +00:00
|
|
|
* None
|
2015-03-09 15:46:59 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2015-08-26 03:31:33 +00:00
|
|
|
* [1234] call ace_microdagr_fnc_appWaypointsButtonSetWP
|
2015-03-09 15:46:59 +00:00
|
|
|
*
|
2015-03-11 07:06:07 +00:00
|
|
|
* Public: No
|
2015-03-09 15:46:59 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
disableSerialization;
|
2015-08-26 03:31:33 +00:00
|
|
|
params ["_wpButton"];
|
2015-03-11 07:06:07 +00:00
|
|
|
|
2017-10-10 14:39:59 +00:00
|
|
|
private _wpListBox = (ctrlParent _wpButton) displayCtrl 144501;
|
|
|
|
private _newWpIndex = lbCurSel _wpListBox;
|
|
|
|
private _waypoints = [] call FUNC(deviceGetWaypoints);
|
2015-03-09 18:52:15 +00:00
|
|
|
|
|
|
|
if ((_newWpIndex < 0) || (_newWpIndex > ((count _waypoints) - 1))) exitWith {
|
2015-03-09 15:46:59 +00:00
|
|
|
GVAR(currentWaypoint) = -1;
|
|
|
|
};
|
|
|
|
|
|
|
|
GVAR(currentWaypoint) = _newWpIndex;
|
|
|
|
[APP_MODE_COMPASS] call FUNC(saveCurrentAndSetNewMode);
|