From: terencehill Date: Tue, 11 Sep 2018 09:46:13 +0000 (+0200) Subject: Delay 2 seconds display of the accuracy panel after the scoreboard but only if its... X-Git-Tag: xonotic-v0.8.5~1841^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1e91f9f6243b8d747f753630b80dc8adfb97749f;p=xonotic%2Fxonotic-data.pk3dir.git Delay 2 seconds display of the accuracy panel after the scoreboard but only if its position is low on the screen (with cvars for delay and position) --- diff --git a/_hud_common.cfg b/_hud_common.cfg index 3631df7eb..ee1babe19 100644 --- a/_hud_common.cfg +++ b/_hud_common.cfg @@ -115,6 +115,9 @@ seta hud_panel_scoreboard_spectators_showping 1 "show ping of spectators" seta hud_panel_scoreboard_spectators_aligned 0 "align spectators in columns" seta hud_panel_scoreboard_minwidth 0.6 "minimum width of the scoreboard" +seta hud_panel_scoreboard_accuracy_showdelay 2 "how long to delay displaying accuracy below the scoreboard if it's too far down" +seta hud_panel_scoreboard_accuracy_showdelay_minpos 0.75 "delay displaying the accuracy panel only if its position is lower than this percentage of the screen height from the top" + // hud panel aliases alias quickmenu "cl_cmd hud quickmenu ${* ?}" diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 5cd0fba73..b9ca0fe82 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -61,6 +61,9 @@ float autocvar_hud_panel_scoreboard_namesize = 15; bool autocvar_hud_panel_scoreboard_accuracy = true; bool autocvar_hud_panel_scoreboard_accuracy_doublerows = false; 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; @@ -1475,6 +1478,7 @@ vector Scoreboard_Rankings_Draw(vector pos, entity pl, vector rgb, vector bg_siz return end_pos; } +float scoreboard_time; bool have_weapon_stats; bool Scoreboard_AccuracyStats_WouldDraw(float ypos) { @@ -1483,6 +1487,12 @@ bool Scoreboard_AccuracyStats_WouldDraw(float ypos) if (!autocvar_hud_panel_scoreboard_accuracy || warmup_stage || ypos > 0.91 * vid_conheight) return false; + if (time < scoreboard_time + autocvar_hud_panel_scoreboard_accuracy_showdelay + && ypos > autocvar_hud_panel_scoreboard_accuracy_showdelay_minpos * vid_conheight) + { + return false; + } + if (!have_weapon_stats) { FOREACH(Weapons, it != WEP_Null, { @@ -1508,6 +1518,8 @@ void Scoreboard_Draw() // frametime checks allow to toggle the scoreboard even when the game is paused if(scoreboard_active) { + if (scoreboard_fade_alpha < 1) + scoreboard_time = time; if(hud_configure_menu_open == 1) scoreboard_fade_alpha = 1; float scoreboard_fadeinspeed = autocvar_hud_panel_scoreboard_fadeinspeed;