- #define NOTIF_WRITE(type,name,text) { \
- ++##type##_NOTIFS; \
- notif_msg = sprintf("seta %s 1 // %s - %s\n", #name, #type, strreplace("\n", "\\n", text)); \
- fputs(fh, notif_msg); \
- if(alsoprint) { print(strreplace("^", "^^", notif_msg)); } }
-
- #define MSG_INFO_NOTIF(name,strnum,flnum,args,hudargs,icon,normal,gentle) NOTIF_WRITE(MSG_INFO, name, normal)
- MSG_INFO_NOTIFICATIONS
- #undef MSG_INFO_NOTIF
-
- #define MSG_CENTER_NOTIF(name,strnum,flnum,args,cpid,durcnt,normal,gentle) NOTIF_WRITE(MSG_CENTER, name, normal)
- MSG_CENTER_NOTIFICATIONS
- #undef MSG_CENTER_NOTIF
-
- #define MSG_WEAPON_NOTIF(name,infoname,centername) NOTIF_WRITE(MSG_WEAPON, name, \
- sprintf("infoname: %s, centername: %s", VAR_TO_TEXT(infoname), VAR_TO_TEXT(centername)))
- MSG_WEAPON_NOTIFICATIONS
- #undef MSG_WEAPON_NOTIF
-
- #define MSG_DEATH_NOTIF(name,infoname,centername) NOTIF_WRITE(MSG_DEATH, name, \
- sprintf("infoname: %s, centername: %s", VAR_TO_TEXT(infoname), VAR_TO_TEXT(centername)))
- MSG_DEATH_NOTIFICATIONS
- #undef MSG_DEATH_NOTIF
-
- print(sprintf("Notification counts: MSG_INFO = %d, MSG_CENTER = %d, MSG_WEAPON = %d, MSG_DEATH = %d\n",
- MSG_INFO_NOTIFS, MSG_CENTER_NOTIFS, MSG_WEAPON_NOTIFS, MSG_DEATH_NOTIFS));
+ // 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");
+
+ // These notifications will also append their string as a comment...
+ // This is not necessary, and does not matter if they vary between config versions,
+ // it is just a semi-helpful tool for those who want to manually change their user settings.
+
+ NOTIF_WRITE(sprintf("\n// MSG_INFO notifications (count = %d):\n", NOTIF_INFO_COUNT));
+ for(i = 1; i <= NOTIF_INFO_COUNT; ++i)
+ {
+ e = Get_Notif_Ent(MSG_INFO, i);
+ if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
+ NOTIF_WRITE_ENTITY(e.nent_name, e.nent_default, "Notification control cvar: 0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)");
+ }
+
+ NOTIF_WRITE(sprintf("\n// MSG_CENTER notifications (count = %d):\n", NOTIF_CENTER_COUNT));
+ for(i = 1; i <= NOTIF_CENTER_COUNT; ++i)
+ {
+ e = Get_Notif_Ent(MSG_CENTER, i);
+ if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
+ NOTIF_WRITE_ENTITY(e.nent_name, e.nent_default, "Notification control cvar: 0 = off, 1 = centerprint");
+ }
+
+ NOTIF_WRITE(sprintf("\n// MSG_WEAPON notifications (count = %d):\n", NOTIF_WEAPON_COUNT));
+ for(i = 1; i <= NOTIF_WEAPON_COUNT; ++i)
+ {
+ e = Get_Notif_Ent(MSG_WEAPON, i);
+ if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
+ NOTIF_WRITE_ENTITY(e.nent_name, e.nent_default, "Notification control cvar: 0 = off, 1 = trigger subcalls");
+ }
+
+ NOTIF_WRITE(sprintf("\n// MSG_DEATH notifications (count = %d):\n", NOTIF_DEATH_COUNT));
+ for(i = 1; i <= NOTIF_DEATH_COUNT; ++i)
+ {
+ e = Get_Notif_Ent(MSG_DEATH, i);
+ if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
+ NOTIF_WRITE_ENTITY(e.nent_name, e.nent_default, "Notification control cvar: 0 = off, 1 = trigger subcalls");
+ }
+
+ // edit these to match whichever cvars are used for specific notification options
+ NOTIF_WRITE("\n// HARD CODED notification variables:\n");
+ NOTIF_WRITE_HARDCODED("allow_chatboxprint", "1", "Allow notifications to be printed to chat box by setting notification cvar to 2 (You can also set this cvar to 2 to force ALL notifications to be printed to the chatbox)");
+ NOTIF_WRITE_HARDCODED("show_location", "0", "Append location information to MSG_INFO death/kill messages");
+ NOTIF_WRITE_HARDCODED("show_location_string", "", "Replacement string piped into sprintf, so you can do different messages like this: ' at the %s' or ' (near %s)'");
+ NOTIF_WRITE_HARDCODED("show_sprees", "1", "Print information about sprees in death/kill messages");
+ NOTIF_WRITE_HARDCODED("show_sprees_center", "1", "Show spree information in MSG_CENTER messages... 0 = off, 1 = target (but only for first victim) and attacker");
+ NOTIF_WRITE_HARDCODED("show_sprees_center_specialonly", "1", "Don't show spree information in MSG_CENTER messages if it isn't an achievement");
+ NOTIF_WRITE_HARDCODED("show_sprees_info", "3", "Show spree information in MSG_INFO messages... 0 = off, 1 = target only, 2 = attacker only, 3 = target and attacker");
+ NOTIF_WRITE_HARDCODED("show_sprees_info_newline", "0", "Show attacker spree information for MSG_INFO messages on a separate line than the death notification itself");
+ NOTIF_WRITE_HARDCODED("show_sprees_info_specialonly", "1", "Don't show attacker spree information in MSG_INFO messages if it isn't an achievement");
+ NOTIF_WRITE_HARDCODED("item_centerprinttime", "1.5", "How long to show item information centerprint messages (like 'You got the Electro' or such)");
+ NOTIF_WRITE_HARDCODED("errors_are_fatal", "1", "If a notification fails upon initialization, cause a Host_Error to stop the program");
+ NOTIF_WRITE_HARDCODED("ctf_pickup_team_verbose", "0", "Show extra information if a team mate picks up a flag");
+ NOTIF_WRITE_HARDCODED("ctf_pickup_enemy_verbose", "0", "Show extra information if an enemy picks up a flag");
+ NOTIF_WRITE_HARDCODED("ctf_capture_verbose", "0", "Show extra information when someone captures a flag");
+ NOTIF_WRITE_HARDCODED("frag_verbose", "1", "Show extra information when you frag someone (or when you are fragged");
+ NOTIF_WRITE_HARDCODED("lifetime_runtime", "0.5", "Amount of time that notification entities last on the server during runtime (In seconds)");
+ NOTIF_WRITE_HARDCODED("lifetime_mapload", "10", "Amount of time that notification entities last immediately at mapload (in seconds) to help prevent notifications from being lost on early init (like gamestart countdown)");
+
+ NOTIF_WRITE(sprintf("\n// Notification counts (total = %d): MSG_INFO = %d, MSG_CENTER = %d, MSG_WEAPON = %d, MSG_DEATH = %d\n",
+ (NOTIF_INFO_COUNT + NOTIF_CENTER_COUNT + NOTIF_WEAPON_COUNT + NOTIF_DEATH_COUNT),
+ NOTIF_INFO_COUNT, NOTIF_CENTER_COUNT, NOTIF_WEAPON_COUNT, NOTIF_DEATH_COUNT));