Add a team color setting for team tables so that accuracy and rankings can be display...
authorterencehill <piuntn@gmail.com>
Fri, 5 Aug 2016 13:07:51 +0000 (15:07 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 5 Aug 2016 13:07:51 +0000 (15:07 +0200)
_hud_descriptions.cfg
hud_luma.cfg
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_minimal_xhair.cfg
hud_luminos_old.cfg
hud_nexuiz.cfg
qcsrc/client/hud/hud.qh
qcsrc/client/hud/panel/scoreboard.qc

index 4bcb286..9a1654f 100644 (file)
@@ -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"
index ee80daa..35414a7 100644 (file)
@@ -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"
 
index 6b3163f..383a8a8 100644 (file)
@@ -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"
 
index 8113c19..630017b 100644 (file)
@@ -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"
 
index 5420659..e332bf8 100644 (file)
@@ -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"
 
index f2cf3e3..4b67250 100644 (file)
@@ -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"
 
index 113310e..bfc7d51 100644 (file)
@@ -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"
 
index f418026..5dfd239 100644 (file)
@@ -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;                                                              \
index 5af9ded..4a7a8b6 100644 (file)
@@ -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
        {