]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Added round number in countdown
authorz411 <z411@omaera.org>
Wed, 9 Mar 2022 10:08:20 +0000 (07:08 -0300)
committerz411 <z411@omaera.org>
Wed, 9 Mar 2022 10:08:20 +0000 (07:08 -0300)
hud_luma.cfg
qcsrc/client/announcer.qc
qcsrc/client/hud/panel/centerprint.qc
qcsrc/client/hud/panel/centerprint.qh
qcsrc/common/notifications/all.inc
qcsrc/common/stats.qh
qcsrc/server/command/vote.qc
qcsrc/server/round_handler.qc

index bd0a1d93cd96730eb7fad6ae0331a1ca9af8e486..0dc4fe8d1189c1e5e3d8fa8f895d9cdb589e705f 100644 (file)
@@ -275,7 +275,7 @@ seta hud_panel_centerprint_align "0.5"
 seta hud_panel_centerprint_flip "0"
 seta hud_panel_centerprint_fontscale "1.4"
 seta hud_panel_centerprint_fontscale_bold "2"
-seta hud_panel_centerprint_fontscale_bold "2.5"
+seta hud_panel_centerprint_fontscale_title "2.5"
 
 seta hud_panel_minigameboard_pos "0.22 0.15"
 seta hud_panel_minigameboard_size "0.50 0.60"
index 309d4a603a212aa3151533b1290c6e9aea680c8b..9f502c387ee3131507230ba920110727a9d888d7 100644 (file)
@@ -52,7 +52,7 @@ void Announcer_Countdown(entity this)
        {
                if(inround)
                {
-                       Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTART, countdown_rounded);
+                       Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTART, countdown_rounded, STAT(ROUND_COUNT));
                        Notification annce_num = Announcer_PickNumber(CNT_ROUNDSTART, countdown_rounded);
                        if(annce_num != NULL)
                                Local_Notification(MSG_ANNCE, annce_num);
@@ -112,7 +112,7 @@ void Announcer_Gamestart()
                                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) // don't play it again if countdown was already going
+                       if(!warmup_stage && time < STAT(GAMESTARTTIME))
                                Local_Notification(MSG_ANNCE, ANNCE_PREPARE);
 
                        announcer_countdown.nextthink = startTime - floor(startTime - time + 0.5); //synchronize nextthink to startTime
index c3022b396f03a741ef74cb664e0cb5d6e6e06b34..22824a1719cf774bb6aec06f20f48fb00631b994 100644 (file)
@@ -50,7 +50,7 @@ string centerprint_title;
 void centerprint_Add(int new_id, string strMessage, float duration, int countdown_num)
 {
        TC(int, new_id); TC(int, countdown_num);
-       LOG_INFOF("centerprint_Add: ^2id: %d ^3dur: %d ^5countdown: %d\n'%s'", new_id, duration, countdown_num, strreplace("\n", "^7\\n^7", strMessage));
+       //LOG_INFOF("centerprint_Add: ^2id: %d ^3dur: %d ^5countdown: %d\n'%s'", new_id, duration, countdown_num, strreplace("\n", "^7\\n^7", strMessage));
        int i, j;
 
        if(strMessage == "" && new_id == 0)
index ebc12ef59b6391aaec2dc676672491a371723871..4a96d40c1a7fb1830efce2124089cfda261f3ed1 100644 (file)
@@ -14,9 +14,9 @@ float autocvar_hud_panel_centerprint_fade_subsequent_passtwo_minalpha = 0.5;
 float autocvar_hud_panel_centerprint_fade_subsequent_minfontsize = 0.75;
 float autocvar_hud_panel_centerprint_fade_minfontsize = 1;
 bool autocvar_hud_panel_centerprint_flip;
-float autocvar_hud_panel_centerprint_fontscale;
-float autocvar_hud_panel_centerprint_fontscale_bold = 1.4;
-float autocvar_hud_panel_centerprint_fontscale_title = 2;
+float autocvar_hud_panel_centerprint_fontscale = 1.4;
+float autocvar_hud_panel_centerprint_fontscale_bold = 2;
+float autocvar_hud_panel_centerprint_fontscale_title = 2.5;
 bool autocvar_hud_panel_centerprint_dynamichud = true;
 float autocvar_hud_panel_centerprint_time;
 
index ef68e00a3ae0b2484cc67699d71959cf0395fce6..0b2f05a98233784f6711a06adea9996262e0e30a 100644 (file)
@@ -528,7 +528,7 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input !=
 
     MSG_CENTER_NOTIF(COUNTDOWN_BEGIN,                   N_ENABLE,    0, 0, "",               CPID_ROUND,             "2 0",  _("^BOLDBegin!"), "")
     MSG_CENTER_NOTIF(COUNTDOWN_GAMESTART,               N_ENABLE,    0, 1, "",               CPID_ROUND,             "1 f1", _("^BGGame starts in\n^BOLD^COUNT"), "")
-    MSG_CENTER_NOTIF(COUNTDOWN_ROUNDSTART,              N_ENABLE,    0, 1, "",               CPID_ROUND,             "1 f1", _("^BGRound starts in\n^BOLD^COUNT"), "")
+    MSG_CENTER_NOTIF(COUNTDOWN_ROUNDSTART,              N_ENABLE,    0, 2, "f2",               CPID_ROUND,           "1 f1", _("^BGRound %s starts in\n^BOLD^COUNT"), "")
     MSG_CENTER_NOTIF(COUNTDOWN_ROUNDSTOP,               N_ENABLE,    0, 0, "",               CPID_ROUND,             "2 0",  _("^F4Round cannot start"), "")
 
     MSG_CENTER_NOTIF(ROUND_TIED,                        N_ENABLE,    0, 0, "",               CPID_ROUND,             "0 0",  _("^BGRound tied"), "")
index abadaa47deefb24f227e0f5350d1673dfa8ff02b..e221421a3f7cc898f5b61e1d4b98dd746b310944 100644 (file)
@@ -366,6 +366,7 @@ REGISTER_STAT(Q3COMPAT, int, q3compat)
 #include "physics/movetypes/movetypes.qh"
 float warmup_limit;
 float round_limit;
+int round_count;
 #endif
 
 #ifdef SVQC
@@ -405,6 +406,7 @@ REGISTER_STAT(MOVEVARS_AIRCONTROL, float)
 REGISTER_STAT(FRAGLIMIT, float, autocvar_fraglimit)
 REGISTER_STAT(TIMELIMIT, float, autocvar_timelimit)
 REGISTER_STAT(WARMUP_TIMELIMIT, float, warmup_limit)
+REGISTER_STAT(ROUND_COUNT, int, round_count)
 REGISTER_STAT(ROUND_TIMELIMIT, float, round_limit)
 #ifdef SVQC
 float autocvar_sv_wallfriction;
index 7ff8d2a133e16abd24425031214f7f11201c35aa..727ac66e97b74bc690e182dfb56d224275b60f39 100644 (file)
@@ -349,8 +349,10 @@ void reset_map(bool dorespawn, bool is_fake_round_start)
                        PlayerStats_GameReport_Reset_All();
                }
 
-               if (round_handler_IsActive())
+               if (round_handler_IsActive()) {
+                       round_count = 0;
                        round_handler_Reset(game_starttime);
+               }
        }
 
        if (shuffleteams_on_reset_map)
index b63883dcc828e4b932a984d6bd8d959455610100..6b7549bf7d29f5e2d5c4093c13d93e5d95e5660b 100644 (file)
@@ -35,7 +35,10 @@ void round_handler_Think(entity this)
        {
                if (this.canRoundStart() && !(autocvar_g_campaign && !campaign_bots_may_start))
                {
-                       if (this.cnt == this.count + 1) round_starttime = time + this.count;
+                       if (this.cnt == this.count + 1) {
+                               round_starttime = time + this.count;
+                               ++round_count;
+                       }
                        int f = this.cnt - 1;
                        if (f == 0)
                        {