/** used to output notifications.cfg file */
void Dump_Notifications(int fh, bool alsoprint)
{
- #define NOTIF_WRITE(a) MACRO_BEGIN \
- fputs(fh, a); \
- if (alsoprint) LOG_INFO(a); \
- MACRO_END
+ #define NOTIF_WRITE(str) write_String_To_File(fh, str, alsoprint)
- #define NOTIF_WRITE_ENTITY(e, description) MACRO_BEGIN \
- string notif_msg = sprintf( \
+ #define NOTIF_WRITE_ENTITY(e, description) \
+ NOTIF_WRITE(sprintf( \
"seta notification_%s \"%d\" \"%s\"\n", \
Get_Notif_CvarName(e), e.nent_default, description \
- ); \
- NOTIF_WRITE(notif_msg); \
- MACRO_END
+ ))
- #define NOTIF_WRITE_ENTITY_CHOICE(e, descriptiona, descriptionb) MACRO_BEGIN \
- string notif_msg = sprintf( \
+ #define NOTIF_WRITE_ENTITY_CHOICE(e, descriptiona, descriptionb) \
+ NOTIF_WRITE(sprintf( \
"seta notification_%s \"%d\" \"%s\"\n" \
"seta notification_%s_ALLOWED \"%d\" \"%s\"\n", \
Get_Notif_CvarName(e), e.nent_default, descriptiona, \
Get_Notif_CvarName(e), e.nent_challow_def, descriptionb \
- ); \
- NOTIF_WRITE(notif_msg); \
- MACRO_END
-
- #define NOTIF_WRITE_HARDCODED(cvar, default, description) MACRO_BEGIN \
- string notif_msg = sprintf( \
- "seta notification_%s \"%s\" \"%s\"\n", \
- cvar, default, description \
- ); \
- NOTIF_WRITE(notif_msg); \
- MACRO_END
+ ))
+
+ #define NOTIF_WRITE_HARDCODED(cvar, default, description) \
+ NOTIF_WRITE("seta notification_" cvar " \"" default "\" \"" description "\"\n")
// Note: This warning only applies to the notifications.cfg file that is output...
// You ARE supposed to manually edit this function to add i.e. hard coded
// notification variables for mutators or game modes or such and then
// regenerate the notifications.cfg file from the new code.
- NOTIF_WRITE("// ********************************************** //\n");
- NOTIF_WRITE("// ** WARNING - DO NOT MANUALLY EDIT THIS FILE ** //\n");
- NOTIF_WRITE("// ** ** //\n");
- NOTIF_WRITE("// ** This file is automatically generated ** //\n");
- NOTIF_WRITE("// ** by code with the command 'dumpnotifs'. ** //\n");
- NOTIF_WRITE("// ** ** //\n");
- NOTIF_WRITE("// ** If you add a new notification, please ** //\n");
- NOTIF_WRITE("// ** regenerate this file with that command ** //\n");
- NOTIF_WRITE("// ** making sure that the output matches ** //\n");
- NOTIF_WRITE("// ** with the lists and defaults in code. ** //\n");
- NOTIF_WRITE("// ** ** //\n");
- NOTIF_WRITE("// ********************************************** //\n");
+ NOTIF_WRITE(
+ "// ********************************************** //\n"
+ "// ** WARNING - DO NOT MANUALLY EDIT THIS FILE ** //\n"
+ "// ** ** //\n"
+ "// ** This file is automatically generated ** //\n"
+ "// ** by code with the command 'dumpnotifs'. ** //\n"
+ "// ** ** //\n"
+ "// ** If you add a new notification, please ** //\n"
+ "// ** regenerate this file with that command ** //\n"
+ "// ** making sure that the output matches ** //\n"
+ "// ** with the lists and defaults in code. ** //\n"
+ "// ** ** //\n"
+ "// ********************************************** //\n");
// These notifications will also append their string as a comment...
// This is not necessary, and does not matter if they vary between config versions,