int rows = 1;
if (autocvar_hud_panel_scoreboard_accuracy_doublerows && weapon_cnt >= floor((REGISTRY_COUNT(Weapons) - nHidden - 1) * 0.5))
rows = 2;
- int columnns = ceil(weapon_cnt / rows);
+ int columns = ceil(weapon_cnt / rows);
float aspect = max(0.001, autocvar_hud_panel_weapons_aspect);
float weapon_height = hud_fontsize.y * 2.3 / aspect;
pos = panel_pos;
vector tmp = panel_size;
- float weapon_width = tmp.x / columnns / rows;
+ float weapon_width = tmp.x / columns / rows;
if (sbt_bg_alpha)
drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, sbt_bg_alpha * scoreboard_acc_fade_alpha, DRAWFLAG_NORMAL);
if(sbt_highlight)
{
// column highlighting
- for (int i = 0; i < columnns; ++i)
+ for (int i = 0; i < columns; ++i)
if ((i % 2) == 0)
drawfill(pos + eX * weapon_width * rows * i, vec2(weapon_width * rows, height * rows), '0 0 0', sbt_highlight_alpha * scoreboard_acc_fade_alpha, DRAWFLAG_NORMAL);
weapons_with_stats += 1;
average_accuracy += weapon_stats; // store sum of all accuracies in average_accuracy
- string s;
- s = sprintf("%d%%", weapon_stats * 100);
-
- float padding;
- padding = (weapon_width - stringwidth(s, false, hud_fontsize)) / 2; // center the accuracy value
+ string s = sprintf("%d%%", weapon_stats * 100);
+ float padding = (weapon_width - stringwidth(s, false, hud_fontsize)) / 2;
if(!autocvar_hud_panel_scoreboard_accuracy_nocolors)
rgb = Accuracy_GetColor(weapon_stats);
}
tmpos.x += weapon_width * rows;
pos.x += weapon_width * rows;
- if (rows == 2 && column == columnns - 1) {
+ if (rows == 2 && column == columns - 1) {
tmpos.x = oldposx;
tmpos.y += height;
pos.y += height;
if (n <= 0) return pos;
int rows = (autocvar_hud_panel_scoreboard_itemstats_doublerows && n >= floor(REGISTRY_COUNT(Items) / 2)) ? 2 : 1;
- int columnns = max(6, ceil(n / rows));
+ int columns = max(6, ceil(n / rows));
float item_height = hud_fontsize.y * 2.3;
float height = item_height + hud_fontsize.y;
pos = panel_pos;
vector tmp = panel_size;
- float item_width = tmp.x / columnns / rows;
+ float item_width = tmp.x / columns / rows;
if (sbt_bg_alpha)
drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, sbt_bg_alpha * scoreboard_itemstats_fade_alpha, DRAWFLAG_NORMAL);
if(sbt_highlight)
{
// column highlighting
- for (int i = 0; i < columnns; ++i)
+ for (int i = 0; i < columns; ++i)
if ((i % 2) == 0)
drawfill(pos + eX * item_width * rows * i, vec2(item_width * rows, height * rows), '0 0 0', sbt_highlight_alpha * scoreboard_itemstats_fade_alpha, DRAWFLAG_NORMAL);
drawstring(tmpos + vec2(padding, item_height), s, hud_fontsize, '1 1 1', panel_fg_alpha * scoreboard_itemstats_fade_alpha, DRAWFLAG_NORMAL);
tmpos.x += item_width * rows;
pos.x += item_width * rows;
- if (rows == 2 && column == columnns - 1) {
+ if (rows == 2 && column == columns - 1) {
tmpos.x = oldposx;
tmpos.y += height;
pos.y += height;