#define MSG_MULTI 5 // Subcall MSG_INFO and/or MSG_CENTER notifications
#define MSG_CHOICE 6 // Choose which subcall wrapper to activate
-#define NO_MSG -12345
+// negative confirmations
+#define NO_MSG -12345 // allows various things to know when no information is added
+#define NOTIF_ABORT -1234 // allows Send_Notification to safely abort sending
#define EIGHT_VARS_TO_VARARGS_VARLIST \
VARITEM(1, 0, s1) \
float typeid,
float nameid,
string namestring,
- float anncename,
- float infoname,
- float centername,
- float channel,
+ float strnum,
+ float flnum,
+ /* MSG_ANNCE */
+ float channel,
string snd,
float vol,
float position,
- float strnum,
- float flnum,
+ /* MSG_INFO & MSG_CENTER */
string args,
string hudargs,
string icon,
string durcnt,
string normal,
string gentle,
+ /* MSG_MULTI */
+ float anncename,
+ float infoname,
+ float centername,
+ /* MSG_CHOICE */
+ float challow_def,
+ float challow_var,
float chtype,
float optiona,
float optionb);
float net_type, float net_name,
...count);
void Send_Notification_WOVA(
+ float broadcast, entity client,
+ 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);
+void Send_Notification_WOCOVA(
float broadcast, entity client,
float net_type, float net_name,
string s1, string s2, string s3, string s4,
/*
List of all notifications (including identifiers and display information)
Possible Tokens:
- default, name, channel, sound, volume, position,
- anncename, infoname, centername, strnum, flnum, args,
- hudargs, icon, cpid, durcnt, normal, gentle
+ default, name, strnum, flnum,
+ channel, sound, volume, position,
+ args, hudargs, icon, cpid, durcnt, normal, gentle,
+ anncename, infoname, centername,
+ challow, chtype, optiona, optionb
Format Specifications:
MSG_ANNCE:
default: FLOAT: Default setting for whether the notification is enabled or not
anncename: VAR: Name of announcer notification for reference
infoname: VAR: Name of info notification for reference
centername: VAR: Name of centerprint notification for reference
+ MSG_CHOICE:
+ default: FLOAT: Default setting for whether the notification is enabled or not
+ ^-> 0 = disabled, 1 = select option A, 2 = selection option B
+ challow: FLOAT: Default setting for server allowing choices other than A
+ ^-> 0 = no choice, 1 = allowed in warmup, 2 = always allowed
+ name: VAR: Name of choice notification
+ chtype: VAR: Notification message type for options
+ optiona: VAR: Name of choice "A" notification for reference
+ optionb: VAR: Name of choice "B" notification for reference
Messages with ^F1, ^BG, ^TC, etc etc in them will replace those strings
with colors according to the cvars the user has chosen. This allows for
-ALWAYS reset a color after a name (this way they don't set it for the whole string).
-NEVER re-declare an event twice.
-NEVER add or remove tokens from the format, it SHOULD already work.
- -MSG_INFO messages must ALWAYS end with a new line: \n
-MSG_INFO hudargs must always be ATTACKER -> VICTIM
- -MSG_CENTER should NOT end with a new line
+ -MSG_INFO and MSG_CENTER should NOT end with a new line
General rules:
-Be clean and simple with your notification naming,
MSG_ANNCE_NOTIF(2, ANNCE_NUM_8, CH_INFO, "8", VOL_BASEVOICE, ATTN_NONE) \
MSG_ANNCE_NOTIF(2, ANNCE_NUM_9, CH_INFO, "9", VOL_BASEVOICE, ATTN_NONE) \
MSG_ANNCE_NOTIF(2, ANNCE_NUM_10, CH_INFO, "10", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_NUM_GAMESTART_1, CH_INFO, "1", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_NUM_GAMESTART_2, CH_INFO, "2", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_NUM_GAMESTART_3, CH_INFO, "3", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_NUM_GAMESTART_4, CH_INFO, "4", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_NUM_GAMESTART_5, CH_INFO, "5", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_GAMESTART_6, CH_INFO, "6", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_GAMESTART_7, CH_INFO, "7", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_GAMESTART_8, CH_INFO, "8", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_GAMESTART_9, CH_INFO, "9", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_GAMESTART_10, CH_INFO, "10", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_IDLE_1, CH_INFO, "1", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_IDLE_2, CH_INFO, "2", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_IDLE_3, CH_INFO, "3", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_IDLE_4, CH_INFO, "4", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_IDLE_5, CH_INFO, "5", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_IDLE_6, CH_INFO, "6", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_IDLE_7, CH_INFO, "7", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_IDLE_8, CH_INFO, "8", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_IDLE_9, CH_INFO, "9", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_IDLE_10, CH_INFO, "10", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_KILL_1, CH_INFO, "1", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_KILL_2, CH_INFO, "2", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_KILL_3, CH_INFO, "3", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_KILL_4, CH_INFO, "4", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_KILL_5, CH_INFO, "5", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_KILL_6, CH_INFO, "6", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_KILL_7, CH_INFO, "7", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_KILL_8, CH_INFO, "8", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_KILL_9, CH_INFO, "9", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_KILL_10, CH_INFO, "10", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_RESPAWN_1, CH_INFO, "1", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_RESPAWN_2, CH_INFO, "2", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_RESPAWN_3, CH_INFO, "3", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_RESPAWN_4, CH_INFO, "4", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_RESPAWN_5, CH_INFO, "5", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_RESPAWN_6, CH_INFO, "6", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_RESPAWN_7, CH_INFO, "7", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_RESPAWN_8, CH_INFO, "8", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_RESPAWN_9, CH_INFO, "9", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_RESPAWN_10, CH_INFO, "10", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_NUM_ROUNDSTART_1, CH_INFO, "1", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_NUM_ROUNDSTART_2, CH_INFO, "2", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_NUM_ROUNDSTART_3, CH_INFO, "3", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_ROUNDSTART_4, CH_INFO, "4", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_ROUNDSTART_5, CH_INFO, "5", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_ROUNDSTART_6, CH_INFO, "6", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_ROUNDSTART_7, CH_INFO, "7", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_ROUNDSTART_8, CH_INFO, "8", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_ROUNDSTART_9, CH_INFO, "9", VOL_BASEVOICE, ATTN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_NUM_ROUNDSTART_10, CH_INFO, "10", VOL_BASEVOICE, ATTN_NONE) \
MSG_ANNCE_NOTIF(2, ANNCE_PREPARE, CH_INFO, "prepareforbattle", VOL_BASEVOICE, ATTN_NONE) \
MSG_ANNCE_NOTIF(1, ANNCE_REMAINING_FRAG_1, CH_INFO, "1fragleft", VOL_BASEVOICE, ATTN_NONE) \
MSG_ANNCE_NOTIF(1, ANNCE_REMAINING_FRAG_2, CH_INFO, "2fragsleft", VOL_BASEVOICE, ATTN_NONE) \
MSG_MULTI_NOTIF(1, WEAPON_UZI_MURDER_SNIPE, NO_MSG, INFO_WEAPON_UZI_MURDER_SNIPE, NO_MSG) \
MSG_MULTI_NOTIF(1, WEAPON_UZI_MURDER_SPRAY, NO_MSG, INFO_WEAPON_UZI_MURDER_SPRAY, NO_MSG)
-#define MULTITEAM_CHOICE(default,prefix,teams,chtype,optiona,optionb) \
- MSG_CHOICE_NOTIF(default, prefix##RED, chtype, optiona##RED, optionb##RED) \
- MSG_CHOICE_NOTIF(default, prefix##BLUE, chtype, optiona##BLUE, optionb##BLUE) \
+#define MULTITEAM_CHOICE(default,challow,prefix,teams,chtype,optiona,optionb) \
+ MSG_CHOICE_NOTIF(default, challow, prefix##RED, chtype, optiona##RED, optionb##RED) \
+ MSG_CHOICE_NOTIF(default, challow, prefix##BLUE, chtype, optiona##BLUE, optionb##BLUE) \
#if teams >= 3 \
- MSG_CHOICE_NOTIF(default, prefix##YELLOW, chtype, optiona##YELLOW, optionb##YELLOW) \
+ MSG_CHOICE_NOTIF(default, challow, prefix##YELLOW, chtype, optiona##YELLOW, optionb##YELLOW) \
#endif \
#if teams >= 4 \
- MSG_CHOICE_NOTIF(default, prefix##PINK, chtype, optiona##PINK, optionb##PINK) \
+ MSG_CHOICE_NOTIF(default, challow, prefix##PINK, chtype, optiona##PINK, optionb##PINK) \
#endif
#define MSG_CHOICE_NOTIFICATIONS \
- MSG_CHOICE_NOTIF(1, CHOICE_FRAG, MSG_CENTER, CENTER_DEATH_MURDER_FRAG, CENTER_DEATH_MURDER_FRAG_VERBOSE) \
- MSG_CHOICE_NOTIF(1, CHOICE_FRAGGED, MSG_CENTER, CENTER_DEATH_MURDER_FRAGGED, CENTER_DEATH_MURDER_FRAGGED_VERBOSE) \
- MSG_CHOICE_NOTIF(1, CHOICE_TYPEFRAG, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAG, CENTER_DEATH_MURDER_TYPEFRAG_VERBOSE) \
- MSG_CHOICE_NOTIF(1, CHOICE_TYPERFRAGGED, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAGGED, CENTER_DEATH_MURDER_TYPEFRAGGED_VERBOSE)
+ MULTITEAM_CHOICE(1, 2, CHOICE_CTF_CAPTURE_BROKEN_, 2, MSG_INFO, INFO_CTF_CAPTURE_, INFO_CTF_CAPTURE_BROKEN_) \
+ MULTITEAM_CHOICE(1, 2, CHOICE_CTF_CAPTURE_TIME_, 2, MSG_INFO, INFO_CTF_CAPTURE_, INFO_CTF_CAPTURE_TIME_) \
+ MULTITEAM_CHOICE(1, 2, CHOICE_CTF_CAPTURE_UNBROKEN_, 2, MSG_INFO, INFO_CTF_CAPTURE_, INFO_CTF_CAPTURE_UNBROKEN_) \
+ MSG_CHOICE_NOTIF(1, 2, CHOICE_CTF_PICKUP_TEAM, MSG_CENTER, CENTER_CTF_PICKUP_TEAM, CENTER_CTF_PICKUP_TEAM_VERBOSE) \
+ MSG_CHOICE_NOTIF(1, 2, CHOICE_CTF_PICKUP_ENEMY, MSG_CENTER, CENTER_CTF_PICKUP_ENEMY, CENTER_CTF_PICKUP_ENEMY_VERBOSE) \
+ MSG_CHOICE_NOTIF(1, 1, CHOICE_FRAG, MSG_CENTER, CENTER_DEATH_MURDER_FRAG, CENTER_DEATH_MURDER_FRAG_VERBOSE) \
+ MSG_CHOICE_NOTIF(1, 1, CHOICE_FRAGGED, MSG_CENTER, CENTER_DEATH_MURDER_FRAGGED, CENTER_DEATH_MURDER_FRAGGED_VERBOSE) \
+ MSG_CHOICE_NOTIF(1, 1, CHOICE_TYPEFRAG, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAG, CENTER_DEATH_MURDER_TYPEFRAG_VERBOSE) \
+ MSG_CHOICE_NOTIF(1, 1, CHOICE_TYPEFRAGGED, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAGGED, CENTER_DEATH_MURDER_TYPEFRAGGED_VERBOSE)
//MSG_CHOICE_NOTIF(2, CHOICE_)
#ifdef SVQC
.float FRAG_VERBOSE;
void Notification_GetCvars(void);
-var float autocvar_notification_server_allows_frag_verbose = 1; // 0 = no, 1 = warmup only, 2 = all the time
var float autocvar_notification_server_allows_location = 1; // 0 = no, 1 = yes
#else
var float autocvar_notification_item_centerprinttime = 1.5;
var float autocvar_notification_show_sprees_center = TRUE;
var float autocvar_notification_show_sprees_center_specialonly = TRUE;
-var float autocvar_notification_frag_verbose = TRUE;
#endif
// Initialization/Create Declarations
// ====================================
-#define NOTIF_FIRST 1
-#define NOTIF_MAX 1024 // limit of recursive functions with ACCUMULATE_FUNCTION
-
-// error detection
-float notif_error;
-float notif_global_error;
-
-// notification entities
-entity msg_annce_notifs[NOTIF_MAX];
-entity msg_info_notifs[NOTIF_MAX];
-entity msg_center_notifs[NOTIF_MAX];
-entity msg_multi_notifs[NOTIF_MAX];
-entity msg_choice_notifs[NOTIF_MAX];
-
// notification counts
+#define NOTIF_FIRST 1
float NOTIF_ANNCE_COUNT;
float NOTIF_INFO_COUNT;
float NOTIF_CENTER_COUNT;
float NOTIF_CHOICE_COUNT;
float NOTIF_CPID_COUNT;
-// notification entity values
+// notification limits -- INCREASE AS NECESSARY
+#define NOTIF_ANNCE_MAX 100
+#define NOTIF_INFO_MAX 300
+#define NOTIF_CENTER_MAX 200
+#define NOTIF_MULTI_MAX 200
+#define NOTIF_CHOICE_MAX 20
+
+// notification entities
+entity msg_annce_notifs[NOTIF_ANNCE_MAX];
+entity msg_info_notifs[NOTIF_INFO_MAX];
+entity msg_center_notifs[NOTIF_CENTER_MAX];
+entity msg_multi_notifs[NOTIF_MULTI_MAX];
+entity msg_choice_notifs[NOTIF_CHOICE_MAX];
+
+// common notification entity values
.float nent_default;
-.string nent_name;
-.float nent_id;
.float nent_enabled;
-.entity nent_msgannce;
-.entity nent_msginfo;
-.entity nent_msgcenter;
+.float nent_type;
+.float nent_id;
+.string nent_name;
+.float nent_stringcount;
+.float nent_floatcount;
+
+// MSG_ANNCE entity values
.float nent_channel;
.string nent_snd;
.float nent_vol;
.float nent_position;
-.float nent_stringcount;
-.float nent_floatcount;
-.string nent_args;
-.string nent_hudargs;
-.string nent_icon;
-.float nent_cpid;
-.string nent_durcnt;
-.string nent_string;
-
-.float nent_msgchtype;
-.string nent_msgopa;
-.string nent_msgopb;
-
-// networked notification values
+
+// MSG_INFO and MSG_CENTER entity values
+.string nent_args; // used by both
+.string nent_hudargs; // used by info
+.string nent_icon; // used by info
+.float nent_cpid; // used by center
+.string nent_durcnt; // used by center
+.string nent_string; // used by both
+
+// MSG_MULTI entity values
+.entity nent_msgannce;
+.entity nent_msginfo;
+.entity nent_msgcenter;
+
+// MSG_CHOICE entity values
+.float nent_challow_def;
+.float nent_challow_var;
+.entity nent_optiona;
+.entity nent_optionb;
+
+// networked notification entity values
.float nent_broadcast;
.entity nent_client;
.float nent_net_type;
.string nent_strings[4];
.float nent_floats[4];
+// other notification properties
+.float msg_choice_choices[NOTIF_CHOICE_MAX]; // set on each player containing MSG_CHOICE choices
+
+// initialization error detection
+float notif_error;
+float notif_global_error;
+
#define MSG_ANNCE_NOTIF(default,name,channel,sound,volume,position) \
NOTIF_ADD_AUTOCVAR(name, default) \
float name; \
void RegisterNotification_##name() \
{ \
SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_ANNCE_COUNT) \
- CHECK_MAX_COUNT(name, NOTIF_MAX, NOTIF_ANNCE_COUNT, "notifications") \
+ CHECK_MAX_COUNT(name, NOTIF_ANNCE_MAX, NOTIF_ANNCE_COUNT, "MSG_ANNCE") \
Create_Notification_Entity( \
- default, /* var_default */ \
- autocvar_notification_##name, /* var_cvar */ \
- MSG_ANNCE, /* typeid */ \
- name, /* nameid */ \
- strtoupper(#name), /* namestring */ \
- NO_MSG, /* anncename */ \
- NO_MSG, /* infoname */ \
- NO_MSG, /* centername */ \
- channel, /* channel */ \
- sound, /* snd */ \
- volume, /* vol */ \
- position, /* position */ \
- NO_MSG, /* strnum */ \
- NO_MSG, /* flnum */ \
- "", /* args */ \
- "", /* hudargs */ \
- "", /* icon */ \
- NO_MSG, /* cpid */ \
- "", /* durcnt */ \
- "", /* normal */ \
- "", /* gentle */ \
- NO_MSG, /* chtype */ \
- NO_MSG, /* optiona */ \
- NO_MSG); /* optionb */ \
+ /* COMMON ======================== */ \
+ default, /* var_default */ \
+ ACVNN(name), /* var_cvar */ \
+ MSG_ANNCE, /* typeid */ \
+ name, /* nameid */ \
+ strtoupper(#name), /* namestring */ \
+ NO_MSG, /* strnum */ \
+ NO_MSG, /* flnum */ \
+ /* ANNCE ============= */ \
+ channel, /* channel */ \
+ sound, /* snd */ \
+ volume, /* vol */ \
+ position, /* position */ \
+ /* INFO & CENTER == */ \
+ "", /* args */ \
+ "", /* hudargs */ \
+ "", /* icon */ \
+ NO_MSG, /* cpid */ \
+ "", /* durcnt */ \
+ "", /* normal */ \
+ "", /* gentle */ \
+ /* MULTI ============= */ \
+ NO_MSG, /* anncename */ \
+ NO_MSG, /* infoname */ \
+ NO_MSG, /* centername */ \
+ /* MSG_CHOICE ========== */ \
+ NO_MSG, /* challow_def */ \
+ NO_MSG, /* challow_var */ \
+ NO_MSG, /* chtype */ \
+ NO_MSG, /* optiona */ \
+ NO_MSG); /* optionb */ \
} \
ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
void RegisterNotification_##name() \
{ \
SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_INFO_COUNT) \
- CHECK_MAX_COUNT(name, NOTIF_MAX, NOTIF_INFO_COUNT, "notifications") \
+ CHECK_MAX_COUNT(name, NOTIF_INFO_MAX, NOTIF_INFO_COUNT, "MSG_INFO") \
Create_Notification_Entity( \
- default, /* var_default */ \
- autocvar_notification_##name, /* var_cvar */ \
- MSG_INFO, /* typeid */ \
- name, /* nameid */ \
- strtoupper(#name), /* namestring */ \
- NO_MSG, /* anncename */ \
- NO_MSG, /* infoname */ \
- NO_MSG, /* centername */ \
- NO_MSG, /* channel */ \
- "", /* snd */ \
- NO_MSG, /* vol */ \
- NO_MSG, /* position */ \
- strnum, /* strnum */ \
- flnum, /* flnum */ \
- args, /* args */ \
- hudargs, /* hudargs */ \
- icon, /* icon */ \
- NO_MSG, /* cpid */ \
- "", /* durcnt */ \
- normal, /* normal */ \
- gentle, /* gentle */ \
- NO_MSG, /* chtype */ \
- NO_MSG, /* optiona */ \
- NO_MSG); /* optionb */ \
+ /* COMMON ======================== */ \
+ default, /* var_default */ \
+ ACVNN(name), /* var_cvar */ \
+ MSG_INFO, /* typeid */ \
+ name, /* nameid */ \
+ strtoupper(#name), /* namestring */ \
+ strnum, /* strnum */ \
+ flnum, /* flnum */ \
+ /* ANNCE =========== */ \
+ NO_MSG, /* channel */ \
+ "", /* snd */ \
+ NO_MSG, /* vol */ \
+ NO_MSG, /* position */ \
+ /* INFO & CENTER === */ \
+ args, /* args */ \
+ hudargs, /* hudargs */ \
+ icon, /* icon */ \
+ NO_MSG, /* cpid */ \
+ "", /* durcnt */ \
+ normal, /* normal */ \
+ gentle, /* gentle */ \
+ /* MULTI ============= */ \
+ NO_MSG, /* anncename */ \
+ NO_MSG, /* infoname */ \
+ NO_MSG, /* centername */ \
+ /* CHOICE ============== */ \
+ NO_MSG, /* challow_def */ \
+ NO_MSG, /* challow_var */ \
+ NO_MSG, /* chtype */ \
+ NO_MSG, /* optiona */ \
+ NO_MSG); /* optionb */ \
} \
ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
{ \
SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_CENTER_COUNT) \
SET_FIELD_COUNT(cpid, NOTIF_FIRST, NOTIF_CPID_COUNT) \
- CHECK_MAX_COUNT(name, NOTIF_MAX, NOTIF_CENTER_COUNT, "notifications") \
+ CHECK_MAX_COUNT(name, NOTIF_CENTER_MAX, NOTIF_CENTER_COUNT, "MSG_CENTER") \
Create_Notification_Entity( \
- default, /* var_default */ \
- autocvar_notification_##name, /* var_cvar */ \
- MSG_CENTER, /* typeid */ \
- name, /* nameid */ \
- strtoupper(#name), /* namestring */ \
- NO_MSG, /* anncename */ \
- NO_MSG, /* infoname */ \
- NO_MSG, /* centername */ \
- NO_MSG, /* channel */ \
- "", /* snd */ \
- NO_MSG, /* vol */ \
- NO_MSG, /* position */ \
- strnum, /* strnum */ \
- flnum, /* flnum */ \
- args, /* args */ \
- "", /* hudargs */ \
- "", /* icon */ \
- cpid, /* cpid */ \
- durcnt, /* durcnt */ \
- normal, /* normal */ \
- gentle, /* gentle */ \
- NO_MSG, /* chtype */ \
- NO_MSG, /* optiona */ \
- NO_MSG); /* optionb */ \
+ /* COMMON ======================== */ \
+ default, /* var_default */ \
+ ACVNN(name), /* var_cvar */ \
+ MSG_CENTER, /* typeid */ \
+ name, /* nameid */ \
+ strtoupper(#name), /* namestring */ \
+ strnum, /* strnum */ \
+ flnum, /* flnum */ \
+ /* ANNCE =========== */ \
+ NO_MSG, /* channel */ \
+ "", /* snd */ \
+ NO_MSG, /* vol */ \
+ NO_MSG, /* position */ \
+ /* INFO & CENTER == */ \
+ args, /* args */ \
+ "", /* hudargs */ \
+ "", /* icon */ \
+ cpid, /* cpid */ \
+ durcnt, /* durcnt */ \
+ normal, /* normal */ \
+ gentle, /* gentle */ \
+ /* MULTI ============= */ \
+ NO_MSG, /* anncename */ \
+ NO_MSG, /* infoname */ \
+ NO_MSG, /* centername */ \
+ /* CHOICE ============== */ \
+ NO_MSG, /* challow_def */ \
+ NO_MSG, /* challow_var */ \
+ NO_MSG, /* chtype */ \
+ NO_MSG, /* optiona */ \
+ NO_MSG); /* optionb */ \
} \
ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
void RegisterNotification_##name() \
{ \
SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_MULTI_COUNT) \
- CHECK_MAX_COUNT(name, NOTIF_MAX, NOTIF_MULTI_COUNT, "notifications") \
+ CHECK_MAX_COUNT(name, NOTIF_MULTI_MAX, NOTIF_MULTI_COUNT, "MSG_MULTI") \
Create_Notification_Entity( \
- default, /* var_default */ \
- autocvar_notification_##name, /* var_cvar */ \
- MSG_MULTI, /* typeid */ \
- name, /* nameid */ \
- strtoupper(#name), /* namestring */ \
- anncename, /* anncename */ \
- infoname, /* infoname */ \
- centername, /* centername */ \
- NO_MSG, /* channel */ \
- "", /* snd */ \
- NO_MSG, /* vol */ \
- NO_MSG, /* position */ \
- NO_MSG, /* strnum */ \
- NO_MSG, /* flnum */ \
- "", /* args */ \
- "", /* hudargs */ \
- "", /* icon */ \
- NO_MSG, /* cpid */ \
- "", /* durcnt */ \
- "", /* normal */ \
- "", /* gentle */ \
- NO_MSG, /* chtype */ \
- NO_MSG, /* optiona */ \
- NO_MSG); /* optionb */ \
+ /* COMMON ======================== */ \
+ default, /* var_default */ \
+ ACVNN(name), /* var_cvar */ \
+ MSG_MULTI, /* typeid */ \
+ name, /* nameid */ \
+ strtoupper(#name), /* namestring */ \
+ NO_MSG, /* strnum */ \
+ NO_MSG, /* flnum */ \
+ /* ANNCE =========== */ \
+ NO_MSG, /* channel */ \
+ "", /* snd */ \
+ NO_MSG, /* vol */ \
+ NO_MSG, /* position */ \
+ /* INFO & CENTER == */ \
+ "", /* args */ \
+ "", /* hudargs */ \
+ "", /* icon */ \
+ NO_MSG, /* cpid */ \
+ "", /* durcnt */ \
+ "", /* normal */ \
+ "", /* gentle */ \
+ /* MULTI ================= */ \
+ anncename, /* anncename */ \
+ infoname, /* infoname */ \
+ centername, /* centername */ \
+ /* CHOICE ============== */ \
+ NO_MSG, /* challow_def */ \
+ NO_MSG, /* challow_var */ \
+ NO_MSG, /* chtype */ \
+ NO_MSG, /* optiona */ \
+ NO_MSG); /* optionb */ \
} \
ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
-#define MSG_CHOICE_NOTIF(default,name,chtype,optiona,optionb) \
+#define ACVNN(name) autocvar_notification_##name
+
+#define MSG_CHOICE_NOTIF(default,challow,name,chtype,optiona,optionb) \
NOTIF_ADD_AUTOCVAR(name, default) \
+ NOTIF_ADD_AUTOCVAR(name##_ALLOWED, challow) \
float name; \
void RegisterNotification_##name() \
{ \
SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_CHOICE_COUNT) \
- CHECK_MAX_COUNT(name, NOTIF_MAX, NOTIF_CHOICE_COUNT, "notifications") \
+ CHECK_MAX_COUNT(name, NOTIF_CHOICE_MAX, NOTIF_CHOICE_COUNT, "MSG_CHOICE") \
Create_Notification_Entity( \
- default, /* var_default */ \
- autocvar_notification_##name, /* var_cvar */ \
- MSG_CHOICE, /* typeid */ \
- name, /* nameid */ \
- strtoupper(#name), /* namestring */ \
- NO_MSG, /* anncename */ \
- NO_MSG, /* infoname */ \
- NO_MSG, /* centername */ \
- NO_MSG, /* channel */ \
- "", /* snd */ \
- NO_MSG, /* vol */ \
- NO_MSG, /* position */ \
- NO_MSG, /* strnum */ \
- NO_MSG, /* flnum */ \
- "", /* args */ \
- "", /* hudargs */ \
- "", /* icon */ \
- NO_MSG, /* cpid */ \
- "", /* durcnt */ \
- "", /* normal */ \
- "", /* gentle */ \
- chtype, /* chtype */ \
- optiona, /* optiona */ \
- optionb); /* optionb */ \
+ /* COMMON ======================== */ \
+ default, /* var_default */ \
+ ACVNN(name), /* var_cvar */ \
+ MSG_CHOICE, /* typeid */ \
+ name, /* nameid */ \
+ strtoupper(#name), /* namestring */ \
+ NO_MSG, /* strnum */ \
+ NO_MSG, /* flnum */ \
+ /* ANNCE =========== */ \
+ NO_MSG, /* channel */ \
+ "", /* snd */ \
+ NO_MSG, /* vol */ \
+ NO_MSG, /* position */ \
+ /* INFO & CENTER == */ \
+ "", /* args */ \
+ "", /* hudargs */ \
+ "", /* icon */ \
+ NO_MSG, /* cpid */ \
+ "", /* durcnt */ \
+ "", /* normal */ \
+ "", /* gentle */ \
+ /* MULTI ============= */ \
+ NO_MSG, /* anncename */ \
+ NO_MSG, /* infoname */ \
+ NO_MSG, /* centername */ \
+ /* CHOICE ============================================= */ \
+ challow, /* challow_def */ \
+ autocvar_notification_##name##_ALLOWED, /* challow_var */ \
+ chtype, /* chtype */ \
+ optiona, /* optiona */ \
+ optionb); /* optionb */ \
} \
ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)