diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 9ed2d927c2..b86f0b5a7b 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -2,6 +2,7 @@ ------------------------------------------------------------------------ - Improved: [#18632] Land ownership and construction rights are now shown on top of the water. - Improved: [#20951] Activate OpenRCT2 window after using native file dialog on macOS. +- Fix: [#20616] Confirmation button in the track designer’s quit prompt has the wrong text. - Fix: [#21145] [Plugin] setInterval/setTimeout handle conflict. - Fix: [#21158] [Plugin] Potential crash using setInterval/setTimeout within the callback. - Fix: [#21171] [Plugin] Crash creating entities with no more entity slots available. diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index 1182bd8674..e5c3c645d4 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -89,14 +89,10 @@ public: void OnOpen() override { - if (gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)) - { - widgets = _quitPromptWidgets; - } - else - { - widgets = _savePromptWidgets; - } + bool canSave = !(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)); + + widgets = canSave ? _savePromptWidgets : _quitPromptWidgets; + InitScrollWidgets(); // Pause the game if not network play. @@ -108,17 +104,20 @@ public: WindowInvalidateByClass(WindowClass::TopToolbar); - StringId stringId = window_save_prompt_labels[EnumValue(_promptMode)][0]; - if (stringId == STR_LOAD_GAME_PROMPT_TITLE && gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) + if (canSave) { - stringId = STR_LOAD_LANDSCAPE_PROMPT_TITLE; + StringId stringId = window_save_prompt_labels[EnumValue(_promptMode)][0]; + if (stringId == STR_LOAD_GAME_PROMPT_TITLE && gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) + { + stringId = STR_LOAD_LANDSCAPE_PROMPT_TITLE; + } + else if (stringId == STR_QUIT_GAME_PROMPT_TITLE && gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) + { + stringId = STR_QUIT_SCENARIO_EDITOR; + } + widgets[WIDX_TITLE].text = stringId; + widgets[WIDX_LABEL].text = window_save_prompt_labels[EnumValue(_promptMode)][1]; } - else if (stringId == STR_QUIT_GAME_PROMPT_TITLE && gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) - { - stringId = STR_QUIT_SCENARIO_EDITOR; - } - widgets[WIDX_TITLE].text = stringId; - widgets[WIDX_LABEL].text = window_save_prompt_labels[EnumValue(_promptMode)][1]; } void OnClose() override