From 2077350c86a422f25651fe5405cca738d382317a Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Wed, 20 Feb 2013 15:19:08 -0500 Subject: [PATCH] Remove the poison of the menu from notification system --- qcsrc/common/command/generic.qc | 5 ++++- qcsrc/common/notifications.qc | 13 +++---------- qcsrc/common/notifications.qh | 25 ++++++++----------------- qcsrc/menu/progs.src | 2 -- 4 files changed, 15 insertions(+), 30 deletions(-) diff --git a/qcsrc/common/command/generic.qc b/qcsrc/common/command/generic.qc index 766639856..e7fe77715 100644 --- a/qcsrc/common/command/generic.qc +++ b/qcsrc/common/command/generic.qc @@ -233,8 +233,8 @@ void GenericCommand_dumpnotifs(float request) { case CMD_REQUEST_COMMAND: { + #ifndef MENUQC float fh, alsoprint = FALSE; - string filename = argv(1); if(filename == "") @@ -261,6 +261,9 @@ void GenericCommand_dumpnotifs(float request) { print(sprintf("^1Error: ^7Could not open file '%s'!\n", filename)); } + #else + print(_("Notification dump command only works with cl_cmd and sv_cmd.\n")); + #endif return; } diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index c0ddd2e46..77ce75f2b 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -3,7 +3,6 @@ // Last updated: February, 2013 // ================================================ -#ifndef MENUQC entity Get_Notif_Ent(float net_type, float net_name) { switch(net_type) @@ -16,7 +15,6 @@ entity Get_Notif_Ent(float net_type, float net_name) backtrace(sprintf("Get_Notif_Ent(%d, %d): Improper net type!\n", net_type, net_name)); return world; } -#endif // ifndef MENUQC // =============================== @@ -30,7 +28,6 @@ void Dump_Notifications(float fh, float alsoprint) fputs(fh, notif_msg); \ if(alsoprint) { print(strreplace("^", "^^", notif_msg)); } } - #ifndef MENUQC string notif_msg; float i; entity e; @@ -53,17 +50,13 @@ void Dump_Notifications(float fh, float alsoprint) NOTIF_WRITE(MSG_DEATH, e.nent_name, sprintf("infoname: %s, centername: %s", e.nent_msginfo.nent_name, e.nent_msgcenter.nent_name)); } - print(sprintf("Notification counts: MSG_INFO = %d, MSG_CENTER = %d, MSG_WEAPON = %d, MSG_DEATH = %d\n", NOTIF_INFO_COUNT, NOTIF_CENTER_COUNT, NOTIF_WEAPON_COUNT, NOTIF_DEATH_COUNT)); - - #endif return; #undef NOTIF_WRITE } -#ifndef MENUQC #define HIT_MAX(count,funcname) if(sel_num == count) { backtrace(sprintf("%s: Hit maximum arguments!\n", funcname)); break; } #define HIT_UNKNOWN(token,funcname) default: { backtrace(sprintf("%s: Hit unknown token in selected string! '%s'\n", funcname, selected)); break; } string Local_Notification_sprintf(string input, string args, @@ -112,8 +105,9 @@ string Local_Notification_sprintf(string input, string args, } return sprintf(input, arg_slot[0], arg_slot[1], arg_slot[2], arg_slot[3], arg_slot[4], arg_slot[5], arg_slot[6]); } + #ifdef CSQC -void Local_Notification_HUD_Notify_Push(string icon, string hudargs, string s1, string s2) +void Local_Notification_HUD_Notify_Push(string icon, string hudargs, string s1, string s2, string s3, string s4) { string selected; float sel_num; @@ -222,7 +216,7 @@ void Local_Notification(float net_type, float net_name, ...count) Local_Notification_HUD_Notify_Push( notif.nent_icon, notif.nent_hudargs, - s1, s2); + s1, s2, s3, s4); } #endif break; @@ -505,4 +499,3 @@ void Send_CSQC_Centerprint_Generic_Expire(entity e, float id) Send_CSQC_Centerprint_Generic(e, id, "", 1, 0); } #endif // ifdef SVQC -#endif // ifndef MENUQC diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index d3069d348..c9228a591 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -9,7 +9,6 @@ #define MSG_WEAPON 3 // "Personal" weapon messages (like "You got the Nex", sent to weapon notify panel) #define MSG_DEATH 4 // "Personal" AND "Global" death messages -#ifndef MENUQC // SERVER AND CLIENT ONLY #define NO_MSG -12345 // ping of bots defined for extra frag message notification information @@ -46,11 +45,14 @@ #define ARG_CSQC 3 #define ARG_SVQC 4 +#define NOTIF_MAX_ARGS 7 +#define NOTIF_MAX_HUDARGS 2 + #define NOTIF_ARGUMENT_LIST \ ARG_CASE(ARG_TRIPLE, "s1", s1) \ ARG_CASE(ARG_TRIPLE, "s2", s2) \ - ARG_CASE(ARG_BOTH, "s3", s3) \ - ARG_CASE(ARG_BOTH, "s4", s4) \ + ARG_CASE(ARG_TRIPLE, "s3", s3) \ + ARG_CASE(ARG_TRIPLE, "s4", s4) \ ARG_CASE(ARG_BOTH, "f1", ftos(f1)) \ ARG_CASE(ARG_BOTH, "f2", ftos(f2)) \ ARG_CASE(ARG_BOTH, "f3", ftos(f3)) \ @@ -75,7 +77,9 @@ entity Get_Notif_Ent(float net_type, float net_name); -string arg_slot[7]; +string arg_slot[NOTIF_MAX_ARGS]; + +void Dump_Notifications(float fh, float alsoprint); 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); @@ -110,10 +114,6 @@ void Send_Notification_Legacy_Wrapper(float broadcast, entity client, float net_ void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration, float countdown_num); void Send_CSQC_Centerprint_Generic_Expire(entity e, float id); #endif // ifdef SVQC -#endif // ifndef MENUQC - -// MENU, SERVER, AND CLIENT -void Dump_Notifications(float fh, float alsoprint); // ==================================== @@ -576,8 +576,6 @@ void Dump_Notifications(float fh, float alsoprint); // Initialization/Create Declarations // ==================================== -#ifndef MENUQC // Menu doesn't need init - #define NOTIF_FIRST 1 #define NOTIF_MAX 1024 // limit of recursive functions with ACCUMULATE_FUNCTION @@ -616,11 +614,6 @@ entity msg_death_notifs[NOTIF_MAX]; .string nent_durcnt; .string nent_string; -#define NOTIF_MAX_ARGS 7 -#define NOTIF_MAX_HUDARGS 2 - -// notif.nent_args = strzone(args); \ -// notif.nent_hudargs = strzone(hudargs); \ // if(durcnt != "") { notif.nent_durcnt = durcnt; } \ string Process_Notif_Line(float check_newline, string input, string notiftype, string notifname, string stringtype) @@ -785,5 +778,3 @@ MSG_DEATH_NOTIFICATIONS #undef MSG_DEATH_NOTIF #undef ADD_AUTOCVAR - -#endif // ifndef MENUQC diff --git a/qcsrc/menu/progs.src b/qcsrc/menu/progs.src index 313fc4639..47db61ba7 100644 --- a/qcsrc/menu/progs.src +++ b/qcsrc/menu/progs.src @@ -14,7 +14,6 @@ config.qh oo/base.h ../common/teams.qh -../common/notifications.qh ../common/constants.qh ../common/mapinfo.qh ../common/campaign_common.qh @@ -37,7 +36,6 @@ oo/implementation.h classes.c ../common/util.qc -../common/notifications.qc ../common/command/markup.qc ../common/command/rpn.qc ../common/command/generic.qc -- 2.39.2