]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Refactor HUD_InfoMessages()
authorbones_was_here <bones_was_here@xonotic.au>
Wed, 23 Nov 2022 14:46:55 +0000 (00:46 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Fri, 6 Jan 2023 07:16:32 +0000 (17:16 +1000)
Because sv_ready_restart (ReadyRestart triggered by readying up
*without* being in warmup_stage) was removed in
https://gitlab.com/xonotic/xonotic-data.pk3dir/-/merge_requests/940
we no longer need to display any ready-related messages outside of
warmup_stage.

qcsrc/client/hud/panel/infomessages.qc

index cfed7d7359dc410992f6cb3da25e0d9f389ad2f2..e85a7f30c3e82a022a543d640ae0621f90bf1a0b 100644 (file)
@@ -140,45 +140,44 @@ void HUD_InfoMessages()
                        InfoMessage(s);
                }
 
-               if(warmup_stage)
-               {
-                       s = _("^2Currently in ^1warmup^2 stage!");
-                       InfoMessage(s);
-               }
-
                string blinkcolor;
                if(time % 1 >= 0.5)
                        blinkcolor = "^1";
                else
                        blinkcolor = "^3";
 
-               int players_needed = 0;
-               if(warmup_stage && STAT(WARMUP_TIMELIMIT) <= 0 && srv_minplayers)
+               if(warmup_stage)
                {
-                       Scoreboard_UpdatePlayerTeams(); // ensure numplayers is current
-                       players_needed = srv_minplayers - numplayers;
-               }
+                       InfoMessage(_("^2Currently in ^1warmup^2 stage!"));
 
-               if(players_needed > 0)
-               {
-                       if(players_needed == 1)
-                               s = _("^31^2 more player is needed for the match to start.");
-                       else
-                               s = sprintf(_("^3%d^2 more players are needed for the match to start."), players_needed);
-                       InfoMessage(s);
-               }
-               else if(ready_waiting && !spectatee_status)
-               {
-                       if(ready_waiting_for_me)
-                               s = sprintf(_("%sPress ^3%s%s to end warmup"), blinkcolor, getcommandkey(_("ready"), "ready"), blinkcolor);
-                       else
-                               s = _("^2Waiting for others to ready up to end warmup...");
-                       InfoMessage(s);
-               }
-               else if(warmup_stage && !spectatee_status)
-               {
-                       s = sprintf(_("^2Press ^3%s^2 to end warmup"), getcommandkey(_("ready"), "ready"));
-                       InfoMessage(s);
+                       int players_needed = 0;
+                       if(STAT(WARMUP_TIMELIMIT) <= 0 && srv_minplayers)
+                       {
+                               Scoreboard_UpdatePlayerTeams(); // ensure numplayers is current
+                               players_needed = srv_minplayers - numplayers;
+                       }
+
+                       if(players_needed > 0)
+                       {
+                               if(players_needed == 1)
+                                       s = _("^31^2 more player is needed for the match to start.");
+                               else
+                                       s = sprintf(_("^3%d^2 more players are needed for the match to start."), players_needed);
+                               InfoMessage(s);
+                       }
+                       else if(!spectatee_status)
+                       {
+                               if(ready_waiting)
+                               {
+                                       if(ready_waiting_for_me)
+                                               s = sprintf(_("%sPress ^3%s%s to end warmup"), blinkcolor, getcommandkey(_("ready"), "ready"), blinkcolor);
+                                       else
+                                               s = _("^2Waiting for others to ready up to end warmup...");
+                               }
+                               else
+                                       s = sprintf(_("^2Press ^3%s^2 to end warmup"), getcommandkey(_("ready"), "ready"));
+                               InfoMessage(s);
+                       }
                }
 
                if(teamplay && !spectatee_status && teamnagger)