From: bones_was_here Date: Mon, 26 Sep 2022 05:22:33 +0000 (+1000) Subject: Display map shortname and longname in welcome message X-Git-Tag: xonotic-v0.8.6~348^2~10 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=370a7a72deb3b8ed440ff20a2025d6ca35d0c998;p=xonotic%2Fxonotic-data.pk3dir.git Display map shortname and longname in welcome message --- diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index eb4cb7ba8..da5f2fbfb 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -1434,6 +1434,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");