]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/infomessages.qc
Create queue system to prevent team imbalance in teamplay
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / infomessages.qc
index e054bd94f05c3c091b02fbc435d22ea652051629..ff5bd8d5d8e30e407a34b780a452713a3ca27def 100644 (file)
@@ -127,7 +127,13 @@ void HUD_InfoMessages()
 
                        if(!mutator_returnvalue)
                        {
-                               s = sprintf(_("^1Press ^3%s^1 to join"), getcommandkey(_("jump"), "+jump"));
+                               if(entcs_GetWantsJoin(current_player))
+                               {
+                                       int tm = Team_IndexToTeam(entcs_GetWantsJoin(current_player));
+                                       s = sprintf(_("^2You're queued to join the %s%s^2 team"), Team_ColorCode(tm), Team_ColorName(tm));
+                               }
+                               else
+                                       s = sprintf(_("^1Press ^3%s^1 to join"), getcommandkey(_("jump"), "+jump"));
                                InfoMessage(s);
                        }
                }
@@ -140,39 +146,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";
 
-               if(warmup_stage && STAT(WARMUP_TIMELIMIT) <= 0 && srv_minplayers)
-               {
-                       Scoreboard_UpdatePlayerTeams(); // ensure numplayers is current
-                       if(srv_minplayers - numplayers == 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."), srv_minplayers - numplayers);
-                       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)
+               if(warmup_stage)
                {
-                       s = sprintf(_("^2Press ^3%s^2 to end warmup"), getcommandkey(_("ready"), "ready"));
-                       InfoMessage(s);
+                       InfoMessage(_("^2Currently in ^1warmup^2 stage!"));
+
+                       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)
@@ -195,7 +206,7 @@ void HUD_InfoMessages()
                                        s = strcat(blinkcolor, _("Teamnumbers are unbalanced!"));
                                        tm = GetTeam(myteam, false);
                                        if (tm && tm.team != NUM_SPECTATOR && tm.team_size == ts_max)
-                                               s = strcat(s, sprintf(_(" Press ^3%s%s to adjust"), getcommandkey(_("team selection"), "scoreboard_team_selection"), blinkcolor));
+                                               s = strcat(s, sprintf(_(" Press ^3%s%s to adjust"), getcommandkey(_("team selection"), "team_selection_show"), blinkcolor));
                                        InfoMessage(s);
                                }
                        }