Fix widget state regressions from #26443 (#26464)

* Fix #26460: Delete, build, forward and backward buttons in Ride Construction window are always held

* Fix #26462: Opening Tile Inspector crashes the game
This commit is contained in:
Michael Steenbeek
2026-04-28 22:11:30 +02:00
committed by GitHub
2 changed files with 9 additions and 4 deletions
+1 -1
View File
@@ -2079,7 +2079,7 @@ namespace OpenRCT2::Ui::Windows
WIDX_BANKING_GROUPBOX, WIDX_CONSTRUCT, WIDX_DEMOLISH, WIDX_PREVIOUS_SECTION,
WIDX_NEXT_SECTION, WIDX_ENTRANCE_EXIT_GROUPBOX, WIDX_ENTRANCE, WIDX_EXIT })
{
if (isWidgetPressed(preservedIndex))
if (widgets[preservedIndex].flags.has(WidgetFlag::isPressed))
newPressedWidgets |= (1uLL << preservedIndex);
}
+8 -3
View File
@@ -474,16 +474,21 @@ namespace OpenRCT2::Ui::Windows
ViewportInteractionItem::footpath, ViewportInteractionItem::pathAddition, ViewportInteractionItem::parkEntrance,
ViewportInteractionItem::wall, ViewportInteractionItem::largeScenery, ViewportInteractionItem::banner);
static constexpr WidgetIndex kDisabledWidgetsDefault[] = {
WIDX_BUTTON_MOVE_UP, WIDX_BUTTON_MOVE_DOWN, WIDX_BUTTON_REMOVE, WIDX_BUTTON_ROTATE, WIDX_BUTTON_COPY,
};
static constexpr WidgetIndex kDisabledWidgetsLargeScenery[] = { WIDX_BUTTON_ROTATE };
// clang-format off
static constexpr std::initializer_list<WidgetIndex> kDisabledWidgetsByPage[] = {
{ WIDX_BUTTON_MOVE_UP, WIDX_BUTTON_MOVE_DOWN, WIDX_BUTTON_REMOVE, WIDX_BUTTON_ROTATE, WIDX_BUTTON_COPY },
static constexpr std::span<const WidgetIndex> kDisabledWidgetsByPage[] = {
kDisabledWidgetsDefault,
{},
{},
{},
{},
{},
{},
{ WIDX_BUTTON_ROTATE },
kDisabledWidgetsLargeScenery,
{},
};
// clang-format on