@@ -3868,8 +3868,10 @@ void AHuman::Update()
3868
3868
m_pBGArm->ReachToward (m_pBGHandGroup->GetLimbPos (m_HFlipped));
3869
3869
3870
3870
} else {
3871
- if (m_pFGArm && m_pFGArm->HoldsHeldDevice () && !m_pBGArm->HoldsHeldDevice ()) {
3872
- if (!EquipShieldInBGArm ()) {
3871
+ if (HeldDevice * heldDevice = dynamic_cast <HeldDevice *>(GetEquippedItem ())) {
3872
+ if (GetEquippedBGItem () && !heldDevice->IsOneHanded ()) {
3873
+ UnequipBGArm ();
3874
+ } else {
3873
3875
m_pBGArm->Reach (m_pFGArm->GetHeldDevice ()->GetSupportPos ());
3874
3876
if (m_pBGArm->DidReach ()) {
3875
3877
m_pFGArm->GetHeldDevice ()->SetSupported (true );
@@ -4300,44 +4302,39 @@ void AHuman::DrawHUD(BITMAP *pTargetBitmap, const Vector &targetPos, int whichSc
4300
4302
4301
4303
m_HUDStack -= 10 ;
4302
4304
if (m_pFGArm && !m_EquipHUDTimer.IsPastRealMS (500 )) {
4303
- if (m_pFGArm->HoldsSomething ()) {
4304
- pSmallFont->DrawAligned (&allegroBitmap, drawPos.GetFloorIntX () + 1 , drawPos.GetFloorIntY () + m_HUDStack + 3 , m_pFGArm->GetHeldMO ()->GetPresetName ().c_str (), GUIFont::Centre);
4305
- } else {
4306
- pSmallFont->DrawAligned (&allegroBitmap, drawPos.GetFloorIntX () + 1 , drawPos.GetFloorIntY () + m_HUDStack + 3 , " EMPTY" , GUIFont::Centre);
4307
- }
4305
+ std::string equippedItemsString = (m_pFGArm->HoldsSomething () ? m_pFGArm->GetHeldMO ()->GetPresetName () : " EMPTY" ) + (m_pBGArm->HoldsSomething () ? " | " + m_pBGArm->GetHeldMO ()->GetPresetName () : " " );
4306
+ pSmallFont->DrawAligned (&allegroBitmap, drawPos.GetFloorIntX () + 1 , drawPos.GetFloorIntY () + m_HUDStack + 3 , equippedItemsString, GUIFont::Centre);
4308
4307
m_HUDStack -= 9 ;
4309
4308
}
4310
4309
}
4311
4310
// Held-related GUI stuff
4312
- else if (m_pFGArm) {
4313
- HDFirearm *pHeldFirearm = dynamic_cast <HDFirearm *>(m_pFGArm->GetHeldDevice ());
4314
-
4315
- // Ammo
4316
- if (pHeldFirearm)
4317
- {
4318
- MovableObject *bgHeldItem = GetEquippedBGItem ();
4319
- HDFirearm const *bgHeldFirearm = bgHeldItem == NULL ? NULL : dynamic_cast <HDFirearm *>(bgHeldItem);
4311
+ else if (m_pFGArm || m_pBGArm) {
4312
+ HDFirearm *fgHeldFirearm = dynamic_cast <HDFirearm *>(m_pFGArm->GetHeldDevice ());
4313
+ MovableObject *bgHeldItem = GetEquippedBGItem ();
4314
+ const HDFirearm *bgHeldFirearm = dynamic_cast <HDFirearm *>(bgHeldItem);
4320
4315
4316
+ if (fgHeldFirearm || bgHeldFirearm) {
4321
4317
str[0 ] = -56 ; str[1 ] = 0 ;
4322
- pSymbolFont->DrawAligned (&allegroBitmap, drawPos.m_X - 10 , drawPos.m_Y + m_HUDStack, str, GUIFont::Left);
4323
- std::string fgWeaponString;
4324
-
4325
- if (pHeldFirearm->IsReloading ()) {
4326
- fgWeaponString = " Reloading" ;
4327
- rectfill (pTargetBitmap, drawPos.GetFloorIntX () + 1 , drawPos.GetFloorIntY () + m_HUDStack + 13 , drawPos.GetFloorIntX () + 29 , drawPos.GetFloorIntY () + m_HUDStack + 14 , 245 );
4328
- 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 );
4329
- } else {
4330
- fgWeaponString = pHeldFirearm->GetRoundInMagCount () < 0 ? " Infinite" : std::to_string (pHeldFirearm->GetRoundInMagCount ());
4318
+ pSymbolFont->DrawAligned (&allegroBitmap, drawPos.GetFloorIntX () - 10 , drawPos.GetFloorIntY () + m_HUDStack, str, GUIFont::Left);
4319
+
4320
+ std::string fgWeaponString = " EMPTY" ;
4321
+ if (fgHeldFirearm) {
4322
+ if (fgHeldFirearm->IsReloading ()) {
4323
+ fgWeaponString = " Reloading" ;
4324
+ rectfill (pTargetBitmap, drawPos.GetFloorIntX () + 1 , drawPos.GetFloorIntY () + m_HUDStack + 13 , drawPos.GetFloorIntX () + 29 , drawPos.GetFloorIntY () + m_HUDStack + 14 , 245 );
4325
+ 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 );
4326
+ } else {
4327
+ fgWeaponString = fgHeldFirearm->GetRoundInMagCount () < 0 ? " Infinite" : std::to_string (fgHeldFirearm->GetRoundInMagCount ());
4328
+ }
4331
4329
}
4332
4330
4333
4331
if (bgHeldItem && bgHeldFirearm) {
4334
4332
std::string bgWeaponString;
4335
-
4336
4333
if (bgHeldFirearm->IsReloading ()) {
4337
4334
bgWeaponString = " Reloading" ;
4338
- int textWidth = pSmallFont->CalculateWidth (fgWeaponString) + 6 ;
4339
- rectfill (pTargetBitmap, drawPos.GetFloorIntX () + 1 + textWidth , drawPos.GetFloorIntY () + m_HUDStack + 13 , drawPos.GetFloorIntX () + 29 + textWidth , drawPos.GetFloorIntY () + m_HUDStack + 14 , 245 );
4340
- 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 );
4335
+ int totalTextWidth = pSmallFont->CalculateWidth (fgWeaponString) + 6 ;
4336
+ rectfill (pTargetBitmap, drawPos.GetFloorIntX () + 1 + totalTextWidth , drawPos.GetFloorIntY () + m_HUDStack + 13 , drawPos.GetFloorIntX () + 29 + totalTextWidth , drawPos.GetFloorIntY () + m_HUDStack + 14 , 245 );
4337
+ 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 );
4341
4338
} else {
4342
4339
bgWeaponString = bgHeldFirearm->GetRoundInMagCount () < 0 ? " Infinite" : std::to_string (bgHeldFirearm->GetRoundInMagCount ());
4343
4340
}
@@ -4363,11 +4360,8 @@ void AHuman::DrawHUD(BITMAP *pTargetBitmap, const Vector &targetPos, int whichSc
4363
4360
m_HUDStack -= 11;
4364
4361
}
4365
4362
*/
4366
- if (m_pFGArm->HoldsSomething ()) {
4367
- pSmallFont->DrawAligned (&allegroBitmap, drawPos.GetFloorIntX () + 1 , drawPos.GetFloorIntY () + m_HUDStack + 3 , m_pFGArm->GetHeldMO ()->GetPresetName ().c_str (), GUIFont::Centre);
4368
- } else {
4369
- pSmallFont->DrawAligned (&allegroBitmap, drawPos.GetFloorIntX () + 1 , drawPos.GetFloorIntY () + m_HUDStack + 3 , " EMPTY" , GUIFont::Centre);
4370
- }
4363
+ std::string equippedItemsString = (m_pFGArm->HoldsSomething () ? m_pFGArm->GetHeldMO ()->GetPresetName () : " EMPTY" ) + (m_pBGArm->HoldsSomething () ? " | " + m_pBGArm->GetHeldMO ()->GetPresetName () : " " );
4364
+ pSmallFont->DrawAligned (&allegroBitmap, drawPos.GetFloorIntX () + 1 , drawPos.GetFloorIntY () + m_HUDStack + 3 , equippedItemsString, GUIFont::Centre);
4371
4365
m_HUDStack -= 9 ;
4372
4366
/*
4373
4367
// Reload GUI, only show when there's nothing to pick up
0 commit comments