mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
34 lines
770 B
Plaintext
34 lines
770 B
Plaintext
/*
|
|
* Author: PabstMirror
|
|
* Handles clicking the setWP button from the waypoint application
|
|
*
|
|
* Arguments:
|
|
* The "SetWP" button <CONTROL>
|
|
*
|
|
* Return Value:
|
|
* Nothing
|
|
*
|
|
* Example:
|
|
* [] call ace_microdagr_fnc_appWaypointsButtonSetWP
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
private ["_wpListBox", "_newWpIndex", "_waypoints"];
|
|
|
|
disableSerialization;
|
|
PARAMS_1(_wpButton);
|
|
|
|
_wpListBox = (ctrlParent _wpButton) displayCtrl 144501;
|
|
_newWpIndex = lbCurSel _wpListBox;
|
|
_waypoints = [] call FUNC(deviceGetWaypoints);
|
|
|
|
if ((_newWpIndex < 0) || (_newWpIndex > ((count _waypoints) - 1))) exitWith {
|
|
GVAR(currentWaypoint) = -1;
|
|
ERROR("out of bounds wp");
|
|
};
|
|
|
|
GVAR(currentWaypoint) = _newWpIndex;
|
|
[APP_MODE_COMPASS] call FUNC(saveCurrentAndSetNewMode);
|