Closed BC46 closed 5 months ago
Ideally we want a full standalone solution, i.e. one that does not require existing DLLs to be recompiled. I came up with the following idea for a plugin:
std::list<Position>
.One downside to this approach is that it does not consider the fact that the weapon list group may be shifted to a different position (not the default one).
Found an easier solution that requires only the HudWeaponGroups module to be modified. Recompiling wasn't an option since the provided Delphi source code is incomplete. Hence I opted for directly implementing the solution in HudWeaponGroups.dll
using asm.
In the HDE installer we clearly specified that the weapon group buttons should only be enabled for 4:3 and 16:9 resolutions, since the plugin only uses hard coded positions.
However, recently I've gotten a few insights into how the positions can possibly be made dynamic. In the assembly I found out where the weapon group button positions in
HudWeaponGroups.dll
are used. From there we could patch some of the instructions and replace the positions with dynamic ones. These would have to come from the HUD Shift plugin, which will have to be modified in order for this to work.The installer code will also have to be modified if the dynamic positions can be set, since there will no longer be a need to check for the user's aspect ratio.
One small implication I noticed during my assembly peek is that
HudWeaponGroups.dll
uses twords to store the HUD positions. Therefore, the floating point values from HUD Shift would have to be converted to long doubles.If for whatever reason it isn't achievable to set the dynamic positions, we should instead opt for this: https://github.com/oliverpechey/Freelancer-hd-edition-install-script/issues/99.