@@ -548,7 +548,7 @@ void HeldDevice::DrawHUD(BITMAP *pTargetBitmap, const Vector &targetPos, int whi
548
548
// Only draw if the team viewing this has seen the space where this is located.
549
549
int viewingPlayer = g_ActivityMan.GetActivity ()->PlayerOfScreen (whichScreen);
550
550
int viewingTeam = g_ActivityMan.GetActivity ()->GetTeamOfPlayer (viewingPlayer);
551
- if (viewingTeam != Activity::NoTeam && g_SceneMan.IsUnseen (m_Pos.GetFloorIntX (), m_Pos.GetFloorIntY (), viewingTeam)) {
551
+ if (viewingTeam == Activity::NoTeam || g_SceneMan.IsUnseen (m_Pos.GetFloorIntX (), m_Pos.GetFloorIntY (), viewingTeam)) {
552
552
return ;
553
553
}
554
554
@@ -573,39 +573,33 @@ void HeldDevice::DrawHUD(BITMAP *pTargetBitmap, const Vector &targetPos, int whi
573
573
}
574
574
}
575
575
576
- char str[64 ];
577
- str[0 ] = 0 ;
578
576
GUIFont *pSymbolFont = g_FrameMan.GetLargeFont ();
579
577
GUIFont *pTextFont = g_FrameMan.GetSmallFont ();
580
578
if (pSymbolFont && pTextFont) {
581
- if (m_BlinkTimer.GetElapsedSimTimeMS () > 750 ) {
582
- str[0 ] = -40 ;
583
- str[1 ] = 0 ;
584
- } else if (m_BlinkTimer.GetElapsedSimTimeMS () > 500 ) {
585
- str[0 ] = -41 ;
586
- str[1 ] = 0 ;
587
- } else if (m_BlinkTimer.GetElapsedSimTimeMS () > 250 ) {
588
- str[0 ] = -42 ;
589
- str[1 ] = 0 ;
590
- } else if (m_BlinkTimer.GetElapsedSimTimeMS () > 0 ) {
591
- str[0 ] = 0 ;
592
- } else {
593
- // Check for nearby cursors that will toggle this pickup HUD.
594
- float range = g_SettingsMan.GetUnheldItemsHUDDisplayRange ();
595
- if (g_ActivityMan.GetActivity ()->GetActivityState () != Activity::ActivityState::Running) {
596
- range = -1 .0F ;
597
- } else if (const GameActivity *gameActivity = dynamic_cast <const GameActivity *>(g_ActivityMan.GetActivity ())) {
598
- if (gameActivity->GetViewState (viewingPlayer) == GameActivity::ViewState::ActorSelect) {
599
- range = -1 .0F ;
600
- }
601
- }
602
- m_SeenByPlayer.at (viewingPlayer) = range < 0 || (range > 0 && g_SceneMan.ShortestDistance (m_Pos, g_SceneMan.GetScrollTarget (whichScreen), g_SceneMan.SceneWrapsX ()).GetMagnitude () < range);
579
+ const Activity *activity = g_ActivityMan.GetActivity ();
580
+ float unheldItemDisplayRange = activity->GetActivityState () == Activity::ActivityState::Running ? g_SettingsMan.GetUnheldItemsHUDDisplayRange () : -1 .0F ;
603
581
}
582
+ m_SeenByPlayer.at (viewingPlayer) = unheldItemDisplayRange < 0 || (unheldItemDisplayRange > 0 && g_SceneMan.ShortestDistance (m_Pos, g_SceneMan.GetScrollTarget (whichScreen), g_SceneMan.SceneWrapsX ()).GetMagnitude () < unheldItemDisplayRange);
583
+
604
584
if (m_SeenByPlayer.at (viewingPlayer)) {
605
- AllegroBitmap pBitmapInt (pTargetBitmap);
606
- pSymbolFont->DrawAligned (&pBitmapInt, drawPos.GetFloorIntX () - 1 , drawPos.GetFloorIntY () - 20 , str, GUIFont::Centre);
607
- std::snprintf (str, sizeof (str), " %s" , m_PresetName.c_str ());
608
- pTextFont->DrawAligned (&pBitmapInt, drawPos.GetFloorIntX (), drawPos.GetFloorIntY () - 29 , str, GUIFont::Centre);
585
+ char pickupArrowString[64 ];
586
+ pickupArrowString[0 ] = 0 ;
587
+ if (m_BlinkTimer.GetElapsedSimTimeMS () < 250 ) {
588
+ pickupArrowString[0 ] = 0 ;
589
+ } else if (m_BlinkTimer.GetElapsedSimTimeMS () < 500 ) {
590
+ pickupArrowString[0 ] = -42 ;
591
+ pickupArrowString[1 ] = 0 ;
592
+ } else if (m_BlinkTimer.GetElapsedSimTimeMS () < 750 ) {
593
+ pickupArrowString[0 ] = -41 ;
594
+ pickupArrowString[1 ] = 0 ;
595
+ } else if (m_BlinkTimer.GetElapsedSimTimeMS () < 1000 ) {
596
+ pickupArrowString[0 ] = -40 ;
597
+ pickupArrowString[1 ] = 0 ;
598
+ }
599
+
600
+ AllegroBitmap targetAllegroBitmap (pTargetBitmap);
601
+ pSymbolFont->DrawAligned (&targetAllegroBitmap, drawPos.GetFloorIntX () - 1 , drawPos.GetFloorIntY () - 20 , pickupArrowString, GUIFont::Centre);
602
+ pTextFont->DrawAligned (&targetAllegroBitmap, drawPos.GetFloorIntX (), drawPos.GetFloorIntY () - 29 , m_PresetName, GUIFont::Centre);
609
603
}
610
604
}
611
605
}
0 commit comments