From: terencehill Date: Thu, 4 Aug 2016 12:23:32 +0000 (+0200) Subject: Integrate text, highlighting and background of scoreboard tables in the panel HUD... X-Git-Tag: xonotic-v0.8.2~716^2~32 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=795a41b106a428476e634a7fc02e268213224f4c;p=xonotic%2Fxonotic-data.pk3dir.git Integrate text, highlighting and background of scoreboard tables in the panel HUD system; remove table bg from luma skin --- diff --git a/_hud_descriptions.cfg b/_hud_descriptions.cfg index c829a22d9..eb1e534e2 100644 --- a/_hud_descriptions.cfg +++ b/_hud_descriptions.cfg @@ -364,3 +364,9 @@ seta hud_panel_scoreboard_bg_color_team "" "override panel color with team color seta hud_panel_scoreboard_bg_alpha "" "if set to something else than \"\" = override default panel background alpha" seta hud_panel_scoreboard_bg_border "" "if set to something else than \"\" = override default size of border around the background" seta hud_panel_scoreboard_bg_padding "" "if set to something else than \"\" = override default padding of contents from border" +seta hud_panel_scoreboard_table_bg_alpha "" "background alpha of a scoreboard table" +seta hud_panel_scoreboard_table_fg_alpha "" "foreground alpha of a scoreboard table" +seta hud_panel_scoreboard_table_fg_alpha_self "" "self foreground alpha of a scoreboard table" +seta hud_panel_scoreboard_table_highlight "" "enable highlighting for rows and columns in scoreboard tables" +seta hud_panel_scoreboard_table_highlight_alpha "" "highlight alpha of a scoreboard table" +seta hud_panel_scoreboard_table_highlight_alpha_self "" "self highlight alpha of a scoreboard table" \ No newline at end of file diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 4461bbded..8d8545377 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -837,13 +837,8 @@ 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_alpha_name 0.9 "alpha of player text in scoreboard list other than self" -seta scoreboard_alpha_name_self 1 "alpha of player text in scoreboard list of self" seta scoreboard_fadeinspeed 10 "speed at which scoreboard fades in, higher is faster (0 = instant)" seta scoreboard_fadeoutspeed 5 "speed at which scoreboard fades out, higher is faster (0 = instant)" -seta scoreboard_highlight 1 "enable highlighting for rows and columns in the scoreboard" -seta scoreboard_highlight_alpha 0.08 "highlight alpha value (depends on hud_scoreboard_highlight 1)" -seta scoreboard_highlight_alpha_self 0.3 "self highlight alpha value" seta scoreboard_bg_scale 0.25 "scale for the tiled scoreboard background" seta scoreboard_respawntime_decimals 1 "decimal places to show for the respawntime countdown display on the scoreboard" seta scoreboard_dynamichud 0 "apply the dynamic hud effects to the scoreboard" diff --git a/hud_luma.cfg b/hud_luma.cfg index cb4a419c4..ebc573441 100644 --- a/hud_luma.cfg +++ b/hud_luma.cfg @@ -365,5 +365,11 @@ seta hud_panel_scoreboard_bg_color_team "0.6" seta hud_panel_scoreboard_bg_alpha "0.7" seta hud_panel_scoreboard_bg_border "" seta hud_panel_scoreboard_bg_padding "" +seta hud_panel_scoreboard_table_bg_alpha "0" +seta hud_panel_scoreboard_table_fg_alpha "0.9" +seta hud_panel_scoreboard_table_fg_alpha_self "1" +seta hud_panel_scoreboard_table_highlight "1" +seta hud_panel_scoreboard_table_highlight_alpha "0.08" +seta hud_panel_scoreboard_table_highlight_alpha_self "0.3" menu_sync diff --git a/hud_luminos.cfg b/hud_luminos.cfg index 5f8ffb162..3fd76d5c1 100644 --- a/hud_luminos.cfg +++ b/hud_luminos.cfg @@ -365,5 +365,11 @@ seta hud_panel_scoreboard_bg_color_team "0.7" seta hud_panel_scoreboard_bg_alpha "0.7" seta hud_panel_scoreboard_bg_border "" seta hud_panel_scoreboard_bg_padding "" +seta hud_panel_scoreboard_table_bg_alpha "0.8" +seta hud_panel_scoreboard_table_fg_alpha "0.9" +seta hud_panel_scoreboard_table_fg_alpha_self "1" +seta hud_panel_scoreboard_table_highlight "1" +seta hud_panel_scoreboard_table_highlight_alpha "0.08" +seta hud_panel_scoreboard_table_highlight_alpha_self "0.3" menu_sync diff --git a/hud_luminos_minimal.cfg b/hud_luminos_minimal.cfg index 372c37297..ca5dd5172 100644 --- a/hud_luminos_minimal.cfg +++ b/hud_luminos_minimal.cfg @@ -365,5 +365,11 @@ seta hud_panel_scoreboard_bg_color_team "" seta hud_panel_scoreboard_bg_alpha "" seta hud_panel_scoreboard_bg_border "" seta hud_panel_scoreboard_bg_padding "" +seta hud_panel_scoreboard_table_bg_alpha "0.8" +seta hud_panel_scoreboard_table_fg_alpha "0.9" +seta hud_panel_scoreboard_table_fg_alpha_self "1" +seta hud_panel_scoreboard_table_highlight "1" +seta hud_panel_scoreboard_table_highlight_alpha "0.08" +seta hud_panel_scoreboard_table_highlight_alpha_self "0.3" menu_sync diff --git a/hud_luminos_minimal_xhair.cfg b/hud_luminos_minimal_xhair.cfg index 53d1a9b9c..8757c951b 100644 --- a/hud_luminos_minimal_xhair.cfg +++ b/hud_luminos_minimal_xhair.cfg @@ -365,5 +365,11 @@ seta hud_panel_scoreboard_bg_color_team "" seta hud_panel_scoreboard_bg_alpha "" seta hud_panel_scoreboard_bg_border "" seta hud_panel_scoreboard_bg_padding "" +seta hud_panel_scoreboard_table_bg_alpha "0.8" +seta hud_panel_scoreboard_table_fg_alpha "0.9" +seta hud_panel_scoreboard_table_fg_alpha_self "1" +seta hud_panel_scoreboard_table_highlight "1" +seta hud_panel_scoreboard_table_highlight_alpha "0.08" +seta hud_panel_scoreboard_table_highlight_alpha_self "0.3" menu_sync diff --git a/hud_luminos_old.cfg b/hud_luminos_old.cfg index e4fe3675f..28988def1 100644 --- a/hud_luminos_old.cfg +++ b/hud_luminos_old.cfg @@ -365,5 +365,11 @@ seta hud_panel_scoreboard_bg_color_team "" seta hud_panel_scoreboard_bg_alpha "" seta hud_panel_scoreboard_bg_border "" seta hud_panel_scoreboard_bg_padding "" +seta hud_panel_scoreboard_table_bg_alpha "0.8" +seta hud_panel_scoreboard_table_fg_alpha "0.9" +seta hud_panel_scoreboard_table_fg_alpha_self "1" +seta hud_panel_scoreboard_table_highlight "1" +seta hud_panel_scoreboard_table_highlight_alpha "0.08" +seta hud_panel_scoreboard_table_highlight_alpha_self "0.3" menu_sync diff --git a/hud_nexuiz.cfg b/hud_nexuiz.cfg index d6f7741c0..06f8dc795 100644 --- a/hud_nexuiz.cfg +++ b/hud_nexuiz.cfg @@ -365,5 +365,11 @@ seta hud_panel_scoreboard_bg_color_team "" seta hud_panel_scoreboard_bg_alpha "" seta hud_panel_scoreboard_bg_border "" seta hud_panel_scoreboard_bg_padding "" +seta hud_panel_scoreboard_table_bg_alpha "0.8" +seta hud_panel_scoreboard_table_fg_alpha "0.9" +seta hud_panel_scoreboard_table_fg_alpha_self "1" +seta hud_panel_scoreboard_table_highlight "1" +seta hud_panel_scoreboard_table_highlight_alpha "0.1" +seta hud_panel_scoreboard_table_highlight_alpha_self "0.25" menu_sync diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 2ebc4fabc..c0a1202d9 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -398,16 +398,11 @@ float autocvar_r_letterbox; bool autocvar_scoreboard_accuracy; bool autocvar_scoreboard_accuracy_doublerows; bool autocvar_scoreboard_accuracy_nocolors; -float autocvar_scoreboard_alpha_name = 0.9; -float autocvar_scoreboard_alpha_name_self = 1; float autocvar_scoreboard_bg_scale; float autocvar_scoreboard_border_thickness; string autocvar_scoreboard_columns; float autocvar_scoreboard_fadeinspeed = 10; float autocvar_scoreboard_fadeoutspeed = 5; -bool autocvar_scoreboard_highlight; -float autocvar_scoreboard_highlight_alpha = 0.10; -float autocvar_scoreboard_highlight_alpha_self = 0.25; float autocvar_scoreboard_respawntime_decimals; bool autocvar_scoreboard_dynamichud = false; bool autocvar_v_flipped; diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 618c03544..3655a53fe 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -8,13 +8,20 @@ #include #include -float scoreboard_alpha_bg; -float scoreboard_alpha_fg; -float scoreboard_highlight; -float scoreboard_highlight_alpha; -float scoreboard_highlight_alpha_self; -float scoreboard_alpha_name; -float scoreboard_alpha_name_self; +float sbt_bg_alpha; +float sbt_fg_alpha; +float sbt_fg_alpha_self; +bool sbt_highlight; +float sbt_highlight_alpha; +float sbt_highlight_alpha_self; + +// TODO init autocvars +float autocvar_hud_panel_scoreboard_table_bg_alpha; +float autocvar_hud_panel_scoreboard_table_fg_alpha; +float autocvar_hud_panel_scoreboard_table_fg_alpha_self; +bool autocvar_hud_panel_scoreboard_table_highlight; +float autocvar_hud_panel_scoreboard_table_highlight_alpha; +float autocvar_hud_panel_scoreboard_table_highlight_alpha_self; void drawstringright(vector, string, vector, vector, float, float); void drawstringcenter(vector, string, vector, vector, float, float); @@ -727,9 +734,9 @@ void HUD_PrintScoreboardItem(vector item_pos, vector rgb, entity pl, bool is_sel vector h_size = eX * panel_size.x + eY * hud_fontsize.y * 1.25; // alternated rows highlighting if(is_self) - drawfill(h_pos, h_size, rgb, scoreboard_highlight_alpha_self, DRAWFLAG_NORMAL); - else if((scoreboard_highlight) && (!(pl_number % 2))) - drawfill(h_pos, h_size, rgb, scoreboard_highlight_alpha, DRAWFLAG_NORMAL); + drawfill(h_pos, h_size, rgb, sbt_highlight_alpha_self, DRAWFLAG_NORMAL); + else if((sbt_highlight) && (!(pl_number % 2))) + drawfill(h_pos, h_size, rgb, sbt_highlight_alpha, DRAWFLAG_NORMAL); vector pos = item_pos; vector tmp = '0 0 0'; @@ -752,33 +759,33 @@ void HUD_PrintScoreboardItem(vector item_pos, vector rgb, entity pl, bool is_sel if(field == SP_NAME) { tmp.x = hud_size[i] - hud_fontsize.x*hud_fixscoreboardcolumnwidth_iconlen - hud_fixscoreboardcolumnwidth_marginlen + hud_fontsize.x; if (is_self) - drawcolorcodedstring(pos - tmp, str, hud_fontsize, scoreboard_alpha_name_self, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos - tmp, str, hud_fontsize, sbt_fg_alpha_self, DRAWFLAG_NORMAL); else - drawcolorcodedstring(pos - tmp, str, hud_fontsize, scoreboard_alpha_name, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos - tmp, str, hud_fontsize, sbt_fg_alpha, DRAWFLAG_NORMAL); } else { tmp.x = hud_fixscoreboardcolumnwidth_len + hud_fontsize.x; if (is_self) - drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, scoreboard_alpha_name_self, DRAWFLAG_NORMAL); + drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, sbt_fg_alpha_self, DRAWFLAG_NORMAL); else - drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, scoreboard_alpha_name, DRAWFLAG_NORMAL); + drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, sbt_fg_alpha, DRAWFLAG_NORMAL); } tmp.x = hud_size[i] + hud_fontsize.x; if(hud_field_icon0 != "") if (is_self) - drawpic(pos - tmp, hud_field_icon0, '0 1 0' * hud_fontsize.y + '1 0 0' * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * scoreboard_alpha_name_self, DRAWFLAG_NORMAL); + drawpic(pos - tmp, hud_field_icon0, eY * hud_fontsize.y + eX * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * sbt_fg_alpha_self, DRAWFLAG_NORMAL); else - drawpic(pos - tmp, hud_field_icon0, '0 1 0' * hud_fontsize.y + '1 0 0' * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * scoreboard_alpha_name, DRAWFLAG_NORMAL); + drawpic(pos - tmp, hud_field_icon0, eY * hud_fontsize.y + eX * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * sbt_fg_alpha, DRAWFLAG_NORMAL); if(hud_field_icon1 != "") if (is_self) - drawpic(pos - tmp, hud_field_icon1, '0 1 0' * hud_fontsize.y + '1 0 0' * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * scoreboard_alpha_name_self, DRAWFLAG_NORMAL); + drawpic(pos - tmp, hud_field_icon1, eY * hud_fontsize.y + eX * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * sbt_fg_alpha_self, DRAWFLAG_NORMAL); else - drawpic(pos - tmp, hud_field_icon1, '0 1 0' * hud_fontsize.y + '1 0 0' * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * scoreboard_alpha_name, DRAWFLAG_NORMAL); + drawpic(pos - tmp, hud_field_icon1, eY * hud_fontsize.y + eX * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * sbt_fg_alpha, DRAWFLAG_NORMAL); if(hud_field_icon2 != "") if (is_self) - drawpic(pos - tmp, hud_field_icon2, '0 1 0' * hud_fontsize.y + '1 0 0' * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * scoreboard_alpha_name_self, DRAWFLAG_NORMAL); + drawpic(pos - tmp, hud_field_icon2, eY * hud_fontsize.y + eX * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * sbt_fg_alpha_self, DRAWFLAG_NORMAL); else - drawpic(pos - tmp, hud_field_icon2, '0 1 0' * hud_fontsize.y + '1 0 0' * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * scoreboard_alpha_name, DRAWFLAG_NORMAL); + drawpic(pos - tmp, hud_field_icon2, eY * hud_fontsize.y + eX * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * sbt_fg_alpha, DRAWFLAG_NORMAL); } if(hud_field[i] == SP_SEPARATOR) @@ -801,39 +808,39 @@ void HUD_PrintScoreboardItem(vector item_pos, vector rgb, entity pl, bool is_sel if(field == SP_NAME) { tmp.x = hud_fixscoreboardcolumnwidth_len; // left or right aligned? let's put it right... if(is_self) - drawcolorcodedstring(pos - tmp, str, hud_fontsize, scoreboard_alpha_name_self, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos - tmp, str, hud_fontsize, sbt_fg_alpha_self, DRAWFLAG_NORMAL); else - drawcolorcodedstring(pos - tmp, str, hud_fontsize, scoreboard_alpha_name, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos - tmp, str, hud_fontsize, sbt_fg_alpha, DRAWFLAG_NORMAL); } else { tmp.x = hud_fixscoreboardcolumnwidth_len; if(is_self) - drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, scoreboard_alpha_name_self, DRAWFLAG_NORMAL); + drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, sbt_fg_alpha_self, DRAWFLAG_NORMAL); else - drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, scoreboard_alpha_name, DRAWFLAG_NORMAL); + drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, sbt_fg_alpha, DRAWFLAG_NORMAL); } tmp.x = hud_size[i]; if(hud_field_icon0 != "") if (is_self) - drawpic(pos - tmp, hud_field_icon0, '0 1 0' * hud_fontsize.y + '1 0 0' * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * scoreboard_alpha_name_self, DRAWFLAG_NORMAL); + drawpic(pos - tmp, hud_field_icon0, eY * hud_fontsize.y + eX * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * sbt_fg_alpha_self, DRAWFLAG_NORMAL); else - drawpic(pos - tmp, hud_field_icon0, '0 1 0' * hud_fontsize.y + '1 0 0' * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * scoreboard_alpha_name, DRAWFLAG_NORMAL); + drawpic(pos - tmp, hud_field_icon0, eY * hud_fontsize.y + eX * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * sbt_fg_alpha, DRAWFLAG_NORMAL); if(hud_field_icon1 != "") if (is_self) - drawpic(pos - tmp, hud_field_icon1, '0 1 0' * hud_fontsize.y + '1 0 0' * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * scoreboard_alpha_name_self, DRAWFLAG_NORMAL); + drawpic(pos - tmp, hud_field_icon1, eY * hud_fontsize.y + eX * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * sbt_fg_alpha_self, DRAWFLAG_NORMAL); else - drawpic(pos - tmp, hud_field_icon1, '0 1 0' * hud_fontsize.y + '1 0 0' * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * scoreboard_alpha_name, DRAWFLAG_NORMAL); + drawpic(pos - tmp, hud_field_icon1, eY * hud_fontsize.y + eX * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * sbt_fg_alpha, DRAWFLAG_NORMAL); if(hud_field_icon2 != "") if (is_self) - drawpic(pos - tmp, hud_field_icon2, '0 1 0' * hud_fontsize.y + '1 0 0' * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * scoreboard_alpha_name_self, DRAWFLAG_NORMAL); + drawpic(pos - tmp, hud_field_icon2, eY * hud_fontsize.y + eX * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * sbt_fg_alpha_self, DRAWFLAG_NORMAL); else - drawpic(pos - tmp, hud_field_icon2, '0 1 0' * hud_fontsize.y + '1 0 0' * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * scoreboard_alpha_name, DRAWFLAG_NORMAL); + drawpic(pos - tmp, hud_field_icon2, eY * hud_fontsize.y + eX * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * sbt_fg_alpha, DRAWFLAG_NORMAL); pos.x -= hud_size[i] + hud_fontsize.x; } } if(pl.eliminated) - drawfill(h_pos, h_size, '0 0 0', 0.5, DRAWFLAG_NORMAL); + drawfill(h_pos, h_size, '0 0 0', 0.5 * panel_fg_alpha, DRAWFLAG_NORMAL); } vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_size) @@ -858,20 +865,20 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz vector tmp = eX * panel_size.x + eY * 1.25 * hud_fontsize.y; // rounded header - if (scoreboard_alpha_bg) - drawpic(pos, "gfx/scoreboard/scoreboard_tableheader", tmp, rgb + '0.5 0.5 0.5', scoreboard_alpha_bg, DRAWFLAG_NORMAL); + if (sbt_bg_alpha) + drawpic(pos, "gfx/scoreboard/scoreboard_tableheader", tmp, rgb + '0.5 0.5 0.5', sbt_bg_alpha, DRAWFLAG_NORMAL); pos.y += 1.25 * hud_fontsize.y; // table background tmp.y = panel_size.y - 1.25 * hud_fontsize.y; - if (scoreboard_alpha_bg) - drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, scoreboard_alpha_bg, DRAWFLAG_NORMAL); + if (sbt_bg_alpha) + drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, sbt_bg_alpha, DRAWFLAG_NORMAL); // go back to the top to make alternated columns highlighting and to print the strings pos.y -= 1.25 * hud_fontsize.y; - if (scoreboard_highlight) + if (sbt_highlight) column_dim.y = panel_size.y; // print the strings of the columns headers and draw the columns @@ -881,12 +888,12 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz if(hud_field[i] == SP_SEPARATOR) break; column_dim.x = hud_size[i] + hud_fontsize.x; - if (scoreboard_highlight) + if (sbt_highlight) { if (i % 2) - drawfill(pos - eX * hud_fontsize.x * 0.5, column_dim, '0 0 0', scoreboard_alpha_bg * 0.2, DRAWFLAG_NORMAL); + drawfill(pos - eX * hud_fontsize.x * 0.5, column_dim, '0 0 0', sbt_highlight_alpha, DRAWFLAG_NORMAL); } - drawstring(pos, hud_title[i], hud_fontsize, rgb * 1.5, scoreboard_alpha_fg, DRAWFLAG_NORMAL); + drawstring(pos, hud_title[i], hud_fontsize, rgb * 1.5, sbt_fg_alpha, DRAWFLAG_NORMAL); pos.x += column_dim.x; } if(hud_field[i] == SP_SEPARATOR) @@ -900,7 +907,7 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz pos.x -= hud_size[i]; - if (scoreboard_highlight) + if (sbt_highlight) { if (!(i % 2)) { @@ -909,15 +916,15 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz else column_dim.x = hud_size[i] + hud_fontsize.x; if(i == hud_num_fields - 1) - drawfill(pos - eX * hud_fontsize.x * 0.5, column_dim, '0 0 0', scoreboard_alpha_bg * 0.2, DRAWFLAG_NORMAL); + drawfill(pos - eX * hud_fontsize.x * 0.5, column_dim, '0 0 0', sbt_highlight_alpha, DRAWFLAG_NORMAL); else - drawfill(pos - eX * hud_fontsize.x * 0.5, column_dim, '0 0 0', scoreboard_alpha_bg * 0.2, DRAWFLAG_NORMAL); + drawfill(pos - eX * hud_fontsize.x * 0.5, column_dim, '0 0 0', sbt_highlight_alpha, DRAWFLAG_NORMAL); } } tmp.x = stringwidth(hud_title[i], false, hud_fontsize); tmp.x = (hud_size[i] - tmp.x); - drawstring(pos + tmp, hud_title[i], hud_fontsize, rgb * 1.5, scoreboard_alpha_fg, DRAWFLAG_NORMAL); + drawstring(pos + tmp, hud_title[i], hud_fontsize, rgb * 1.5, sbt_fg_alpha, DRAWFLAG_NORMAL); pos.x -= hud_fontsize.x; } } @@ -996,7 +1003,7 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size) float height = 40; - drawstring(pos + eX * panel_bg_padding, sprintf(_("Accuracy stats (average %d%%)"), average_accuracy), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL); + drawstring(pos + eX * panel_bg_padding, sprintf(_("Accuracy stats (average %d%%)"), average_accuracy), hud_fontsize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); pos.y += 1.25 * hud_fontsize.y; pos.y += panel_bg_border; @@ -1020,21 +1027,17 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size) float weapon_height = height * 2/3; float weapon_width = tmp.x / columnns / rows; - if (scoreboard_alpha_bg) - drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, scoreboard_alpha_bg, DRAWFLAG_NORMAL); + if (sbt_bg_alpha) + drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, sbt_bg_alpha, DRAWFLAG_NORMAL); // column highlighting for (int i = 0; i < columnns; ++i) - { if ((i % 2) == 0) - drawfill(pos + '1 0 0' * weapon_width * rows * i, '0 1 0' * height * rows + '1 0 0' * weapon_width * rows, '0 0 0', scoreboard_alpha_bg * 0.2, DRAWFLAG_NORMAL); - } + drawfill(pos + eX * weapon_width * rows * i, eY * height * rows + eX * weapon_width * rows, '0 0 0', sbt_highlight_alpha, DRAWFLAG_NORMAL); // row highlighting for (int i = 0; i < rows; ++i) - { - drawfill(pos + '0 1 0' * weapon_height + '0 1 0' * height * i, '1 0 0' * tmp.x + '0 1 0' * fontsize, '1 1 1', scoreboard_highlight_alpha, DRAWFLAG_NORMAL); - } + drawfill(pos + eY * weapon_height + eY * height * i, eX * tmp.x + eY * fontsize, '1 1 1', sbt_highlight_alpha, DRAWFLAG_NORMAL); average_accuracy = 0; int weapons_with_stats = 0; @@ -1059,27 +1062,27 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size) float weapon_alpha; if (weapon_stats >= 0) - weapon_alpha = scoreboard_alpha_fg; + weapon_alpha = sbt_fg_alpha; else - weapon_alpha = 0.2 * scoreboard_alpha_fg; + weapon_alpha = 0.2 * sbt_fg_alpha; // weapon icon - drawpic_aspect_skin(tmpos, it.model2, '1 0 0' * weapon_width + '0 1 0' * weapon_height, '1 1 1', weapon_alpha, DRAWFLAG_NORMAL); + drawpic_aspect_skin(tmpos, it.model2, eX * weapon_width + eY * weapon_height, '1 1 1', weapon_alpha, DRAWFLAG_NORMAL); // the accuracy if (weapon_stats >= 0) { weapons_with_stats += 1; average_accuracy += weapon_stats; // store sum of all accuracies in average_accuracy string s; - s = sprintf("%d%%", weapon_stats*100); + s = sprintf("%d%%", weapon_stats * 100); float padding; - padding = (weapon_width - stringwidth(s, false, '1 0 0' * fontsize)) / 2; // center the accuracy value + padding = (weapon_width - stringwidth(s, false, eX * fontsize)) / 2; // center the accuracy value if(!autocvar_scoreboard_accuracy_nocolors) rgb = Accuracy_GetColor(weapon_stats); - drawstring(tmpos + '1 0 0' * padding + '0 1 0' * weapon_height, s, '1 1 0' * fontsize, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL); + drawstring(tmpos + eX * padding + eY * weapon_height, s, '1 1 0' * fontsize, rgb, sbt_fg_alpha, DRAWFLAG_NORMAL); } tmpos.x += weapon_width * rows; pos.x += weapon_width * rows; @@ -1101,9 +1104,9 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size) vector HUD_DrawKeyValue(vector pos, string key, string value) { float px = pos.x; pos.x += hud_fontsize.x * 0.25; - drawstring(pos, key, hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL); + drawstring(pos, key, hud_fontsize, '1 1 1', sbt_fg_alpha, DRAWFLAG_NORMAL); pos.x = panel_pos.x + panel_size.x - stringwidth(value, false, hud_fontsize) - hud_fontsize.x * 0.25; - drawstring(pos, value, hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL); + drawstring(pos, value, hud_fontsize, '1 1 1', sbt_fg_alpha, DRAWFLAG_NORMAL); pos.x = px; pos.y += hud_fontsize.y; @@ -1135,7 +1138,7 @@ vector HUD_DrawMapStats(vector pos, vector rgb, vector bg_size) { return pos; // draw table header - drawstring(pos + eX * panel_bg_padding, _("Map stats:"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL); + drawstring(pos + eX * panel_bg_padding, _("Map stats:"), hud_fontsize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); pos.y += 1.25 * hud_fontsize.y; pos.y += panel_bg_border; @@ -1155,8 +1158,8 @@ vector HUD_DrawMapStats(vector pos, vector rgb, vector bg_size) { pos = panel_pos; vector tmp = panel_size; - if (scoreboard_alpha_bg) - drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, scoreboard_alpha_bg, DRAWFLAG_NORMAL); + if (sbt_bg_alpha) + drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, sbt_bg_alpha, DRAWFLAG_NORMAL); // draw monsters if(stat_monsters_total) @@ -1191,7 +1194,7 @@ vector HUD_DrawScoreboardRankings(vector pos, entity pl, vector rgb, vector bg_s vector hl_rgb = rgb + '0.5 0.5 0.5'; pos.y += hud_fontsize.y; - drawstring(pos + eX * panel_bg_padding, _("Rankings"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL); + drawstring(pos + eX * panel_bg_padding, _("Rankings"), hud_fontsize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); pos.y += 1.25 * hud_fontsize.y; pos.y += panel_bg_border; @@ -1211,11 +1214,11 @@ vector HUD_DrawScoreboardRankings(vector pos, entity pl, vector rgb, vector bg_s pos = panel_pos; vector tmp = panel_size; - if (scoreboard_alpha_bg) - drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, scoreboard_alpha_bg, DRAWFLAG_NORMAL); + if (sbt_bg_alpha) + drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, sbt_bg_alpha, DRAWFLAG_NORMAL); // row highlighting - for(i = 0; i