]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/announcer.qc
Calculate centerprint title offset in real time in duel
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / announcer.qc
index 59f977818748240387cc9cca1bc569093a9623d4..e86702afa086a8314ee12ba92540f605929a6b7d 100644 (file)
@@ -42,8 +42,7 @@ void Announcer_Duel()
        strcpy(prev_pl2_name, pl2_name);
 
        // There are new duelers, update title
-       float offset = stringwidth(pl2_name, true, hud_fontsize) - stringwidth(pl1_name, true, hud_fontsize) - 1;
-       centerprint_SetTitle(sprintf("^BG%s^BG  %s  %s", pl1_name, _("vs"), pl2_name), offset / 2);
+       centerprint_SetDuelTitle(pl1_name, pl2_name, _("vs"));
 }
 
 void Announcer_ClearTitle()
@@ -150,7 +149,7 @@ void Announcer_Gamestart()
                                if (gametype.m_1v1)
                                        Announcer_Duel();
                                else
-                                       centerprint_SetTitle(strcat("^BG", MapInfo_Type_ToText(gametype)), 0); // Show game type as title
+                                       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);