From 33fbad9726eafd62e14fe078d3975aaf02ebdbe0 Mon Sep 17 00:00:00 2001 From: seanmajorpayne <4562746+seanmajorpayne@users.noreply.github.com> Date: Wed, 8 Sep 2021 19:39:34 +0900 Subject: [PATCH] Fix #15257: Chat widgets removed from Scenario Editor (#15365) * Update TopToolbar.cpp Removed else statement which caused the game to skip toolbar element deactivations. * Update contributors.md Adding name to contrib.md * Update changelog.txt Updated changelog * Update changelog.txt Fixing changelog item position --- contributors.md | 1 + distribution/changelog.txt | 1 + src/openrct2-ui/windows/TopToolbar.cpp | 64 ++++++++++++-------------- 3 files changed, 31 insertions(+), 35 deletions(-) diff --git a/contributors.md b/contributors.md index b12d3c4d21..302be0ee29 100644 --- a/contributors.md +++ b/contributors.md @@ -176,6 +176,7 @@ The following people are not part of the development team, but have been contrib * Kane Shaw (seifer7) * Saad Rehman (SaadRehmanCS) * (ocalhoun6) +* Sean Payne (seanmajorpayne) ## Toolchain * (Balletie) - macOS diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 4389b0eb51..f1e4eab986 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -22,6 +22,7 @@ - Fix: [#15193] Crash when rides/stalls are demolished. - Fix: [#15199] Construction window is not closed when a ride gets demolished. - Fix: [#15255] Tile Inspector shows banner information on walls that do not contain one. +- Fix: [#15257] Chat icon shows in scenario/track editor. Other icons don't disable when deactivated in options menu. - Fix: [#15289] Unexpected behavior with duplicated banners which also caused desyncs in multiplayer. - Improved: [#3417] Crash dumps are now placed in their own folder. - Change: [#8601] Revert ToonTower base block fix to re-enable support blocking. diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 870ec0f40a..3970a94872 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -675,13 +675,24 @@ static void window_top_toolbar_invalidate(rct_window* w) window_top_toolbar_widgets[WIDX_NETWORK].type = WindowWidgetType::TrnBtn; if (!gConfigInterface.toolbar_show_mute) - { window_top_toolbar_widgets[WIDX_MUTE].type = WindowWidgetType::Empty; - } if (!gConfigInterface.toolbar_show_chat) - { window_top_toolbar_widgets[WIDX_CHAT].type = WindowWidgetType::Empty; + + if (!gConfigInterface.toolbar_show_research) + window_top_toolbar_widgets[WIDX_RESEARCH].type = WindowWidgetType::Empty; + + if (!gConfigInterface.toolbar_show_cheats) + window_top_toolbar_widgets[WIDX_CHEATS].type = WindowWidgetType::Empty; + + if (!gConfigInterface.toolbar_show_news) + window_top_toolbar_widgets[WIDX_NEWS].type = WindowWidgetType::Empty; + + if (!gConfigInterface.toolbar_show_zoom) + { + window_top_toolbar_widgets[WIDX_ZOOM_IN].type = WindowWidgetType::Empty; + window_top_toolbar_widgets[WIDX_ZOOM_OUT].type = WindowWidgetType::Empty; } if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR || gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) @@ -689,6 +700,9 @@ static void window_top_toolbar_invalidate(rct_window* w) window_top_toolbar_widgets[WIDX_PAUSE].type = WindowWidgetType::Empty; } + if ((gParkFlags & PARK_FLAGS_NO_MONEY) || !gConfigInterface.toolbar_show_finances) + window_top_toolbar_widgets[WIDX_FINANCES].type = WindowWidgetType::Empty; + if (gScreenFlags & SCREEN_FLAGS_EDITOR) { window_top_toolbar_widgets[WIDX_PARK].type = WindowWidgetType::Empty; @@ -725,39 +739,19 @@ static void window_top_toolbar_invalidate(rct_window* w) window_top_toolbar_widgets[WIDX_VIEW_MENU].type = WindowWidgetType::Empty; } } - else + + switch (network_get_mode()) { - if ((gParkFlags & PARK_FLAGS_NO_MONEY) || !gConfigInterface.toolbar_show_finances) - window_top_toolbar_widgets[WIDX_FINANCES].type = WindowWidgetType::Empty; - - if (!gConfigInterface.toolbar_show_research) - window_top_toolbar_widgets[WIDX_RESEARCH].type = WindowWidgetType::Empty; - - if (!gConfigInterface.toolbar_show_cheats) - window_top_toolbar_widgets[WIDX_CHEATS].type = WindowWidgetType::Empty; - - if (!gConfigInterface.toolbar_show_news) - window_top_toolbar_widgets[WIDX_NEWS].type = WindowWidgetType::Empty; - - if (!gConfigInterface.toolbar_show_zoom) - { - window_top_toolbar_widgets[WIDX_ZOOM_IN].type = WindowWidgetType::Empty; - window_top_toolbar_widgets[WIDX_ZOOM_OUT].type = WindowWidgetType::Empty; - } - - switch (network_get_mode()) - { - case NETWORK_MODE_NONE: - window_top_toolbar_widgets[WIDX_NETWORK].type = WindowWidgetType::Empty; - window_top_toolbar_widgets[WIDX_CHAT].type = WindowWidgetType::Empty; - break; - case NETWORK_MODE_CLIENT: - window_top_toolbar_widgets[WIDX_PAUSE].type = WindowWidgetType::Empty; - [[fallthrough]]; - case NETWORK_MODE_SERVER: - window_top_toolbar_widgets[WIDX_FASTFORWARD].type = WindowWidgetType::Empty; - break; - } + case NETWORK_MODE_NONE: + window_top_toolbar_widgets[WIDX_NETWORK].type = WindowWidgetType::Empty; + window_top_toolbar_widgets[WIDX_CHAT].type = WindowWidgetType::Empty; + break; + case NETWORK_MODE_CLIENT: + window_top_toolbar_widgets[WIDX_PAUSE].type = WindowWidgetType::Empty; + [[fallthrough]]; + case NETWORK_MODE_SERVER: + window_top_toolbar_widgets[WIDX_FASTFORWARD].type = WindowWidgetType::Empty; + break; } enabledWidgets = 0;