ACE3/addons/microdagr/functions/fnc_appWaypointsButtonDeleteWP.sqf

32 lines
821 B
Plaintext
Raw Normal View History

2015-03-09 15:46:59 +00:00
/*
* Author: PabstMirror
2015-03-11 07:06:07 +00:00
* Handles clicking the delete button from the waypoint application
2015-03-09 15:46:59 +00:00
*
* Arguments:
2015-08-26 03:31:33 +00:00
* None
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
* call ace_microdagr_fnc_appWaypointsButtonDeleteWP
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
*/
#include "script_component.hpp"
disableSerialization;
private _display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
2015-08-26 03:31:33 +00:00
2015-03-09 18:52:15 +00:00
if (isNull _display) exitWith {ERROR("No Display");};
2015-03-09 15:46:59 +00:00
private _wpIndex = lbCurSel (_display displayCtrl IDC_MODEWAYPOINTS_LISTOFWAYPOINTS);
2015-03-09 15:46:59 +00:00
//If it's our currentWP then deactivate
if (GVAR(currentWaypoint) == _wpIndex) then {GVAR(currentWaypoint) = -1};
//Delete from list:
2015-03-09 18:52:15 +00:00
[_wpIndex] call FUNC(deviceDeleteWaypoint);
2015-03-09 15:46:59 +00:00
//Update list now:
[] call FUNC(updateDisplay);