]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/scoreboard.qc
Properly draw respawn info on a new line
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / scoreboard.qc
index 48a7217fc703a08b3b7f7fdfab3bc58efea36c2e..c07759fee571a92d40642f4d2500535eedf79401 100644 (file)
@@ -1374,9 +1374,31 @@ 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);
 
+       // add information about respawn status
+       float respawn_time = getstatf(STAT_RESPAWN_SCHEDULE);
+       if(respawn_time)
+       {
+               if(respawn_time < 0)
+               {
+                       // a negative value means we are awaiting respawn, time value is still the same
+                       respawn_time *= -1; // remove our mark now that we checked it
+                       str = strcat("Respawning in ", ftos(respawn_time - time), " seconds...");
+               }
+               else if(time < respawn_time)
+               {
+                       str = strcat("You are dead, wait ", ftos(respawn_time - time), " seconds before respawning");
+               }
+               else if(time >= respawn_time)
+               {
+                       str = strcat("You are dead, press fire 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;
 }