Basically (for certain definitions of 'basic'), the patching (on PBash, I don't really understand how it works for CBash) works like this:
- The user clicks
Build Patch PatchDialog.PatchExecuteis called. This is the central method.- It calls
init_patchers_data, which callsinitDataon each patcher. - Now it differs from patcher to patcher. Some use
initDatato read a lot of mod file to gether information, some don't use it at all (because they don't need it). - Next,
PatchExecutecallsinitFactories. This asks every patcher, 'hey, which record types do you actually need to read and write?' - Every patcher answers, and we make a union of the results.
- Next,
PatchExecutecallsscanLoadMods. This loads every file in the load order, skipping all record types that no patcher wanted. Most patchers stick every record they could potentially patch into the BP at this point (you'll see why later). - This is where the BP merges mods, resolves aliases, applies
FilterandIIMtags, etc.