mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Remove some parts of Old the Cargo UI Interaction
This commit is contained in:
parent
74d31e3ba7
commit
1b420cf66c
@ -9,7 +9,6 @@ PREP_RECOMPILE_END;
|
||||
#include "initSettings.inc.sqf"
|
||||
|
||||
GVAR(initializedItemClasses) = [];
|
||||
GVAR(initializedVehicleClasses) = [];
|
||||
GVAR(cargoHolderTypes) = ["Car", "Air", "Tank", "Ship", "Cargo_base_F", "Land_PaperBox_closed_F"] apply {_x call EFUNC(common,getConfigName)}; // make sure they are config case
|
||||
GVAR(disableParadropEffectsClasstypes) = ["Car_F"] apply {_x call EFUNC(common,getConfigName)};
|
||||
|
||||
|
@ -44,7 +44,6 @@ private _class = "";
|
||||
|
||||
uiNamespace setVariable [QGVAR(vehicleClasses_classEH), compileFinal str _vehicleClasses_addClassEH];
|
||||
uiNamespace setVariable [QGVAR(objectClasses_classEH), compileFinal str _objectClasses_addClassEH];
|
||||
uiNamespace setVariable [QGVAR(initializedVehicleClasses), compileFinal str _vehicleClasses_addAction];
|
||||
uiNamespace setVariable [QGVAR(initializedItemClasses), compileFinal str _itemClasses_addAction];
|
||||
|
||||
TRACE_4("compiled",count _vehicleClasses_addClassEH,count _objectClasses_addClassEH,count _vehicleClasses_addAction,count _itemClasses_addAction);
|
||||
|
@ -86,57 +86,3 @@ if (!_hasInventory) then {
|
||||
}, nil, 5.1, _showWindow, _hideOnUse, _shortcut, "!(lockedInventory _target)"];
|
||||
_vehicle setUserActionText [_id, _title, _textDefault];
|
||||
};
|
||||
|
||||
// Unnecessary to add actions to a vehicle class that's already got them
|
||||
if (_type in GVAR(initializedVehicleClasses)) exitWith {};
|
||||
if (_vehicle getVariable [QGVAR(initVehicle),false]) exitWith {};
|
||||
|
||||
// Vehicles given cargo via eden have their actions added to the object
|
||||
// So this function may run for multiple of the same class in that case
|
||||
if (_hasCargoConfig) then {
|
||||
GVAR(initializedVehicleClasses) pushBack _type;
|
||||
|
||||
TRACE_1("Adding unload cargo action to class",_type);
|
||||
|
||||
[_type, 0, ["ACE_MainActions"], GVAR(vehicleAction)] call EFUNC(interact_menu,addActionToClass);
|
||||
} else {
|
||||
_vehicle setVariable [QGVAR(initVehicle), true];
|
||||
|
||||
TRACE_1("Adding unload cargo action to object",_vehicle);
|
||||
|
||||
[_vehicle, 0, ["ACE_MainActions"], GVAR(vehicleAction)] call EFUNC(interact_menu,addActionToObject);
|
||||
};
|
||||
|
||||
// Add the paradrop self interaction for planes and helicopters
|
||||
if (_vehicle isKindOf "Air") then {
|
||||
private _condition = {
|
||||
//IGNORE_PRIVATE_WARNING ["_target", "_player"];
|
||||
GVAR(enable) &&
|
||||
{[_player, _target, []] call EFUNC(common,canInteractWith)} && {
|
||||
private _turretPath = _target unitTurret _player;
|
||||
|
||||
(_player == currentPilot _target) || // Pilot/Co-pilot
|
||||
{(getNumber ([_target, _turretPath] call CBA_fnc_getTurret >> "isCopilot")) == 1} || // Co-pilot
|
||||
{_turretPath in (getArray (configOf _target >> QGVAR(loadmasterTurrets)))}
|
||||
}
|
||||
};
|
||||
|
||||
private _statement = {
|
||||
//IGNORE_PRIVATE_WARNING ["_target", "_player"];
|
||||
GVAR(interactionVehicle) = _target;
|
||||
GVAR(interactionParadrop) = true;
|
||||
ACE_Player action ["Gear", _target];
|
||||
};
|
||||
|
||||
private _text = LLSTRING(openMenu);
|
||||
private _icon = "";
|
||||
|
||||
private _action = [QGVAR(openMenu), _text, _icon, _statement, _condition] call EFUNC(interact_menu,createAction);
|
||||
|
||||
// Self action on the vehicle
|
||||
if (_hasCargoConfig) then {
|
||||
[_type, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToClass);
|
||||
} else {
|
||||
[_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject);
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user