From 2e079abcbe5b62453fc7d6af904fdd6b826641ed Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 18 Jan 2013 23:33:30 +0100 Subject: [PATCH] Bring back the possibility of showing plain white accuracy values in the scoreboard with the new cvar scoreboard_accuracy_nocolors (before it was possible by setting improperly accuracy_color_levels to "") --- defaultXonotic.cfg | 1 + qcsrc/client/autocvars.qh | 1 + qcsrc/client/scoreboard.qc | 9 ++++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index c51cc0c71..3e8f43421 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -945,6 +945,7 @@ seta scoreboard_columns default seta scoreboard_border_thickness 1 "scoreboard border thickness" seta scoreboard_accuracy_border_thickness 1 "accuracy stats border thickness" seta scoreboard_accuracy_doublerows 0 "use two rows instead of one" +seta scoreboard_accuracy_nocolors 0 "don't use colors displaying accuracy stats" seta scoreboard_accuracy 1 "show weapon accuracy stats panel on scoreboard; colors can be configured with accuracy_color* cvars" seta scoreboard_color_bg_r 0 "red color component of the scoreboard background" seta scoreboard_color_bg_g 0.4 "green color component of the scoreboard background" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 94cd1a5c0..97565bc68 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -353,6 +353,7 @@ float autocvar_r_fullbright; float autocvar_r_letterbox; float autocvar_scoreboard_accuracy; float autocvar_scoreboard_accuracy_doublerows; +float autocvar_scoreboard_accuracy_nocolors; float autocvar_scoreboard_alpha_bg; var float autocvar_scoreboard_alpha_fg = 1.0; var float autocvar_scoreboard_alpha_name = 0.9; diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index ea54d0fbe..a576ae493 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -998,8 +998,10 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size) g_minstagib = 1; // TODO: real detection for minstagib? float weapon_stats; - - Accuracy_LoadColors(); + if(autocvar_scoreboard_accuracy_nocolors) + rgb = '1 1 1'; + else + Accuracy_LoadColors(); for(i = WEP_FIRST; i <= WEP_LAST; ++i) { @@ -1029,7 +1031,8 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size) float padding; padding = (weapon_width - stringwidth(s, FALSE, '1 0 0' * fontsize)) / 2; // center the accuracy value - rgb = Accuracy_GetColor(weapon_stats); + if(!autocvar_scoreboard_accuracy_nocolors) + rgb = Accuracy_GetColor(weapon_stats); drawstring(pos + '1 0 0' * padding + '0 1 0' * weapon_height, s, '1 1 0' * fontsize, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL); } -- 2.39.2