]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Begin making a new notification system and its format specs
authorSamual Lenks <samual@xonotic.org>
Mon, 24 Sep 2012 22:04:59 +0000 (18:04 -0400)
committerSamual Lenks <samual@xonotic.org>
Mon, 24 Sep 2012 22:04:59 +0000 (18:04 -0400)
qcsrc/client/progs.src
qcsrc/common/notifications.qc [new file with mode: 0644]
qcsrc/server/progs.src

index 0922433eebdecd2d6c3c229636162e1475c6e56b..8fc2b9b73d82df18f37024d4a63edd7207e5ace6 100644 (file)
@@ -50,6 +50,8 @@ vehicles/vehicles.qh
 ../csqcmodellib/cl_player.qh
 projectile.qh
 
+../common/notifications.qc
+
 sortlist.qc
 miscfunctions.qc
 teamplay.qc
diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc
new file mode 100644 (file)
index 0000000..a956a5e
--- /dev/null
@@ -0,0 +1,53 @@
+// =====================
+//  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 MSG_CENTER 3 // centerprint messages
+#define MSG_WEAPON 4 // weapon messages (like "You got the Nex", sent to weapon notify panel)
+
+// collapse multiple arguments into one argument
+#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
+// Specifications:
+//    Type of notification
+//    Name of notification
+//    ID number of notification
+//    Arguments for sprintf(string, args), if no args needed then use ""
+//    Special:
+//      MSG_INFO: NULL/FLOAT: leave as FALSE
+//      MSG_NOTIFY: STRING: icon string name for the hud notify panel, "" if no icon is used
+//      MSG_CENTER: FLOAT: centerprint ID number (CPID_*), FALSE if no CPID is needed
+//      MSG_WEAPON: NULL/FLOAT: leave as FALSE
+//    Normal message (string for sprintf when gentle messages are NOT enabled)
+//    Gentle message (string for sprintf when gentle messages ARE enabled)
+//
+// Messages have ^FG1, ^FG2, and ^BG in them-- these are replaced
+// with colors according to the cvars the user has chosen.
+
+#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."), "") \
+       /* nothing */
+
+// declare notifications
+#define NOTIFICATION(type,name,num,args,special,normal,gentle) float name = num;
+NOTIFICATIONS
+#undef NOTIFICATION
+
+
+void testingthisshit()
+{
+       print("KILL_FRAG = ", ftos(KILL_FRAG), ".\n");
+
+
+       return;
+}
index 028519372f025ae24aa923d472ba0a6593de86b7..136ece3b16ea512bf75706932154ecc34eefe460 100644 (file)
@@ -82,6 +82,8 @@ playerdemo.qh
 item_key.qh
 secret.qh
 
+../common/notifications.qc
+
 scores_rules.qc
 
 miscfunctions.qc