Readd Deploy to Inventory Cargo UI

This commit is contained in:
jokoho482 2024-04-21 01:22:15 +02:00
parent b49960d058
commit 15b01acd72
2 changed files with 19 additions and 4 deletions

View File

@ -87,7 +87,7 @@ GVAR(interactionParadrop) = _container isKindOf "Air" && {
uiNamespace setVariable [QGVAR(CargoListBox), _list]; uiNamespace setVariable [QGVAR(CargoListBox), _list];
private _unloadBtn = _display ctrlCreate ["RscButton", -1, _group]; private _unloadBtn = _display ctrlCreate ["RscButton", -1, _group];
_unloadBtn ctrlSetPosition [0.5 * _gX, 20 * _gY, 5.5 * _gX, 1 * _gY]; _unloadBtn ctrlSetPosition [0.5 * _gX, 20 * _gY, 5.25 * _gX, 1 * _gY];
_unloadBtn ctrlSetText localize ([LSTRING(unloadObject), LSTRING(paradropButton)] select GVAR(interactionParadrop)); _unloadBtn ctrlSetText localize ([LSTRING(unloadObject), LSTRING(paradropButton)] select GVAR(interactionParadrop));
_unloadBtn ctrlAddEventHandler ["ButtonClick", { _unloadBtn ctrlAddEventHandler ["ButtonClick", {
private _index = lbCurSel (uiNamespace getVariable QGVAR(CargoListBox)); private _index = lbCurSel (uiNamespace getVariable QGVAR(CargoListBox));
@ -97,6 +97,20 @@ GVAR(interactionParadrop) = _container isKindOf "Air" && {
}]; }];
_unloadBtn ctrlCommit 0; _unloadBtn ctrlCommit 0;
if ((GVAR(enableDeploy) && !GVAR(interactionParadrop) && {isNull curatorCamera})) then {
private _depolyBtn = _display ctrlCreate ["RscButton", -1, _group];
_depolyBtn ctrlSetPosition [6.25 * _gX, 20 * _gY, 5.25 * _gX, 1 * _gY];
_depolyBtn ctrlSetText localize LSTRING(deployObject);
_depolyBtn ctrlAddEventHandler ["ButtonClick", {
private _index = lbCurSel (uiNamespace getVariable QGVAR(CargoListBox));
if (_index == -1) exitWith {};
closeDialog 602;
[ACE_Player, _index] call FUNC(startDeploy);
}];
_depolyBtn ctrlCommit 0;
};
private _loadBarFrame = _display ctrlCreate ["RscFrame", -1, _group]; private _loadBarFrame = _display ctrlCreate ["RscFrame", -1, _group];
_loadBarFrame ctrlSetPosition [0.5 * _gX, 21.5 * _gY, 11 * _gX, 0.5 * _gY]; _loadBarFrame ctrlSetPosition [0.5 * _gX, 21.5 * _gY, 11 * _gX, 0.5 * _gY];
_loadBarFrame ctrlSetTextColor [0.9, 0.9, 0.9, 0.5]; _loadBarFrame ctrlSetTextColor [0.9, 0.9, 0.9, 0.5];

View File

@ -5,12 +5,13 @@
* *
* Arguments: * Arguments:
* 0: Unit deploying <OBJECT> * 0: Unit deploying <OBJECT>
* 1: Index of Unloading Item <NUMBER> (default: -1)
* *
* Return Value: * Return Value:
* None * None
* *
* Example: * Example:
* player call ace_cargo_fnc_startDeploy * [player, 1] call ace_cargo_fnc_startDeploy
* *
* Public: No * Public: No
*/ */
@ -18,13 +19,13 @@
// Deny creating preview item as it will destroy player vehicle instantly by collision // Deny creating preview item as it will destroy player vehicle instantly by collision
if (GVAR(interactionParadrop)) exitWith {}; if (GVAR(interactionParadrop)) exitWith {};
params ["_unit"]; params [["_unit", objNull, [objNull]], ["_selected", -1, [0]]];
// Don't allow deploying if already deploying // Don't allow deploying if already deploying
if (_unit getVariable [QGVAR(isDeploying), false]) exitWith {}; if (_unit getVariable [QGVAR(isDeploying), false]) exitWith {};
// This can be an object or a classname string // This can be an object or a classname string
private _item = call FUNC(getSelectedItem); private _item = _selected call FUNC(getSelectedItem);
if (isNil "_item") exitWith {}; if (isNil "_item") exitWith {};