From 1b420cf66cf2397818504b66f4a12cc462e550fa Mon Sep 17 00:00:00 2001 From: jokoho482 Date: Sun, 21 Apr 2024 11:14:13 +0200 Subject: [PATCH] Remove some parts of Old the Cargo UI Interaction --- addons/cargo/XEH_preInit.sqf | 1 - addons/cargo/XEH_preStart.sqf | 1 - addons/cargo/functions/fnc_initVehicle.sqf | 56 +--------------------- 3 files changed, 1 insertion(+), 57 deletions(-) diff --git a/addons/cargo/XEH_preInit.sqf b/addons/cargo/XEH_preInit.sqf index 35f2d78e45..6a11ee85ef 100644 --- a/addons/cargo/XEH_preInit.sqf +++ b/addons/cargo/XEH_preInit.sqf @@ -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)}; diff --git a/addons/cargo/XEH_preStart.sqf b/addons/cargo/XEH_preStart.sqf index e5ef507556..6ebb98fd2f 100644 --- a/addons/cargo/XEH_preStart.sqf +++ b/addons/cargo/XEH_preStart.sqf @@ -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); diff --git a/addons/cargo/functions/fnc_initVehicle.sqf b/addons/cargo/functions/fnc_initVehicle.sqf index b85a634d79..a13903a5a1 100644 --- a/addons/cargo/functions/fnc_initVehicle.sqf +++ b/addons/cargo/functions/fnc_initVehicle.sqf @@ -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); - }; -}; +}; \ No newline at end of file