]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/scoreboard.qc
Use ftos_decimals instead of foolshly bounding and substring-ing the value. Respawn...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / scoreboard.qc
index 69a296796108022624ef2b5a7bb65c4fb9a9634d..9bc340abcceb17c219ae0501dce46eb19fd86720 100644 (file)
@@ -19,6 +19,7 @@ string TranslateScoresLabel(string l)
                case "bckills": return CTX(_("SCO^bckills"));
                case "bctime": return CTX(_("SCO^bctime"));
                case "caps": return CTX(_("SCO^caps"));
+               case "captime": return CTX(_("SCO^captime"));
                case "deaths": return CTX(_("SCO^deaths"));
                case "destroyed": return CTX(_("SCO^destroyed"));
                case "drops": return CTX(_("SCO^drops"));
@@ -254,6 +255,7 @@ void Cmd_HUD_Help()
        print(_("^3kd^7                       The kill-death ratio\n"));
        print(_("^3caps^7                     How often a flag (CTF) or a key (KeyHunt) was captured\n"));
        print(_("^3pickups^7                  How often a flag (CTF) or a key (KeyHunt) or a ball (Keepaway) was picked up\n"));
+       print(_("^3captime^7                  Time of fastest cap (CTF)\n"));
        print(_("^3fckills^7                  Number of flag carrier kills\n"));
        print(_("^3returns^7                  Number of flag returns\n"));
        print(_("^3drops^7                    Number of flag drops\n"));
@@ -1372,9 +1374,27 @@ void HUD_DrawScoreboard()
                }
        }
 
-
        pos_y += 1.2 * hud_fontsize_y;
        drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, hud_fontsize)), str, hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
 
+       // print information about respawn status
+       float respawn_time = getstatf(STAT_RESPAWN_TIME);
+       if(respawn_time)
+       {
+               if(respawn_time < 0)
+               {
+                       // a negative number means we are awaiting respawn, time value is still the same
+                       respawn_time *= -1; // remove mark now that we checked it
+                       str = strcat("^1Respawning in ^3", ftos_decimals(respawn_time - time, 2), "^1 seconds...");
+               }
+               else if(time < respawn_time)
+                       str = strcat("You are dead, wait ^3", ftos_decimals(respawn_time - time, 2), "^7 seconds before respawning");
+               else if(time >= respawn_time)
+                       str = strcat("You are dead, press ^2", getcommandkey("primary fire", "+fire"), "^7 to respawn");
+
+               pos_y += 1.2 * hud_fontsize_y;
+               drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, hud_fontsize)), str, hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+       }
+
        scoreboard_bottom = pos_y + 2 * hud_fontsize_y;
 }