]> git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/hud.qc
Merge master
[voretournament/voretournament.git] / data / qcsrc / client / hud.qc
index e81da42c0fbfc2d715b456a0cdbc11ab97e517bb..16251aad7c5b253c6e7a98db74d23ddf0513e0cf 100644 (file)
@@ -1563,6 +1563,29 @@ void Sbar_DrawScoreboard()
        pos_y += 1.2 * sbar_fontsize_y;\r
        drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, sbar_fontsize)), str, sbar_fontsize, sbar_scoreboard_alpha_fg, DRAWFLAG_NORMAL);\r
 \r
+       // print information about respawn status\r
+       float respawn_time = getstatf(STAT_RESPAWN_TIME);\r
+       dprint(strcat(ftos(respawn_time), " --------\n"));\r
+       if(respawn_time)\r
+       {\r
+               if(respawn_time < 0)\r
+               {\r
+                       // a negative number means we are awaiting respawn, time value is still the same\r
+                       respawn_time *= -1; // remove mark now that we checked it\r
+                       if(time >= respawn_time) // don't show a negative value while the server is respawning the player (lag)\r
+                               str = strcat("^1Respawning...");\r
+                       else\r
+                               str = strcat("^1Respawning in ^3", ftos_decimals(respawn_time - time, 2), "^1 seconds...");\r
+               }\r
+               else if(time < respawn_time)\r
+                       str = strcat("You are dead, wait ^3", ftos_decimals(respawn_time - time, 2), "^7 seconds before respawning");\r
+               else if(time >= respawn_time)\r
+                       str = strcat("You are dead, press ^2", getcommandkey("primary fire", "+fire"), "^7 to respawn");\r
+\r
+               pos_y += 1.2 * sbar_fontsize_y;\r
+               drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, sbar_fontsize)), str, sbar_fontsize, sbar_scoreboard_alpha_fg, DRAWFLAG_NORMAL);\r
+       }\r
+\r
        scoreboard_bottom = pos_y + 2 * sbar_fontsize_y;\r
 }\r
 \r