From: terencehill Date: Fri, 5 Aug 2016 13:07:51 +0000 (+0200) Subject: Add a team color setting for team tables so that accuracy and rankings can be display... X-Git-Tag: xonotic-v0.8.2~716^2~19 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=07efc3766f3b2a6ea8c55ee58f3cfeb372f1bd41;p=xonotic%2Fxonotic-data.pk3dir.git Add a team color setting for team tables so that accuracy and rankings can be displayed with a non-team color, for example in the luminos_old skin --- diff --git a/_hud_descriptions.cfg b/_hud_descriptions.cfg index 4bcb28689..9a1654f83 100644 --- a/_hud_descriptions.cfg +++ b/_hud_descriptions.cfg @@ -375,5 +375,6 @@ seta hud_panel_scoreboard_table_fg_alpha_self "" "self foreground alpha of a sco 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" +seta hud_panel_scoreboard_bg_teams_color_team "" "override panel team color in team tables" seta hud_panel_scoreboard_accuracy_doublerows "" "use two rows instead of one" seta hud_panel_scoreboard_accuracy_nocolors "" "don't use colors displaying accuracy stats" diff --git a/hud_luma.cfg b/hud_luma.cfg index ee80daa63..35414a779 100644 --- a/hud_luma.cfg +++ b/hud_luma.cfg @@ -376,6 +376,7 @@ seta hud_panel_scoreboard_table_fg_alpha_self "1" seta hud_panel_scoreboard_table_highlight "1" seta hud_panel_scoreboard_table_highlight_alpha "0.2" seta hud_panel_scoreboard_table_highlight_alpha_self "0.5" +seta hud_panel_scoreboard_bg_teams_color_team "0" seta hud_panel_scoreboard_accuracy_doublerows "0" seta hud_panel_scoreboard_accuracy_nocolors "0" diff --git a/hud_luminos.cfg b/hud_luminos.cfg index 6b3163f0e..383a8a884 100644 --- a/hud_luminos.cfg +++ b/hud_luminos.cfg @@ -376,6 +376,7 @@ 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" +seta hud_panel_scoreboard_bg_teams_color_team "0" seta hud_panel_scoreboard_accuracy_doublerows "1" seta hud_panel_scoreboard_accuracy_nocolors "0" diff --git a/hud_luminos_minimal.cfg b/hud_luminos_minimal.cfg index 8113c1975..630017b38 100644 --- a/hud_luminos_minimal.cfg +++ b/hud_luminos_minimal.cfg @@ -376,6 +376,7 @@ 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" +seta hud_panel_scoreboard_bg_teams_color_team "0.7" seta hud_panel_scoreboard_accuracy_doublerows "1" seta hud_panel_scoreboard_accuracy_nocolors "0" diff --git a/hud_luminos_minimal_xhair.cfg b/hud_luminos_minimal_xhair.cfg index 54206598e..e332bf8af 100644 --- a/hud_luminos_minimal_xhair.cfg +++ b/hud_luminos_minimal_xhair.cfg @@ -376,6 +376,7 @@ 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" +seta hud_panel_scoreboard_bg_teams_color_team "0.7" seta hud_panel_scoreboard_accuracy_doublerows "1" seta hud_panel_scoreboard_accuracy_nocolors "0" diff --git a/hud_luminos_old.cfg b/hud_luminos_old.cfg index f2cf3e3ca..4b6725052 100644 --- a/hud_luminos_old.cfg +++ b/hud_luminos_old.cfg @@ -376,6 +376,7 @@ 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" +seta hud_panel_scoreboard_bg_teams_color_team "0.7" seta hud_panel_scoreboard_accuracy_doublerows "1" seta hud_panel_scoreboard_accuracy_nocolors "0" diff --git a/hud_nexuiz.cfg b/hud_nexuiz.cfg index 113310e1b..bfc7d51b6 100644 --- a/hud_nexuiz.cfg +++ b/hud_nexuiz.cfg @@ -376,6 +376,7 @@ 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" +seta hud_panel_scoreboard_bg_teams_color_team "0.7" seta hud_panel_scoreboard_accuracy_doublerows "1" seta hud_panel_scoreboard_accuracy_nocolors "0" diff --git a/qcsrc/client/hud/hud.qh b/qcsrc/client/hud/hud.qh index f41802666..5dfd2391c 100644 --- a/qcsrc/client/hud/hud.qh +++ b/qcsrc/client/hud/hud.qh @@ -275,12 +275,12 @@ REGISTER_HUD_PANEL(SCOREBOARD, Scoreboard_Draw, scoreboard, PANEL_CO // Get value for panel_bg_color: if "" fetch default, else use panel_bg_color. Convert pants, shirt or teamcolor into a vector. #define HUD_Panel_GetColor() MACRO_BEGIN { \ - if ((teamplay) && panel_bg_color_team) { \ + if ((teamplay) && panel_bg_color_team > 0) { \ if (autocvar__hud_configure && myteam == NUM_SPECTATOR) \ panel_bg_color = '1 0 0' * panel_bg_color_team; \ else \ panel_bg_color = myteamcolors * panel_bg_color_team; \ - } else if (autocvar_hud_configure_teamcolorforced && autocvar__hud_configure && panel_bg_color_team) { \ + } else if (autocvar_hud_configure_teamcolorforced && autocvar__hud_configure && panel_bg_color_team > 0) { \ panel_bg_color = '1 0 0' * panel_bg_color_team; \ } else { \ if (panel_bg_color_str == "") { \ @@ -387,11 +387,11 @@ REGISTER_HUD_PANEL(SCOREBOARD, Scoreboard_Draw, scoreboard, PANEL_CO panel_bg_padding_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_padding")); \ HUD_Panel_GetBg(); \ if (panel.current_panel_bg != "0") { \ - HUD_Panel_GetColorTeam(); \ - HUD_Panel_GetColor(); \ HUD_Panel_GetBgAlpha(); \ HUD_Panel_GetBorder(); \ } \ + HUD_Panel_GetColorTeam(); \ + HUD_Panel_GetColor(); \ HUD_Panel_GetFgAlpha(); \ HUD_Panel_GetPadding(); \ panel.current_panel_bg_alpha = panel_bg_alpha; \ diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 5af9ded7a..4a7a8b656 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -25,6 +25,7 @@ float autocvar_hud_panel_scoreboard_table_fg_alpha_self = 1; bool autocvar_hud_panel_scoreboard_table_highlight = true; float autocvar_hud_panel_scoreboard_table_highlight_alpha = 0.2; float autocvar_hud_panel_scoreboard_table_highlight_alpha_self = 0.5; +float autocvar_hud_panel_scoreboard_bg_teams_color_team = 0; bool autocvar_hud_panel_scoreboard_accuracy = true; bool autocvar_hud_panel_scoreboard_accuracy_doublerows = false; @@ -1327,6 +1328,7 @@ void Scoreboard_Draw() if(teamplay) { + vector panel_bg_color_save = panel_bg_color; vector team_score_baseoffset = eY * hud_fontsize.y - eX * (panel_bg_border + hud_fontsize.x * 0.5); for(tm = teams.sort_next; tm; tm = tm.sort_next) { @@ -1346,11 +1348,15 @@ void Scoreboard_Draw() drawstring(pos + team_score_baseoffset - eX * stringwidth(str, false, hud_fontsize) + eY * hud_fontsize.y * 1.5, str, hud_fontsize, rgb, panel_fg_alpha, DRAWFLAG_NORMAL); } draw_endBoldFont(); - - panel_bg_color = rgb * panel_bg_color_team; + if(autocvar_hud_panel_scoreboard_bg_teams_color_team > 0) + panel_bg_color = rgb * autocvar_hud_panel_scoreboard_bg_teams_color_team; + else if(panel_bg_color_team > 0) + panel_bg_color = rgb * panel_bg_color_team; + else + panel_bg_color = rgb; pos = Scoreboard_MakeTable(pos, tm, panel_bg_color, bg_size); } - panel_bg_color = Team_ColorRGB(myteam) * panel_bg_color_team; + panel_bg_color = panel_bg_color_save; } else {