]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
More announcer stuff, plus fix #1476
authorSamual Lenks <samual@xonotic.org>
Mon, 15 Apr 2013 03:28:51 +0000 (23:28 -0400)
committerSamual Lenks <samual@xonotic.org>
Mon, 15 Apr 2013 03:28:51 +0000 (23:28 -0400)
qcsrc/common/notifications.qc
qcsrc/common/notifications.qh

index bc06af1b98adeb9e847d804e32bdae1124e9bc7e..fbed3e58987fdb4e70e307edd6eee0bef1bb3c4d 100644 (file)
@@ -426,7 +426,7 @@ void Create_Notification_Entity(
        if(msg_is_multi)
        {
                // Set MSG_MULTI string/float counts
-               if((infoname == NO_MSG) && (centername == NO_MSG))
+               if((anncename == NO_MSG) && (infoname == NO_MSG) && (centername == NO_MSG))
                {
                        print(sprintf(
                                strcat(
@@ -440,6 +440,9 @@ void Create_Notification_Entity(
                }
                else
                {
+                       // announcements don't actually need any arguments, so lets not even count them.
+                       if(anncename != NO_MSG) { notif.nent_msgannce = msg_annce_notifs[anncename - 1]; }
+                       
                        float infoname_stringcount = 0, infoname_floatcount = 0;
                        float centername_stringcount = 0, centername_floatcount = 0;
                        
@@ -465,8 +468,10 @@ void Create_Notification_Entity(
        else if(typeid == MSG_ANNCE)
        {
                // Set MSG_ANNCE information and handle precaching
+               #ifdef CSQC
                if(snd != "")
                {
+                       precache_sound(sprintf("announcer/%s/%s", autocvar_cl_announcer, snd));
                        notif.nent_channel = channel;
                        notif.nent_snd = strzone(snd);
                        notif.nent_vol = vol;
@@ -484,6 +489,9 @@ void Create_Notification_Entity(
                        ));
                        notif_error = TRUE;
                }
+               #else
+               notif.nent_enabled = FALSE;
+               #endif
        }
        else
        {
index c525bdd0c3fd0c70c1faf224d91a8a94ab09fc28..84d41f8e24b34d871d363c84ce817228e75f1ba9 100644 (file)
@@ -346,8 +346,8 @@ void Send_Notification_WOVA(
        MSG_INFO_NOTIF(1, INFO_QUIT_KICK_SPECTATING,           0, 0, "", "",                            "",                     _("^F2You were kicked from the server because you are a spectator and spectators aren't allowed at the moment.\n"), "") \
        MSG_INFO_NOTIF(1, INFO_QUIT_SPECTATE,                  1, 0, "s1", "",                          "",                     _("^BG%s^F3 is now spectating\n"), "") \
        MSG_INFO_NOTIF(1, INFO_RACE_ABANDONED,                 1, 0, "s1", "",                                                        "",                      _("^BG%s^BG has abandoned the race\n"), "") \
-       MSG_INFO_NOTIF(1, INFO_RACE_FAIL_RANKED,               1, 3, "s1 race_col f1ord race_col f2race_time race_diff", "s1",        "race_newfail",          _("^BG%s^BG couldn't break their %s%s^BG place record of %s%s %s\n"), "") \
-       MSG_INFO_NOTIF(1, INFO_RACE_FAIL_UNRANKED,             1, 3, "s1 race_col f1ord race_col f2race_time race_diff", "s1",        "race_newfail",          _("^BG%s^BG couldn't break the %s%s^BG place record of %s%s %s\n"), "") \
+       MSG_INFO_NOTIF(1, INFO_RACE_FAIL_RANKED,               1, 3, "s1 race_col f1ord race_col f3race_time race_diff", "s1",        "race_newfail",          _("^BG%s^BG couldn't break their %s%s^BG place record of %s%s %s\n"), "") \
+       MSG_INFO_NOTIF(1, INFO_RACE_FAIL_UNRANKED,             1, 3, "s1 race_col f1ord race_col f3race_time race_diff", "s1",        "race_newfail",          _("^BG%s^BG couldn't break the %s%s^BG place record of %s%s %s\n"), "") \
        MSG_INFO_NOTIF(1, INFO_RACE_FINISHED,                  1, 0, "s1", "",                                                        "",                      _("^BG%s^BG has finished the race\n"), "") \
        MSG_INFO_NOTIF(1, INFO_RACE_NEW_BROKEN,                2, 3, "s1 s2 race_col f1ord race_col f2race_time race_diff", "s1 s2",  "race_newrankyellow",    _("^BG%s^BG broke %s^BG's %s%s^BG place record with %s%s %s\n"), "") \
        MSG_INFO_NOTIF(1, INFO_RACE_NEW_IMPROVED,              1, 3, "s1 race_col f1ord race_col f2race_time race_diff", "s1",        "race_newtime",          _("^BG%s^BG improved their %s%s^BG place record with %s%s %s\n"), "") \
@@ -779,6 +779,7 @@ string arg_slot[NOTIF_MAX_ARGS];
     ARG_CASE(ARG_CS,        "f1time",        process_time(2, f1)) \
     ARG_CASE(ARG_CS_SV,     "f1race_time",   mmssss(f1)) \
     ARG_CASE(ARG_CS_SV,     "f2race_time",   mmssss(f2)) \
+    ARG_CASE(ARG_CS_SV,     "f3race_time",   mmssss(f3)) \
     ARG_CASE(ARG_CS_SV,     "race_col",      CCR(((f1 == 1) ? "^F1" : "^F2"))) \
     ARG_CASE(ARG_CS_SV,     "race_diff",     ((f2 > f3) ? sprintf(CCR("^1[+%s]"), mmssss(f2 - f3)) : sprintf(CCR("^2[-%s]"), mmssss(f3 - f2)))) \
     ARG_CASE(ARG_CS,        "kh_teams",      notif_arg_kh_teams(f1, f2, f3, f4)) \