2015-05-01 17:37:17 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-02-22 14:20:36 +00:00
|
|
|
#include "XEH_PREP.hpp"
|
2019-02-17 17:41:05 +00:00
|
|
|
|
2023-11-17 23:07:28 +00:00
|
|
|
// See XEH_postInit.sqf
|
2019-02-17 17:41:05 +00:00
|
|
|
private _vehicleClasses_addClassEH = ["ThingX", "LandVehicle", "Air", "Ship_F"];
|
|
|
|
private _objectClasses_addClassEH = ["ThingX", "StaticWeapon"];
|
|
|
|
private _vehicleClasses_addAction = [];
|
|
|
|
private _itemClasses_addAction = [];
|
2023-11-17 23:07:28 +00:00
|
|
|
private _class = "";
|
2019-02-17 17:41:05 +00:00
|
|
|
|
2023-11-17 23:07:28 +00:00
|
|
|
// Find all remaining configured classes and init them
|
2019-02-17 17:41:05 +00:00
|
|
|
{
|
2023-11-17 23:07:28 +00:00
|
|
|
_class = configName _x;
|
|
|
|
|
|
|
|
// Init vehicle
|
2019-02-17 17:41:05 +00:00
|
|
|
if (
|
2023-11-17 23:07:28 +00:00
|
|
|
getNumber (_x >> QGVAR(hasCargo)) == 1 &&
|
|
|
|
{_vehicleClasses_addClassEH findIf {_class isKindOf _x} == -1}
|
2019-02-17 17:41:05 +00:00
|
|
|
) then {
|
|
|
|
if (_class isKindOf "Static") then {
|
2023-11-17 23:07:28 +00:00
|
|
|
if (getNumber (_x >> "scope") == 2) then {
|
2019-02-17 17:41:05 +00:00
|
|
|
_vehicleClasses_addAction pushBackUnique _class;
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
_vehicleClasses_addClassEH pushBackUnique _class;
|
|
|
|
};
|
|
|
|
};
|
2023-11-17 23:07:28 +00:00
|
|
|
|
|
|
|
// Init object
|
2019-02-17 17:41:05 +00:00
|
|
|
if (
|
2023-11-17 23:07:28 +00:00
|
|
|
getNumber (_x >> QGVAR(canLoad)) == 1 &&
|
|
|
|
{_objectClasses_addClassEH findIf {_class isKindOf _x} == -1}
|
2019-02-17 17:41:05 +00:00
|
|
|
) then {
|
|
|
|
if (_class isKindOf "Static") then {
|
2023-11-17 23:07:28 +00:00
|
|
|
if (getNumber (_x >> "scope") == 2) then {
|
2019-02-17 17:41:05 +00:00
|
|
|
_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);
|