FromDarkHell / BL3DX11Injection

A quick/simple way of having plugins get loaded into Borderlands 3.
MIT License
36 stars 4 forks source link

Add plugin path as dll directory #9

Closed apple1417 closed 1 year ago

apple1417 commented 1 year ago

This allows multiple plugins to link against each other, while all being placed in the plugins folder.

If libA.dll provides a bunch of base functionality, and modX.dll links against it, with the current system you'd either to specifically link against Plugins/libA.dll, or to lay out files as follows:

Borderlands3.exe
d3d11.dll
libA.dll
Plugins
└ modX.dll

However with this layout, if you want to run libA.dll by itself, it'll never be loaded - it would have to be placed in plugins instead. Installing modX.dll would mean you need to move it.

Additionally there's also the problem of what if modY.dll chooses the opposite setup, so you need libA.dll in both places?

With this patch, linking against just libA.dll will check both locations, so we can just tell users to always place all files in the plugins folder.