]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove the poison of the menu from notification system
authorSamual Lenks <samual@xonotic.org>
Wed, 20 Feb 2013 20:19:08 +0000 (15:19 -0500)
committerSamual Lenks <samual@xonotic.org>
Wed, 20 Feb 2013 20:19:08 +0000 (15:19 -0500)
qcsrc/common/command/generic.qc
qcsrc/common/notifications.qc
qcsrc/common/notifications.qh
qcsrc/menu/progs.src

index 766639856b6eb5a3520062e1143a594636378e81..e7fe7771506ad2f13ecf2af2aa9994703748d215 100644 (file)
@@ -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;
                }
                        
index c0ddd2e4648769a6d11075b2eb7a398f76f8dabc..77ce75f2b0aa6244d22215cc82ec0c183a9e2a92 100644 (file)
@@ -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
index d3069d3485001dec26eb5c622ded104f07eb1b97..c9228a5911835fddeafe5fdc62430e2839819ee3 100644 (file)
@@ -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
 #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
index 313fc4639bd1c76f35e1ad65ae347a25287e0e30..47db61ba730925a5c4f7157a12da54b15ee63126 100644 (file)
@@ -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