Fix grenade icon alignment for enabled oldfashionedgunstats

Now, if oldfashionedgunstats is enabled, then ammo stats > 99 won't collide
with grenade icon on modern monitors with aspect ratio > 1.5 . It will
collide still on older monitors, because of lack of the free space on HUD.
This commit is contained in:
aurhat
2021-02-14 19:46:14 +01:00
committed by drian
parent 4a064da5b5
commit db18caba16
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -333,6 +333,7 @@ void drawequipicons(playerent *p)
// health & armor
if(p->armour) drawequipicon(HUDPOS_ARMOUR*2, 1650, (p->armour-1)/25, 2);
if(p->mag[GUN_GRENADE]) drawequipicon(oldfashionedgunstats ? (HUDPOS_GRENADE + (((float)screen->w / (float)screen->h > 1.5f) ? 75 : 25)) * 2 : HUDPOS_GRENADE*2, 1650, 3, 1);
drawequipicon(HUDPOS_HEALTH*2, 1650, 2, 3);
if(p->mag[GUN_GRENADE]) drawequipicon(oldfashionedgunstats ? (HUDPOS_GRENADE + 25)*2 : HUDPOS_GRENADE*2, 1650, 3, 1);
+1 -1
View File
@@ -1340,7 +1340,7 @@ void grenades::renderstats()
{
char gunstats[64];
sprintf(gunstats, "%d", mag);
draw_text(gunstats, oldfashionedgunstats ? HUDPOS_GRENADE + HUDPOS_NUMBERSPACING + 25 : HUDPOS_GRENADE + HUDPOS_NUMBERSPACING, 823);
draw_text(gunstats, oldfashionedgunstats ? HUDPOS_GRENADE + HUDPOS_NUMBERSPACING + (((float)screen->w / (float)screen->h > 1.5f) ? 75 : 25) : HUDPOS_GRENADE + HUDPOS_NUMBERSPACING, 823);
}
bool grenades::selectable() { return weapon::selectable() && state != GST_INHAND && mag; }