]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/announcer.qc
Removing short fade in cvar - we really never want fade in for counts
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / announcer.qc
index 109ee5ac1c25cb0e5529cadfd46a527f616a964f..0635ea5fc48ce54fd525ba96e9577ae7f505c603 100644 (file)
@@ -4,6 +4,7 @@
 #include <client/mutators/_mod.qh>
 #include <common/notifications/all.qh>
 #include <common/stats.qh>
+#include <common/mapinfo.qh>
 
 bool announcer_1min;
 bool announcer_5min;
@@ -26,6 +27,7 @@ void Announcer_Countdown(entity this)
                Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTOP);
                delete(this);
                announcer_countdown = NULL;
+               centerprint_ClearTitle();
                return;
        }
        if(starttime <= time && roundstarttime != starttime) // game start time has passed
@@ -35,20 +37,22 @@ void Announcer_Countdown(entity this)
        float countdown = (inround ? roundstarttime - time : starttime - time);
        float countdown_rounded = floor(0.5 + countdown);
 
+       if(time >= starttime) centerprint_ClearTitle();
+
        if(countdown <= 0) // countdown has finished, starttime is now
        {
                Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_BEGIN);
                Local_Notification(MSG_MULTI, MULTI_COUNTDOWN_BEGIN);
                delete(this);
                announcer_countdown = NULL;
+               centerprint_ClearTitle();
                return;
        }
        else // countdown is still going
        {
-               // if concomitant countdown to round start overrides countdown to game start
                if(inround)
                {
-                       Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTART, countdown_rounded);
+                       Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTART, STAT(ROUNDS_PLAYED) + 1, countdown_rounded);
                        Notification annce_num = Announcer_PickNumber(CNT_ROUNDSTART, countdown_rounded);
                        if(annce_num != NULL)
                                Local_Notification(MSG_ANNCE, annce_num);
@@ -72,7 +76,7 @@ void Announcer_Countdown(entity this)
  * timelimit, fraglimit and game_starttime! Requires engine changes (remove STAT_TIMELIMIT
  * and STAT_FRAGLIMIT to be auto-sent)
  */
- float previous_game_starttime;
+float previous_game_starttime;
 void Announcer_Gamestart()
 {
        float startTime = STAT(GAMESTARTTIME);
@@ -103,9 +107,12 @@ void Announcer_Gamestart()
                                setthink(announcer_countdown, Announcer_Countdown);
                        }
 
-                       if(time + 5.0 < startTime) // if connecting to server while restart was active don't always play prepareforbattle
-                       if(time > announcer_countdown.nextthink) // don't play it again if countdown was already going
-                               Local_Notification(MSG_ANNCE, ANNCE_PREPARE);
+                       if(!warmup_stage && time < STAT(GAMESTARTTIME))
+                       {
+                               centerprint_SetTitle(MapInfo_Type_ToText(gametype)); // Set centerprint 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);
+                       }
 
                        announcer_countdown.nextthink = startTime - floor(startTime - time + 0.5); //synchronize nextthink to startTime
                }