From: Samual Lenks Date: Mon, 24 Sep 2012 22:04:59 +0000 (-0400) Subject: Begin making a new notification system and its format specs X-Git-Tag: xonotic-v0.7.0~62^2~23^2~430 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=dca3f878a663a137d4320450683f575263b5b8c5;p=xonotic%2Fxonotic-data.pk3dir.git Begin making a new notification system and its format specs --- diff --git a/qcsrc/client/progs.src b/qcsrc/client/progs.src index 0922433ee..8fc2b9b73 100644 --- a/qcsrc/client/progs.src +++ b/qcsrc/client/progs.src @@ -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 index 000000000..a956a5eae --- /dev/null +++ b/qcsrc/common/notifications.qc @@ -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; +} diff --git a/qcsrc/server/progs.src b/qcsrc/server/progs.src index 028519372..136ece3b1 100644 --- a/qcsrc/server/progs.src +++ b/qcsrc/server/progs.src @@ -82,6 +82,8 @@ playerdemo.qh item_key.qh secret.qh +../common/notifications.qc + scores_rules.qc miscfunctions.qc