ACE3/addons/microdagr/functions/fnc_appWaypointsButtonDeleteWP.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

32 lines
821 B
Plaintext

/*
* Author: PabstMirror
* Handles clicking the delete button from the waypoint application
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call ace_microdagr_fnc_appWaypointsButtonDeleteWP
*
* Public: No
*/
#include "script_component.hpp"
disableSerialization;
private _display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
if (isNull _display) exitWith {ERROR("No Display");};
private _wpIndex = lbCurSel (_display displayCtrl IDC_MODEWAYPOINTS_LISTOFWAYPOINTS);
//If it's our currentWP then deactivate
if (GVAR(currentWaypoint) == _wpIndex) then {GVAR(currentWaypoint) = -1};
//Delete from list:
[_wpIndex] call FUNC(deviceDeleteWaypoint);
//Update list now:
[] call FUNC(updateDisplay);