X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fpanel%2Fscoreboard.qc;h=5821dc46946808598f58f01f77d28b0e7e73ac59;hb=126111bb9ef1d8979a6b76bcf464f6e19ea1168d;hp=120feeafa05cb858f0835c232b4e88f796e7ee88;hpb=0409f3fe91e759cbe3b885b5c543411f02844f21;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 120feeafa..5821dc469 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -1,15 +1,15 @@ #include "scoreboard.qh" -#include -#include -#include -#include -#include "quickmenu.qh" -#include +#include +#include +#include +#include +#include #include -#include +#include #include #include +#include #include #include #include @@ -83,8 +83,6 @@ bool autocvar_hud_panel_scoreboard_accuracy_nocolors = false; float autocvar_hud_panel_scoreboard_accuracy_showdelay = 2; float autocvar_hud_panel_scoreboard_accuracy_showdelay_minpos = 0.75; -bool autocvar_hud_panel_scoreboard_ctf_leaderboard = true; - bool autocvar_hud_panel_scoreboard_dynamichud = false; float autocvar_hud_panel_scoreboard_maxheight = 0.6; @@ -1148,12 +1146,12 @@ bool Scoreboard_WouldDraw() return true; else if (intermission == 2) return false; - else if (spectatee_status != -1 && STAT(HEALTH) <= 0 && autocvar_cl_deathscoreboard && !ISGAMETYPE(CTS) + else if (spectatee_status != -1 && STAT(HEALTH) <= 0 && autocvar_cl_deathscoreboard && !MUTATOR_CALLHOOK(DrawDeathScoreboard) && (!HUD_MinigameMenu_IsOpened() || !active_minigame)) { return true; } - else if (scoreboard_showscores_force) + else if (scoreboard_showscores_force || MUTATOR_CALLHOOK(DrawScoreboard_Force)) return true; return false; } @@ -1396,7 +1394,7 @@ vector Scoreboard_MapStats_Draw(vector pos, vector rgb, vector bg_size) { } -vector Scoreboard_Rankings_Draw(vector pos, entity pl, vector rgb, vector bg_size) +vector Scoreboard_Rankings_Draw(vector pos, string ranktitle, entity pl, vector rgb, vector bg_size) { int i; RANKINGS_RECEIVED_CNT = 0; @@ -1410,7 +1408,7 @@ vector Scoreboard_Rankings_Draw(vector pos, entity pl, vector rgb, vector bg_siz vector hl_rgb = rgb + '0.5 0.5 0.5'; pos.y += hud_fontsize.y; - drawstring(pos + eX * panel_bg_padding, ((ISGAMETYPE(CTF)) ? _("Capture time rankings") : _("Rankings")), hud_fontsize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + drawstring(pos + eX * panel_bg_padding, ranktitle, hud_fontsize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); pos.y += 1.25 * hud_fontsize.y; if(panel.current_panel_bg != "0") pos.y += panel_bg_border; @@ -1506,7 +1504,7 @@ float scoreboard_time; bool have_weapon_stats; bool Scoreboard_AccuracyStats_WouldDraw(float ypos) { - if (ISGAMETYPE(CTS) || ISGAMETYPE(RACE) || ISGAMETYPE(NEXBALL)) + if (MUTATOR_CALLHOOK(DrawScoreboardAccuracy)) return false; if (!autocvar_hud_panel_scoreboard_accuracy || warmup_stage || ypos > 0.91 * vid_conheight) return false; @@ -1629,7 +1627,7 @@ void Scoreboard_Draw() str = ""; if(tl > 0) str = strcat(str, sprintf(_("^3%1.0f minutes"), tl)); - if(!ISGAMETYPE(LMS)) + if(!gametype.m_hidelimits) { if(fl > 0) { @@ -1818,7 +1816,8 @@ void Scoreboard_Draw() if (Scoreboard_AccuracyStats_WouldDraw(pos.y)) pos = Scoreboard_AccuracyStats_Draw(pos, panel_bg_color, bg_size); - if(ISGAMETYPE(CTS) || ISGAMETYPE(RACE) || (autocvar_hud_panel_scoreboard_ctf_leaderboard && ISGAMETYPE(CTF) && STAT(CTF_SHOWLEADERBOARD))) { + if(MUTATOR_CALLHOOK(ShowRankings)) { + string ranktitle = M_ARGV(0, string); if(race_speedaward) { drawcolorcodedstring(pos, sprintf(_("Speed award: %d%s ^7(%s^7)"), race_speedaward, race_speedaward_unit, ColorTranslateRGB(race_speedaward_holder)), hud_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); pos.y += 1.25 * hud_fontsize.y; @@ -1827,7 +1826,7 @@ void Scoreboard_Draw() drawcolorcodedstring(pos, sprintf(_("All-time fastest: %d%s ^7(%s^7)"), race_speedaward_alltimebest, race_speedaward_alltimebest_unit, ColorTranslateRGB(race_speedaward_alltimebest_holder)), hud_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); pos.y += 1.25 * hud_fontsize.y; } - pos = Scoreboard_Rankings_Draw(pos, playerslots[player_localnum], panel_bg_color, bg_size); + pos = Scoreboard_Rankings_Draw(pos, ranktitle, playerslots[player_localnum], panel_bg_color, bg_size); } pos = Scoreboard_MapStats_Draw(pos, panel_bg_color, bg_size);