]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 4bcb286898b6cf73278c84be614ca112c2a94faf..9a1654f83abd1a177f392a12fd6d785ce883a706 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 ee80daa63c9626d5e58193556798d93507749751..35414a7798e3fa0e4dcd19d525736a77b8801cee 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 6b3163f0ed247117f43e626610b031b9e12eb352..383a8a88406c196c0946cda3b395d692b4d2ba5c 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 8113c197517dace5043fe4095b993348b3bc3a7f..630017b38a35306a518902e8df6a9e6916cc5a07 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 54206598efb4655853dd26945e317afb4081958c..e332bf8af1a3cbfee87a9e94ed567993a1134a6a 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 f2cf3e3caa2cb2bceb8a8450e81f865a41daef23..4b672505237630edc2738cc35bd747fc2e314833 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 113310e1b81f5972e0bb56ec9203ce73af68d339..bfc7d51b69162573492a45de4aafcffdbde07de1 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 f418026667439c30938a47622cb1a9cbc7685530..5dfd2391c012c5562197df397de87cfe47dbb13f 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 5af9ded7ac945b28d2b75f732f9ecd2ffc5fa25c..4a7a8b65639a987dbea84b6edfa2177a789f0630 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
        {