2015-08-10 21:07:47 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
2015-08-16 20:41:35 +00:00
|
|
|
* Handle the UI data display.
|
2015-08-10 21:07:47 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2015-08-16 20:41:35 +00:00
|
|
|
* 0: Display <DISPLAY>
|
2015-08-10 21:07:47 +00:00
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* None
|
|
|
|
*
|
2015-08-16 20:41:35 +00:00
|
|
|
* Example:
|
|
|
|
* [display] call ace_cargo_fnc_onMenuOpen
|
|
|
|
*
|
2015-08-10 21:07:47 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
disableSerialization;
|
|
|
|
|
2015-08-16 20:41:35 +00:00
|
|
|
params ["_display"];
|
|
|
|
|
|
|
|
uiNamespace setVariable [QGVAR(menuDisplay), _display];
|
2015-08-10 21:07:47 +00:00
|
|
|
|
|
|
|
[{
|
|
|
|
private ["_display","_loaded", "_ctrl", "_label"];
|
|
|
|
disableSerialization;
|
2015-08-16 20:41:35 +00:00
|
|
|
_display = uiNamespace getVariable QGVAR(menuDisplay);
|
|
|
|
if (isnil "_display") exitWith {
|
2015-08-10 21:07:47 +00:00
|
|
|
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
|
|
|
};
|
|
|
|
|
2015-08-16 20:41:35 +00:00
|
|
|
if (isNull GVAR(interactionVehicle) || ACE_player distance GVAR(interactionVehicle) >= 10) exitWith {
|
2015-08-10 21:07:47 +00:00
|
|
|
closeDialog 0;
|
|
|
|
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
|
|
|
};
|
|
|
|
|
2015-08-16 20:41:35 +00:00
|
|
|
_loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []];
|
2015-08-10 21:07:47 +00:00
|
|
|
_ctrl = _display displayCtrl 100;
|
|
|
|
_label = _display displayCtrl 2;
|
|
|
|
|
|
|
|
lbClear _ctrl;
|
|
|
|
{
|
|
|
|
_ctrl lbAdd (getText(configfile >> "CfgVehicles" >> typeOf _x >> "displayName"));
|
2015-08-14 16:07:31 +00:00
|
|
|
true
|
|
|
|
} count _loaded;
|
2015-08-10 21:07:47 +00:00
|
|
|
|
2015-08-14 20:46:51 +00:00
|
|
|
_label ctrlSetText format[localize LSTRING(labelSpace), [GVAR(interactionVehicle)] call DFUNC(getCargoSpaceLeft)];
|
2015-08-10 21:07:47 +00:00
|
|
|
}, 0, []] call CBA_fnc_addPerFrameHandler;
|