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

CfgPatches sorting #923

Merged
merged 1 commit into from
Jun 6, 2018
Merged

CfgPatches sorting #923

merged 1 commit into from
Jun 6, 2018

Conversation

commy2
Copy link
Contributor

@commy2 commy2 commented May 13, 2018

This is inspired by A3_Data_F_XXX_Loadorder and restores what cba_main(_a3) once did.

In vanilla every bigger update X (e.g. Orange, Tanks) works like this:

A3_Data_F_X
    requiredAddons: A3_Data_F_(X-1)_Loadorder

A3_feature1_F_X
    requiredAddons: A3_Data_F_X
A3_feature2_F_X
    requiredAddons: A3_Data_F_X
A3_feature3_F_X
    requiredAddons: A3_Data_F_X

A3_Data_F_X_Loadorder
    requiredAddons: A3_feature1_F_X + A3_feature2_F_X + A3_feature3_F_X

Where (X-1) is the last big update before X.

This ensures that the config patches of big updates are loaded in chunks (everything update 1 first, then everything update 2, etc.), which makes the master config predictable and setting up requiredAddons easier.
It is similar of how CBA is supposed to work (we did it first!), but our A3_Data_F_X is named cba_common and our A3_Data_F_X_Loadorder cba_main.
Problem is that over the years this wasn't maintained properly (partly due to _Loadorder not being a thing for years), so many cba patches use vanilla game patches as required addons instead of just cba_common, cba_main not properly waiting for every cba patch, and some weird almost circular dependencies.

With this pull request cba_common now requires the latest big update of Arma 3 (A3_Data_F_Tanks_Loadorder) and cba_main/cba_main_a3 waits for every config patch from cba (bar optionals but w/e).
I also put every config patch into one config.cpp file, and some of these inside sub-folders of the PBO folders. I think this is cleaner, but if someone has a problem with that I can revert it for this pull request.

Note that ace_main works differently than cba_main.
ace_main is responsible for waiting for every base game patch and then ace_common requires ace_main. Which makes ace_main kind of redundant in this regard but w/e.
ace_main is always the first config loaded of the mod instead of the last.
An addon like A3_Data_F_X_Loadorder doesn't make much sense for x = ACE, because of the modular nature of ACE3.

Every addon X relying on CBA can now just safely use cba_main (or cba_main_a3) as requiredAddon in their x_common equivalent.
The names cba_common and cba_main are not very descriptive, which is regretable and something I'll hopefully fix for A4 (bwc)!

'

A list of all config patches created by cba can be generated by using:

private _cbaFolderName = configSourceMod (configFile/"CfgPatches"/"cba_main");
"true" configClasses configFile/"CfgPatches" select {configSourceMod _x isEqualTo _cbaFolderName} apply {toLower configName _x}

assuming that the addons folder is placed inside a folder named "cba".

After this PR, the addons are loaded in this order:

cba_common, cba_events, cba_hashes, cba_jr_prep, cba_keybinding,
cba_modules, cba_music, cba_network, cba_settings, cba_statemachine,
cba_strings, cba_vectors, cba_xeh, CBA_Extended_EventHandlers, cba_ee,
Extended_EventHandlers, cba_xeh_a3, cba_accessory, MRT_AccFncs, cba_ai,
cba_arrays, cba_diagnostic, cba_help, cba_jr, asdg_jointmuzzles,
asdg_jointrails, cba_ui, cba_ui_helper, cba_versioning, cba_main,
cba_main_a3

@commy2 commy2 modified the milestones: 3.7.1, 3.8 May 13, 2018
@Killswitch00 Killswitch00 merged commit 35fa884 into master Jun 6, 2018
@commy2 commy2 deleted the cba_loadorder branch June 6, 2018 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants