From: z411 Date: Sun, 20 Mar 2022 03:57:30 +0000 (-0300) Subject: Show player names in centerprint title in 1v1 games X-Git-Tag: xonotic-v0.8.5~128^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5ecbee94a0f236f3afc6dd84db22945377363c8c;p=xonotic%2Fxonotic-data.pk3dir.git Show player names in centerprint title in 1v1 games --- diff --git a/qcsrc/client/announcer.qc b/qcsrc/client/announcer.qc index 64606a684..bd89c8045 100644 --- a/qcsrc/client/announcer.qc +++ b/qcsrc/client/announcer.qc @@ -5,6 +5,7 @@ #include #include #include +#include bool announcer_1min; bool announcer_5min; @@ -107,7 +108,18 @@ void Announcer_Gamestart() if(!warmup_stage && time < STAT(GAMESTARTTIME)) { - centerprint_SetTitle(strcat("^BG", MapInfo_Type_ToText(gametype))); // Set centerprint title + if (gametype.m_1v1) + { + entity pl1 = players.sort_next; + entity pl2 = pl1.sort_next; + string pl1_name = (pl1 && pl1.team != NUM_SPECTATOR ? entcs_GetName(pl1.sv_entnum) : "???"); + string pl2_name = (pl2 && pl2.team != NUM_SPECTATOR ? entcs_GetName(pl2.sv_entnum) : "???"); + + centerprint_SetTitle(sprintf(_("^BG%s^BG vs %s"), pl1_name, pl2_name)); // Show duelers in 1v1 game mode + } + else + centerprint_SetTitle(strcat("^BG", MapInfo_Type_ToText(gametype))); // Show game type as title + if(time + 5.0 < startTime) // if connecting to server while restart was active don't always play prepareforbattle Local_Notification(MSG_ANNCE, ANNCE_PREPARE); }