1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-28 09:14:58 +01:00

Fix hats/balloons/umbrellas not showing in guest notifications (#23728)

This commit is contained in:
Aaron van Geffen
2025-01-28 16:31:33 +01:00
committed by GitHub
parent eeee934a47
commit 17e1fab0f2

View File

@@ -260,8 +260,8 @@ namespace OpenRCT2::Ui::Windows
if (newsItem->HasButton())
break;
DrawPixelInfo cliped_dpi;
if (!ClipDrawPixelInfo(cliped_dpi, dpi, screenCoords + ScreenCoordsXY{ 1, 1 }, 22, 22))
DrawPixelInfo clipped_dpi;
if (!ClipDrawPixelInfo(clipped_dpi, dpi, screenCoords + ScreenCoordsXY{ 1, 1 }, 22, 22))
{
break;
}
@@ -285,26 +285,38 @@ namespace OpenRCT2::Ui::Windows
image_id_base++;
auto image_id = ImageId(image_id_base, peep->TshirtColour, peep->TrousersColour);
GfxDrawSprite(cliped_dpi, image_id, clipCoords);
GfxDrawSprite(clipped_dpi, image_id, clipCoords);
auto* guest = peep->As<Guest>();
if (guest != nullptr)
if (guest == nullptr)
return;
// There are only 6 walking frames available for each item,
// as well as 1 sprite for sitting and 1 for standing still.
auto itemFrame = (frame_no / 4) % 6;
if (guest->AnimationGroup == PeepAnimationGroup::Hat)
{
if (image_id_base >= kPeepSpriteBalloonStateWatchRideId
&& image_id_base < kPeepSpriteBalloonStateSittingIdleId + 4)
{
GfxDrawSprite(cliped_dpi, ImageId(image_id_base + 32, guest->BalloonColour), clipCoords);
}
if (image_id_base >= kPeepSpriteUmbrellaStateWalkingId
&& image_id_base < kPeepSpriteUmbrellaStateSittingIdleId + 4)
{
GfxDrawSprite(cliped_dpi, ImageId(image_id_base + 32, guest->UmbrellaColour), clipCoords);
}
if (image_id_base >= kPeepSpriteHatStateWatchRideId
&& image_id_base < kPeepSpriteHatStateSittingIdleId + 4)
{
GfxDrawSprite(cliped_dpi, ImageId(image_id_base + 32, guest->HatColour), clipCoords);
}
auto itemOffset = kPeepSpriteHatItemStart + 1;
auto imageId = ImageId(itemOffset + itemFrame * 4, guest->HatColour);
GfxDrawSprite(clipped_dpi, imageId, clipCoords);
return;
}
if (guest->AnimationGroup == PeepAnimationGroup::Balloon)
{
auto itemOffset = kPeepSpriteBalloonItemStart + 1;
auto imageId = ImageId(itemOffset + itemFrame * 4, guest->BalloonColour);
GfxDrawSprite(clipped_dpi, imageId, clipCoords);
return;
}
if (guest->AnimationGroup == PeepAnimationGroup::Umbrella)
{
auto itemOffset = kPeepSpriteUmbrellaItemStart + 1;
auto imageId = ImageId(itemOffset + itemFrame * 4, guest->UmbrellaColour);
GfxDrawSprite(clipped_dpi, imageId, clipCoords);
return;
}
break;
}