]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/main.qc
Make MOTD header fancier in welcome message
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / main.qc
index eb4cb7ba87e7f2b1312210f0914417d347217b1c..9fc858cdad179673c3166f5b2dde64b496129d79 100644 (file)
@@ -129,7 +129,6 @@ void CSQC_Init()
        {
                get_mi_min_max_texcoords(1); // try the CLEVER way first
                minimapname = strcat("gfx/", mi_shortname, "_radar");
-               shortmapname = mi_shortname;
 
                if (precache_pic(minimapname) == "")
                {
@@ -1434,6 +1433,16 @@ bool net_handle_ServerWelcome()
 
        msg = strcat(msg, "^8\n\n", strcat(_("Gametype:"), " ^1", MapInfo_Type_ToText(gametype)), "^8\n");
 
+       msg = strcat(msg, "^8\n", _("Map:"), " ^2");
+       if (world.message == "")
+               msg = strcat(msg, mi_shortname, "^8\n");
+       else
+       {
+               int i = strstrofs(world.message, " by ", 0); // matches _MapInfo_Generate()
+               string longname = i >= 0 ? substring(world.message, 0, i) : world.message;
+               msg = strcat(msg, (strcasecmp(longname, mi_shortname) ? strcat(mi_shortname, " ^7// ^2") : ""), longname, "^8\n");
+       }
+
        if (srv_minplayers || srv_maxplayers)
        {
                msg = strcat(msg, "^8\n", _("This match supports"), " ^5");
@@ -1459,7 +1468,7 @@ bool net_handle_ServerWelcome()
        msg = strcat(msg, mutator_msg); // trust that the mutator will do proper formatting
 
        if (motd != "")
-               msg = strcat(msg, "\n\n^8", _("MOTD:"), " ^7", motd);
+               msg = strcat(msg, "^8\n^9↓ ", _("Server's message"), " ↓^8\n", motd);
 
        strcpy(welcome_msg, msg);
        welcome_msg_menu_check_maxtime = time + 1; // wait for menu to load before showing the welcome dialog