]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bugfixes
authorz411 <z411@omaera.org>
Sun, 13 Sep 2020 01:36:42 +0000 (22:36 -0300)
committerz411 <z411@omaera.org>
Sun, 13 Sep 2020 01:36:42 +0000 (22:36 -0300)
qcsrc/client/announcer.qc
qcsrc/client/hud/panel/centerprint.qc

index 44237d9b386a67b86f77b18c189ca69bd1cca3f6..01afb0902c7d36561150383b8435459265d4a795 100644 (file)
@@ -7,6 +7,10 @@
 #include <common/mapinfo.qh>
 #include "hud/panel/centerprint.qh"
 
+#include <common/ent_cs.qh>
+#include <common/gamemodes/gamemode/duel/duel.qh>
+#include "miscfunctions.qh"
+
 bool announcer_1min;
 bool announcer_5min;
 string AnnouncerOption()
@@ -64,7 +68,7 @@ void Announcer_Countdown(entity this)
        }
        else // countdown is still going
        {
-               // if concomitant countdown to round start overrides countdown to game start
+               // counting down to rounds
                if(rounds)
                {
                        Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTART, countdown_rounded);
@@ -77,12 +81,10 @@ void Announcer_Countdown(entity this)
                {
                        Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_GAMESTART, countdown_rounded);
                        Notification annce_num = Announcer_PickNumber(CNT_GAMESTART, countdown_rounded);
-                       if(annce_num != NULL)
+                       if(!roundstarttime && annce_num != NULL) // count only if the gametype has no rounds
                                Local_Notification(MSG_ANNCE, annce_num);
                        this.nextthink = (starttime - (countdown - 1));
                }
-               
-               
        }
 }
 
@@ -125,12 +127,22 @@ void Announcer_Gamestart()
                        }
 
                        // z411 set title
-                       if(time < STAT(GAMESTARTTIME) && !warmup_stage)
-                               centerprint_SetTitle(MapInfo_Type_ToText(gametype));
+                       if(time < STAT(GAMESTARTTIME) && !warmup_stage) {
+                               //if(IS_GAMETYPE(DUEL)) {
+                               //if(g_duel) {
+                               if(gametype == MAPINFO_TYPE_DUEL) {
+                                       entity pl1 = players.sort_next;
+                                       entity pl2 = pl1.sort_next;
+                                       
+                                       centerprint_SetTitle(strcat(entcs_GetName(pl1.sv_entnum), " vs ", entcs_GetName(pl2.sv_entnum)));
+                               } else {
+                                       centerprint_SetTitle(MapInfo_Type_ToText(gametype));
+                               }
+                       }
                        
                        if(time + 5.0 < startTime) // if connecting to server while restart was active don't always play prepareforbattle
-                       if(time > announcer_countdown.nextthink && !warmup_stage) { // don't play it again if countdown was already going
-                               if(teamplay && time < startTime)
+                       if(time > announcer_countdown.nextthink && !warmup_stage && time < STAT(GAMESTARTTIME)) { // don't play it again if countdown was already going
+                               if(teamplay)
                                        Local_Notification(MSG_ANNCE, ANNCE_PREPARE_TEAM);
                                else
                                        Local_Notification(MSG_ANNCE, ANNCE_PREPARE);
index f40966e0bf1310bd3a3187d7a7e82b6b2ab23b90..88819c932e605cbe9396a959e16fa24305b8dfe9 100644 (file)
@@ -297,7 +297,7 @@ void HUD_CenterPrint()
        // z411 title
        if(centerprint_title_show) {
                fontsize = '1 1 0' * vid_conheight/50 * autocvar_hud_panel_centerprint_fontscale * 1.5;
-               drawstring(pos + '0.5 0 0' * (panel_size.x - stringwidth(centerprint_title, true, fontsize)), centerprint_title, fontsize, '1 1 1', 1, DRAWFLAG_NORMAL);
+               drawcolorcodedstring(pos + '0.5 0 0' * (panel_size.x - stringwidth(centerprint_title, true, fontsize)), centerprint_title, fontsize, 1, DRAWFLAG_NORMAL);
                pos.y += fontsize.y + (fontsize.y / 4);
                
                all_messages_expired = false;