[ModApi] Move Usings Injection to After Custom Preprocessor Symbols

Aristeas shared this feedback 5 days ago
Not Enough Votes

In the current ModApi, custom preprocessor symbols are available and quite useful for some tasks (i.e. framework mods), like in the example below:


#define MAINMOD
// this can be removed much more easily than modifying the code directly

// ...

#if MAINMOD
Log.Info("I'm in the main mod!")
#else
Log.Info("I'm in a client mod!")
#endif


However, the current usings injection system places new usings at the very start of the file, causing a compilation error - preprocessor symbol definitions must be at the start of the file themselves. This is a minor issue, but it would still be very nice to have this tool available.

Leave a Comment
 
Attach a file