]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/scoreboard.qc
Merge branch 'fruitiex/fruitbalance' of ssh://git.xonotic.org/xonotic-data.pk3dir...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / scoreboard.qc
index cd6ea9efebbc1a583f1baea8217737c92c467955..0e5ee12939b8d5a53527b720ae2663788eba706f 100644 (file)
@@ -870,7 +870,9 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz
 }
 
 float HUD_WouldDrawScoreboard() {
-       if (scoreboard_showscores)
+       if (autocvar__hud_configure)
+               return 0;
+       else if (scoreboard_showscores)
                return 1;
        else if (intermission == 1)
                return 1;
@@ -966,7 +968,19 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
                        float padding;
                        padding = ((sbwidth/weapon_cnt) - stringwidth(s, FALSE, '1 0 0' * fontsize)) / 2; // center the accuracy value
 
-                       rgb = HUD_AccuracyColor(weapon_stats);
+                       // yellow_accuracy = value at which accuracy becomes yellow
+                       if(weapon_stats >= 100) {
+                               rgb_x = 0;
+                               rgb_y = 1;
+                       }
+                       else if(weapon_stats > autocvar_hud_weaponicons_accuracy_yellow) {
+                               rgb_x = 1 - (weapon_stats-autocvar_hud_weaponicons_accuracy_yellow)/(100-autocvar_hud_weaponicons_accuracy_yellow); // red value between 1 -> 0
+                               rgb_y = 1;
+                       } else {
+                               rgb_x = 1;
+                               rgb_y = weapon_stats/autocvar_hud_weaponicons_accuracy_yellow; // green value between 0 -> 1
+                       }
+                       rgb_z = 0;
                        drawstring(pos + '1 0 0' * padding + '0 1 0' * height * (2/3), s, '1 1 0' * fontsize, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
                }
                pos_x += sbwidth/weapon_cnt * rows;