]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/notifications.qh
Update that other shit too
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / notifications.qh
index 179bf9b91967175f4b39add2cafdf7959bfc4914..95b022820df4fa6d5df8d7d55a9a8d594e7ab15b 100644 (file)
@@ -6,7 +6,7 @@
 // main types/groups of notifications
 #define MSG_INFO 1 // "Global" information messages (sent to console, and notify panel if it has an icon)
 #define MSG_CENTER 2 // "Personal" centerprint messages
-#define MSG_CENTER_KILL 3 // Kill centerprint message
+#define MSG_CENTER_CPID 3 // Kill centerprint message
 #define MSG_MULTI 4 // Subcall MSG_INFO and/or MSG_CENTER notifications
 
 #define NO_MSG -12345 
@@ -94,10 +94,6 @@ void Send_Notification_WOVA(
        float net_type, float net_name,
        string s1, string s2, string s3, string s4,
        float f1, float f2, float f3, float f4);
-
-// legacy stuff
-void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration, float countdown_num);
-#define Send_CSQC_Centerprint_Generic_Expire(e,id) Send_CSQC_Centerprint_Generic(e, id, "", 1, 0)
 #endif
 
 
@@ -265,21 +261,21 @@ void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration,
        MSG_INFO_NOTIF(1, INFO_FREEZETAG_FREEZE,                                2, 0, "s1 s2", "",                                              "",                                             _("^BG%s^K1 was frozen by ^BG%s\n"), "") \
        MSG_INFO_NOTIF(1, INFO_FREEZETAG_SELF,                                  1, 0, "s1", "",                                                 "",                                             _("^BG%s^K1 froze themself\n"), "") \
        MSG_INFO_NOTIF(1, INFO_GODMODE_OFF,                                             0, 1, "f1", "",                                                 "",                                             _("^BGGodmode saved you %s units of damage, cheater!\n"), "") \
-       MSG_INFO_NOTIF(0, INFO_ITEM_WEAPON_DONTHAVE,                    0, 1, "item_wepname", "",                               "",                                             _("^BGYou do not have the ^F1%s\n"), "") \
-       MSG_INFO_NOTIF(0, INFO_ITEM_WEAPON_DROP,                                1, 1, "item_wepname item_wepammo", "",  "",                                             _("^BGYou dropped the ^F1%s^BG%s\n"), "") \
-       MSG_INFO_NOTIF(0, INFO_ITEM_WEAPON_GOT,                                 0, 1, "item_wepname", "",                               "",                                             _("^BGYou got the ^F1%s\n"), "") \
-       MSG_INFO_NOTIF(0, INFO_ITEM_WEAPON_NOAMMO,                              0, 1, "item_wepname", "",                               "",                                             _("^BGYou don't have enough ammo for the ^F1%s\n"), "") \
-       MSG_INFO_NOTIF(0, INFO_ITEM_WEAPON_PRIMORSEC,                   0, 3, "item_wepname f2primsec f3primsec", "", "",                               _("^F1%s %s^BG is unable to fire, but its ^F1%s^BG can\n"), "") \
-       MSG_INFO_NOTIF(0, INFO_ITEM_WEAPON_UNAVAILABLE,                 0, 1, "item_wepname", "",                               "",                                             _("^F1%s^BG is ^F4not available^BG on this map\n"), "") \
+       MSG_INFO_NOTIF(0, INFO_ITEM_WEAPON_DONTHAVE,                    0, 1, "item_wepname", "",                                               "",                             _("^BGYou do not have the ^F1%s\n"), "") \
+       MSG_INFO_NOTIF(0, INFO_ITEM_WEAPON_DROP,                                1, 1, "item_wepname item_wepammo", "",                  "",                             _("^BGYou dropped the ^F1%s^BG%s\n"), "") \
+       MSG_INFO_NOTIF(0, INFO_ITEM_WEAPON_GOT,                                 0, 1, "item_wepname", "",                                               "",                             _("^BGYou got the ^F1%s\n"), "") \
+       MSG_INFO_NOTIF(0, INFO_ITEM_WEAPON_NOAMMO,                              0, 1, "item_wepname", "",                                               "",                             _("^BGYou don't have enough ammo for the ^F1%s\n"), "") \
+       MSG_INFO_NOTIF(0, INFO_ITEM_WEAPON_PRIMORSEC,                   0, 3, "item_wepname f2primsec f3primsec", "",   "",                     _("^F1%s %s^BG is unable to fire, but its ^F1%s^BG can\n"), "") \
+       MSG_INFO_NOTIF(0, INFO_ITEM_WEAPON_UNAVAILABLE,                 0, 1, "item_wepname", "",                                               "",                             _("^F1%s^BG is ^F4not available^BG on this map\n"), "") \
        MSG_INFO_NOTIF(2, INFO_JOIN_CONNECT,                                    1, 0, "s1", "",                                                 "",                                             _("^BG%s^F3 connected%s\n"), "") \
        MULTITEAM_INFO(2, INFO_JOIN_CONNECT_TEAM_, 4,                   1, 0, "s1", "",                                                 "",                                             _("^BG%s^F3 connected and joined the ^TC^TT\n"), "") \
        MSG_INFO_NOTIF(2, INFO_JOIN_PLAY,                                               1, 0, "s1", "",                                                 "",                                             _("^BG%s^F3 is now playing\n"), "") \
        MSG_INFO_NOTIF(1, INFO_KEEPAWAY_DROPPED,                                1, 0, "s1", "s1",                                               "notify_balldropped",   _("^BG%s^BG has dropped the ball!\n"), "") \
        MSG_INFO_NOTIF(1, INFO_KEEPAWAY_PICKUP,                                 1, 0, "s1", "s1",                                               "notify_ballpickedup",  _("^BG%s^BG has picked up the ball!\n"), "") \
        MULTITEAM_INFO(1, INFO_KEYHUNT_CAPTURE_, 4,                             1, 0, "s1", "",                                                 "",                                             _("^BG%s^BG captured the keys for the ^TC^TT team\n"), "") \
-       MULTITEAM_INFO(1, INFO_KEYHUNT_DROP_, 4,                                1, 0, "s1", "",                                                 "",                                             _("^BG%s^BG dropped the ^TC^TT key\n"), "") \
-       MULTITEAM_INFO(1, INFO_KEYHUNT_LOST_, 4,                                1, 0, "s1", "",                                                 "",                                             _("^BG%s^BG lost the ^TC^TT key\n"), "") \
-       MULTITEAM_INFO(1, INFO_KEYHUNT_PICKUP_, 4,                              1, 0, "s1", "",                                                 "",                                             _("^BG%s^BG picked up the ^TC^TT key\n"), "") \
+       MULTITEAM_INFO(1, INFO_KEYHUNT_DROP_, 4,                                1, 0, "s1", "",                                                 "",                                             _("^BG%s^BG dropped the ^TC^TT Key\n"), "") \
+       MULTITEAM_INFO(1, INFO_KEYHUNT_LOST_, 4,                                1, 0, "s1", "",                                                 "",                                             _("^BG%s^BG lost the ^TC^TT Key\n"), "") \
+       MULTITEAM_INFO(1, INFO_KEYHUNT_PICKUP_, 4,                              1, 0, "s1", "",                                                 "",                                             _("^BG%s^BG picked up the ^TC^TT Key\n"), "") \
        MSG_INFO_NOTIF(1, INFO_LMS_NOLIVES,                                             1, 0, "s1", "",                                                 "",                                             _("^BG%s^F3 has no more lives left\n"), "") \
        MSG_INFO_NOTIF(1, INFO_LMS_FORFEIT,                                             1, 0, "s1", "",                                                 "",                                             _("^BG%s^F3 forfeited\n"), "") \
        MSG_INFO_NOTIF(1, INFO_POWERUP_INVISIBILITY,                    1, 0, "s1", "s1",                                               "strength",                             _("^BG%s^K1 picked up Invisibility\n"), "") \
@@ -290,13 +286,16 @@ void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration,
        MSG_INFO_NOTIF(2, INFO_QUIT_KICK_IDLING,                                1, 0, "s1", "",                                                 "",                                             _("^BG%s^F3 was kicked for idling\n"), "") \
        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(2, INFO_QUIT_SPECTATE,                                   1, 0, "s1", "",                                                 "",                                             _("^BG%s^F3 is now spectating\n"), "") \
-       MSG_INFO_NOTIF(1, INFO_RACE_FAIL_RANKED,                                1, 3, "s1 f1ord race_time race_diff", "s1",             "race_newfail", _("^BG%s^BG couldn't break their %s place record of %s %s\n"), "") \
-       MSG_INFO_NOTIF(1, INFO_RACE_FAIL_UNRANKED,                              1, 3, "s1 f1ord race_time race_diff", "s1",             "race_newfail", _("^BG%s^BG couldn't break the %s place record of %s %s\n"), "") \
-       MSG_INFO_NOTIF(1, INFO_RACE_NEW_RECORD,                                 2, 0, "s1 s2", "s1",                                    "race_newrecordserver", "TODO\n", "") \
-       MSG_INFO_NOTIF(1, INFO_RACE_NEW_TIME,                                   2, 0, "s1 s2", "s1",                                    "race_newtime",                 "TODO\n", "") \
-       MSG_INFO_NOTIF(1, INFO_RACE_NEW_RANK,                                   2, 0, "s1 s2", "s1",                                    "race_newrankyellow",   "TODO\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_FINISHED,                                   1, 0, "s1", "",                                                                                                                         "",                                             _("^BG%s^BG has finished 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_NEW_MISSING_UID,                    1, 1, "s1 f1race_time", "s1",                                                                                           "race_newfail",                         _("^BG%s^BG scored a new record with ^F2%s^BG, but unfortunately lacks a UID and will be lost.\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"), "") \
+       MSG_INFO_NOTIF(1, INFO_RACE_NEW_SET,                                    1, 2, "s1 race_col f1ord race_col f2race_time", "s1",                                           "race_newrecordserver",         _("^BG%s^BG set the %s%s^BG place record with %s%s\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"), "") \
        MULTITEAM_INFO(1, INFO_SCORES_, 4,                                              0, 0, "", "",                                                   "",                                             _("^TC^TT ^BGteam scores!\n"), "") \
-       MSG_INFO_NOTIF(1, INFO_SPECTATE_WARNING,                                0, 1, "f1", "",                                                 "",                                             _("^F2You have to become a player within the next %s seconds, otherwise you will be kicked, because spectating isn't allowed at this time!\n"), "") \
+       MSG_INFO_NOTIF(1, INFO_SPECTATE_WARNING,                                0, 1, "f1secs", "",                                             "",                                             _("^F2You have to become a player within the next %s, otherwise you will be kicked, because spectating isn't allowed at this time!\n"), "") \
        MSG_INFO_NOTIF(1, INFO_SUPERWEAPON_PICKUP,                              0, 0, "s1", "s1",                                               "strength",                             _("^BG%s^K1 picked up a Superweapon\n"), "") \
        MSG_INFO_NOTIF(2, INFO_VERSION_BETA,                                    2, 0, "s1 s2", "",                                              "",                                             _("^F4NOTE: ^BGThe server is running ^F1Xonotic %s (beta)^BG, you have ^F2Xonotic %s\n"), "") \
        MSG_INFO_NOTIF(2, INFO_VERSION_OLD,                                             2, 0, "s1 s2", "",                                              "",                                             _("^F4NOTE: ^BGThe server is running ^F1Xonotic %s^BG, you have ^F2Xonotic %s\n"), "") \
@@ -458,7 +457,7 @@ void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration,
        MSG_CENTER_NOTIF(1, CENTER_NIX_NEWWEAPON,                                       0, 1, "item_wepname",   CPID_NIX,                               "0 0", _("^F2Active weapon: ^F1%s"), "") \
        MSG_CENTER_NOTIF(1, CENTER_JOIN_NOSPAWNS,                                       0, 0, "",                               CPID_PREVENT_JOIN,              "0 0", _("^K1No spawnpoints available!\nHope your team can fix it..."), "") \
        MSG_CENTER_NOTIF(1, CENTER_JOIN_PREVENT,                                        0, 0, "",                               CPID_PREVENT_JOIN,              "0 0", _("^K1You may not join the game at this time.\nThe player limit reached maximum capacity."), "") \
-       MSG_CENTER_NOTIF(1, CENTER_OVERTIME_TIME,                                       0, 1, "f1time",                 CPID_OVERTIME,                  "0 0", _("^F2Now playing ^F4OVERTIME^F2!\nAdded ^F4%s ^F2minute(s) to the game!"), "") \
+       MSG_CENTER_NOTIF(1, CENTER_OVERTIME_TIME,                                       0, 1, "f1time",                 CPID_OVERTIME,                  "0 0", _("^F2Now playing ^F4OVERTIME^F2!\nAdded ^F4%s^F2 to the game!"), "") \
        MSG_CENTER_NOTIF(1, CENTER_OVERTIME_FRAG,                                       0, 0, "",                               CPID_OVERTIME,                  "0 0", _("^F2Now playing ^F4OVERTIME^F2!\nKeep fragging until we have a winner!"), _("^F2Now playing ^F4OVERTIME^F2!\nKeep scoring until we have a winner!")) \
        MSG_CENTER_NOTIF(1, CENTER_POWERDOWN_INVISIBILITY,                      0, 0, "",                               CPID_POWERUP,                   "0 0", _("^F2Invisibility has worn off"), "") \
        MSG_CENTER_NOTIF(1, CENTER_POWERDOWN_SHIELD,                            0, 0, "",                               CPID_POWERUP,                   "0 0", _("^F2Shield has worn off"), "") \
@@ -711,7 +710,11 @@ string arg_slot[NOTIF_MAX_ARGS];
        ARG_CASE(ARG_CS,                        "f3primsec",            (f3 ? _("secondary") : _("primary"))) \
        ARG_CASE(ARG_CS,                        "f1secs",                       count_seconds(f1)) \
        ARG_CASE(ARG_CS_SV,                     "f1ord",                        count_ordinal(f1)) \
-       ARG_CASE(ARG_CS,                        "f1time",                       process_time("todo", f1)) \
+       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,                     "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,                        "pass_key",             ((((tmp_s = getcommandkey("pass", "+use")) != "pass") && !(strstrofs(tmp_s, "not bound", 0) >= 0)) ? sprintf(CCR(_(" ^F1(Press %s)")), tmp_s) : "")) \
        ARG_CASE(ARG_CS,                        "frag_ping",            ((f2 != NO_MSG) ? sprintf(CCR(_("\n(Ping ^2%d^BG)")), f2) : "")) \
        ARG_CASE(ARG_CS,                        "frag_stats",           sprintf(CCR(_("\n(Health ^1%d^BG / Armor ^2%d^BG)%s")), f2, f3, ((f4 != NO_MSG) ? sprintf(CCR(_(" (Ping ^2%d^BG)")), f4) : ""))) \
@@ -725,9 +728,7 @@ string arg_slot[NOTIF_MAX_ARGS];
        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,                        "kh_teams",             notif_arg_kh_teams(f1, f2, f3, f4)) \
-       ARG_CASE(ARG_CS_SV,                     "race_time",            mmssss(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))
 
 #define NOTIF_HIT_MAX(count,funcname) if(sel_num == count) { backtrace(sprintf("%s: Hit maximum arguments!\n", funcname)); break; }
 #define NOTIF_HIT_UNKNOWN(token,funcname) { backtrace(sprintf("%s: Hit unknown token in selected string! '%s'\n", funcname, selected)); break; }