]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/scoreboard.qc
always draw the scoreboard when observing (won't change behaviour in other gamemodes...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / scoreboard.qc
index 29fb20642a90fbb514f7a1244c0d79b4541b1dcb..31cdc45bfa04b4bcffe5697e0bbf47d4fcc4ccec 100644 (file)
@@ -248,12 +248,12 @@ string HUD_DefaultColumnLayout()
 {
        return strcat( // fteqcc sucks
                "ping pl name | ",
 {
        return strcat( // fteqcc sucks
                "ping pl name | ",
-               "-teams,race,lms/kills -teams,lms/deaths -teams,lms,race/suicides -race,dm,tdm/frags ", // tdm already has this in "score"
+               "-teams,race,lms/kills -teams,lms/deaths -teams,lms,race,ka/suicides -race,dm,tdm,ka/frags ", // tdm already has this in "score"
                "+ctf/caps +ctf/pickups +ctf/fckills +ctf/returns ",
                "+lms/lives +lms/rank ",
                "+kh/caps +kh/pushes +kh/destroyed ",
                "?+race/laps ?+race/time ?+race/fastest ",
                "+ctf/caps +ctf/pickups +ctf/fckills +ctf/returns ",
                "+lms/lives +lms/rank ",
                "+kh/caps +kh/pushes +kh/destroyed ",
                "?+race/laps ?+race/time ?+race/fastest ",
-               "+as/objectives +nexball/faults +nexball/goals ",
+               "+as/objectives +nexball/faults +nexball/goals +ka/drops +ka/pickups +ka/bckills ",
                "-lms,race,nexball/score");
 }
 
                "-lms,race,nexball/score");
 }
 
@@ -266,7 +266,7 @@ void Cmd_HUD_SetFields(float argc)
 
        // TODO: re enable with gametype dependant cvars?
        if(argc < 2) // no arguments provided
 
        // TODO: re enable with gametype dependant cvars?
        if(argc < 2) // no arguments provided
-               argc = tokenizebyseparator(strcat("x ", cvar_string("scoreboard_columns")), " ");
+               argc = tokenizebyseparator(strcat("x ", autocvar_scoreboard_columns), " ");
 
        if(argc < 2)
                argc = tokenizebyseparator(strcat("x ", HUD_DefaultColumnLayout()), " ");
 
        if(argc < 2)
                argc = tokenizebyseparator(strcat("x ", HUD_DefaultColumnLayout()), " ");
@@ -595,8 +595,8 @@ string HUD_FixScoreboardColumnWidth(float i, string str)
                for(j = 0; j < hud_num_fields; ++j)
                        if(j != i)
                                if (hud_field[i] != SP_SEPARATOR)
                for(j = 0; j < hud_num_fields; ++j)
                        if(j != i)
                                if (hud_field[i] != SP_SEPARATOR)
-                                       namesize -= hud_size[j] + 1;
-               namesize += 1;
+                                       namesize -= hud_size[j] + hud_fontsize_x;
+               namesize += hud_fontsize_x;
                hud_size[i] = namesize;
 
                if (hud_fixscoreboardcolumnwidth_iconlen != 0)
                hud_size[i] = namesize;
 
                if (hud_fixscoreboardcolumnwidth_iconlen != 0)
@@ -624,9 +624,9 @@ void HUD_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_numb
        is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR);
 
        if((rgb == '1 1 1') && (!is_spec)) {
        is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR);
 
        if((rgb == '1 1 1') && (!is_spec)) {
-               rgb_x = cvar("scoreboard_color_bg_r") + 0.5;
-               rgb_y = cvar("scoreboard_color_bg_g") + 0.5;
-               rgb_z = cvar("scoreboard_color_bg_b") + 0.5; }
+               rgb_x = autocvar_scoreboard_color_bg_r + 0.5;
+               rgb_y = autocvar_scoreboard_color_bg_g + 0.5;
+               rgb_z = autocvar_scoreboard_color_bg_b + 0.5; }
 
        // Layout:
        tmp_x = sbwidth;
 
        // Layout:
        tmp_x = sbwidth;
@@ -760,37 +760,43 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz
        tmp_y = 1.25 * hud_fontsize_y;
 
        // rounded header
        tmp_y = 1.25 * hud_fontsize_y;
 
        // rounded header
-       drawpic(pos, "gfx/scoreboard/scoreboard_tableheader", tmp, (rgb * autocvar_hud_color_bg_team) + '0.5 0.5 0.5', scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+       if (teamplay)
+               drawpic(pos, "gfx/scoreboard/scoreboard_tableheader", tmp, (rgb * autocvar_scoreboard_color_bg_team) + '0.5 0.5 0.5', scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+       else
+               drawpic(pos, "gfx/scoreboard/scoreboard_tableheader", tmp, rgb + '0.5 0.5 0.5', scoreboard_alpha_bg, DRAWFLAG_NORMAL);
 
        // table border
 
        // table border
-       tmp_y += hud_border_thickness;
+       tmp_y += autocvar_scoreboard_border_thickness;
        tmp_y += body_table_height;
        tmp_y += body_table_height;
-       drawborderlines(hud_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg, DRAWFLAG_NORMAL); // more transparency for the scoreboard
+       drawborderlines(autocvar_scoreboard_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg, DRAWFLAG_NORMAL); // more transparency for the scoreboard
 
        // separator header/table
        pos_y += 1.25 * hud_fontsize_y;
 
        // separator header/table
        pos_y += 1.25 * hud_fontsize_y;
-       tmp_y = hud_border_thickness;
+       tmp_y = autocvar_scoreboard_border_thickness;
        drawfill(pos, tmp, '0 0 0', scoreboard_alpha_bg, DRAWFLAG_NORMAL);
 
        drawfill(pos, tmp, '0 0 0', scoreboard_alpha_bg, DRAWFLAG_NORMAL);
 
-       pos_y += hud_border_thickness;
+       pos_y += autocvar_scoreboard_border_thickness;
 
        // table background
        tmp_y = body_table_height;
 
        // table background
        tmp_y = body_table_height;
-       drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * autocvar_hud_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+       if (teamplay)
+               drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * autocvar_scoreboard_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+       else
+               drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
 
        // anyway, apply some color
        //drawfill(pos, tmp + '2 0 0', rgb, 0.1, DRAWFLAG_NORMAL);
 
        // go back to the top to make alternated columns highlighting and to print the strings
        pos_y -= 1.25 * hud_fontsize_y;
 
        // anyway, apply some color
        //drawfill(pos, tmp + '2 0 0', rgb, 0.1, DRAWFLAG_NORMAL);
 
        // go back to the top to make alternated columns highlighting and to print the strings
        pos_y -= 1.25 * hud_fontsize_y;
-       pos_y -= hud_border_thickness;
+       pos_y -= autocvar_scoreboard_border_thickness;
 
        pos += '1 1 0';
 
        if (scoreboard_highlight)
        {
                column_dim_y = 1.25 * hud_fontsize_y; // header
 
        pos += '1 1 0';
 
        if (scoreboard_highlight)
        {
                column_dim_y = 1.25 * hud_fontsize_y; // header
-               column_dim_y += hud_border_thickness;
+               column_dim_y += autocvar_scoreboard_border_thickness;
                column_dim_y += body_table_height;
        }
 
                column_dim_y += body_table_height;
        }
 
@@ -840,7 +846,7 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz
 
        pos_x = xmin;
        pos_y += 1.25 * hud_fontsize_y; // skip the header
 
        pos_x = xmin;
        pos_y += 1.25 * hud_fontsize_y; // skip the header
-       pos_y += hud_border_thickness;
+       pos_y += autocvar_scoreboard_border_thickness;
 
        // fill the table and draw the rows
        i = 0;
 
        // fill the table and draw the rows
        i = 0;
@@ -877,11 +883,11 @@ float HUD_WouldDrawScoreboard() {
                return 1;
        else if (intermission == 1)
                return 1;
                return 1;
        else if (intermission == 1)
                return 1;
-       else if (intermission == 2)
-               return 1;
-       else if (getstati(STAT_HEALTH) <= 0 && cvar("cl_deathscoreboard"))
+       else if (getstati(STAT_HEALTH) <= 0 && autocvar_cl_deathscoreboard && gametype != GAME_CTS)
                return 1;
                return 1;
-       else if(scoreboard_showscores_force)
+    else if (spectatee_status == -1)
+        return 1;
+       else if (scoreboard_showscores_force)
                return 1;
        return 0;
 }
                return 1;
        return 0;
 }
@@ -891,41 +897,40 @@ float average_accuracy;
 vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
 {
        float i;
 vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
 {
        float i;
-       float weapon_hit, weapon_damage, weapon_stats;
-       float fontsize = 40 * 1/3;
        float weapon_cnt = WEP_COUNT - 3; // either minstanex/nex are hidden, no port-o-launch, no tuba
        float rows;
        float weapon_cnt = WEP_COUNT - 3; // either minstanex/nex are hidden, no port-o-launch, no tuba
        float rows;
-       if(cvar("scoreboard_accuracy_doublerows"))
+       if(autocvar_scoreboard_accuracy_doublerows)
                rows = 2;
        else
                rows = 1;
        float height = 40;
                rows = 2;
        else
                rows = 1;
        float height = 40;
-
-       if(warmup_stage)
-       {
-               return pos;
-       }
+       float fontsize = height * 1/3;
+       float weapon_height = height * 2/3;
+       float weapon_width = sbwidth / weapon_cnt;
 
        drawstring(pos, strcat("Accuracy stats (average ", ftos(average_accuracy), "%)"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
 
        drawstring(pos, strcat("Accuracy stats (average ", ftos(average_accuracy), "%)"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-       pos_y += 18;
+       pos_y += 1.25 * hud_fontsize_y;
        vector tmp;
        tmp_x = sbwidth;
        tmp_y = height * rows;
 
        vector tmp;
        tmp_x = sbwidth;
        tmp_y = height * rows;
 
-       drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * autocvar_hud_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
-       drawborderlines(hud_accuracy_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg * 0.75, DRAWFLAG_NORMAL);
+       if (teamplay)
+               drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * autocvar_scoreboard_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+       else
+               drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+       drawborderlines(autocvar_scoreboard_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg * 0.75, DRAWFLAG_NORMAL);
 
        // column highlighting
        for(i = 0; i < weapon_cnt/rows; ++i)
        {
                if(!mod(i, 2))
 
        // column highlighting
        for(i = 0; i < weapon_cnt/rows; ++i)
        {
                if(!mod(i, 2))
-                       drawfill(pos + '1 0 0' * (sbwidth/weapon_cnt) * rows * i, '0 1 0' * height * rows + '1 0 0' * (sbwidth/weapon_cnt) * rows, '0 0 0', scoreboard_alpha_bg * 0.2, DRAWFLAG_NORMAL);
+                       drawfill(pos + '1 0 0' * weapon_width * rows * i, '0 1 0' * height * rows + '1 0 0' * weapon_width * rows, '0 0 0', scoreboard_alpha_bg * 0.2, DRAWFLAG_NORMAL);
        }
 
        // row highlighting
        for(i = 0; i < rows; ++i)
        {
        }
 
        // row highlighting
        for(i = 0; i < rows; ++i)
        {
-               drawfill(pos + '0 1 0' * height * (2/3) + '0 1 0' * height * i, '1 0 0' * sbwidth + '0 1 0' * fontsize, '1 1 1', scoreboard_highlight_alpha, DRAWFLAG_NORMAL);
+               drawfill(pos + '0 1 0' * weapon_height + '0 1 0' * height * i, '1 0 0' * sbwidth + '0 1 0' * fontsize, '1 1 1', scoreboard_highlight_alpha, DRAWFLAG_NORMAL);
        }
 
        drawfont = hud_bigfont;
        }
 
        drawfont = hud_bigfont;
@@ -933,11 +938,19 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
        float weapons_with_stats;
        weapons_with_stats = 0;
        if(rows == 2)
        float weapons_with_stats;
        weapons_with_stats = 0;
        if(rows == 2)
-               pos_x += sbwidth/weapon_cnt / 2;
+               pos_x += weapon_width / 2;
 
        if(getstati(STAT_SWITCHWEAPON) == WEP_MINSTANEX)
                g_minstagib = 1; // TODO: real detection for minstagib?
 
 
        if(getstati(STAT_SWITCHWEAPON) == WEP_MINSTANEX)
                g_minstagib = 1; // TODO: real detection for minstagib?
 
+       float weapon_stats, weapon_number;
+
+       if (!acc_levels)
+               rgb = '1 1 1';
+       else if (acc_col_x[0] == -1)
+               for (i = 0; i < acc_levels; ++i)
+                       acc_col[i] = stov(cvar_string(strcat("accuracy_color", ftos(i))));
+
        for(i = WEP_FIRST; i <= WEP_LAST; ++i)
        {
                self = get_weaponinfo(i);
        for(i = WEP_FIRST; i <= WEP_LAST; ++i)
        {
                self = get_weaponinfo(i);
@@ -945,53 +958,45 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
                        continue;
                if ((i == WEP_NEX && g_minstagib) || i == WEP_PORTO || (i == WEP_MINSTANEX && !g_minstagib) || i == WEP_TUBA) // skip port-o-launch, nex || minstanex and tuba
                        continue;
                        continue;
                if ((i == WEP_NEX && g_minstagib) || i == WEP_PORTO || (i == WEP_MINSTANEX && !g_minstagib) || i == WEP_TUBA) // skip port-o-launch, nex || minstanex and tuba
                        continue;
-               weapon_hit = weapon_hits[i-WEP_FIRST];
-               weapon_damage = weapon_fired[i-WEP_FIRST];
-               if(weapon_damage)
-                       weapon_stats = bound(0, floor(100 * weapon_hit / weapon_damage), 100);
-               float weapon_alpha;
+               weapon_stats = weapon_accuracy[i-WEP_FIRST];
 
 
-               if(weapon_damage)
+               float weapon_alpha;
+               if(weapon_stats >= 0)
                        weapon_alpha = scoreboard_alpha_fg;
                else
                        weapon_alpha = 0.2 * scoreboard_alpha_fg;
 
                // weapon icon
                        weapon_alpha = scoreboard_alpha_fg;
                else
                        weapon_alpha = 0.2 * scoreboard_alpha_fg;
 
                // weapon icon
-               drawpic_aspect_skin(pos, strcat("weapon", self.netname), '1 0 0' * sbwidth * (1/weapon_cnt) + '0 1 0' * height * (2/3), '1 1 1', weapon_alpha, DRAWFLAG_NORMAL);
+               drawpic_aspect_skin(pos, strcat("weapon", self.netname), '1 0 0' * weapon_width + '0 1 0' * weapon_height, '1 1 1', weapon_alpha, DRAWFLAG_NORMAL);
                // the accuracy
                // the accuracy
-               if(weapon_damage) {
+               if(weapon_stats >= 0) {
                        weapons_with_stats += 1;
                        average_accuracy += weapon_stats; // store sum of all accuracies in average_accuracy
 
                        string s;
                        weapons_with_stats += 1;
                        average_accuracy += weapon_stats; // store sum of all accuracies in average_accuracy
 
                        string s;
-                       s = strcat(ftos(weapon_stats),"%");
+                       s = sprintf("%d%%", weapon_stats*100);
 
                        float padding;
 
                        float padding;
-                       padding = ((sbwidth/weapon_cnt) - stringwidth(s, FALSE, '1 0 0' * fontsize)) / 2; // center the accuracy value
+                       padding = (weapon_width - stringwidth(s, FALSE, '1 0 0' * fontsize)) / 2; // center the accuracy value
 
 
-                       float weapon_hit, weapon_damage;
-                       weapon_damage = weapon_fired[self.weapon-WEP_FIRST];
-                       if(weapon_damage)
+                       if (acc_levels)
                        {
                        {
-                               weapon_hit = weapon_hits[self.weapon-WEP_FIRST];
-                               weapon_stats = floor(100 * weapon_hit / weapon_damage);
+                               // find the max level lower than weapon_stats
+                               float j;
+                               j = acc_levels-1;
+                               while ( j && weapon_stats < acc_lev[j] )
+                                       --j;
+
+                               // inject color j+1 in color j, how much depending on how much weapon_stats is higher than level j
+                               float factor;
+                               factor = (weapon_stats - acc_lev[j]) / (acc_lev[j+1] - acc_lev[j]);
+                               rgb = acc_col[j];
+                               rgb = rgb + factor * (acc_col[j+1] - rgb);
                        }
 
                        }
 
-                       // find the max level lower than weapon_stats
-                       float j;
-                       j = acc_levels-1;
-                       while ( j && weapon_stats < acc_lev[j] )
-                               --j;
-
-                       // inject color j+1 in color j, how much depending on how much weapon_stats is higher than level j
-                       float factor;
-                       factor = (weapon_stats - acc_lev[j]) / (acc_lev[j+1] - acc_lev[j]);
-                       rgb = acc_color(j);
-                       rgb = rgb + factor * (acc_color(j+1) - rgb);
-
-                       drawstring(pos + '1 0 0' * padding + '0 1 0' * height * (2/3), s, '1 1 0' * fontsize, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+                       drawstring(pos + '1 0 0' * padding + '0 1 0' * weapon_height, s, '1 1 0' * fontsize, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
                }
                }
-               pos_x += sbwidth/weapon_cnt * rows;
+               pos_x += weapon_width * rows;
                if(rows == 2 && i == 6) {
                        pos_x -= sbwidth;
                        pos_y += height;
                if(rows == 2 && i == 6) {
                        pos_x -= sbwidth;
                        pos_y += height;
@@ -1003,9 +1008,11 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
                average_accuracy = floor(average_accuracy / weapons_with_stats);
 
        if(rows == 2)
                average_accuracy = floor(average_accuracy / weapons_with_stats);
 
        if(rows == 2)
-               pos_x -= sbwidth/weapon_cnt / 2;
+               pos_x -= weapon_width / 2;
        pos_x -= sbwidth;
        pos_y += height;
        pos_x -= sbwidth;
        pos_y += height;
+
+       pos_y +=  1.25 * hud_fontsize_y;
        return pos;
 }
 
        return pos;
 }
 
@@ -1013,9 +1020,9 @@ vector HUD_DrawScoreboardRankings(vector pos, entity pl,  vector rgb, vector bg_
 {
        float i;
        RANKINGS_RECEIVED_CNT = 0;
 {
        float i;
        RANKINGS_RECEIVED_CNT = 0;
-               for (i=RANKINGS_CNT-1; i>=0; --i)
-                       if (grecordtime[i])
-                               RANKINGS_RECEIVED_CNT = RANKINGS_RECEIVED_CNT + 1;
+       for (i=RANKINGS_CNT-1; i>=0; --i)
+               if (grecordtime[i])
+                       ++RANKINGS_RECEIVED_CNT;
 
        if (RANKINGS_RECEIVED_CNT == 0)
                return pos;
 
        if (RANKINGS_RECEIVED_CNT == 0)
                return pos;
@@ -1023,19 +1030,22 @@ vector HUD_DrawScoreboardRankings(vector pos, entity pl,  vector rgb, vector bg_
        float is_spec;
        is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR);
        vector hl_rgb;
        float is_spec;
        is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR);
        vector hl_rgb;
-               hl_rgb_x = cvar("scoreboard_color_bg_r") + 0.5;
-               hl_rgb_y = cvar("scoreboard_color_bg_g") + 0.5;
-               hl_rgb_z = cvar("scoreboard_color_bg_b") + 0.5;
+       hl_rgb_x = autocvar_scoreboard_color_bg_r + 0.5;
+       hl_rgb_y = autocvar_scoreboard_color_bg_g + 0.5;
+       hl_rgb_z = autocvar_scoreboard_color_bg_b + 0.5;
 
        pos_y += hud_fontsize_y;
        drawstring(pos, strcat("Rankings"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
        pos_y += hud_fontsize_y;
        vector tmp;
        tmp_x = sbwidth;
 
        pos_y += hud_fontsize_y;
        drawstring(pos, strcat("Rankings"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
        pos_y += hud_fontsize_y;
        vector tmp;
        tmp_x = sbwidth;
-       tmp_y = hud_fontsize_y * RANKINGS_RECEIVED_CNT;
+       tmp_y = 1.25 * hud_fontsize_y * RANKINGS_RECEIVED_CNT;
 
 
-       drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * autocvar_hud_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
-       drawborderlines(hud_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg * 0.75, DRAWFLAG_NORMAL);
+       if (teamplay)
+               drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * autocvar_scoreboard_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+       else
+               drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+       drawborderlines(autocvar_scoreboard_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg * 0.75, DRAWFLAG_NORMAL);
 
        // row highlighting
        for(i = 0; i<RANKINGS_RECEIVED_CNT; ++i)
 
        // row highlighting
        for(i = 0; i<RANKINGS_RECEIVED_CNT; ++i)
@@ -1048,67 +1058,67 @@ vector HUD_DrawScoreboardRankings(vector pos, entity pl,  vector rgb, vector bg_
                n = grecordholder[i];
                p = race_PlaceName(i+1);
                if(grecordholder[i] == GetPlayerName(player_localentnum - 1))
                n = grecordholder[i];
                p = race_PlaceName(i+1);
                if(grecordholder[i] == GetPlayerName(player_localentnum - 1))
-                       drawfill(pos, '1 0 0' * sbwidth + '0 1 0' * hud_fontsize_y, hl_rgb, scoreboard_highlight_alpha_self, DRAWFLAG_NORMAL);
+                       drawfill(pos, '1 0 0' * sbwidth + '0 1.25 0' * hud_fontsize_y, hl_rgb, scoreboard_highlight_alpha_self, DRAWFLAG_NORMAL);
                else if(!mod(i, 2) && scoreboard_highlight)
                else if(!mod(i, 2) && scoreboard_highlight)
-                       drawfill(pos, '1 0 0' * sbwidth + '0 1 0' * hud_fontsize_y, hl_rgb, scoreboard_highlight_alpha, DRAWFLAG_NORMAL);
-               drawstring(pos, p, hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-               drawstring(pos + '3 0 0' * hud_fontsize_x, TIME_ENCODED_TOSTRING(t), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-               drawcolorcodedstring(pos + '8 0 0' * hud_fontsize_x, n, hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-               pos += '0 1 0' * hud_fontsize_y;
+                       drawfill(pos, '1 0 0' * sbwidth + '0 1.25 0' * hud_fontsize_y, hl_rgb, scoreboard_highlight_alpha, DRAWFLAG_NORMAL);
+               drawstring(pos, p, '1 1 0' * hud_fontsize_y, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+               drawstring(pos + '3 0 0' * hud_fontsize_y, TIME_ENCODED_TOSTRING(t), '1 1 0' * hud_fontsize_y, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+               drawcolorcodedstring(pos + '8 0 0' * hud_fontsize_y, n, '1 1 0' * hud_fontsize_y, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+               pos_y += 1.25 * hud_fontsize_y;
        }
 
        return pos;
 }
 
        }
 
        return pos;
 }
 
-float scoreboard_fade_alpha;
 float hud_woulddrawscoreboard_prev;
 float hud_woulddrawscoreboard_change; // "time" at which HUD_WouldDrawScoreboard() changed
 void HUD_DrawScoreboard()
 {
 float hud_woulddrawscoreboard_prev;
 float hud_woulddrawscoreboard_change; // "time" at which HUD_WouldDrawScoreboard() changed
 void HUD_DrawScoreboard()
 {
-       HUD_UpdatePlayerTeams();
-
        float hud_woulddrawscoreboard;
        float hud_woulddrawscoreboard;
-       hud_woulddrawscoreboard = HUD_WouldDrawScoreboard();
+       hud_woulddrawscoreboard = scoreboard_active;
        if(hud_woulddrawscoreboard != hud_woulddrawscoreboard_prev) {
                hud_woulddrawscoreboard_change = time;
                hud_woulddrawscoreboard_prev = hud_woulddrawscoreboard;
        }
 
        if(hud_woulddrawscoreboard != hud_woulddrawscoreboard_prev) {
                hud_woulddrawscoreboard_change = time;
                hud_woulddrawscoreboard_prev = hud_woulddrawscoreboard;
        }
 
-       float scoreboard_fadeinspeed = cvar_or("scoreboard_fadeinspeed", 10);
-       float scoreboard_fadeoutspeed = cvar_or("scoreboard_fadeoutspeed", 5);
        if(hud_woulddrawscoreboard) {
        if(hud_woulddrawscoreboard) {
+               float scoreboard_fadeinspeed = autocvar_scoreboard_fadeinspeed;
                if (scoreboard_fadeinspeed)
                        scoreboard_fade_alpha = bound (0, (time - hud_woulddrawscoreboard_change) * scoreboard_fadeinspeed, 1);
                else
                        scoreboard_fade_alpha = 1;
        }
                if (scoreboard_fadeinspeed)
                        scoreboard_fade_alpha = bound (0, (time - hud_woulddrawscoreboard_change) * scoreboard_fadeinspeed, 1);
                else
                        scoreboard_fade_alpha = 1;
        }
-       else
+       else {
+               float scoreboard_fadeoutspeed = autocvar_scoreboard_fadeoutspeed;
                if (scoreboard_fadeoutspeed)
                        scoreboard_fade_alpha = bound (0, (1/scoreboard_fadeoutspeed - (time - hud_woulddrawscoreboard_change)) * scoreboard_fadeoutspeed, 1);
                else
                        scoreboard_fade_alpha = 0;
                if (scoreboard_fadeoutspeed)
                        scoreboard_fade_alpha = bound (0, (1/scoreboard_fadeoutspeed - (time - hud_woulddrawscoreboard_change)) * scoreboard_fadeoutspeed, 1);
                else
                        scoreboard_fade_alpha = 0;
+       }
 
        if not(scoreboard_fade_alpha)
                return;
 
 
        if not(scoreboard_fade_alpha)
                return;
 
-       scoreboard_alpha_bg = cvar("scoreboard_alpha_bg") * scoreboard_fade_alpha * (1 - cvar("_menu_alpha"));
-       scoreboard_alpha_fg = cvar_or("scoreboard_alpha_fg", 1.0) * scoreboard_fade_alpha * (1 - cvar("_menu_alpha"));
-       scoreboard_highlight = cvar("scoreboard_highlight");
-       scoreboard_highlight_alpha = cvar_or("scoreboard_highlight_alpha", 0.10) * scoreboard_alpha_fg;
-       scoreboard_highlight_alpha_self = cvar_or("scoreboard_highlight_alpha_self", 0.25) * scoreboard_alpha_fg;
-       scoreboard_alpha_name = cvar_or("scoreboard_alpha_name", 0.9) * scoreboard_alpha_fg;
-       scoreboard_alpha_name_self = cvar_or("scoreboard_alpha_name_self", 1) * scoreboard_alpha_fg;
+       HUD_UpdatePlayerTeams();
+
+       scoreboard_alpha_bg = autocvar_scoreboard_alpha_bg * scoreboard_fade_alpha * (1 - autocvar__menu_alpha);
+       scoreboard_alpha_fg = autocvar_scoreboard_alpha_fg * scoreboard_fade_alpha * (1 - autocvar__menu_alpha);
+       scoreboard_highlight = autocvar_scoreboard_highlight;
+       scoreboard_highlight_alpha = autocvar_scoreboard_highlight_alpha * scoreboard_alpha_fg;
+       scoreboard_highlight_alpha_self = autocvar_scoreboard_highlight_alpha_self * scoreboard_alpha_fg;
+       scoreboard_alpha_name = autocvar_scoreboard_alpha_name * scoreboard_alpha_fg;
+       scoreboard_alpha_name_self = autocvar_scoreboard_alpha_name_self * scoreboard_alpha_fg;
 
        vector rgb, pos, tmp;
        entity pl, tm;
 
 
        vector rgb, pos, tmp;
        entity pl, tm;
 
-       sbwidth = HUD_GetWidth(6.5 * hud_fontsize_y);
+       xmin = autocvar_scoreboard_offset_left * vid_conwidth;
+       ymin = autocvar_con_notify * autocvar_con_notifysize;
 
 
-       xmin = 0.5 * (vid_conwidth - sbwidth);
-       ymin = SCOREBOARD_OFFSET;
+       xmax = (1 - autocvar_scoreboard_offset_right) * vid_conwidth;
+       ymax = vid_conheight - ymin;
 
 
-       xmax = vid_conwidth - xmin;
-       ymax = vid_conheight - 0.2*vid_conheight;
+       sbwidth = xmax - xmin;
 
        // Initializes position
        pos_x = xmin;
 
        // Initializes position
        pos_x = xmin;
@@ -1117,16 +1127,17 @@ void HUD_DrawScoreboard()
 
        // Heading
        drawfont = hud_bigfont;
 
        // Heading
        drawfont = hud_bigfont;
-       drawstringcenter('0 1 0' * ymin, "Scoreboard", '24 24 0', '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+       drawstring(pos, "Scoreboard", '24 24 0', '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+       
+       centerprint_start_x = vid_conwidth - 0.5 * (pos_x + stringwidth("Scoreboard", FALSE, '24 24 0'));
+       centerprint_start_y = pos_y;
 
 
-       pos_y += 24 + 4;
-       pos_y += hud_fontsize_y;
+       pos_y += 24;
 
        drawfont = hud_font;
 
        // Draw the scoreboard
 
        drawfont = hud_font;
 
        // Draw the scoreboard
-       vector bg_size;
-       bg_size = drawgetimagesize("gfx/hud/scoreboard_scoreboard_bg");
+       vector bg_size = drawgetimagesize("gfx/scoreboard/scoreboard_bg") * autocvar_scoreboard_bg_scale;
 
        if(teamplay)
        {
 
        if(teamplay)
        {
@@ -1136,19 +1147,19 @@ void HUD_DrawScoreboard()
                                continue;
 
                        rgb = GetTeamRGB(tm.team);
                                continue;
 
                        rgb = GetTeamRGB(tm.team);
-                       drawstring(pos - '9.5 0 0' * hud_fontsize_y + '0 1 0' * hud_fontsize_y, ftos(tm.(teamscores[ts_primary])), '1 1 0' * hud_fontsize_y * 1.5, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+                       drawstring(pos - '2 0 0' * hud_fontsize_x + '0 1 0' * hud_fontsize_y, ftos(tm.(teamscores[ts_primary])), '1 1 0' * hud_fontsize_y * 1.5, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
 
                        if(ts_primary != ts_secondary)
 
                        if(ts_primary != ts_secondary)
-                               drawstring(pos - '7.5 0 0' * hud_fontsize_y + '0 2.5 0' * hud_fontsize_y, ftos(tm.(teamscores[ts_secondary])), '1 1 0' * hud_fontsize_y * 1, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+                               drawstring(pos - '2 0 0' * hud_fontsize_x + '0 2.5 0' * hud_fontsize_y, ftos(tm.(teamscores[ts_secondary])), '1 1 0' * hud_fontsize_y * 1, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
 
                        pos = HUD_Scoreboard_MakeTable(pos, tm, rgb, bg_size);
                }
        }
        else
        {
 
                        pos = HUD_Scoreboard_MakeTable(pos, tm, rgb, bg_size);
                }
        }
        else
        {
-               rgb_x = cvar("scoreboard_color_bg_r");
-               rgb_y = cvar("scoreboard_color_bg_g");
-               rgb_z = cvar("scoreboard_color_bg_b");
+               rgb_x = autocvar_scoreboard_color_bg_r;
+               rgb_y = autocvar_scoreboard_color_bg_g;
+               rgb_z = autocvar_scoreboard_color_bg_b;
 
                for(tm = teams.sort_next; tm; tm = tm.sort_next)
                {
 
                for(tm = teams.sort_next; tm; tm = tm.sort_next)
                {
@@ -1161,39 +1172,40 @@ void HUD_DrawScoreboard()
 
        if(gametype == GAME_CTS || gametype == GAME_RACE) {
                if(race_speedaward) {
 
        if(gametype == GAME_CTS || gametype == GAME_RACE) {
                if(race_speedaward) {
-                       drawcolorcodedstring(pos, strcat("Speed award: ", ftos(race_speedaward), " (", race_speedaward_holder, ")"), hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+                       drawcolorcodedstring(pos, strcat("Speed award: ", ftos(race_speedaward), " ^7(", race_speedaward_holder, "^7)"), hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
                        pos_y += 1.25 * hud_fontsize_y;
                }
                if(race_speedaward_alltimebest) {
                        pos_y += 1.25 * hud_fontsize_y;
                }
                if(race_speedaward_alltimebest) {
-                       drawcolorcodedstring(pos, strcat("All-time fastest: ", ftos(race_speedaward_alltimebest), " (", race_speedaward_alltimebest_holder, ")"), hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+                       drawcolorcodedstring(pos, strcat("All-time fastest: ", ftos(race_speedaward_alltimebest), " ^7(", race_speedaward_alltimebest_holder, "^7)"), hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
                        pos_y += 1.25 * hud_fontsize_y;
                }
                pos = HUD_DrawScoreboardRankings(pos, pl, rgb, bg_size);
        }
                        pos_y += 1.25 * hud_fontsize_y;
                }
                pos = HUD_DrawScoreboardRankings(pos, pl, rgb, bg_size);
        }
-       else if(cvar("scoreboard_accuracy") && spectatee_status != -1) {
+       else if(autocvar_scoreboard_accuracy && spectatee_status != -1 && !warmup_stage) {
                if(teamplay)
                        pos = HUD_DrawScoreboardAccuracyStats(pos, GetTeamRGB(myteam), bg_size);
                else
                        pos = HUD_DrawScoreboardAccuracyStats(pos, rgb, bg_size);
        }
 
                if(teamplay)
                        pos = HUD_DrawScoreboardAccuracyStats(pos, GetTeamRGB(myteam), bg_size);
                else
                        pos = HUD_DrawScoreboardAccuracyStats(pos, rgb, bg_size);
        }
 
-       tmp = pos + '0 1.5 0' * hud_fontsize_y;
-       pos_y += 3 * hud_fontsize_y;
-
        // List spectators
        float specs;
        specs = 0;
        // List spectators
        float specs;
        specs = 0;
+       tmp = pos;
        for(pl = players.sort_next; pl; pl = pl.sort_next)
        {
                if(pl.team != COLOR_SPECTATOR)
                        continue;
        for(pl = players.sort_next; pl; pl = pl.sort_next)
        {
                if(pl.team != COLOR_SPECTATOR)
                        continue;
-               HUD_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localentnum - 1), specs);
                pos_y += 1.25 * hud_fontsize_y;
                pos_y += 1.25 * hud_fontsize_y;
+               HUD_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localentnum - 1), specs);
                ++specs;
        }
 
        if(specs)
                ++specs;
        }
 
        if(specs)
+       {
                drawstring(tmp, "Spectators", hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
                drawstring(tmp, "Spectators", hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+               pos_y += 1.25 * hud_fontsize_y;
+       }
 
        // Print info string
        string str;
 
        // Print info string
        string str;
@@ -1269,183 +1281,3 @@ void HUD_DrawScoreboard()
 
        scoreboard_bottom = pos_y + 2 * hud_fontsize_y;
 }
 
        scoreboard_bottom = pos_y + 2 * hud_fontsize_y;
 }
-
-void HUD_DrawAccuracyStats_Description_Hitscan(vector position)
-{
-       drawstring(position + '0 3 0' * hud_fontsize_y, "Shots fired:", hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-       drawstring(position + '0 5 0' * hud_fontsize_y, "Shots hit:", hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-       drawstring(position + '0 7 0' * hud_fontsize_y, "Accuracy:", hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-       drawstring(position + '0 9 0' * hud_fontsize_y, "Shots missed:", hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-}
-
-void HUD_DrawAccuracyStats_Description_Splash(vector position)
-{
-       drawstring(position + '0 3 0' * hud_fontsize_y, "Maximum damage:", hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-       drawstring(position + '0 5 0' * hud_fontsize_y, "Actual damage:", hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-       drawstring(position + '0 7 0' * hud_fontsize_y, "Accuracy:", hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-       drawstring(position + '0 9 0' * hud_fontsize_y, "Damage wasted:", hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-}
-
-void HUD_DrawAccuracyStats()
-{
-       float i, count_hitscan, count_splash, row;  // count is the number of 'colums'
-       float weapon_hit, weapon_damage, weapon_stats;
-       float left_border;  // position where the weapons start, the description is in the border
-       vector fill_colour, fill_size;
-       vector pos;
-       vector border_colour;
-
-       float col_margin = 20;  // pixels between the columns
-       float row_margin = 20;  // pixels between the rows
-
-       fill_size_x = 5 * hud_fontsize_x;  // width of the background
-       fill_size_y = 10 * hud_fontsize_y;  // height of the background
-
-       drawfont = hud_bigfont;
-       pos_x = 0;
-       pos_y = SCOREBOARD_OFFSET;
-       pos_z = 0;
-       drawstringcenter(pos, "Weapon Accuracy", 2 * hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-
-       left_border = col_margin + 11 * hud_fontsize_x;
-
-       drawfont = hud_font;
-
-       if(warmup_stage)
-       {
-               pos_y += 40;
-               if(mod(time, 1) >= 0.4)
-                       drawstringcenter(pos, "Stats are not tracked during warmup stage", hud_fontsize, '1 1 0', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-
-               return;
-       }
-
-       if(gametype == GAME_RACE || gametype == GAME_CTS)
-       {
-               pos_y += 40;
-               if(mod(time, 1) >= 0.4)
-                       drawstringcenter(pos, "Stats are not tracked in Race/CTS", hud_fontsize, '1 1 0', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-
-               return;
-       }
-
-       float top_border_hitscan = SCOREBOARD_OFFSET + 55;  // position where the hitscan row starts: pixels down the screen
-       HUD_DrawAccuracyStats_Description_Hitscan('1 0 0' * col_margin + '0 1 0' * top_border_hitscan);
-
-       float top_border_splash = SCOREBOARD_OFFSET + 175;  // position where the splash row starts: pixels down the screen
-       HUD_DrawAccuracyStats_Description_Splash('1 0 0' * col_margin + '0 1 0' * top_border_splash);
-
-       for(i = WEP_FIRST; i <= WEP_LAST; ++i)
-       {
-               self = get_weaponinfo(i);
-               if not(self.weapons)
-                       continue;
-               weapon_hit = weapon_hits[i-WEP_FIRST];
-               weapon_damage = weapon_fired[i-WEP_FIRST];
-               border_colour = (i == activeweapon) ? '1 1 1' : '0 0 0';  // white or black border
-
-               if (weapon_damage) {
-                       if (self.spawnflags & WEP_TYPE_SPLASH) {
-                               weapon_stats = bound(0, floor(100 * weapon_hit / weapon_damage), 100);
-
-                               fill_colour_x = 1 - 0.015 * weapon_stats;
-                               fill_colour_y = 1 - 0.015 * (100 - weapon_stats);
-
-                               // how the background colour is calculated
-                               // %    red             green   red_2                   green_2
-                               // 0    1               0               1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 10   0.85    0               1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 20   0.70    0               1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 30   0.55    0               1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 40   0.40    0.10    1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 50   0.25    0.25    1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 60   0.10    0.40    1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 70   0               0.55    1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 80   0               0.70    1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 90   0               0.85    1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 100  0               1               1 - % * 0.015   1 - (100 - %) * 0.015
-
-                               if ((left_border + count_splash * (fill_size_x + col_margin) + fill_size_x) >= vid_conwidth)
-                               {
-                                       count_splash = 0;
-                                       ++row;
-                                       HUD_DrawAccuracyStats_Description_Splash('1 0 0' * col_margin + '0 1 0' * (top_border_splash + row * (fill_size_y + row_margin)));
-                               }
-
-                               pos_x = left_border + count_splash * (fill_size_x + col_margin);
-                               pos_y = top_border_splash + row * (fill_size_y + row_margin);
-
-                               // background
-                               drawpic(pos, "gfx/scoreboard/accuracy_bg", fill_size , fill_colour, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
-                               drawborderlines(hud_border_thickness, pos, fill_size, border_colour, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
-
-                               // the weapon
-                               drawpic(pos, strcat("gfx/weapons/weapon", self.netname), '1 0.5 0' * fill_size_x , '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-
-                               // the amount of shots fired or max damage
-                               drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 3 0' * hud_fontsize_y, ftos(weapon_damage), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-
-                               // the amount of hits or actual damage
-                               drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 5 0' * hud_fontsize_y, ftos(weapon_hit), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-
-                               // the accuracy
-                               drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 7 0' * hud_fontsize_y, strcat(ftos(weapon_stats),"%"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-
-                               // the amount of shots missed or damage wasted
-                               drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 9 0' * hud_fontsize_y, ftos(max(0, weapon_damage - weapon_hit)), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-
-                               ++count_splash;
-                       } else if (self.spawnflags & WEP_TYPE_HITSCAN) {
-                               weapon_stats = bound(0, floor(100 * weapon_hit / weapon_damage), 100);
-
-                               fill_colour_x = 1 - 0.015 * weapon_stats;
-                               fill_colour_y = 1 - 0.015 * (100 - weapon_stats);
-
-                               // how the background colour is calculated
-                               // %    red             green   red_2                   green_2
-                               // 0    1               0               1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 10   0.850   0               1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 20   0.70    0               1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 30   0.55    0               1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 40   0.40    0.10    1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 50   0.25    0.25    1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 60   0.10    0.40    1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 70   0               0.55    1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 80   0               0.70    1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 90   0               0.85    1 - % * 0.015   1 - (100 - %) * 0.015
-                               // 100  0               1               1 - % * 0.015   1 - (100 - %) * 0.015
-
-                               if ((left_border + count_hitscan * (fill_size_x + col_margin) + fill_size_x + cvar("stats_right_margin")) >= vid_conwidth)
-                               {
-                                       count_hitscan = 0;
-                                       ++row;
-                                       HUD_DrawAccuracyStats_Description_Hitscan('1 0 0' * col_margin + '0 1 0' * (top_border_hitscan + row * (fill_size_y + row_margin)));
-                               }
-
-                               pos_x = left_border + count_hitscan * (fill_size_x + col_margin);
-                               pos_y = top_border_hitscan + row * (fill_size_y + row_margin);
-
-                               // background
-                               drawpic(pos, "gfx/scoreboard/accuracy_bg", fill_size , fill_colour, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
-                               drawborderlines(hud_border_thickness, pos, fill_size, border_colour, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
-
-                               // the weapon
-                               drawpic(pos, strcat("gfx/weapons/weapon", self.netname), '1 0.5 0' * fill_size_x , '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-
-                               // the amount of shots fired or max damage
-                               drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 3 0' * hud_fontsize_y, ftos(weapon_damage), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-
-                               // the amount of hits or actual damage
-                               drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 5 0' * hud_fontsize_y, ftos(weapon_hit), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-
-                               // the accuracy
-                               drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 7 0' * hud_fontsize_y, strcat(ftos(weapon_stats),"%"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-
-                               // the amount of shots missed or damage wasted
-                               drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 9 0' * hud_fontsize_y, ftos(max(0, weapon_damage - weapon_hit)), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-
-                               ++count_hitscan;
-                       }
-               }
-       }
-}