Remove some parts of Old the Cargo UI Interaction

This commit is contained in:
jokoho482 2024-04-21 11:14:13 +02:00
parent 74d31e3ba7
commit 1b420cf66c
3 changed files with 1 additions and 57 deletions

View File

@ -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)};

View File

@ -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);

View File

@ -85,58 +85,4 @@ if (!_hasInventory) then {
ACE_Player action ["Gear", objNull];
}, 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);
};
};
};