]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/notifications/all.qh
Merge branch 'master' into Mario/monsters
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / notifications / all.qh
index a94ac9ab93bae4d9b8c7f0cad814cf75b7b49e41..45259741b355aa7d703c0e4db40a276abb53be5e 100644 (file)
@@ -36,6 +36,7 @@ string Get_Notif_TypeName(MSG net_type)
                case MSG_CENTER: return "MSG_CENTER";
                case MSG_MULTI: return "MSG_MULTI";
                case MSG_CHOICE: return "MSG_CHOICE";
+               case MSG_CENTER_KILL: return "MSG_CENTER_KILL";
        }
        LOG_WARNF("Get_Notif_TypeName(%d): Improper net type!", ORDINAL(net_type));
        return "";
@@ -61,7 +62,6 @@ ENUMCLASS(CPID)
        CASE(CPID, MISSING_TEAMS)
        CASE(CPID, MISSING_PLAYERS)
        CASE(CPID, INSTAGIB_FINDAMMO)
-       CASE(CPID, CAMPAIGN_MESSAGE)
        CASE(CPID, MOTD)
        CASE(CPID, NIX)
        CASE(CPID, ONSLAUGHT)
@@ -160,7 +160,9 @@ void Create_Notification_Entity_Choice(entity notif,
 
 void Dump_Notifications(int fh, bool alsoprint);
 
-GENERIC_COMMAND(dumpnotifs, "Dump all notifications into notifications_dump.txt", false)
+#define DEFAULT_FILENAME "notifications_dump.cfg"
+// NOTE: dumpeffectinfo, dumpnotifs, dumpturrets and dumpweapons use similar code
+GENERIC_COMMAND(dumpnotifs, "Dump all notifications into " DEFAULT_FILENAME, false)
 {
        switch (request)
        {
@@ -171,12 +173,12 @@ GENERIC_COMMAND(dumpnotifs, "Dump all notifications into notifications_dump.txt"
                        bool alsoprint = false;
                        if (filename == "")
                        {
-                               filename = "notifications_dump.cfg";
+                               filename = DEFAULT_FILENAME;
                                alsoprint = false;
                        }
                        else if (filename == "-")
                        {
-                               filename = "notifications_dump.cfg";
+                               filename = DEFAULT_FILENAME;
                                alsoprint = true;
                        }
                        int fh = fopen(filename, FILE_WRITE);
@@ -191,21 +193,22 @@ GENERIC_COMMAND(dumpnotifs, "Dump all notifications into notifications_dump.txt"
                                LOG_INFOF("^1Error: ^7Could not open file '%s'!", filename);
                        }
                        #else
-                       LOG_INFO(_("Notification dump command only works with cl_cmd and sv_cmd."));
+                       LOG_INFO("Notification dump command only works with cl_cmd and sv_cmd.");
                        #endif
                        return;
                }
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [filename]");
-                       LOG_HELP("  Where 'filename' is the file to write (default is notifications_dump.cfg),");
+                       LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [<filename>]");
+                       LOG_HELPF("  Where <filename> is the file to write (default is %s),", DEFAULT_FILENAME);
                        LOG_HELP("  if supplied with '-' output to console as well as default,");
                        LOG_HELP("  if left blank, it will only write to default.");
                        return;
                }
        }
 }
+#undef DEFAULT_FILENAME
 
 #ifdef NOTIFICATIONS_DEBUG
 bool autocvar_notification_debug = false;
@@ -310,7 +313,7 @@ float autocvar_notification_lifetime_mapload = 10;
 #endif
 
 #ifdef SVQC
-void Notification_GetCvars(entity this);
+void Notification_GetCvars(entity this, entity store);
 float autocvar_notification_server_allows_location = 1; // 0 = no, 1 = yes
 #else
 float autocvar_notification_item_centerprinttime = 1.5;
@@ -355,8 +358,8 @@ float autocvar_notification_show_sprees_center_specialonly = true;
        f1points: point or points depending on f1
        f1ord: count_ordinal of f1
        f1time: process_time of f1
-       f1race_time: mmssss of f1
-       f2race_time: mmssss of f2
+       f1race_time: mmssth of f1
+       f2race_time: mmssth of f2
        race_col: color of race time/position (i.e. good or bad)
        race_diff: show time difference between f2 and f3
        missing_teams: show which teams still need players
@@ -415,11 +418,11 @@ string BUFF_NAME(int i);
        ARG_CASE(ARG_CS,        "f1points",      (f1 == 1 ? _("point") : _("points"))) \
        ARG_CASE(ARG_CS_SV,     "f1ord",         count_ordinal(f1)) \
        ARG_CASE(ARG_CS_SV,     "f1time",        process_time(2, f1)) \
-       ARG_CASE(ARG_CS_SV_HA,  "f1race_time",   mmssss(f1)) \
-       ARG_CASE(ARG_CS_SV_HA,  "f2race_time",   mmssss(f2)) \
-       ARG_CASE(ARG_CS_SV_HA,  "f3race_time",   mmssss(f3)) \
+       ARG_CASE(ARG_CS_SV_HA,  "f1race_time",   mmssth(f1)) \
+       ARG_CASE(ARG_CS_SV_HA,  "f2race_time",   mmssth(f2)) \
+       ARG_CASE(ARG_CS_SV_HA,  "f3race_time",   mmssth(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_SV,     "race_diff",     ((f2 > f3) ? sprintf(CCR("^1[+%s]"), mmssth(f2 - f3)) : sprintf(CCR("^2[-%s]"), mmssth(f3 - f2)))) \
        ARG_CASE(ARG_CS,        "missing_teams", notif_arg_missing_teams(f1)) \
        ARG_CASE(ARG_CS,        "pass_key",      getcommandkey(_("drop flag"), "+use")) \
        ARG_CASE(ARG_CS,        "nade_key",      getcommandkey(_("throw nade"), "dropweapon")) \
@@ -630,6 +633,7 @@ string notif_arg_item_wepammo(float f1, float f2)
 {
        string ammoitems = "";
        Weapon wep = REGISTRY_GET(Weapons, f1);
+       // TODO: registry handles
        switch (wep.ammo_type)
        {
                case RES_SHELLS:  ammoitems = ITEM_Shells.m_name;      break;