Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activate all addons #1081

Merged
merged 1 commit into from
Feb 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the actual problem. We could still keep filtering out CfgAddons.

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];