From f8805635f614c961e6e0bfbdda89b265dbb096c0 Mon Sep 17 00:00:00 2001 From: Michael Berk Date: Tue, 20 Jan 2026 11:56:28 -0500 Subject: [PATCH 1/4] Implement ShowMenuDialog on macOS --- distribution/changelog.txt | 1 + src/openrct2-ui/UiContext.macOS.mm | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 6ba6873e17..973ff0a627 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -2,6 +2,7 @@ ------------------------------------------------------------------------ - Feature: [#25844] The sprite builder now also supports adding JSON-based palettes. - Improved: [#25765] The ‘View options’ and ‘Special track elements’ dropdowns no longer need click-and-hold. +- Improved: [#25858] macOS now supports the onboarding menu. - Fix: [#4643, #25167] Many metal supports draw with a filled in top when they didn't in vanilla, causing some slight misalignment and glitching. - Fix: [#25739] Game freezes when a tab in the New Ride window contains more than 384 items. - Fix: [#25745] Crash when a player connection is aborted early. diff --git a/src/openrct2-ui/UiContext.macOS.mm b/src/openrct2-ui/UiContext.macOS.mm index 8aa9f0539b..66dd41a729 100644 --- a/src/openrct2-ui/UiContext.macOS.mm +++ b/src/openrct2-ui/UiContext.macOS.mm @@ -66,13 +66,29 @@ namespace OpenRCT2::Ui bool HasMenuSupport() override { - return false; + return true; } int32_t ShowMenuDialog( const std::vector& options, const std::string& title, const std::string& text) override { - return -1; + @autoreleasepool + { + NSAlert* alert = [[[NSAlert alloc] init] autorelease]; + for (const std::string& option : options) + { + [alert addButtonWithTitle:[NSString stringWithUTF8String:option.c_str()]]; + } + + alert.messageText = [NSString stringWithUTF8String:title.c_str()]; + alert.informativeText = [NSString stringWithUTF8String:text.c_str()]; + NSModalResponse response = [alert runModal]; + if (response >= 1000) + { + return static_cast(response - 1000); + } + return -1; + } } void OpenFolder(const std::string& path) override From 17533dae34970121fae6322ffc6ba8e82ecaeee4 Mon Sep 17 00:00:00 2001 From: Michael Berk Date: Tue, 20 Jan 2026 19:12:03 -0500 Subject: [PATCH 2/4] Add quit button to onboarding options --- data/language/en-GB.txt | 1 + src/openrct2-ui/UiContext.macOS.mm | 4 ++-- src/openrct2/config/Config.cpp | 6 ++++++ src/openrct2/localisation/StringIds.h | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index b10b65b668..5e5a3e61f7 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3846,3 +3846,4 @@ STR_7013 :Drag areas of path STR_7014 :I own the game on Steam, but I haven’t installed it yet. STR_7015 :Please close Steam if it’s running, then click ‘OK’. STR_7016 :OpenRCT2 has tried to trigger a download in Steam. Please open Steam and let it download the game. When Steam is finished, click ‘OK’. +STR_7017 :Quit \ No newline at end of file diff --git a/src/openrct2-ui/UiContext.macOS.mm b/src/openrct2-ui/UiContext.macOS.mm index 66dd41a729..7cf788c339 100644 --- a/src/openrct2-ui/UiContext.macOS.mm +++ b/src/openrct2-ui/UiContext.macOS.mm @@ -73,13 +73,13 @@ namespace OpenRCT2::Ui const std::vector& options, const std::string& title, const std::string& text) override { @autoreleasepool - { + { NSAlert* alert = [[[NSAlert alloc] init] autorelease]; for (const std::string& option : options) { [alert addButtonWithTitle:[NSString stringWithUTF8String:option.c_str()]]; } - + alert.messageText = [NSString stringWithUTF8String:title.c_str()]; alert.informativeText = [NSString stringWithUTF8String:text.c_str()]; NSModalResponse response = [alert runModal]; diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index 15dc19befc..8a12ec36ff 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -929,6 +929,7 @@ namespace OpenRCT2::Config std::string gog = LanguageGetString(STR_OWN_ON_GOG); std::string steam = LanguageGetString(STR_OWN_ON_STEAM); std::string hdd = LanguageGetString(STR_INSTALLED_ON_HDD); + std::string exit = LanguageGetString(STR_QUIT_ONBOARDING); std::string chosenOption; @@ -938,6 +939,7 @@ namespace OpenRCT2::Config options.push_back(hdd); options.push_back(gog); options.push_back(steam); + options.push_back(exit); int optionIndex = uiContext.ShowMenuDialog( options, LanguageGetString(STR_OPENRCT2_SETUP), LanguageGetString(STR_WHICH_APPLIES_BEST)); if (optionIndex < 0 || static_cast(optionIndex) >= options.size()) @@ -1010,6 +1012,10 @@ namespace OpenRCT2::Config return true; } } + else if (chosenOption == exit) + { + ContextQuit(); + } if (possibleInstallPaths.empty()) { return false; diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 8c9ab7e0bf..c02f22f875 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -1605,6 +1605,7 @@ enum : StringId STR_OWN_ON_STEAM = 7014, STR_PLEASE_CLOSE_STEAM = 7015, STR_WAIT_FOR_STEAM_DOWNLOAD = 7016, + STR_QUIT_ONBOARDING = 7017, STR_TILE_INSPECTOR_TOGGLE_INVISIBILITY_TIP = 6436, From 639c64974f9f2b156d5a5084ffa23101cf98dabb Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Thu, 22 Jan 2026 20:58:02 +0100 Subject: [PATCH 3/4] Fix #25221: When trying to cancel game file discovery, the prompt reappears --- distribution/changelog.txt | 1 + src/openrct2-ui/UiContext.Linux.cpp | 2 +- src/openrct2/config/Config.cpp | 13 ++++++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 973ff0a627..911f932c7e 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -4,6 +4,7 @@ - Improved: [#25765] The ‘View options’ and ‘Special track elements’ dropdowns no longer need click-and-hold. - Improved: [#25858] macOS now supports the onboarding menu. - Fix: [#4643, #25167] Many metal supports draw with a filled in top when they didn't in vanilla, causing some slight misalignment and glitching. +- Fix: [#25221] When trying to cancel game file discovery, the prompt reappears. - Fix: [#25739] Game freezes when a tab in the New Ride window contains more than 384 items. - Fix: [#25745] Crash when a player connection is aborted early. - Fix: [#25799] The animated options tab icon of the news window does not always redraw. diff --git a/src/openrct2-ui/UiContext.Linux.cpp b/src/openrct2-ui/UiContext.Linux.cpp index 6c3f7d3523..7ba530197c 100644 --- a/src/openrct2-ui/UiContext.Linux.cpp +++ b/src/openrct2-ui/UiContext.Linux.cpp @@ -394,7 +394,7 @@ namespace OpenRCT2::Ui } } - return options.size(); + return -1; } private: diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index 8a12ec36ff..e06df18931 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -942,11 +942,16 @@ namespace OpenRCT2::Config options.push_back(exit); int optionIndex = uiContext.ShowMenuDialog( options, LanguageGetString(STR_OPENRCT2_SETUP), LanguageGetString(STR_WHICH_APPLIES_BEST)); - if (optionIndex < 0 || static_cast(optionIndex) >= options.size()) + // Error while trying to show menu options, fall back. + if (optionIndex < 0) { - // graceful fallback if app errors or user exits out of window chosenOption = hdd; } + // User clicked the Cancel or Close button + else if (static_cast(optionIndex) >= options.size()) + { + chosenOption = exit; + } else { chosenOption = options[optionIndex]; @@ -960,7 +965,9 @@ namespace OpenRCT2::Config std::vector possibleInstallPaths{}; if (chosenOption == hdd) { - possibleInstallPaths.emplace_back(uiContext.ShowDirectoryDialog(LanguageGetString(STR_PICK_RCT2_DIR))); + auto pickedPath = uiContext.ShowDirectoryDialog(LanguageGetString(STR_PICK_RCT2_DIR)); + if (!pickedPath.empty()) + possibleInstallPaths.emplace_back(pickedPath); } else if (chosenOption == gog) { From dcd097a3b11c644e3ca9482b1c649fd1a012be5d Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Thu, 22 Jan 2026 20:59:02 +0100 Subject: [PATCH 4/4] Fix minimum height of Zenity/Kdialog window to 350 pixels --- src/openrct2-ui/UiContext.Linux.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2-ui/UiContext.Linux.cpp b/src/openrct2-ui/UiContext.Linux.cpp index 7ba530197c..88437b5740 100644 --- a/src/openrct2-ui/UiContext.Linux.cpp +++ b/src/openrct2-ui/UiContext.Linux.cpp @@ -337,7 +337,7 @@ namespace OpenRCT2::Ui // zenity and kdialog don't support automatic scaling, this is an approximation int width = (longest_string + 1) * 8; - int height = (options.size() + 1) * 8; + int height = 350; switch (dtype) {