ACE3/addons/cargo/XEH_preStart.sqf
johnb432 d1f0dc5e83
Cargo - Improve various aspects (#9617)
* Update CfgVehicles.hpp

* Cargo cleanup

* Update menu.hpp

* Updated status effect key

* Update fnc_onMenuOpen.sqf

* Update fnc_onMenuOpen.sqf

* fix comment from merge

* nil interaction GVARs on menu close

* fix carry bug

* Fix floating objects in MP

* Updated ace_cargoAdded doc

* Fix progress bar prematurely stopping

* Finer cursor object selection

---------

Co-authored-by: LinkIsGrim <salluci.lovi@gmail.com>
2023-11-17 20:07:28 -03:00

51 lines
1.9 KiB
Plaintext

#include "script_component.hpp"
#include "XEH_PREP.hpp"
// See XEH_postInit.sqf
private _vehicleClasses_addClassEH = ["ThingX", "LandVehicle", "Air", "Ship_F"];
private _objectClasses_addClassEH = ["ThingX", "StaticWeapon"];
private _vehicleClasses_addAction = [];
private _itemClasses_addAction = [];
private _class = "";
// Find all remaining configured classes and init them
{
_class = configName _x;
// Init vehicle
if (
getNumber (_x >> QGVAR(hasCargo)) == 1 &&
{_vehicleClasses_addClassEH findIf {_class isKindOf _x} == -1}
) then {
if (_class isKindOf "Static") then {
if (getNumber (_x >> "scope") == 2) then {
_vehicleClasses_addAction pushBackUnique _class;
};
} else {
_vehicleClasses_addClassEH pushBackUnique _class;
};
};
// Init object
if (
getNumber (_x >> QGVAR(canLoad)) == 1 &&
{_objectClasses_addClassEH findIf {_class isKindOf _x} == -1}
) then {
if (_class isKindOf "Static") then {
if (getNumber (_x >> "scope") == 2) then {
_itemClasses_addAction pushBackUnique _class;
};
} else {
_objectClasses_addClassEH pushBackUnique _class;
};
};
} forEach ("true" configClasses (configFile >> "CfgVehicles"));
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);