Skip to content

Commit

Permalink
HUD: Allow option to swap alt. ammo display
Browse files Browse the repository at this point in the history
  • Loading branch information
dastrukar committed Jan 27, 2021
1 parent 1214dfe commit 8c53b35
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions fdhud.zs
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,21 @@ class fdhud : BaseStatusBar

DrawInventoryIcon(GetCurrentAmmo(), (x+24+adjustment.X, y+21+adjustment.Y), DI_ITEM_OFFSETS, alpha);

DrawString(mHUDFont, FormatNumber(mAmmoInterpolator.GetValue(), 3), (x+44, y+3), DI_TEXT_ALIGN_RIGHT|DI_NOSHADOW);
if (ammotype2 != null) { DrawString(mIndexFont, FormatNumber(mAltAmmoInterpolator.GetValue(), 3), (x+46, y+16), DI_TEXT_ALIGN_RIGHT|DI_NOSHADOW); }
if (CVar.GetCVar("fdhud_swapaltammo", CPlayer).GetBool())
{
if (ammotype2 != null)
{
DrawString(mHUDFont, FormatNumber(mAltAmmoInterpolator.GetValue(), 3), (x+44, y+3), DI_TEXT_ALIGN_RIGHT|DI_NOSHADOW);
DrawString(mIndexFont, FormatNumber(mAmmoInterpolator.GetValue(), 3), (x+46, y+16), DI_TEXT_ALIGN_RIGHT|DI_NOSHADOW);
}
else { DrawString(mHUDFont, FormatNumber(mAmmoInterpolator.GetValue(), 3), (x+44, y+3), DI_TEXT_ALIGN_RIGHT|DI_NOSHADOW); }
}
else
{
DrawString(mHUDFont, FormatNumber(mAmmoInterpolator.GetValue(), 3), (x+44, y+3), DI_TEXT_ALIGN_RIGHT|DI_NOSHADOW);
if (ammotype2 != null) { DrawString(mIndexFont, FormatNumber(mAltAmmoInterpolator.GetValue(), 3), (x+46, y+16), DI_TEXT_ALIGN_RIGHT|DI_NOSHADOW); }
}

}
}

Expand Down

0 comments on commit 8c53b35

Please sign in to comment.