2015-08-10 21:07:47 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Start unload action
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-14 20:01:14 +00:00
|
|
|
private ["_display", "_loaded", "_ctrl", "_selected", "_item"];
|
2015-08-10 21:07:47 +00:00
|
|
|
disableSerialization;
|
|
|
|
_display = uiNamespace getvariable QGVAR(menuDisplay);
|
|
|
|
if (isnil "_display") exitwith {};
|
|
|
|
|
|
|
|
_loaded = GVAR(interactionVehicle) getvariable [QGVAR(loaded), []];
|
2015-08-14 20:01:14 +00:00
|
|
|
if (count _loaded == 0) exitwith {};
|
2015-08-10 21:07:47 +00:00
|
|
|
|
|
|
|
_ctrl = _display displayCtrl 100;
|
|
|
|
|
|
|
|
_selected = (lbCurSel _ctrl) max 0;
|
|
|
|
|
2015-08-14 20:01:14 +00:00
|
|
|
if (count _loaded <= _selected) exitwith {};
|
2015-08-10 21:07:47 +00:00
|
|
|
_item = _loaded select _selected;
|
|
|
|
|
|
|
|
[_item, GVAR(interactionVehicle)] call FUNC(unloadItem);
|