]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Apply hud_panel_weapons_aspect to weapon icons in the Accuracy panel too
authorterencehill <piuntn@gmail.com>
Sat, 4 Sep 2021 13:03:48 +0000 (15:03 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 4 Sep 2021 13:03:48 +0000 (15:03 +0200)
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/hud/panel/weapons.qc

index 6dadc75ed0be8da95fe54346b700d4e28b36b79f..c0e0f04ae7e7efcc70d081d5dc588122a1f665e3 100644 (file)
@@ -1243,7 +1243,8 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size)
                rows = 2;
        int columnns = ceil(weapon_cnt / rows);
 
-       float weapon_height = hud_fontsize.y * 2.3;
+       float aspect = max(0.001, autocvar_hud_panel_weapons_aspect);
+       float weapon_height = hud_fontsize.y * 2.3 / aspect;
        float height = weapon_height + hud_fontsize.y;
 
        drawstring(pos + eX * panel_bg_padding, sprintf(_("Accuracy stats (average %d%%)"), average_accuracy), hud_fontsize, '1 1 1', panel_fg_alpha * scoreboard_acc_fade_alpha, DRAWFLAG_NORMAL);
index 7ac8b8dae6bf20cc8da807fbba6ef7733dff874d..a79b64c4073cee7816c8f74f8adde3bcea9a4145 100644 (file)
@@ -127,7 +127,7 @@ void HUD_Weapons()
        int weapon_count, weapon_id;
        int row, column, rows = 0, columns = 0;
        bool vertical_order = true;
-       float aspect = autocvar_hud_panel_weapons_aspect;
+       float aspect = max(0.001, autocvar_hud_panel_weapons_aspect);
 
        float timeout = autocvar_hud_panel_weapons_timeout;
        float timein_effect_length = autocvar_hud_panel_weapons_timeout_speed_in; //? 0.375 : 0);