#define WEAPON_NAME f1 // weaponorder[f1].netname
#endif
-#define ADD_AUTOCVAR(name) var float autocvar_notification_##name = TRUE;
-#define CHECK_AUTOCVAR(name) if(autocvar_notification_##name)
+#define NOTIF_SWITCH_LIST(net_type,net_name,returnv) \
+ switch(net_name) \
+ { \
+ ##net_type##_NOTIFICATIONS \
+ default: { backtrace(strcat("^1NOTIFICATION HAD NO MATCH: ^7net_type = ##net_type##, net_name = ", ftos(net_name), ".\n")); returnv; } \
+ }
string Get_Field_Value(float field, float net_type, float net_name); // get the actual name of a notification and return it as a string
void Local_Notification(float net_type, float net_name, ...count);
.string nent_strings[4];
.float nent_floats[4];
-#define IFSTR(num) ((num <= (stringcount-1)) ? ...(num, string) : NO_STR_ARG)
+#define IFSTR(num) ((num < stringcount) ? ...(num, string) : NO_STR_ARG)
#define IFFL(num) ((((stringcount-1) + num) < count) ? ...(((stringcount-1) + num), float) : NO_FL_ARG)
void Send_Notification(float broadcast, entity client, float net_type, float net_name, ...count);
users to create unique color profiles for their HUD, giving more customization
options to HUD designers and end users who want such a feature.
- Check out the function calls for string CCR(...) and
- string TCR(...) to better understand how these codes work.
+ Check out the definitions in util.qc/util.qh/teams.qh for string CCR(...) and
+ string TCR(...) to better understand how these code replacements work.
Guidlines for notification declaration (please try and follow these):
Specific rules:
MSG_INFO_NOTIF(INFO_VERSION_BETA, 2, 0, XPD(s1, s2), XPD("", ""), "", _("\{1}^F4NOTE: ^BGThe server is running ^F1Xonotic %s (beta)^BG, you have ^F2Xonotic %s\n"), "") \
MSG_INFO_NOTIF(INFO_VERSION_OLD, 2, 0, XPD(s1, s2), XPD("", ""), "", _("\{1}^F4NOTE: ^BGThe server is running ^F1Xonotic %s^BG, you have ^F2Xonotic %s\n"), "") \
MSG_INFO_NOTIF(INFO_VERSION_OUTDATED, 2, 0, XPD(s1, s2), XPD("", ""), "", _("\{1}^F4NOTE: ^F1Xonotic %s^BG is out, and you still have ^F2Xonotic %s^BG - get the update from ^F3http://www.xonotic.org/^BG!\n"), "") \
- MSG_INFO_NOTIF(INFO_WATERMARK, 1, 0, s1, XPD("", ""), "", _("^F4SVQC Build information: ^BG%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_WATERMARK, 1, 0, s1, XPD("", ""), "", _("^F3SVQC Build information: ^F4%s\n"), "") \
MSG_INFO_NOTIF(INFO_WEAPON_THINKING_WITH_PORTALS, 1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""), "notify_selfkill", _("^BG%s^K1 is now thinking with portals%s\n"), "") \
MSG_INFO_NOTIF(INFO_WEAPON_CRYLINK_SUICIDE, 1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""), "weaponcrylink", _("^BG%s^K1 felt the strong pull of their Crylink%s\n"), "") \
MSG_INFO_NOTIF(INFO_WEAPON_CRYLINK_MURDER, 2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1), "weaponcrylink", _("^BG%s^K1 felt the strong pull of ^BG%s^K1's Crylink%s\n"), "") \
#define NOTIF_FIRST 1
#define NOTIF_MAX 1024 // limit of recursive functions with ACCUMULATE_FUNCTION
+#define ADD_AUTOCVAR(name) var float autocvar_notification_##name = TRUE;
+#define CHECK_AUTOCVAR(name) if(autocvar_notification_##name)
+
#define CHECK_NOTIFICATION_1(net_type,net_name,check_newline,normal,gentle) \
if((normal == "") || ((normal == "") && (gentle == ""))) { print(strcat("^1EMPTY NOTIFICATION: ^7net_type = ", net_type, ", net_name = ", VAR_TO_TEXT(net_name), ".\n")); } \
#if check_newline \
#undef MSG_WEAPON_NOTIF
#undef MSG_DEATH_NOTIF
+#undef ADD_AUTOCVAR
+
#endif // ifndef MENUQC