andrewgu / ModConfigMenu

XCOM 2 Mod Config Menu: a project to build a shared settings menu for Xcom 2 mods.
11 stars 13 forks source link

Don't have clients hard-code the ModConfigMenu version #7

Closed BlueRaja closed 8 years ago

BlueRaja commented 8 years ago

Currently the example code has

APIInst.RegisterClientMod(0, 1, ClientModCallback);

where the first two parameters are the version of ModConfigMenu. This is sure to lead to all sorts of trouble when people forget to update it, copy+paste code from other mods, etc.

Instead the value should be included in one of those files that they're forced to copy into their mod but not allowed to touch.

andrewgu commented 8 years ago

Just clarified with BlueRaja. Rather than have the developer of the client mod manually enter those numbers, we can define preprocessor macros in the API files. Since those macros are substituted at compile-time, this should allow us to keep the versioning system without requiring users to hard-code anything.

BlueRaja commented 8 years ago

:+1:

Superd22 commented 8 years ago

:+1:

andrewgu commented 8 years ago

This is done, implemented as a macro. You can see an example of its usage in MCM_TestHarness.uc.