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: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=07efc3766f3b2a6ea8c55ee58f3cfeb372f1bd41 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 4bcb286898..9a1654f83a 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 ee80daa63c..35414a7798 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 6b3163f0ed..383a8a8840 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 8113c19751..630017b38a 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 54206598ef..e332bf8af1 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 f2cf3e3caa..4b67250523 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 113310e1b8..bfc7d51b69 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 f418026667..5dfd2391c0 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 5af9ded7ac..4a7a8b6563 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 {