X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=data%2Fqcsrc%2Fclient%2Fhud.qc;h=be1cc1e7204dfac692a3734e36eca97c3e4cbbfe;hb=cc045f9d09b57e3ce32ee45f807b18438e410380;hp=64f428c4e603a02611a081013fc4d67e39ac252f;hpb=e09f61dbc84f7ca4e3d3ccf1bc8f399f47460d64;p=voretournament%2Fvoretournament.git diff --git a/data/qcsrc/client/hud.qc b/data/qcsrc/client/hud.qc index 64f428c4..be1cc1e7 100644 --- a/data/qcsrc/client/hud.qc +++ b/data/qcsrc/client/hud.qc @@ -1516,6 +1516,29 @@ void Sbar_DrawScoreboard() pos_y += 1.2 * sbar_fontsize_y; drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, sbar_fontsize)), str, sbar_fontsize, sbar_scoreboard_alpha_fg, DRAWFLAG_NORMAL); + // print information about respawn status + float respawn_time = getstatf(STAT_RESPAWN_TIME); + dprint(strcat(ftos(respawn_time), " --------\n")); + 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 + if(time >= respawn_time) // don't show a negative value while the server is respawning the player (lag) + str = strcat("^1Respawning..."); + else + 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 * sbar_fontsize_y; + drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, sbar_fontsize)), str, sbar_fontsize, sbar_scoreboard_alpha_fg, DRAWFLAG_NORMAL); + } + scoreboard_bottom = pos_y + 2 * sbar_fontsize_y; }