From f9c5633c194e2c54e74cb611bbdc12d3af0c3d45 Mon Sep 17 00:00:00 2001 From: XplosiveLugnut <46918213+XplosiveLugnut@users.noreply.github.com> Date: Wed, 10 Jun 2020 12:31:33 -0500 Subject: [PATCH] Can now pop balloons and quack ducks in title screen. (#9614) * Can now pop balloons and quack ducks in title screen. * Chengelog entry * Narrow check for misc sprite down to only duck and balloon sprite. * Update distribution/changelog.txt Co-authored-by: Michael Steenbeek * Use the IsBalloon and IsDuck functions instead. * Update src/openrct2-ui/interface/ViewportInteraction.cpp Co-authored-by: Michael Steenbeek * Squash: Bring code up to date. * Add nullptr check. * Update src/openrct2-ui/interface/ViewportInteraction.cpp Co-authored-by: Aaron van Geffen Co-authored-by: Michael Steenbeek Co-authored-by: Aaron van Geffen --- distribution/changelog.txt | 1 + src/openrct2-ui/interface/ViewportInteraction.cpp | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 9c6d4de512..e9b6500bad 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -2,6 +2,7 @@ ------------------------------------------------------------------------ - Feature: [#7648] "Enable all drawable track pieces" now enables more pieces for the Twister, Vertical and Air Powered Vertical coasters. - Feature: [#9029] Open doors with the tile inspector. +- Feature: [#9614] Allow popping balloons and quacking ducks in the title screen. - Feature: [#10572] Cheat to allow building at invalid heights. - Feature: [#11155] Guest entry points can now be removed by clicking them again. - Feature: [#11231] Change shortcut window list order to be more intuitive, and split it into logical sections. diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index d1ccdd1bbb..1536964c51 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -57,8 +57,8 @@ int32_t viewport_interaction_get_item_left(const ScreenCoordsXY& screenCoords, v rct_sprite* sprite; Vehicle* vehicle; - // No click input for title screen or scenario editor or track manager - if (gScreenFlags & (SCREEN_FLAGS_TITLE_DEMO | SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_MANAGER)) + // No click input for scenario editor or track manager + if (gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_MANAGER)) return info->type = VIEWPORT_INTERACTION_ITEM_NONE; // @@ -74,6 +74,15 @@ int32_t viewport_interaction_get_item_left(const ScreenCoordsXY& screenCoords, v tileElement = info->tileElement; sprite = info->sprite; + // Allows only balloons to be popped and ducks to be quacked in title screen + if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) + { + if (info->type == VIEWPORT_INTERACTION_ITEM_SPRITE && (sprite->generic.Is() || sprite->generic.Is())) + return info->type; + else + return info->type = VIEWPORT_INTERACTION_ITEM_NONE; + } + switch (info->type) { case VIEWPORT_INTERACTION_ITEM_SPRITE: