]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
More work on item messages
authorSamual Lenks <samual@xonotic.org>
Wed, 27 Feb 2013 06:59:47 +0000 (01:59 -0500)
committerSamual Lenks <samual@xonotic.org>
Wed, 27 Feb 2013 06:59:47 +0000 (01:59 -0500)
qcsrc/common/notifications.qc
qcsrc/common/notifications.qh

index 33b7ba528f0e128e4ab9a4debbd0d2dc15f6570a..5653a6d9a946e9e8fcc20e5c8641b2660813fd62 100644 (file)
@@ -292,7 +292,7 @@ void Local_Notification_centerprint_generic(string input, string durcnt, float c
                switch(strtolower(selected))
                {
                        #define ARG_CASE(prog,selected,result) \
-                               #if (prog == ARG_CS_SV_DC) \
+                               #if (prog == ARG_CS_SV_DC) || (prog == ARG_DC) \
                                        case selected: { arg_slot[sel_num] = result; ++sel_num; break; } \
                                #endif
                        NOTIF_ARGUMENT_LIST
index ee5b3687cb108dc954a6771500cb33b93604f534..8a2695159260fb2327af9977b26963a6de3cef24 100644 (file)
@@ -261,8 +261,8 @@ float CPID_KH_MSG = 10;
        MSG_INFO_NOTIF(2, INFO_VERSION_OLD,                                             2, 0, "s1 s2", "",                                              "",                                             _("^F4NOTE: ^BGThe server is running ^F1Xonotic %s^BG, you have ^F2Xonotic %s\n"), "") \
        MSG_INFO_NOTIF(2, INFO_VERSION_OUTDATED,                                2, 0, "s1 s2", "",                                              "",                                             _("^F4NOTE: ^F1Xonotic %s^BG is out, and you still have ^F2Xonotic %s^BG - get the update from ^F3http://www.xonotic.org/^BG!\n"), "") \
        MSG_INFO_NOTIF(1, INFO_WATERMARK,                                               1, 0, "s1", "",                                                 "",                                             _("^F3SVQC Build information: ^F4%s\n"), "") \
-       MSG_INFO_NOTIF(0, INFO_WEAPON_GOTWEP,                                   0, 1, "weapon", "",                                                                                     "",                                             _("^BGYou got the ^F1%s\n"), "") \
-       MSG_INFO_NOTIF(0, INFO_WEAPON_DROPPED,                                  1, 1, "weapon withammo", "",                                                            "",                                             _("^BGYou dropped the ^F1%s^BG%s\n"), "") \
+       MSG_INFO_NOTIF(0, INFO_WEAPON_GOTWEP,                                   0, 1, "item_wepname", "",                               "",                                     _("^BGYou got the ^F1%s\n"), "") \
+       MSG_INFO_NOTIF(0, INFO_WEAPON_DROPPED,                                  1, 1, "item_wepname item_wepammo", "",  "",                                     _("^BGYou dropped the ^F1%s^BG%s\n"), "") \
        MSG_INFO_NOTIF(1, INFO_WEAPON_THINKING_WITH_PORTALS,                    2, 1, "s1 s2loc spree_lost", "s1",                                      "notify_selfkill",                      _("^BG%s^K1 is now thinking with portals%s%s\n"), "") \
        MSG_INFO_NOTIF(1, INFO_WEAPON_CRYLINK_SUICIDE,                                  2, 1, "s1 s2loc spree_lost", "s1",                                      "weaponcrylink",                        _("^BG%s^K1 felt the strong pull of their Crylink%s%s\n"), "") \
        MSG_INFO_NOTIF(1, INFO_WEAPON_CRYLINK_MURDER,                                   3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1",       "weaponcrylink",                        _("^BG%s%s^K1 felt the strong pull of ^BG%s^K1's Crylink%s%s\n"), "") \
@@ -426,8 +426,8 @@ float CPID_KH_MSG = 10;
        MSG_CENTER_NOTIF(1, CENTER_TEAMCHANGE_SUICIDE,                          0, 1, "",                               CPID_TEAMCHANGE,                "1 f1", _("^K1Suicide in ^COUNT"), "") \
        MSG_CENTER_NOTIF(1, CENTER_TIMEOUT_BEGINNING,                           0, 1, "",                               CPID_TIMEOUT,                   "1 f1", _("^F4Timeout begins in ^COUNT"), "") \
        MSG_CENTER_NOTIF(1, CENTER_TIMEOUT_ENDING,                                      0, 1, "",                               CPID_TIMEOUT,                   "1 f1", _("^F4Timeout ends in ^COUNT"), "") \
-       MSG_CENTER_NOTIF(1, CENTER_WEAPON_GOTWEP,                                       0, 1, "weapon",                         CPID_ITEM,                      "1 0", _("^BGYou got the ^F1%s"), "") \
-       MSG_CENTER_NOTIF(1, CENTER_WEAPON_DROPPED,                                      1, 1, "weapon withammo",        CPID_ITEM,                      "1 0", _("^BGYou dropped the ^F1%s^BG%s"), "")
+       MSG_CENTER_NOTIF(1, CENTER_WEAPON_GOTWEP,                                       0, 1, "item_wepname",                           CPID_ITEM,      "item_centime 0", _("^BGYou got the ^F1%s"), "") \
+       MSG_CENTER_NOTIF(1, CENTER_WEAPON_DROPPED,                                      1, 1, "item_wepname item_wepammo",      CPID_ITEM,      "item_centime 0", _("^BGYou dropped the ^F1%s^BG%s"), "")
 
 #define MSG_WEAPON_NOTIFICATIONS \
        /*MSG_WEAPON_NOTIF(1, WEAPON_EMPTY,                                                     NO_MSG,                                                                         NO_MSG)*/ \
@@ -565,6 +565,7 @@ var float autocvar_notification_show_sprees = TRUE;
 var float autocvar_notification_show_sprees_info = 3; // 0 = off, 1 = target only, 2 = attacker only, 3 = target and attacker
 var float autocvar_notification_show_sprees_info_newline = FALSE;
 var float autocvar_notification_show_sprees_info_specialonly = TRUE;
+var float autocvar_notification_item_centerprinttime = 1.5;
 var float autocvar_notification_errors_are_fatal = TRUE;
 var float autocvar_notification_lifetime_runtime = 0.5;
 var float autocvar_notification_lifetime_mapload = 10;
@@ -626,6 +627,7 @@ string arg_slot[NOTIF_MAX_ARGS];
 #define ARG_CS_SV 3 // enabled on CSQC and SVQC
 #define ARG_CS 4 // unique result to CSQC
 #define ARG_SV 5 // unique result to SVQC
+#define ARG_DC 6 // unique result to durcnt/centerprint
 
 // todo possible idea.... declare how many floats/strings each arg needs, and then dynamically increment the input
 // this way, we don't need to have duplicates like i.e. s2loc and s3loc
@@ -654,8 +656,9 @@ string arg_slot[NOTIF_MAX_ARGS];
        ARG_CASE(ARG_CS_SV,             "spree_inf",            (autocvar_notification_show_sprees ? notif_arg_spree_inf(1, input, s2, f2) : "")) \
        ARG_CASE(ARG_CS_SV,             "spree_end",            (autocvar_notification_show_sprees ? notif_arg_spree_inf(-1, "", "", f1) : "")) \
        ARG_CASE(ARG_CS_SV,             "spree_lost",           (autocvar_notification_show_sprees ? notif_arg_spree_inf(-2, "", "", f1) : "")) \
-       ARG_CASE(ARG_CS_SV,             "weapon",                       W_Name(f1)) \
-       ARG_CASE(ARG_CS_SV,                     "withammo",             (s1 != "" ? s1 : "")) \
+       ARG_CASE(ARG_CS_SV,             "item_wepname",         W_Name(f1)) \
+       ARG_CASE(ARG_CS_SV,                     "item_wepammo",         (s1 != "" ? s1 : "")) \
+       ARG_CASE(ARG_DC,                "item_centime",         ftos(autocvar_notification_item_centerprinttime)) \
        ARG_CASE(ARG_SV,                        "death_team",           Team_ColoredFullName(f1)) \
        ARG_CASE(ARG_CS,                        "death_team",           Team_ColoredFullName(f1 - 1)) \
        ARG_CASE(ARG_CS_SV,                     "race_time",            mmssss(f2)) \
@@ -970,7 +973,7 @@ string Process_Notif_Args(float arg_type, string args, string notiftype, string
                                switch(strtolower(selected))
                                {
                                        #define ARG_CASE(prog,selected,result) \
-                                               #if (prog == ARG_CS_SV_DC) \
+                                               #if (prog == ARG_CS_SV_DC) || (prog == ARG_DC) \
                                                        case selected: { ++sel_num; break; } \
                                                #endif
                                        NOTIF_ARGUMENT_LIST