Skip to content

Commit

Permalink
Activate all addons (#1081)
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror authored and commy2 committed Feb 28, 2019
1 parent 47002bc commit bd585de
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
2 changes: 1 addition & 1 deletion addons/common/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ call COMPILE_FILE(init_perFrameHandler);
call COMPILE_FILE(init_delayLess);

// Due to activateAddons being overwritten by eachother (only the last executed command will be active), we apply this bandaid
activateAddons call (uiNamespace getVariable [QGVAR(unitAddons), {[]}]);
GVAR(addons) = call (uiNamespace getVariable [QGVAR(addons), {[]}]);
activateAddons GVAR(addons);

// BWC
#include "backwards_comp.sqf"
Expand Down
17 changes: 0 additions & 17 deletions addons/common/XEH_preStart.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,4 @@
//See usage in XEH_preInit
private _cfgPatches = configFile >> "CfgPatches";
private _allComponents = "true" configClasses _cfgPatches apply {configName _x};

//Filter out addons that don't have any units defined as we don't need to activate these
private _unitAddons = _allComponents select {
!(getArray (_cfgPatches >> _x >> "units") isEqualTo [])
};

//Filter out addons defined in CfgAddons as they are always activated
private _allAddons = "true" configClasses (configFile >> "CfgAddons");
private _preloadedAddons = [];

{
_preloadedAddons append (getArray (_x >> "list") apply {configName (_cfgPatches >> _x)});
} forEach _allAddons;

_unitAddons = _unitAddons - _preloadedAddons;

uiNamespace setVariable [QGVAR(addons), compileFinal str _allComponents];
uiNamespace setVariable [QGVAR(unitAddons), compileFinal str _unitAddons];

0 comments on commit bd585de

Please sign in to comment.