- Duke: Don't flash the weapon's ammo icon when flashing text for low ammo in Duke FullscreenHUD1.

This commit is contained in:
Mitchell Richters 2020-08-21 16:28:50 +10:00 committed by Christoph Oelckers
parent 4e0bef35c0
commit 2cabc4b14d

View file

@ -153,24 +153,26 @@ public:
int weapon = p->curr_weapon; int weapon = p->curr_weapon;
if (weapon == HANDREMOTE_WEAPON) weapon = HANDBOMB_WEAPON; if (weapon == HANDREMOTE_WEAPON) weapon = HANDBOMB_WEAPON;
if (p->curr_weapon != KNEE_WEAPON && (!althud_flashing || (int)totalclock & 32 || p->ammo_amount[weapon] > (max_ammo_amount[weapon] / 10))) int wicon = ammo_sprites[p->curr_weapon];
if (wicon > 0)
{ {
format.Format("%d", p->ammo_amount[weapon]); format.Format("%d", p->ammo_amount[weapon]);
SBar_DrawString(this, &numberFont, format, -3, -numberFont.mFont->GetHeight() + 4.5, DI_TEXT_ALIGN_RIGHT, CR_UNTRANSLATED, 1, 0, 0, 1, 1); auto imgWeap = tileGetTexture(wicon);
auto weapScale = imgScale / imgWeap->GetDisplayHeight();
auto imgX = 20.;
auto strlen = format.Len();
int wicon = ammo_sprites[p->curr_weapon]; if (strlen > 1)
if (wicon > 0)
{ {
auto imgWeap = tileGetTexture(wicon); imgX += (imgX * 0.6) * (strlen - 1);
auto weapScale = imgScale / imgWeap->GetDisplayHeight();
auto imgX = 20.;
auto strlen = format.Len();
if (strlen > 1)
{
imgX += (imgX * 0.6) * (strlen - 1);
}
DrawGraphic(imgWeap, -imgX, -1.5, DI_ITEM_RIGHT_BOTTOM, 1, -1, -1, weapScale, weapScale);
} }
if (p->curr_weapon != KNEE_WEAPON && (!althud_flashing || (int)totalclock & 32 || p->ammo_amount[weapon] > (max_ammo_amount[weapon] / 10)))
{
SBar_DrawString(this, &numberFont, format, -3, -numberFont.mFont->GetHeight() + 4.5, DI_TEXT_ALIGN_RIGHT, CR_UNTRANSLATED, 1, 0, 0, 1, 1);
}
DrawGraphic(imgWeap, -imgX, -1.5, DI_ITEM_RIGHT_BOTTOM, 1, -1, -1, weapScale, weapScale);
} }
// //