@@ -4309,44 +4309,39 @@ void AHuman::DrawHUD(BITMAP *pTargetBitmap, const Vector &targetPos, int whichSc
4309
4309
4310
4310
m_HUDStack -= 10 ;
4311
4311
if (m_pFGArm && !m_EquipHUDTimer.IsPastRealMS (500 )) {
4312
- if (m_pFGArm->HoldsSomething ()) {
4313
- pSmallFont->DrawAligned (&allegroBitmap, drawPos.GetFloorIntX () + 1 , drawPos.GetFloorIntY () + m_HUDStack + 3 , m_pFGArm->GetHeldMO ()->GetPresetName ().c_str (), GUIFont::Centre);
4314
- } else {
4315
- pSmallFont->DrawAligned (&allegroBitmap, drawPos.GetFloorIntX () + 1 , drawPos.GetFloorIntY () + m_HUDStack + 3 , " EMPTY" , GUIFont::Centre);
4316
- }
4312
+ std::string equippedItemsString = (m_pFGArm->HoldsSomething () ? m_pFGArm->GetHeldMO ()->GetPresetName () : " EMPTY" ) + (m_pBGArm->HoldsSomething () ? " | " + m_pBGArm->GetHeldMO ()->GetPresetName () : " " );
4313
+ pSmallFont->DrawAligned (&allegroBitmap, drawPos.GetFloorIntX () + 1 , drawPos.GetFloorIntY () + m_HUDStack + 3 , equippedItemsString, GUIFont::Centre);
4317
4314
m_HUDStack -= 9 ;
4318
4315
}
4319
4316
}
4320
4317
// Held-related GUI stuff
4321
- else if (m_pFGArm) {
4322
- HDFirearm *pHeldFirearm = dynamic_cast <HDFirearm *>(m_pFGArm->GetHeldDevice ());
4323
-
4324
- // Ammo
4325
- if (pHeldFirearm)
4326
- {
4327
- MovableObject *bgHeldItem = GetEquippedBGItem ();
4328
- HDFirearm const *bgHeldFirearm = bgHeldItem == NULL ? NULL : dynamic_cast <HDFirearm *>(bgHeldItem);
4318
+ else if (m_pFGArm || m_pBGArm) {
4319
+ HDFirearm *fgHeldFirearm = dynamic_cast <HDFirearm *>(m_pFGArm->GetHeldDevice ());
4320
+ MovableObject *bgHeldItem = GetEquippedBGItem ();
4321
+ const HDFirearm *bgHeldFirearm = dynamic_cast <HDFirearm *>(bgHeldItem);
4329
4322
4323
+ if (fgHeldFirearm || bgHeldFirearm) {
4330
4324
str[0 ] = -56 ; str[1 ] = 0 ;
4331
- pSymbolFont->DrawAligned (&allegroBitmap, drawPos.m_X - 10 , drawPos.m_Y + m_HUDStack, str, GUIFont::Left);
4332
- std::string fgWeaponString;
4333
-
4334
- if (pHeldFirearm->IsReloading ()) {
4335
- fgWeaponString = " Reloading" ;
4336
- rectfill (pTargetBitmap, drawPos.GetFloorIntX () + 1 , drawPos.GetFloorIntY () + m_HUDStack + 13 , drawPos.GetFloorIntX () + 29 , drawPos.GetFloorIntY () + m_HUDStack + 14 , 245 );
4337
- rectfill (pTargetBitmap, drawPos.GetFloorIntX (), drawPos.GetFloorIntY () + m_HUDStack + 12 , drawPos.GetFloorIntX () + static_cast <int >(28 .0F * pHeldFirearm->GetReloadProgress () + 0 .5F ), drawPos.GetFloorIntY () + m_HUDStack + 13 , 77 );
4338
- } else {
4339
- fgWeaponString = pHeldFirearm->GetRoundInMagCount () < 0 ? " Infinite" : std::to_string (pHeldFirearm->GetRoundInMagCount ());
4325
+ pSymbolFont->DrawAligned (&allegroBitmap, drawPos.GetFloorIntX () - 10 , drawPos.GetFloorIntY () + m_HUDStack, str, GUIFont::Left);
4326
+
4327
+ std::string fgWeaponString = " EMPTY" ;
4328
+ if (fgHeldFirearm) {
4329
+ if (fgHeldFirearm->IsReloading ()) {
4330
+ fgWeaponString = " Reloading" ;
4331
+ rectfill (pTargetBitmap, drawPos.GetFloorIntX () + 1 , drawPos.GetFloorIntY () + m_HUDStack + 13 , drawPos.GetFloorIntX () + 29 , drawPos.GetFloorIntY () + m_HUDStack + 14 , 245 );
4332
+ rectfill (pTargetBitmap, drawPos.GetFloorIntX (), drawPos.GetFloorIntY () + m_HUDStack + 12 , drawPos.GetFloorIntX () + static_cast <int >(28 .0F * fgHeldFirearm->GetReloadProgress () + 0 .5F ), drawPos.GetFloorIntY () + m_HUDStack + 13 , 77 );
4333
+ } else {
4334
+ fgWeaponString = fgHeldFirearm->GetRoundInMagCount () < 0 ? " Infinite" : std::to_string (fgHeldFirearm->GetRoundInMagCount ());
4335
+ }
4340
4336
}
4341
4337
4342
4338
if (bgHeldItem && bgHeldFirearm) {
4343
4339
std::string bgWeaponString;
4344
-
4345
4340
if (bgHeldFirearm->IsReloading ()) {
4346
4341
bgWeaponString = " Reloading" ;
4347
- int textWidth = pSmallFont->CalculateWidth (fgWeaponString) + 6 ;
4348
- rectfill (pTargetBitmap, drawPos.GetFloorIntX () + 1 + textWidth , drawPos.GetFloorIntY () + m_HUDStack + 13 , drawPos.GetFloorIntX () + 29 + textWidth , drawPos.GetFloorIntY () + m_HUDStack + 14 , 245 );
4349
- rectfill (pTargetBitmap, drawPos.GetFloorIntX () + textWidth , drawPos.GetFloorIntY () + m_HUDStack + 12 , drawPos.GetFloorIntX () + static_cast <int >(28 .0F * bgHeldFirearm->GetReloadProgress () + 0 .5F ) + textWidth , drawPos.GetFloorIntY () + m_HUDStack + 13 , 77 );
4342
+ int totalTextWidth = pSmallFont->CalculateWidth (fgWeaponString) + 6 ;
4343
+ rectfill (pTargetBitmap, drawPos.GetFloorIntX () + 1 + totalTextWidth , drawPos.GetFloorIntY () + m_HUDStack + 13 , drawPos.GetFloorIntX () + 29 + totalTextWidth , drawPos.GetFloorIntY () + m_HUDStack + 14 , 245 );
4344
+ rectfill (pTargetBitmap, drawPos.GetFloorIntX () + totalTextWidth , drawPos.GetFloorIntY () + m_HUDStack + 12 , drawPos.GetFloorIntX () + static_cast <int >(28 .0F * bgHeldFirearm->GetReloadProgress () + 0 .5F ) + totalTextWidth , drawPos.GetFloorIntY () + m_HUDStack + 13 , 77 );
4350
4345
} else {
4351
4346
bgWeaponString = bgHeldFirearm->GetRoundInMagCount () < 0 ? " Infinite" : std::to_string (bgHeldFirearm->GetRoundInMagCount ());
4352
4347
}
@@ -4372,11 +4367,8 @@ void AHuman::DrawHUD(BITMAP *pTargetBitmap, const Vector &targetPos, int whichSc
4372
4367
m_HUDStack -= 11;
4373
4368
}
4374
4369
*/
4375
- if (m_pFGArm->HoldsSomething ()) {
4376
- pSmallFont->DrawAligned (&allegroBitmap, drawPos.GetFloorIntX () + 1 , drawPos.GetFloorIntY () + m_HUDStack + 3 , m_pFGArm->GetHeldMO ()->GetPresetName ().c_str (), GUIFont::Centre);
4377
- } else {
4378
- pSmallFont->DrawAligned (&allegroBitmap, drawPos.GetFloorIntX () + 1 , drawPos.GetFloorIntY () + m_HUDStack + 3 , " EMPTY" , GUIFont::Centre);
4379
- }
4370
+ std::string equippedItemsString = (m_pFGArm->HoldsSomething () ? m_pFGArm->GetHeldMO ()->GetPresetName () : " EMPTY" ) + (m_pBGArm->HoldsSomething () ? " | " + m_pBGArm->GetHeldMO ()->GetPresetName () : " " );
4371
+ pSmallFont->DrawAligned (&allegroBitmap, drawPos.GetFloorIntX () + 1 , drawPos.GetFloorIntY () + m_HUDStack + 3 , equippedItemsString, GUIFont::Centre);
4380
4372
m_HUDStack -= 9 ;
4381
4373
/*
4382
4374
// Reload GUI, only show when there's nothing to pick up
0 commit comments