// =====================
// Notification System
// =====================
-
// main types/groups of notifications
#define MSG_INFO 1 // information messages (sent to console)
#define MSG_NOTIFY 2 // events to be sent to the notification panel
#define CLPS3(arg1,arg2,arg3) arg1, arg2, arg3
#define CLPS2(arg1,arg2) arg1, arg2
+
// ===================
// Notification List
// ===================
// List of all notifications (including identifiers and display information)
-// Format: type, name, number, args, special, normal, gentle
+// Format: name, number, args, special, normal, gentle
// Specifications:
-// Type of notification
// Name of notification
// ID number of notification
// Arguments for sprintf(string, args), if no args needed then use ""
//
// Messages have ^FG1, ^FG2, and ^BG in them-- these are replaced
// with colors according to the cvars the user has chosen.
+// ^FG1 = highest priority, "primary"
+// ^FG2 = next highest priority, "secondary"
+// ^BG = less important information, "tertiary"
+
+#define MSG_INFO_NOTIFICATIONS \
+ NOTIFICATION(DEATH_MARBLES_LOST, 1, CLPS3(s1, s2, s3), "notify_death", _("^FG1%s^BG lost their marbles against ^FG1%s^BG using the ^FG2%s^BG\n"), "") \
+ /* nothing */
+
+#define MSG_NOTIFY_NOTIFICATIONS \
+ NOTIFICATION(DEATH_MARBLES_LOST2, 1, CLPS3(s1, s2, s3), "notify_death", _("^FG1%s^BG lost their marbles against ^FG1%s^BG using the ^FG2%s^BG\n"), "") \
+ /* nothing */
-#define NOTIFICATIONS \
- NOTIFICATION(MSG_NOTIFY, DEATH_MARBLES_LOST, 1, CLPS3(s1, s2, s3), "notify_death", _("^FG1%s^BG lost their marbles against ^FG1%s^BG using the ^FG2%s^BG\n"), "") \
- NOTIFICATION(MSG_CENTER, CENTER_CTF_CAPTURESHIELD_SHIELDED, 1, "", CPID_CTF_CAPTURESHIELD, _("^BGYou are now ^FG1shielded^BG from the flag\n^BGfor ^FG2too many unsuccessful attempts^BG to capture.\n\n^BGMake some defensive scores before trying again."), "") \
+#define MSG_CENTER_NOTIFICATIONS \
+ NOTIFICATION(CENTER_CTF_CAPTURESHIELD_SHIELDED, 1, "", CPID_CTF_CAPTURESHIELD, _("^BGYou are now ^FG1shielded^BG from the flag\n^BGfor ^FG2too many unsuccessful attempts^BG to capture.\n\n^BGMake some defensive scores before trying again."), "") \
+ NOTIFICATION(CENTER_CTF_CAPTURESHIELD_FREE, 2, "", CPID_CTF_CAPTURESHIELD, _("^BGYou are now free.\n\n^BGFeel free to ^FG2try to capture^BG the flag again\n^BGif you think you will succeed."), "") \
+ NOTIFICATION(CENTER_CTF_PASS, 10, CLPS2(s1, s2, s3), CPID_CTF_CAPTURESHIELD, _("^BG%s passed the ^FG1%s^BG to %s"), "") \
+ NOTIFICATION(CENTER_CTF_PASS_SENT, 11, CLPS2(s1, s2), CPID_CTF_CAPTURESHIELD, _("^BGYou passed the ^FG1%s^BG to %s"), "") \
+ NOTIFICATION(CENTER_CTF_PASS_RECEIVED, 12, CLPS2(s1, s2), CPID_CTF_CAPTURESHIELD, _("^BGYou received the ^FG1%s^BG from %s"), "") \
+ /* nothing */
+
+#define MSG_WEAPON_NOTIFICATIONS \
+ NOTIFICATION(DEATH_MARBLES_LOST3, 1, CLPS3(s1, s2, s3), "notify_death", _("^FG1%s^BG lost their marbles against ^FG1%s^BG using the ^FG2%s^BG\n"), "") \
/* nothing */
// declare notifications
-#define NOTIFICATION(type,name,num,args,special,normal,gentle) float name = num;
-NOTIFICATIONS
+#define NOTIFICATION(name,num,args,special,normal,gentle) float name = num;
+MSG_INFO_NOTIFICATIONS
+MSG_NOTIFY_NOTIFICATIONS
+MSG_CENTER_NOTIFICATIONS
+MSG_WEAPON_NOTIFICATIONS
#undef NOTIFICATION
-void testingthisshit()
+#ifdef CSQC
+void readnotificationorwhatever()
{
- print("KILL_FRAG = ", ftos(KILL_FRAG), ".\n");
+ //stuff and things
+}
+#endif
- return;
+// ================
+//
+#ifdef SVQC
+//#define WRITESPECTATABLE_MSG_ONE_VARNAME(varname,statement) entity varname; varname = msg_entity; FOR_EACH_REALCLIENT(msg_entity) if(msg_entity == varname || (msg_entity.classname == STR_SPECTATOR && msg_entity.enemy == varname)) statement msg_entity = varname
+//#define WRITESPECTATABLE_MSG_ONE(statement) WRITESPECTATABLE_MSG_ONE_VARNAME(oldmsg_entity, statement)
+//#define WRITESPECTATABLE(msg,statement) if(msg == MSG_ONE) { WRITESPECTATABLE_MSG_ONE(statement); } else statement float WRITESPECTATABLE_workaround = 0
+
+void Send_Notification(float type, entity client, float id, string s, float duration, float countdown_num)
+{
+ if ((clienttype(client) == CLIENTTYPE_REAL) && (client.flags & FL_CLIENT))
+ {
+ msg_entity = client;
+ WRITESPECTATABLE_MSG_ONE({
+ WriteByte(MSG_ONE, SVC_TEMPENTITY);
+ //WriteByte(MSG_ONE, TE_CSQC_NOTIFICATION);
+ WriteByte(MSG_ONE, id);
+ WriteString(MSG_ONE, s);
+ if (id != 0 && s != "")
+ {
+ WriteByte(MSG_ONE, duration);
+ WriteByte(MSG_ONE, countdown_num);
+ }
+ });
+ }
}
+#endif