ACE3/addons/microdagr/functions/fnc_appWaypointsButtonDeleteWP.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

32 lines
824 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: PabstMirror
* Handles clicking the delete button from the waypoint application
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call ace_microdagr_fnc_appWaypointsButtonDeleteWP
*
* Public: No
*/
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);