]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into fruitiex/newpanelhud
authorFruitieX <rasse@rasse-lappy.localdomain>
Tue, 29 Jun 2010 00:13:40 +0000 (03:13 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Tue, 29 Jun 2010 00:13:40 +0000 (03:13 +0300)
18 files changed:
gfx/hud/wickedhud/flag_blue_captured.tga [new file with mode: 0644]
gfx/hud/wickedhud/flag_blue_carrying.tga
gfx/hud/wickedhud/flag_blue_lost.tga
gfx/hud/wickedhud/flag_blue_returned.tga [new file with mode: 0644]
gfx/hud/wickedhud/flag_blue_shielded.tga
gfx/hud/wickedhud/flag_blue_taken.tga
gfx/hud/wickedhud/flag_red_captured.tga [new file with mode: 0644]
gfx/hud/wickedhud/flag_red_carrying.tga
gfx/hud/wickedhud/flag_red_lost.tga
gfx/hud/wickedhud/flag_red_returned.tga [new file with mode: 0644]
gfx/hud/wickedhud/flag_red_shielded.tga
gfx/hud/wickedhud/flag_red_taken.tga
gfx/hud/wickedhud/notify_teamkill.tga
hud_wickedhud_default.cfg
hud_wickedhud_minimalistic.cfg [new file with mode: 0644]
qcsrc/client/hud.qc
qcsrc/client/scoreboard.qc
qcsrc/common/items.qh

diff --git a/gfx/hud/wickedhud/flag_blue_captured.tga b/gfx/hud/wickedhud/flag_blue_captured.tga
new file mode 100644 (file)
index 0000000..7cff17e
Binary files /dev/null and b/gfx/hud/wickedhud/flag_blue_captured.tga differ
index 0700cd5bc77d69776a417c0d171633f77df88b2f..ace6a5f2c3a01c554eda6a1ba10944252499d5c2 100644 (file)
Binary files a/gfx/hud/wickedhud/flag_blue_carrying.tga and b/gfx/hud/wickedhud/flag_blue_carrying.tga differ
index f0bb89d2ee80532e0ec9f4d8664e81c802b6a93d..67d894d82dfce9467ee18d6e90604b224d1eadab 100644 (file)
Binary files a/gfx/hud/wickedhud/flag_blue_lost.tga and b/gfx/hud/wickedhud/flag_blue_lost.tga differ
diff --git a/gfx/hud/wickedhud/flag_blue_returned.tga b/gfx/hud/wickedhud/flag_blue_returned.tga
new file mode 100644 (file)
index 0000000..8e8b67f
Binary files /dev/null and b/gfx/hud/wickedhud/flag_blue_returned.tga differ
index e385437f1c17c57acbef3b583c19f8e5d5db9fde..a8993f6b2cc58a3e92f5ae12ceba9e1a81d970de 100644 (file)
Binary files a/gfx/hud/wickedhud/flag_blue_shielded.tga and b/gfx/hud/wickedhud/flag_blue_shielded.tga differ
index e51e297bab335ccb70f8e29d7f580e8835858285..6847e7cc19ed17384a8112b0d36b9bbfd1d4e3d7 100644 (file)
Binary files a/gfx/hud/wickedhud/flag_blue_taken.tga and b/gfx/hud/wickedhud/flag_blue_taken.tga differ
diff --git a/gfx/hud/wickedhud/flag_red_captured.tga b/gfx/hud/wickedhud/flag_red_captured.tga
new file mode 100644 (file)
index 0000000..72814ec
Binary files /dev/null and b/gfx/hud/wickedhud/flag_red_captured.tga differ
index c28cea877c2d82bbe53e6431fcb512e9d663a6c2..33930833233d10c4649fe955dc7fb7ce6456109d 100644 (file)
Binary files a/gfx/hud/wickedhud/flag_red_carrying.tga and b/gfx/hud/wickedhud/flag_red_carrying.tga differ
index 93d55793e9a87d17d12d3e48202599efc61eb098..f96e02147e738af1d0f051efe1b9b4138d04f00b 100644 (file)
Binary files a/gfx/hud/wickedhud/flag_red_lost.tga and b/gfx/hud/wickedhud/flag_red_lost.tga differ
diff --git a/gfx/hud/wickedhud/flag_red_returned.tga b/gfx/hud/wickedhud/flag_red_returned.tga
new file mode 100644 (file)
index 0000000..deee468
Binary files /dev/null and b/gfx/hud/wickedhud/flag_red_returned.tga differ
index ed9994ac402c568a34afeed31b52f4a0c7e1dbcb..e7ec491fd6bcc7bb49fcf053de2642a179a492c5 100644 (file)
Binary files a/gfx/hud/wickedhud/flag_red_shielded.tga and b/gfx/hud/wickedhud/flag_red_shielded.tga differ
index f999476d232e2d7730b9b04ae092660ab90f2832..bf71977e149ab7de484f221c14fab285c61a411f 100644 (file)
Binary files a/gfx/hud/wickedhud/flag_red_taken.tga and b/gfx/hud/wickedhud/flag_red_taken.tga differ
index 0f28ebb36e1de6a5811c883c61f0d6a4f04b1109..a40920b204ada24a40da0b3ed7ff3445af9147ac 100644 (file)
Binary files a/gfx/hud/wickedhud/notify_teamkill.tga and b/gfx/hud/wickedhud/notify_teamkill.tga differ
index 62d9d11b314cf24fbfb6c90797adb0f620c1edfb..dfb3a89fa944d0a10ad4e49c1de2219cef573f59 100644 (file)
@@ -36,6 +36,7 @@ seta hud_inventory 1 "enable/disable this panel"
 seta hud_inventory_pos "0.190000 0.930000" "position of this panel"
 seta hud_inventory_size "0.093750 0.050000" "size of this panel"
 seta hud_inventory_onlycurrent 1 "1 = show only current ammo type"
+seta hud_inventory_iconalign 0 "0 = align icons to the left, 1 = align icons to the right"
 seta hud_inventory_bg "border_inventory" "if set to something else than \"\" = override default background"
 seta hud_inventory_bg_color "" "if set to something else than \"\" = override default panel background color"
 seta hud_inventory_bg_color_team "" "override panel color with team color in team based games"
@@ -47,7 +48,8 @@ seta hud_powerups 1 "enable/disable this panel"
 seta hud_powerups_pos "0.400000 0.130000" "position of this panel"
 seta hud_powerups_size "0.200000 0.050000" "size of this panel"
 seta hud_powerups_flip 1 "flip strength/shield positions"
-seta hud_powerups_mirror 0 "mirror alignment of panel items"
+seta hud_powerups_baralign 0 "0 = align bars to the left, 1 = align bars to the right, 2 = align right bar to the right, 3 = align left bar to the right"
+seta hud_powerups_iconalign 0 "0 = align icons to the left, 1 = align icons to the right, 2 = align right icon to the right, 3 = align left icon to the right"
 seta hud_powerups_bg "border_powerups" "if set to something else than \"\" = override default background"
 seta hud_powerups_bg_color "" "if set to something else than \"\" = override default panel background color"
 seta hud_powerups_bg_color_team "" "override panel color with team color in team based games"
@@ -59,7 +61,8 @@ seta hud_healtharmor 1 "enable/disable this panel, 2 = combined health/armor dis
 seta hud_healtharmor_pos "0.300000 0.930000" "position of this panel"
 seta hud_healtharmor_size "0.240000 0.050000" "size of this panel"
 seta hud_healtharmor_flip 0 "flip health/armor positions"
-seta hud_healtharmor_mirror 0 "mirror alignment of panel items"
+seta hud_healtharmor_baralign 0 "0 = align bars to the left, 1 = align bars to the right, 2 = align right bar to the right, 3 = align left bar to the right"
+seta hud_healtharmor_iconalign 0 "0 = align icons to the left, 1 = align icons to the right, 2 = align right icon to the right, 3 = align left icon to the right"
 seta hud_healtharmor_bg "border_healtharmor" "if set to something else than \"\" = override default background"
 seta hud_healtharmor_bg_color "" "if set to something else than \"\" = override default panel background color"
 seta hud_healtharmor_bg_color_team "" "override panel color with team color in team based games"
diff --git a/hud_wickedhud_minimalistic.cfg b/hud_wickedhud_minimalistic.cfg
new file mode 100644 (file)
index 0000000..ad2ae87
--- /dev/null
@@ -0,0 +1,173 @@
+seta hud_skin "wickedhud"
+seta hud_bg "border"
+seta hud_bg_color "0.875 0.375 0"
+seta hud_bg_color_team "0"
+seta hud_bg_alpha "1"
+seta hud_bg_border "6"
+seta hud_bg_padding "2"
+seta hud_fg_alpha "1"
+
+seta hud_dock ""
+seta hud_dock_color "0 0.1875 0.4375"
+seta hud_dock_color_team "0.700000"
+seta hud_dock_alpha "1"
+
+seta hud_progressbar_alpha 0.500000
+seta hud_progressbar_strength_color "0 0 0.6"
+seta hud_progressbar_shield_color "0.6 0 0.6"
+seta hud_progressbar_health_color "0.6 0 0"
+seta hud_progressbar_armor_color "0 0.6 0"
+seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_nexball_color "0.7 0.1 0"
+
+seta hud_weaponicons 1
+seta hud_weaponicons_pos "0.940000 0.040000"
+seta hud_weaponicons_size "0.060000 0.630000"
+seta hud_weaponicons_bg "0"
+seta hud_weaponicons_bg_color ""
+seta hud_weaponicons_bg_color_team ""
+seta hud_weaponicons_bg_alpha ""
+seta hud_weaponicons_bg_border ""
+seta hud_weaponicons_bg_padding ""
+seta hud_weaponicons_accuracy_yellow 40
+
+seta hud_inventory 1
+seta hud_inventory_pos "0 0.810000"
+seta hud_inventory_size "0.090000 0.190000"
+seta hud_inventory_bg "0"
+seta hud_inventory_bg_color ""
+seta hud_inventory_bg_color_team ""
+seta hud_inventory_bg_alpha ""
+seta hud_inventory_bg_border ""
+seta hud_inventory_bg_padding ""
+seta hud_inventory_onlycurrent 0
+
+seta hud_powerups 1
+seta hud_powerups_pos "0.400000 0.130000"
+seta hud_powerups_size "0.200000 0.050000"
+seta hud_powerups_bg "0"
+seta hud_powerups_bg_color ""
+seta hud_powerups_bg_color_team ""
+seta hud_powerups_bg_alpha ""
+seta hud_powerups_bg_border ""
+seta hud_powerups_bg_padding ""
+seta hud_powerups_flip 1
+seta hud_powerups_mirror 0
+
+seta hud_healtharmor 1
+seta hud_healtharmor_pos "0.100000 0.920000"
+seta hud_healtharmor_size "0.560000 0.080000"
+seta hud_healtharmor_bg "0"
+seta hud_healtharmor_bg_color ""
+seta hud_healtharmor_bg_color_team ""
+seta hud_healtharmor_bg_alpha ""
+seta hud_healtharmor_bg_border ""
+seta hud_healtharmor_bg_padding ""
+seta hud_healtharmor_flip 0
+seta hud_healtharmor_mirror 1
+
+seta hud_notify 1
+seta hud_notify_pos "0.670000 0.680000"
+seta hud_notify_size "0.330000 0.230000"
+seta hud_notify_bg "border_modicons"
+seta hud_notify_bg_color ""
+seta hud_notify_bg_color_team ""
+seta hud_notify_bg_alpha "0"
+seta hud_notify_bg_border ""
+seta hud_notify_bg_padding ""
+seta hud_notify_flip 0
+seta hud_notify_info_top 1
+
+seta hud_timer 1
+seta hud_timer_pos "0.940000 0"
+seta hud_timer_size "0.060000 0.030000"
+seta hud_timer_bg "border_timer"
+seta hud_timer_bg_color ""
+seta hud_timer_bg_color_team ""
+seta hud_timer_bg_alpha ""
+seta hud_timer_bg_border ""
+seta hud_timer_bg_padding "0"
+
+seta hud_radar 0
+seta hud_radar_pos "0 0"
+seta hud_radar_size "0.190000 0.230000"
+seta hud_radar_bg "border_radar"
+seta hud_radar_bg_color ""
+seta hud_radar_bg_color_team ""
+seta hud_radar_bg_alpha ""
+seta hud_radar_bg_border ""
+seta hud_radar_bg_padding "-3"
+seta hud_radar_foreground_alpha 0.800000
+seta hud_radar_alreadyvoted_alpha 0
+
+seta hud_score 1
+seta hud_score_pos "0.830000 0.920000"
+seta hud_score_size "0.170000 0.060000"
+seta hud_score_bg "0"
+seta hud_score_bg_color ""
+seta hud_score_bg_color_team ""
+seta hud_score_bg_alpha ""
+seta hud_score_bg_border ""
+seta hud_score_bg_padding ""
+
+seta hud_racetimer 1
+seta hud_racetimer_pos "0.360000 0.010000"
+seta hud_racetimer_size "0.280000 0.093333"
+seta hud_racetimer_bg "border_timer"
+seta hud_racetimer_bg_color ""
+seta hud_racetimer_bg_color_team ""
+seta hud_racetimer_bg_alpha "0"
+seta hud_racetimer_bg_border ""
+seta hud_racetimer_bg_padding ""
+
+seta hud_vote 1
+seta hud_vote_pos "0.690000 0"
+seta hud_vote_size "0.240000 0.080000"
+seta hud_vote_bg "border_vote"
+seta hud_vote_bg_color ""
+seta hud_vote_bg_color_team ""
+seta hud_vote_bg_alpha ""
+seta hud_vote_bg_border ""
+seta hud_vote_bg_padding ""
+seta hud_vote_alreadyvoted_alpha 0.750000
+
+seta hud_modicons 1
+seta hud_modicons_pos "0.700000 0.920000"
+seta hud_modicons_size "0.120000 0.080000"
+seta hud_modicons_bg "border_modicons"
+seta hud_modicons_bg_color ""
+seta hud_modicons_bg_color_team ""
+seta hud_modicons_bg_alpha ""
+seta hud_modicons_bg_border ""
+seta hud_modicons_bg_padding ""
+
+seta hud_pressedkeys 0
+seta hud_pressedkeys_pos "0 0"
+seta hud_pressedkeys_size "0.080000 0.062912"
+seta hud_pressedkeys_bg "border_modicons"
+seta hud_pressedkeys_bg_color ""
+seta hud_pressedkeys_bg_color_team ""
+seta hud_pressedkeys_bg_alpha "0"
+seta hud_pressedkeys_bg_border ""
+seta hud_pressedkeys_bg_padding ""
+
+seta hud_chat 1
+seta hud_chat_pos "0.100000 0.790000"
+seta hud_chat_size "0.560000 0.120000"
+seta hud_chat_bg "border_chat"
+seta hud_chat_bg_color ""
+seta hud_chat_bg_color_team ""
+seta hud_chat_bg_alpha "0"
+seta hud_chat_bg_border ""
+seta hud_chat_bg_padding ""
+
+seta hud_engineinfo 0
+seta hud_engineinfo_pos "0 0"
+seta hud_engineinfo_size "0.130000 0.034667"
+seta hud_engineinfo_bg "border_modicons"
+seta hud_engineinfo_bg_color ""
+seta hud_engineinfo_bg_color_team ""
+seta hud_engineinfo_bg_alpha "0"
+seta hud_engineinfo_bg_border ""
+seta hud_engineinfo_bg_padding ""
+
index 1b8b2366e0122f52b1b7d9e814970fff075acba7..334ca34b3e935daab9de8f601996535e0f454fa0 100644 (file)
@@ -97,17 +97,20 @@ void drawpic_aspect(vector pos, string pic, vector sz, vector color, float alpha
 }
 
 // draw HUD element with image from gfx/hud/hud_skin/foo.tga if it exists, otherwise gfx/hud/default/foo.tga
+// TODO: make a default skin, and fallback to these!
 void drawpic_skin(vector pos, string pic, vector sz, vector color, float alpha, float drawflag) {
        drawpic_aspect(pos, strcat("gfx/hud/", cvar_string("hud_skin"), "/", pic), sz, color, alpha, drawflag);
 }
 
 // TODO: aspect!
 void drawpic_skin_expanding(vector pos, string pic, vector sz, vector rgb, float alpha, float flag, float fadelerp) {
-       drawpic_expanding(pos, strcat("gfx/hud/", cvar_string("hud_skin"), "/", pic), sz, rgb, alpha, flag, fadelerp);
+       return;
+       //drawpic_aspect_expanding(pos, strcat("gfx/hud/", cvar_string("hud_skin"), "/", pic), sz, rgb, alpha, flag, fadelerp);
 }
 
 void drawpic_skin_expanding_two(vector pos, string pic, vector sz, vector rgb, float alpha, float flag, float fadelerp) {
-       drawpic_expanding_two(pos, strcat("gfx/hud/", cvar_string("hud_skin"), "/", pic), sz, rgb, alpha, flag, fadelerp);
+       return;
+       //drawpic_aspect_expanding_two(pos, strcat("gfx/hud/", cvar_string("hud_skin"), "/", pic), sz, rgb, alpha, flag, fadelerp);
 }
 
 // return HUD background color
@@ -146,99 +149,6 @@ vector HUD_AccuracyColor(float accuracy)
        return rgb;
 }
 
-// draw number in the XSCALE font
-void HUD_DrawXNum (vector pos, float num, float digits, float showsign, float lettersize, vector rgb, float highlighted, float stroke, float alpha, float dflags)
-{
-       float l, i;
-       string str, tmp, l_length;
-       float minus, plus;
-       vector vsize, num_color;
-
-       vsize_x = vsize_y = lettersize;
-       vsize_z = 0;
-
-       // showsign 1: always prefix with minus sign (useful in race distribution display)
-       // showsign 2: always prefix with plus sign (useful in race distribution display)
-       // showsign 3: prefix with minus sign if negative, plus sign if positive (useful in score distribution display)
-
-       if((showsign == 2 && num >= 0) || (num > 0 && showsign == 3))
-       {
-               plus = true;
-               pos_x -= lettersize;
-       } else
-               plus = false;
-
-       if(num < 0 || (num < 0 && showsign == 3) || (showsign == 1 && num <= 0))
-       {
-               minus = true;
-               num = -num;
-               pos_x -= lettersize;
-       } else
-               minus = false;
-
-       if(digits < 0)
-       {
-               tmp = ftos(num);
-               digits = -digits;
-               str = strcat(substring("0000000000", 0, digits - strlen(tmp)), tmp);
-       } else
-               str = ftos(num);
-
-       l = strlen(str);
-       l_length = ftos(l);
-
-       if(l > digits)
-       {
-               str = substring(str, l-digits, 999);
-               l = strlen(str);
-       } else if(l < digits)
-               pos_x += (digits-l) * lettersize;
-
-       if (highlighted == 1) {
-               vector hl_size;
-               hl_size_x = vsize_x * l + vsize_x * 0.2;
-               hl_size_y = vsize_y * 1.1;
-               hl_size_z = 0;
-               if(minus)
-                       hl_size_x = hl_size_x + vsize_x;
-
-               vector hl_pos;
-               hl_pos_x = pos_x - lettersize/10;
-               hl_pos_y = pos_y - lettersize/20;
-               hl_pos_z = 0;
-
-               drawpic_skin(hl_pos, strcat("num_leading_", l_length), hl_size, '1 1 1', alpha, dflags);
-       }
-
-       if (stroke == 1)
-               num_color = '1 1 1';
-       else
-               num_color = rgb;
-
-       if(minus)
-       {
-               if (stroke == 1)
-                       drawpic_skin(pos, "num_minus_stroke", vsize, rgb, alpha, dflags);
-               drawpic_skin(pos, "num_minus", vsize, num_color, alpha, dflags);
-               pos_x += lettersize;
-       } else if(plus)
-       {
-               if (stroke == 1)
-                       drawpic_skin(pos, "num_plus_stroke", vsize, rgb, alpha, dflags);
-               drawpic_skin(pos, "num_plus", vsize, num_color, alpha, dflags);
-               pos_x += lettersize;
-       }
-
-       for(i = 0; i < l; ++i)
-       {
-               tmp = substring(str, i, 1);
-               if (stroke == 1)
-                       drawpic_skin(pos, strcat("num_", tmp, "_stroke"), vsize, rgb, alpha, dflags);
-               drawpic_skin(pos, strcat("num_", tmp), vsize, num_color, alpha, dflags);
-               pos_x += lettersize;
-       }
-}
-
 vector HUD_Get_Num_Color (float x, float maxvalue)
 {
        vector color;
@@ -274,13 +184,6 @@ vector HUD_Get_Num_Color (float x, float maxvalue)
        }
        return color;
 }
-// color the number differently based on how big it is (used in the health/armor panel)
-void HUD_DrawXNum_Colored (vector pos, float x, float digits, float lettersize, float alpha)
-{
-       vector color;
-       color = HUD_Get_Num_Color (x, 200);
-       HUD_DrawXNum(pos, x, digits, 0, lettersize, color, 0, 0, alpha, DRAWFLAG_NORMAL);
-}
 
 float stringwidth_colors(string s, vector theSize)
 {
@@ -877,7 +780,9 @@ void HUD_Panel_DrawBg(float id, vector pos, vector mySize, float alpha)
 
 void HUD_Panel_DrawProgressBar(vector pos, float vertical, vector mySize, vector color, float alpha, float drawflag)
 {
-//float        drawsubpic(vector position, vector size, string pic, vector srcPosition, vector srcSize, vector rgb, float alpha, float flag) = #328;
+       if(!alpha)
+               return;
+
        string pic;
        pic = strcat("gfx/hud/", cvar_string("hud_skin"), "/");
        if(vertical) {
@@ -1528,6 +1433,7 @@ void HUD_WeaponIcons(void)
                        if(cvar_or("hud_weaponicons_number", 1))
                                drawstring(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows), ftos(weapid), '1 1 0' * 0.5 * mySize_y*(1/rows), '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                }
+               // draw a "ghost weapon icon" if you don't have the weapon
                else
                {
                        drawpic_skin(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows), strcat("weapon", self.netname), eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows), '0 0 0', HUD_Panel_GetFgAlpha(id) * 0.5, DRAWFLAG_NORMAL);
@@ -1584,13 +1490,68 @@ string GetAmmoPicture(float i)
        }
 }
 
+void DrawAmmoItem(vector myPos, vector mySize, float itemcode, float currently_selected)
+{
+       float a;
+       a = getstati(GetAmmoStat(itemcode)); // how much ammo do we have of type itemcode?
+       if(hud_configure)
+               a = 100;
+
+       vector color;
+       if(a < 10)
+               color = '0.7 0 0';
+       else
+               color = '1 1 1';
+
+       float alpha;
+       if(currently_selected)
+               alpha = 1;
+       else
+               alpha = 0.7;
+
+       vector newSize, newPos;
+       if(mySize_x/mySize_y > 3)
+       {
+               newSize_x = 3 * mySize_y;
+               newSize_y = mySize_y;
+
+               newPos_x = myPos_x + (mySize_x - newSize_x) / 2;
+               newPos_y = myPos_y;
+       }
+       else
+       {
+               newSize_y = 1/3 * mySize_x;
+               newSize_x = mySize_x;
+
+               newPos_y = myPos_y + (mySize_y - newSize_y) / 2;
+               newPos_x = myPos_x;
+       }
+
+       vector picpos, numpos;
+       if(cvar("hud_inventory_iconalign"))
+       {
+               numpos = newPos;
+               picpos = newPos + eX * 2 * newSize_y;
+       }
+       else
+       {
+               numpos = newPos + eX * newSize_y;
+               picpos = newPos;
+       }
+
+       if (currently_selected)
+               drawpic_skin(newPos, "ammo_current_bg", newSize, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_INVENTORY), DRAWFLAG_NORMAL);
+
+       drawstring_aspect(numpos, ftos(a), eX * (2/3) * newSize_x + eY * newSize_y, newSize_y, color, HUD_Panel_GetFgAlpha(HUD_PANEL_INVENTORY) * alpha, DRAWFLAG_NORMAL);
+       drawpic_skin(picpos, GetAmmoPicture(itemcode), '1 1 0' * newSize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_INVENTORY) * alpha, DRAWFLAG_NORMAL);
+}
+
 void HUD_Inventory(void)
 {
        float id = HUD_PANEL_INVENTORY;
-       float i;
-       float stat_items;
+       float i, currently_selected;
 
-       vector pos, mySize, mysize, mypos;
+       vector pos, mySize;
        pos = HUD_Panel_GetPos(id);
        mySize = HUD_Panel_GetSize(id);
 
@@ -1603,77 +1564,35 @@ void HUD_Inventory(void)
                mySize -= '2 2 0' * padding;
        }
 
-       // ammo
-       stat_items = getstati(STAT_ITEMS);
-       for (i = 0; i < 4; ++i) {
-               float a;
-               a = getstati(GetAmmoStat(i)); // how much ammo do we have of type i?
-               if(hud_configure)
-                       a = 100;
+       float rows, columns;
+       rows = mySize_y/mySize_x;
+       rows = bound(1, floor((sqrt(4 * (3/1) * rows * AMMO_COUNT + rows * rows) + rows + 0.5) / 2), AMMO_COUNT);
+       //                               ^^^ ammo item aspect goes here
+
+       columns = ceil(AMMO_COUNT/rows);
 
+       float row, column;
+       // ammo
+       for (i = 0; i < AMMO_COUNT; ++i) {
+               currently_selected = getstati(STAT_ITEMS) & GetAmmoItemCode(i);
                if(cvar("hud_inventory_onlycurrent")) {
                        if(hud_configure)
                                i = 2;
-                       if (stat_items & GetAmmoItemCode(i) || hud_configure) {
-                               drawpic_skin(pos, GetAmmoPicture(i), '1 1 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                               if(a < 10)
-                                       HUD_DrawXNum(pos + eX * mySize_y + eY * 0.25 * mySize_y, a, strlen(ftos(a)), 0, 0.5 * mySize_y, '0.7 0 0', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                               else
-                                       HUD_DrawXNum(pos + eX * mySize_y + eY * 0.25 * mySize_y, a, strlen(ftos(a)), 0, 0.5 * mySize_y, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                       }
-                       if(hud_configure)
-                               break;
+                       if (currently_selected || hud_configure)
+                               DrawAmmoItem(pos, mySize, i, currently_selected);
+                       break;
                } else {
-                       if (a > 0) {
-                               if(mySize_x/mySize_y >= 10) { // arrange horizontally
-                                       switch (i) {
-                                               case 0: mypos_x = pos_x;                        mypos_y = pos_y;                        break; // shells
-                                               case 1: mypos_x = pos_x + 0.25 * mySize_x;      mypos_y = pos_y;                        break; // bullets
-                                               case 2: mypos_x = pos_x + 0.5  * mySize_x;      mypos_y = pos_y;                        break; // rockets
-                                               case 3: mypos_x = pos_x + 0.75 * mySize_x;      mypos_y = pos_y;                        break; // cells
-                                       }
-                                       mysize_x = 0.25 * mySize_x;
-                                       mysize_y = mySize_y;
-                               } else if(mySize_x/mySize_y >= 2.5) { // arrange in a 2x2 grid
-                                       switch (i) {
-                                               case 0: mypos_x = pos_x + 0.5 * mySize_x;       mypos_y = pos_y + 0.5 * mySize_y;       break; // shells
-                                               case 1: mypos_x = pos_x + 0.5 * mySize_x;       mypos_y = pos_y;                        break; // bullets
-                                               case 2: mypos_x = pos_x;                        mypos_y = pos_y + 0.5 * mySize_y;       break; // rockets
-                                               case 3: mypos_x = pos_x;                        mypos_y = pos_y;                        break; // cells
-                                       }
-                                       mysize_x = 0.5 * mySize_x;
-                                       mysize_y = 0.5 * mySize_y;
-                               } else { // arrange vertically
-                                       switch (i) {
-                                               case 0: mypos_x = pos_x;                        mypos_y = pos_y;                        break; // shells
-                                               case 1: mypos_x = pos_x;                        mypos_y = pos_y + 0.25 * mySize_y;      break; // bullets
-                                               case 2: mypos_x = pos_x;                        mypos_y = pos_y + 0.5  * mySize_y;      break; // rockets
-                                               case 3: mypos_x = pos_x;                        mypos_y = pos_y + 0.75 * mySize_y;      break; // cells
-                                       }
-                                       mysize_x = mySize_x;
-                                       mysize_y = 0.25 * mySize_y;
-                               }
-
-                               if (stat_items & GetAmmoItemCode(i))
-                                       drawpic_skin(mypos, "ammo_current_bg", mysize, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                               drawpic_skin(mypos + eY * 0.05 * mysize_y, GetAmmoPicture(i), '1 1 0' * 0.8 * mysize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                               if (a < 10) {
-                                       if(stat_items & GetAmmoItemCode(i))
-                                               HUD_DrawXNum(mypos + eX * 0.8 * mysize_y + eY * 0.25 * mysize_y, a, strlen(ftos(a)), 0, 0.5 * mysize_y, '0.7 0 0', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                                       else
-                                               HUD_DrawXNum(mypos + eX * 0.8 * mysize_y + eY * 0.25 * mysize_y, a, strlen(ftos(a)), 0, 0.5 * mysize_y, '0.7 0 0', 0, 0, HUD_Panel_GetFgAlpha(id) * 0.7, DRAWFLAG_NORMAL);
-                               } else {
-                                       if(stat_items & GetAmmoItemCode(i))
-                                               HUD_DrawXNum(mypos + eX * 0.8 * mysize_y + eY * 0.25 * mysize_y, a, strlen(ftos(a)), 0, 0.5 * mysize_y, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                                       else
-                                               HUD_DrawXNum(mypos + eX * 0.8 * mysize_y + eY * 0.25 * mysize_y, a, strlen(ftos(a)), 0, 0.5 * mysize_y, '0.7 0.7 0.7', 0, 0, HUD_Panel_GetFgAlpha(id) * 0.7, DRAWFLAG_NORMAL);
-                               }
+                       DrawAmmoItem(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows), eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows), i, currently_selected);
+                       ++row;
+                       if(row >= rows)
+                       {
+                               row = 0;
+                               column = column + 1;
                        }
                }
        }
 }
 
-
 // Powerups (#2)
 //
 void HUD_Powerups(void) {
@@ -1715,8 +1634,6 @@ void HUD_Powerups(void) {
                shield_time = 27;
        }
 
-       float len;
-
        vector barpos, barsize;
        vector picpos;
        vector numpos;
@@ -1745,122 +1662,136 @@ void HUD_Powerups(void) {
        leftalpha = bound(0, leftexact, 1);
        rightalpha = bound(0, rightexact, 1);
 
+       float baralign, iconalign;
+       baralign = cvar(strcat("hud_", HUD_Panel_GetName(id), "_baralign"));
+       iconalign = cvar(strcat("hud_", HUD_Panel_GetName(id), "_iconalign"));
+
        if (mySize_x/mySize_y > 4)
        {
                if(leftcnt)
                {
-                       len = strlen(ftos(leftcnt));
-
-                       if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+                       if(baralign == 1 || baralign == 3) { // right align
                                barpos = pos + eX * 0.5 * mySize_x - eX * 0.5 * mySize_x * min(1, leftcnt/30);
                                barsize = eX * 0.5 * mySize_x * min(1, leftcnt/30) + eY * mySize_y;
-                               picpos = pos + eX * 0.5 * mySize_x - eX * mySize_y;
-                               numpos = picpos - eX * 2 * 0.5 * mySize_y + eX * (2-len) * 0.5 * mySize_y + eY * 0.25 * mySize_y;
-                       } else {
+                       } else { // left align
                                barpos = pos;
                                barsize = eX * 0.5 * mySize_x * min(1, leftcnt/30) + eY * mySize_y;
+                       }
+
+                       if(iconalign == 1 || iconalign == 3) { // right align
+                               picpos = pos + eX * (2/6) * mySize_x;
+                               numpos = pos;
+                       } else { // left align
                                picpos = pos;
-                               numpos = picpos + eX * mySize_y - eX * (2-len) * 0.5 * mySize_y + eY * 0.25 * mySize_y;
+                               numpos = pos + eX * (1/6) * mySize_x;
                        }
 
                        HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor(leftname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                        if(leftcnt <= 5)
                                drawpic_skin_expanding_two(picpos, leftname, '1 1 0' * mySize_y, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_ADDITIVE, bound(0, (leftcnt - leftexact) / 0.5, 1));
                        else
-                               drawpic_skin(picpos, leftname, '1 1 0' * mySize_y, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                       HUD_DrawXNum(numpos, leftcnt, 2, 0, 0.5 * mySize_y, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                               drawpic_skin(picpos, leftname, eX * (1/6) * mySize_x + eY * mySize_y, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                       drawstring_aspect(numpos, ftos(leftcnt), eX * (2/6) * mySize_x + eY * mySize_y, mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                }
 
                if(rightcnt)
                {
-                       len = strlen(ftos(rightcnt));
-
-                       if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+                       if(baralign == 0 || baralign == 3) { // left align
                                barpos = pos + eX * 0.5 * mySize_x;
                                barsize = eX * 0.5 * mySize_x * min(1, rightcnt/30) + eY * mySize_y;
-                               picpos = pos + eX * 0.5 * mySize_x;
-                               numpos = picpos + eX * mySize_y - eX * (2-len) * 0.5 * mySize_y + eY * 0.25 * mySize_y;
-                       } else {
+                       } else { // right align
                                barpos = pos + eX * mySize_x - eX * 0.5 * mySize_x * min(1, rightcnt/30);
                                barsize = eX * 0.5 * mySize_x * min(1, rightcnt/30) + eY * mySize_y;
-                               picpos = pos + eX * mySize_x - eX * mySize_y;
-                               numpos = picpos - eX * mySize_y + eY * 0.25 * mySize_y;
+                       }
+
+                       if(iconalign == 0 || iconalign == 3) { // left align
+                               picpos = pos + eX * (3/6) * mySize_x;
+                               numpos = pos + eX * (4/6) * mySize_x;
+                       } else { // right align
+                               picpos = pos + eX * (5/6) * mySize_x;
+                               numpos = pos + eX * (3/6) * mySize_x;
                        }
 
                        HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor(rightname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                        if(rightcnt <= 5)
                                drawpic_skin_expanding_two(picpos, rightname, '1 1 0' * mySize_y, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_ADDITIVE, bound(0, (rightcnt - rightexact) / 0.5, 1));
                        else
-                               drawpic_skin(picpos, rightname, '1 1 0' * mySize_y, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                       HUD_DrawXNum(numpos, rightcnt, 2, 0, 0.5 * mySize_y, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                               drawpic_skin(picpos, rightname, eX * (1/6) * mySize_x + eY * mySize_y, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                       drawstring_aspect(numpos, ftos(rightcnt), eX * (2/6) * mySize_x + eY * mySize_y, mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                }
        }
        else if (mySize_x/mySize_y > 1.5)
        {
                if(leftcnt)
                {
-                       len = strlen(ftos(leftcnt));
-
-                       if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+                       if(baralign == 1 || baralign == 3) { // right align
                                barpos = pos + eX * mySize_x - eX * mySize_x * min(1, leftcnt/30);
                                barsize = eX * mySize_x * min(1, leftcnt/30) + eY * 0.5 * mySize_y;
-                               picpos = pos + eX * mySize_x - eX * 0.5 * mySize_y;
-                               numpos = picpos - eX * len * 0.5 * mySize_y;
-                       } else {
+                       } else { // left align
                                barpos = pos;
                                barsize = eX * mySize_x * min(1, leftcnt/30) + eY * 0.5 * mySize_y;
+                       }
+
+                       if(iconalign == 1 || iconalign == 3) { // right align
+                               picpos = pos + eX * (2/3) * mySize_x;
+                               numpos = pos;
+                       } else { // left align
                                picpos = pos;
-                               numpos = picpos + eX * 0.5 * mySize_y;
+                               numpos = pos + eX * (1/3) * mySize_x;
                        }
 
                        HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor(leftname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                        if(leftcnt <= 5)
                                drawpic_skin_expanding_two(picpos, leftname, '0.5 0.5 0' * mySize_y, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_ADDITIVE, bound(0, (leftcnt - leftexact) / 0.5, 1));
                        else
-                               drawpic_skin(picpos, leftname, '0.5 0.5 0' * mySize_y, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                       HUD_DrawXNum(numpos, leftcnt, len, 0, 0.5 * mySize_y, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                               drawpic_skin(picpos, leftname, eX * (1/3) * mySize_x + eY * 0.5 * mySize_y, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                       drawstring_aspect(numpos, ftos(leftcnt), eX * (2/3) * mySize_x + eY * 0.5 * mySize_y, mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                }
 
                if(rightcnt)
                {
-                       len = strlen(ftos(rightcnt));
-
-                       if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
-                               barpos = pos + eX * mySize_x - eX * mySize_x * min(1, rightcnt/30) + eY * 0.5 * mySize_y;
-                               barsize = eX * mySize_x * min(1, rightcnt/30) + eY * 0.5 * mySize_y;
-                               picpos = pos + eX * mySize_x - eX * 0.5 * mySize_y + eY * 0.5 * mySize_y;
-                               numpos = picpos - eX * len * 0.5 * mySize_y;
-                       } else {
+                       if(baralign == 0 || baralign == 3) { // left align
                                barpos = pos + eY * 0.5 * mySize_y;
                                barsize = eX * mySize_x * min(1, rightcnt/30) + eY * 0.5 * mySize_y;
+                       } else { // right align
+                               barpos = pos + eX * mySize_x - eX * mySize_x * min(1, rightcnt/30) + eY * 0.5 * mySize_y;
+                               barsize = eX * mySize_x * min(1, rightcnt/30) + eY * 0.5 * mySize_y;
+                       }
+
+                       if(iconalign == 0 || iconalign == 3) { // left align
                                picpos = pos + eY * 0.5 * mySize_y;
-                               numpos = picpos + eX * 0.5 * mySize_y;
+                               numpos = pos + eX * (1/3) * mySize_x + eY * 0.5 * mySize_y;
+                       } else { // right align
+                               picpos = pos + eX * (2/3) * mySize_x + eY * 0.5 * mySize_y;
+                               numpos = pos + eY * 0.5 * mySize_y;
                        }
 
                        HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor(rightname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                        if(rightcnt <= 5)
                                drawpic_skin_expanding_two(picpos, rightname, '0.5 0.5 0' * mySize_y, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_ADDITIVE, bound(0, (rightcnt - rightexact) / 0.5, 1));
                        else
-                               drawpic_skin(picpos, rightname, '0.5 0.5 0' * mySize_y, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                       HUD_DrawXNum(numpos, rightcnt, len, 0, 0.5 * mySize_y, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                               drawpic_skin(picpos, rightname, eX * (1/3) * mySize_x + eY * 0.5 * mySize_y, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                       drawstring_aspect(numpos, ftos(rightcnt), eX * (2/3) * mySize_x + eY * 0.5 * mySize_y, mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                }
        }
        else
        {
                if(leftcnt)
                {
-                       len = strlen(ftos(leftcnt));
-
-                       if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+                       if(baralign == 1 || baralign == 3) { // down align
+                               barpos = pos + eY * mySize_y - eY * mySize_y * min(1, leftcnt/30);
+                               barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, leftcnt/30);
+                       } else { // up align
                                barpos = pos;
                                barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, leftcnt/30);
+                       }
+
+                       if(iconalign == 1 || iconalign == 3) { // down align
+                               picpos = pos + eX * 0.05 * mySize_x + eY * (mySize_y - 0.65 * mySize_x);
+                               numpos = pos + eY * mySize_y - eY * 0.25 * mySize_x;
+                       } else { // up align
                                picpos = pos + eX * 0.05 * mySize_x;
-                               numpos = pos + eX * ((2-len)/2) * 0.25 * mySize_x + eY * 0.4 * mySize_x;
-                       } else {
-                               barpos = pos + eY * mySize_y - eY * mySize_y * min(1, leftcnt/30);
-                               barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, leftcnt/30);
-                               picpos = pos + eX * 0.05 * mySize_x + eY * mySize_y - eY * 0.65 * mySize_x;
-                               numpos = pos + eX * ((2-len)/2) * 0.25 * mySize_x + eY * mySize_y - eY * 0.25 * mySize_x;
+                               numpos = pos + eY * 0.4 * mySize_x;
                        }
 
                        HUD_Panel_DrawProgressBar(barpos, 1, barsize, HUD_Panel_GetProgressBarColor(leftname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
@@ -1868,23 +1799,25 @@ void HUD_Powerups(void) {
                                drawpic_skin_expanding_two(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_ADDITIVE, bound(0, (leftcnt - leftexact) / 0.5, 1));
                        else
                                drawpic_skin(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                       HUD_DrawXNum(numpos, leftcnt, len, 0, 0.25 * mySize_x, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                       drawstring_aspect(numpos, ftos(leftcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, 0.25 * mySize_x, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                }
 
                if(rightcnt)
                {
-                       len = strlen(ftos(rightcnt));
-
-                       if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+                       if(baralign == 0 || baralign == 3) { // up align
                                barpos = pos + eX * 0.5 * mySize_x;
                                barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, rightcnt/30);
-                               picpos = pos + eX * 0.05 * mySize_x + eX * 0.5 * mySize_x;
-                               numpos = pos + eX * ((2-len)/2) * 0.25 * mySize_x + eY * 0.4 * mySize_x + eX * 0.5 * mySize_x;
-                       } else {
+                       } else { // down align
                                barpos = pos + eY * mySize_y - eY * mySize_y * min(1, rightcnt/30) + eX * 0.5 * mySize_x;
                                barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, rightcnt/30);
-                               picpos = pos + eX * 0.05 * mySize_x + eY * mySize_y - eY * 0.65 * mySize_x + eX * 0.5 * mySize_x;
-                               numpos = pos + eX * ((2-len)/2) * 0.25 * mySize_x + eY * mySize_y - eY * 0.25 * mySize_x + eX * 0.5 * mySize_x;
+                       }
+
+                       if(iconalign == 0 || iconalign == 3) { // up align
+                               picpos = pos + eX * 0.05 * mySize_x + eX * 0.5 * mySize_x;
+                               numpos = pos + eY * 0.4 * mySize_x + eX * 0.5 * mySize_x;
+                       } else { // down align
+                               picpos = pos + eX * 0.05 * mySize_x + eY * (mySize_y - 0.65 * mySize_x) + eX * 0.5 * mySize_x;
+                               numpos = pos + eY * mySize_y - eY * 0.25 * mySize_x + eX * 0.5 * mySize_x;
                        }
 
                        HUD_Panel_DrawProgressBar(barpos, 1, barsize, HUD_Panel_GetProgressBarColor(rightname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
@@ -1892,7 +1825,7 @@ void HUD_Powerups(void) {
                                drawpic_skin_expanding_two(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_ADDITIVE, bound(0, (rightcnt - rightexact) / 0.5, 1));
                        else
                                drawpic_skin(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                       HUD_DrawXNum(numpos, rightcnt, len, 0, 0.25 * mySize_x, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                       drawstring_aspect(numpos, ftos(rightcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, 0.25 * mySize_x, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                }
        }
 }
@@ -1932,7 +1865,6 @@ void HUD_HealthArmor(void)
        if(health <= 0)
                return;
 
-       float len;
        vector barpos, barsize;
        vector picpos;
        vector numpos;
@@ -1971,7 +1903,7 @@ void HUD_HealthArmor(void)
                        if(armor)
                                drawpic_skin(picpos, "armor", '1 1 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                }
-               HUD_DrawXNum_Colored(numpos, x, 3, mySize_y, HUD_Panel_GetFgAlpha(id)); // draw the combined health and armor
+               //HUD_DrawXNum_Colored(numpos, x, 3, mySize_y, HUD_Panel_GetFgAlpha(id)); // draw the combined health and armor
 
                // fuel
                if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
@@ -1984,7 +1916,6 @@ void HUD_HealthArmor(void)
                if(fuel)
                        HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor("fuel"), HUD_Panel_GetFgAlpha(id) * 0.8, DRAWFLAG_NORMAL);
        }
-
        else
        {
                string leftname, rightname;
@@ -2015,167 +1946,189 @@ void HUD_HealthArmor(void)
                        rightalpha = min((armor+10)/55, 1);
                }
 
+               float baralign, iconalign;
+               baralign = cvar(strcat("hud_", HUD_Panel_GetName(id), "_baralign"));
+               iconalign = cvar(strcat("hud_", HUD_Panel_GetName(id), "_iconalign"));
+
                if (mySize_x/mySize_y > 5)
                {
                        if(leftactive)
                        {
-                               len = strlen(ftos(leftcnt));
-
-                               if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+                               if(baralign == 1 || baralign == 3) { // right align
                                        barpos = pos + eX * 0.5 * mySize_x - eX * 0.5 * mySize_x * min(1, leftcnt/200);
                                        barsize = eX * 0.5 * mySize_x * min(1, leftcnt/200) + eY * mySize_y;
-                                       picpos = pos + eX * 0.5 * mySize_x - eX * mySize_y;
-                                       numpos = picpos - eX * 3 * 0.5 * mySize_y + eX * (3-len) * 0.5 * mySize_y + eY * 0.25 * mySize_y;
-                               } else {
+                               } else { // left align
                                        barpos = pos;
                                        barsize = eX * 0.5 * mySize_x * min(1, leftcnt/200) + eY * mySize_y;
+                               }
+
+                               if(iconalign == 1 || iconalign == 3) { // right align
+                                       picpos = pos + eX * (2/6) * mySize_x;
+                                       numpos = pos;
+                               } else { // left align
                                        picpos = pos;
-                                       numpos = picpos + eX * mySize_y + eY * 0.25 * mySize_y;
+                                       numpos = pos + eX * (1/6) * mySize_x;
                                }
 
                                HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor(leftname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                               drawpic_skin(picpos, leftname, '1 1 0' * mySize_y, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                               HUD_DrawXNum_Colored(numpos, leftcnt, len, 0.5 * mySize_y, HUD_Panel_GetFgAlpha(id));
+                               drawpic_skin(picpos, leftname, eX * (1/6) * mySize_x + eY * mySize_y, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                               drawstring_aspect(numpos, ftos(leftcnt), eX * (2/6) * mySize_x + eY * mySize_y, mySize_y, HUD_Get_Num_Color(leftcnt, 200), HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                        }
 
                        if(rightactive)
                        {
-                               len = strlen(ftos(rightcnt));
-
-                               if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+                               if(baralign == 0 || baralign == 3) { // left align
                                        barpos = pos + eX * 0.5 * mySize_x;
                                        barsize = eX * 0.5 * mySize_x * min(1, rightcnt/200) + eY * mySize_y;
-                                       picpos = pos + eX * 0.5 * mySize_x;
-                                       numpos = picpos + eX * mySize_y - eX * (3-len) * 0.5 * mySize_y + eY * 0.25 * mySize_y;
-                               } else {
+                               } else { // right align
                                        barpos = pos + eX * mySize_x - eX * 0.5 * mySize_x * min(1, rightcnt/200);
                                        barsize = eX * 0.5 * mySize_x * min(1, rightcnt/200) + eY * mySize_y;
-                                       picpos = pos + eX * mySize_x - eX * mySize_y;
-                                       numpos = picpos - eX * 1.5 * mySize_y + eY * 0.25 * mySize_y;
+                               }
+
+                               if(iconalign == 0 || iconalign == 3) { // left align
+                                       picpos = pos + eX * (3/6) * mySize_x;
+                                       numpos = pos + eX * (4/6) * mySize_x;
+                               } else { // right align
+                                       picpos = pos + eX * (5/6) * mySize_x;
+                                       numpos = pos + eX * (3/6) * mySize_x;
                                }
 
                                HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor(rightname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                               drawpic_skin(picpos, rightname, '1 1 0' * mySize_y, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                               HUD_DrawXNum_Colored(numpos, rightcnt, 3, 0.5 * mySize_y, HUD_Panel_GetFgAlpha(id));
+                               drawpic_skin(picpos, rightname, eX * (1/6) * mySize_x + eY * mySize_y, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                               drawstring_aspect(numpos, ftos(rightcnt), eX * (2/6) * mySize_x + eY * mySize_y, mySize_y, HUD_Get_Num_Color(rightcnt, 200), HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                        }
 
-                       if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
-                               barpos = pos + eX * mySize_x - eX * mySize_x * min(1, fuel/100);
-                               barsize = eX * mySize_x * min(1, fuel/100) + eY * 0.2 * mySize_y;
-                       } else {
-                               barpos = pos;
-                               barsize = eX * mySize_x * min(1, fuel/100) + eY * 0.2 * mySize_y;
-                       }
                        if(fuel)
+                       {
+                               if(baralign == 0 || baralign == 3) { // left align
+                                       barpos = pos + eX * mySize_x - eX * mySize_x * min(1, fuel/100);
+                                       barsize = eX * mySize_x * min(1, fuel/100) + eY * 0.2 * mySize_y;
+                               } else {
+                                       barpos = pos;
+                                       barsize = eX * mySize_x * min(1, fuel/100) + eY * 0.2 * mySize_y;
+                               }
                                HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor("fuel"), HUD_Panel_GetFgAlpha(id) * 0.8, DRAWFLAG_NORMAL);
+                       }
                }
                else if (mySize_x/mySize_y > 2)
                {
                        if(leftactive)
                        {
-                               len = strlen(ftos(leftcnt));
-
-                               if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+                               if(baralign == 1 || baralign == 3) { // right align
                                        barpos = pos + eX * mySize_x - eX * mySize_x * min(1, leftcnt/200);
-                                       barsize = eX * mySize_x * min(1, leftcnt/200) + eY * 0.5 * mySize_y;
-                                       picpos = pos + eX * mySize_x - eX * 0.5 * mySize_y;
-                                       numpos = picpos - eX * len * 0.5 * mySize_y;
-                               } else {
+                                       barsize = eX * mySize_x * min(1, rightcnt/200) + eY * 0.5 * mySize_y;
+                               } else { // left align
                                        barpos = pos;
-                                       barsize = eX * mySize_x * min(1, leftcnt/200) + eY * 0.5 * mySize_y;
+                                       barsize = eX * mySize_x * min(1, rightcnt/200) + eY * 0.5 * mySize_y;
+                               }
+
+                               if(iconalign == 1 || iconalign == 3) { // right align
+                                       picpos = pos + eX * (2/3) * mySize_x;
+                                       numpos = pos;
+                               } else { // left align
                                        picpos = pos;
-                                       numpos = picpos + eX * 0.5 * mySize_y;
+                                       numpos = pos + eX * (1/3) * mySize_x;
                                }
 
                                HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor(leftname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                               drawpic_skin(picpos, leftname, '0.5 0.5 0' * mySize_y, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                               HUD_DrawXNum_Colored(numpos, leftcnt, len, 0.5 * mySize_y, HUD_Panel_GetFgAlpha(id));
+                               drawpic_skin(picpos, leftname, eX * (1/3) * mySize_x + eY * 0.5 * mySize_y, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                               drawstring_aspect(numpos, ftos(leftcnt), eX * (2/3) * mySize_x + eY * 0.5 * mySize_y, mySize_y, HUD_Get_Num_Color(leftcnt, 200), HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                        }
 
                        if(rightactive)
                        {
-                               len = strlen(ftos(rightcnt));
-
-                               if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
-                                       barpos = pos + eX * mySize_x - eX * mySize_x * min(1, rightcnt/200) + eY * 0.5 * mySize_y;
-                                       barsize = eX * mySize_x * min(1, rightcnt/200) + eY * 0.5 * mySize_y;
-                                       picpos = pos + eX * mySize_x - eX * 0.5 * mySize_y + eY * 0.5 * mySize_y;
-                                       numpos = picpos - eX * len * 0.5 * mySize_y;
-                               } else {
+                               if(baralign == 0 || baralign == 3) { // left align
                                        barpos = pos + eY * 0.5 * mySize_y;
                                        barsize = eX * mySize_x * min(1, rightcnt/200) + eY * 0.5 * mySize_y;
+                               } else { // right align
+                                       barpos = pos + eX * mySize_x - eX * mySize_x * min(1, rightcnt/200) + eY * 0.5 * mySize_y;
+                                       barsize = eX * mySize_x * min(1, rightcnt/200) + eY * 0.5 * mySize_y;
+                               }
+
+                               if(iconalign == 0 || iconalign == 3) { // left align
                                        picpos = pos + eY * 0.5 * mySize_y;
-                                       numpos = picpos + eX * 0.5 * mySize_y;
+                                       numpos = pos + eX * (1/3) * mySize_x + eY * 0.5 * mySize_y;
+                               } else { // right align
+                                       picpos = pos + eX * (2/3) * mySize_x + eY * 0.5 * mySize_y;
+                                       numpos = pos + eY * 0.5 * mySize_y;
                                }
 
                                HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor(rightname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                               drawpic_skin(picpos, rightname, '0.5 0.5 0' * mySize_y, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                               HUD_DrawXNum_Colored(numpos, rightcnt, len, 0.5 * mySize_y, HUD_Panel_GetFgAlpha(id));
+                               drawpic_skin(picpos, rightname, eX * (1/3) * mySize_x + eY * 0.5 * mySize_y, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                               drawstring_aspect(numpos, ftos(rightcnt), eX * (2/3) * mySize_x + eY * 0.5 * mySize_y, mySize_y, HUD_Get_Num_Color(rightcnt, 200), HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                        }
 
-                       if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
-                               barpos = pos + eX * mySize_x - eX * mySize_x * min(1, fuel/100);
-                               barsize = eX * mySize_x * min(1, fuel/100) + eY * 0.1 * mySize_y;
-                       } else {
-                               barpos = pos;
-                               barsize = eX * mySize_x * min(1, fuel/100) + eY * 0.1 * mySize_y;
-                       }
                        if(fuel)
+                       {
+                               if(baralign == 0 || baralign == 3) { // left align
+                                       barpos = pos + eX * mySize_x - eX * mySize_x * min(1, fuel/100);
+                                       barsize = eX * mySize_x * min(1, fuel/100) + eY * 0.1 * mySize_y;
+                               } else {
+                                       barpos = pos;
+                                       barsize = eX * mySize_x * min(1, fuel/100) + eY * 0.1 * mySize_y;
+                               }
                                HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor("fuel"), HUD_Panel_GetFgAlpha(id) * 0.8, DRAWFLAG_NORMAL);
+                       }
                }
                else
                {
                        if(leftactive)
                        {
-                               len = strlen(ftos(leftcnt));
-
-                               if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+                               if(baralign == 1 || baralign == 3) { // down align
+                                       barpos = pos + eY * mySize_y - eY * mySize_y * min(1, leftcnt/200);
+                                       barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, leftcnt/200);
+                               } else { // up align
                                        barpos = pos;
                                        barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, leftcnt/200);
+                               }
+
+                               if(iconalign == 1 || iconalign == 3) { // down align
+                                       picpos = pos + eX * 0.05 * mySize_x + eY * (mySize_y - 0.65 * mySize_x);
+                                       numpos = pos + eY * mySize_y - eY * 0.25 * mySize_x;
+                               } else { // up align
                                        picpos = pos + eX * 0.05 * mySize_x;
-                                       numpos = pos + eX * ((3-len)/2) * 0.25 * mySize_x + eY * 0.4 * mySize_x;
-                               } else {
-                                       barpos = pos + eY * mySize_y - eY * mySize_y * min(1, leftcnt/200);
-                                       barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, leftcnt/200);
-                                       picpos = pos + eX * 0.05 * mySize_x + eY * mySize_y - eY * 0.566 * mySize_x;
-                                       numpos = pos + eX * ((3-len)/2) * 0.25 * mySize_x + eY * mySize_y - eY * 0.166 * mySize_x;
+                                       numpos = pos + eY * 0.4 * mySize_x;
                                }
 
                                HUD_Panel_DrawProgressBar(barpos, 1, barsize, HUD_Panel_GetProgressBarColor(leftname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                                drawpic_skin(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                               HUD_DrawXNum_Colored(numpos, leftcnt, len, 0.166 * mySize_x, HUD_Panel_GetFgAlpha(id));
+                               drawstring_aspect(numpos, ftos(leftcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, 0.25 * mySize_x, HUD_Get_Num_Color(leftcnt, 200), HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                        }
 
                        if(rightactive)
                        {
-                               len = strlen(ftos(rightcnt));
-
-                               if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+                               if(baralign == 0 || baralign == 3) { // up align
                                        barpos = pos + eX * 0.5 * mySize_x;
                                        barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, rightcnt/200);
-                                       picpos = pos + eX * 0.05 * mySize_x + eX * 0.5 * mySize_x;
-                                       numpos = pos + eX * ((3-len)/2) * 0.25 * mySize_x + eY * 0.4 * mySize_x + eX * 0.5 * mySize_x;
-                               } else {
+                               } else { // down align
                                        barpos = pos + eY * mySize_y - eY * mySize_y * min(1, rightcnt/200) + eX * 0.5 * mySize_x;
                                        barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, rightcnt/200);
-                                       picpos = pos + eX * 0.05 * mySize_x + eY * mySize_y - eY * 0.566 * mySize_x + eX * 0.5 * mySize_x;
-                                       numpos = pos + eX * ((3-len)/2) * 0.25 * mySize_x + eY * mySize_y - eY * 0.166 * mySize_x + eX * 0.5 * mySize_x;
+                               }
+
+                               if(iconalign == 0 || iconalign == 3) { // up align
+                                       picpos = pos + eX * 0.05 * mySize_x + eX * 0.5 * mySize_x;
+                                       numpos = pos + eY * 0.4 * mySize_x + eX * 0.5 * mySize_x;
+                               } else { // down align
+                                       picpos = pos + eX * 0.05 * mySize_x + eY * (mySize_y - 0.65 * mySize_x) + eX * 0.5 * mySize_x;
+                                       numpos = pos + eY * mySize_y - eY * 0.25 * mySize_x + eX * 0.5 * mySize_x;
                                }
 
                                HUD_Panel_DrawProgressBar(barpos, 1, barsize, HUD_Panel_GetProgressBarColor(rightname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                                drawpic_skin(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                               HUD_DrawXNum_Colored(numpos, rightcnt, len, 0.166 * mySize_x, HUD_Panel_GetFgAlpha(id));
+                               drawstring_aspect(numpos, ftos(rightcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, 0.25 * mySize_x, HUD_Get_Num_Color(rightcnt, 200), HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                        }
 
-                       if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
-                               barpos = pos;
-                               barsize = eX * 0.05 * mySize_x + eY * mySize_y * min(1, fuel/100);
-                       } else {
-                               barpos = pos + eY * mySize_y - eY * mySize_y * min(1, fuel/100);
-                               barsize = eX * 0.05 * mySize_x + eY * mySize_y * min(1, fuel/100);
-                       }
                        if(fuel)
+                       {
+                               if(baralign == 0 || baralign == 3) { // left align
+                                       barpos = pos;
+                                       barsize = eX * 0.05 * mySize_x + eY * mySize_y * min(1, fuel/100);
+                               } else {
+                                       barpos = pos + eY * mySize_y - eY * mySize_y * min(1, fuel/100);
+                                       barsize = eX * 0.05 * mySize_x + eY * mySize_y * min(1, fuel/100);
+                               }
                                HUD_Panel_DrawProgressBar(barpos, 1, barsize, HUD_Panel_GetProgressBarColor("fuel"), HUD_Panel_GetFgAlpha(id) * 0.8, DRAWFLAG_NORMAL);
+                       }
                }
        }
 }
@@ -3245,7 +3198,7 @@ void HUD_Score(void)
        }
 
        float score, distribution, leader;
-       float score_len, distr_len;
+       float score_len;
        vector distribution_color;
        entity tm, pl, me;
        me = (spectatee_status > 0) ? playerslots[spectatee_status - 1] : playerslots[player_localentnum - 1];
@@ -3289,19 +3242,19 @@ void HUD_Score(void)
                                distribution_color = eX;
                                minusplus = 2; // minusplus 1: always prefix with plus sign
                        }
-                       HUD_DrawXNum(bottomright - '0 48 0' - '16 0 0' * TIME_DECIMALS, distmsec, -TIME_DECIMALS, 0, 16, distribution_color, 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                       HUD_DrawXNum(bottomright - '68 48 0' - '16 0 0' * TIME_DECIMALS, distsec, 4, minusplus, 16, distribution_color, 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                       //HUD_DrawXNum(bottomright - '0 48 0' - '16 0 0' * TIME_DECIMALS, distmsec, -TIME_DECIMALS, 0, 16, distribution_color, 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                       //HUD_DrawXNum(bottomright - '68 48 0' - '16 0 0' * TIME_DECIMALS, distsec, 4, minusplus, 16, distribution_color, 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                        drawpic_skin(bottomright - '10 48 0' - '16 0 0' * TIME_DECIMALS, "num_dot", '16 16 0', distribution_color, HUD_Panel_GetFgAlpha(id), DRAWFLAG_ADDITIVE);
                }
                // race record display
                if (distribution <= 0 || distribution == score) // draw the highlight background behind the timer if we have the lead
                        drawpic_skin(bottomright - '0 32 0' - '32 0 0' * (4 + TIME_DECIMALS), "num_leading_4", '0 28 0' + '32 0 0' * (4 + TIME_DECIMALS), '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
 
-               HUD_DrawXNum(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0', racemsec, -TIME_DECIMALS, 0, 30, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-               HUD_DrawXNum(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0'  - '66 0 0', racesec, -2, 0, 30, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+               //HUD_DrawXNum(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0', racemsec, -TIME_DECIMALS, 0, 30, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+               //HUD_DrawXNum(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0'  - '66 0 0', racesec, -2, 0, 30, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                drawpic_skin(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0' - '18 0 0', "num_dot", '30 30 0', '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_ADDITIVE);
 
-               HUD_DrawXNum(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0' - '132 0 0', racemin, -2, 0, 30, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+               //HUD_DrawXNum(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0' - '132 0 0', racemin, -2, 0, 30, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                drawpic_skin(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0' - '84 0 0', "num_colon", '30 30 0', '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_ADDITIVE);
                */
        } else if (!teamplay) { // non-teamgames
@@ -3333,12 +3286,13 @@ void HUD_Score(void)
                        distribution_color = eX;
 
                score_len = strlen(ftos(score));
-               distr_len = strlen(ftos(distribution));
 
-               HUD_DrawXNum(pos + eX * mySize_x - eX * 3 * 0.33 * mySize_y, distribution, 3, 3, 0.33 * mySize_y, distribution_color, 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+               drawstring_aspect(pos + eX * 0.75 * mySize_x, ftos(distribution), eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, (1/3) * mySize_y, distribution_color, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                if (leader)
-                       drawpic_skin(pos + eX * mySize_x - eX * score_len * mySize_y - eX * 3 * 0.33 * mySize_y, strcat("num_leading_", ftos(score_len)), eX * score_len * mySize_y + eY * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-               HUD_DrawXNum(pos + eX * mySize_x - eX * 3 * mySize_y - eX * 3 * 0.33 * mySize_y, score, 3, 0, mySize_y, distribution_color, 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                       drawpic_skin(pos, strcat("num_leading_", ftos(score_len)), eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+               drawfont = hud_bigfont;
+               drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize_x + eY * mySize_y, mySize_y, distribution_color, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+               drawfont = hud_font;
        } else { // teamgames
                float max_fragcount;
                max_fragcount = -99;
@@ -3361,14 +3315,16 @@ void HUD_Score(void)
                                if (max_fragcount == score)
                                        leader = 1;
                                if (leader)
-                                       drawpic_skin(pos + eX * mySize_x - eX * score_len * mySize_y - eX * 3 * 0.33 * mySize_y, strcat("num_leading_", ftos(score_len)), eX * score_len * mySize_y + eY * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                               HUD_DrawXNum(pos + eX * mySize_x - eX * 3 * mySize_y - eX * 3 * 0.33 * mySize_y, score, 3, 0, mySize_y, GetTeamRGB(tm.team) * 0.8, 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                                       drawpic_skin(pos, strcat("num_leading_", ftos(score_len)), eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                               drawfont = hud_bigfont;
+                               drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize_x + eY * mySize_y, mySize_y, GetTeamRGB(tm.team) * 0.8, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                               drawfont = hud_font;
                        } else {
                                if (max_fragcount == score)
                                        leader = 1;
                                if (leader)
-                                       drawpic_skin(pos + eX * mySize_x - eX * 0.33 * score_len * mySize_y + eY * 0.33 * mySize_y * teamnum, strcat("num_leading_", ftos(score_len)), eX * 0.33 * score_len * mySize_y + eY * 0.33 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-                               HUD_DrawXNum(pos + eX * mySize_x - eX * 3 * 0.33 * mySize_y + eY * 0.33 * mySize_y * teamnum, score, 3, 0, 0.33 * mySize_y, GetTeamRGB(tm.team) * 0.8, 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                                       drawpic_skin(pos + eX * 0.75 * mySize_x + eY * (1/3) * teamnum * mySize_y, strcat("num_leading_", ftos(score_len)), eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                               drawstring_aspect(pos + eX * 0.75 * mySize_x + eY * (1/3) * teamnum * mySize_y, ftos(score), eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, (1/3) * mySize_y, GetTeamRGB(tm.team) * 0.8, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
                                teamnum += 1;
                        }
                }
@@ -4397,7 +4353,7 @@ void HUD_Main (void)
                }
        }
 
-       if(cvar_string("hud_dock") != "")
+       if(cvar_string("hud_dock") != "" && cvar_string("hud_dock") != "0")
                drawpic('0 0 0', strcat("gfx/hud/", cvar_string("hud_skin"), "/", cvar_string("hud_dock")), eX * vid_conwidth + eY * vid_conheight, HUD_Panel_Dock_GetColor(), cvar("hud_dock_alpha") * menu_fade_alpha, DRAWFLAG_NORMAL); // no aspect ratio forcing on dock...
 
        if(HUD_Panel_CheckActive(HUD_PANEL_RADAR) || hud_configure)
index 36168ea2e772ce05fce447b024d1abcbcf8d815d..cd6ea9efebbc1a583f1baea8217737c92c467955 100644 (file)
@@ -1114,10 +1114,10 @@ void HUD_DrawScoreboard()
                                continue;
 
                        rgb = GetTeamRGB(tm.team);
-                       HUD_DrawXNum(pos - '9.5 0 0' * hud_fontsize_y + '0 1 0' * hud_fontsize_y, tm.(teamscores[ts_primary]), 6, 0, hud_fontsize_y * 1.5, rgb, 0, 1, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+                       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);
 
                        if(ts_primary != ts_secondary)
-                               HUD_DrawXNum(pos - '7.5 0 0' * hud_fontsize_y + '0 2.5 0' * hud_fontsize_y, tm.(teamscores[ts_secondary]), 6, 0, hud_fontsize_y * 1, rgb, 0, 1, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+                               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);
 
                        pos = HUD_Scoreboard_MakeTable(pos, tm, rgb, bg_size);
                }
index a410474eb559d98500fc3ad9e12f43743f9ecd95..62f2d8551e7c58716280895cd8c7bbc0ce531745 100644 (file)
@@ -49,6 +49,8 @@ float IT_AMMO                                 = 8064; // IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | IT_S
 float  IT_PICKUPMASK           = 51; // IT_FUEL_REGEN | IT_JETPACK | IT_UNLIMITED_AMMO; // strength and invincible are handled separately
 float  IT_UNLIMITED_AMMO       = 3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;
 
+float AMMO_COUNT = 4; // amount of ammo types to show in the inventory panel
+
 // variables:
 string weaponorder_byid;
 string weaponorder_byimpulse;