{
#define MSG_INFO_NOTIF(name,strnum,flnum,args,hudargs,icon,normal,gentle) case name: { GET_FIELD_VALUE_OUTPUT(field,name,strnum,flnum) }
- switch(net_name)
- {
- MSG_INFO_NOTIFICATIONS
- default: { backtrace(strcat("^1NOTIFICATION HAD NO MATCH: ^7net_type = MSG_INFO, net_name = ", ftos(net_name), ".\n")); return ""; }
- }
+ NOTIF_SWITCH_LIST(MSG_INFO, net_name, return "")
#undef MSG_INFO_NOTIF
break;
{
#define MSG_CENTER_NOTIF(name,strnum,flnum,args,cpid,durcnt,normal,gentle) case name: { GET_FIELD_VALUE_OUTPUT(field,name,strnum,flnum) }
- switch(net_name)
- {
- MSG_CENTER_NOTIFICATIONS
- default: { backtrace(strcat("^1NOTIFICATION HAD NO MATCH: ^7net_type = MSG_CENTER, net_name = ", ftos(net_name), ".\n")); return ""; }
- }
+ NOTIF_SWITCH_LIST(MSG_CENTER, net_name, return "")
#undef MSG_CENTER_NOTIF
break;
max(CLPSE_GETVALUE(infoname, MSG_INFO, F_STRNUM), CLPSE_GETVALUE(centername, MSG_CENTER, F_STRNUM)), \
max(CLPSE_GETVALUE(infoname, MSG_INFO, F_FLNUM), CLPSE_GETVALUE(centername, MSG_CENTER, F_FLNUM))) }
- switch(net_name)
- {
- MSG_WEAPON_NOTIFICATIONS
- default: { backtrace(strcat("^1NOTIFICATION HAD NO MATCH: ^7net_type = MSG_WEAPON, net_name = ", ftos(net_name), ".\n")); return ""; }
- }
+ NOTIF_SWITCH_LIST(MSG_WEAPON, net_name, return "")
#undef MSG_WEAPON_NOTIF
break;
max(CLPSE_GETVALUE(infoname, MSG_INFO, F_STRNUM), CLPSE_GETVALUE(centername, MSG_CENTER, F_STRNUM)), \
max(CLPSE_GETVALUE(infoname, MSG_INFO, F_FLNUM), CLPSE_GETVALUE(centername, MSG_CENTER, F_FLNUM))) }
- switch(net_name)
- {
- MSG_DEATH_NOTIFICATIONS
- default: { backtrace(strcat("^1NOTIFICATION HAD NO MATCH: ^7net_type = MSG_DEATH, net_name = ", ftos(net_name), ".\n")); return ""; }
- }
+ NOTIF_SWITCH_LIST(MSG_DEATH, net_name, return "")
#undef MSG_DEATH_NOTIF
break;
#endif \
} return; }
- switch(net_name)
- {
- MSG_INFO_NOTIFICATIONS
- default: { backtrace(strcat("^1NOTIFICATION HAD NO MATCH: ^7net_type = MSG_INFO, net_name = ", ftos(net_name), ".\n")); return; }
- }
+ NOTIF_SWITCH_LIST(MSG_INFO, net_name, return)
#undef MSG_INFO_NOTIF
break;
centerprint_generic(HANDLE_CPID(cpid), sprintf(CCR(normal_or_gentle(normal, gentle)), args), durcnt); \
} return; }
- switch(net_name)
- {
- MSG_CENTER_NOTIFICATIONS
- default: { backtrace(strcat("^1NOTIFICATION HAD NO MATCH: ^7net_type = MSG_CENTER, net_name = ", ftos(net_name), ".\n")); return; }
- }
+ NOTIF_SWITCH_LIST(MSG_CENTER, net_name, return)
#undef MSG_CENTER_NOTIF
break;
#endif \
} return; }
- switch(net_name)
- {
- MSG_WEAPON_NOTIFICATIONS
- default: { backtrace(strcat("^1NOTIFICATION HAD NO MATCH: ^7net_type = MSG_WEAPON, net_name = ", ftos(net_name), ".\n")); return; }
- }
+ NOTIF_SWITCH_LIST(MSG_WEAPON, net_name, return)
#undef MSG_WEAPON_NOTIF
break;
#endif \
} return; }
- switch(net_name)
- {
- MSG_DEATH_NOTIFICATIONS
- default: { backtrace(strcat("^1NOTIFICATION HAD NO MATCH: ^7net_type = MSG_DEATH, net_name = ", ftos(net_name), ".\n")); return; }
- }
+ NOTIF_SWITCH_LIST(MSG_DEATH, net_name, return)
#undef MSG_DEATH_NOTIF
break;
#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);
void Local_Notification_Without_VarArgs(float net_type, float net_name, float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4);