From: bones_was_here Date: Wed, 23 Nov 2022 14:46:55 +0000 (+1000) Subject: Refactor HUD_InfoMessages() X-Git-Tag: xonotic-v0.8.6~179^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=204b7067d0ffe1ed67d365fbc2bc87e86c82bb06;p=xonotic%2Fxonotic-data.pk3dir.git Refactor HUD_InfoMessages() 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. --- diff --git a/qcsrc/client/hud/panel/infomessages.qc b/qcsrc/client/hud/panel/infomessages.qc index cfed7d735..e85a7f30c 100644 --- a/qcsrc/client/hud/panel/infomessages.qc +++ b/qcsrc/client/hud/panel/infomessages.qc @@ -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)