Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/language/en-GB.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions distribution/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
------------------------------------------------------------------------
- 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: [#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.
Expand Down
4 changes: 2 additions & 2 deletions src/openrct2-ui/UiContext.Linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -394,7 +394,7 @@ namespace OpenRCT2::Ui
}
}

return options.size();
return -1;
}

private:
Expand Down
20 changes: 18 additions & 2 deletions src/openrct2-ui/UiContext.macOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,29 @@ void ShowMessageBox(SDL_Window* window, const std::string& message) override

bool HasMenuSupport() override
{
return false;
return true;
}

int32_t ShowMenuDialog(
const std::vector<std::string>& 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<int32_t>(response - 1000);
}
return -1;
}
}

void OpenFolder(const std::string& path) override
Expand Down
19 changes: 16 additions & 3 deletions src/openrct2/config/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -938,13 +939,19 @@ 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<uint32_t>(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<uint32_t>(optionIndex) >= options.size())
{
chosenOption = exit;
}
else
{
chosenOption = options[optionIndex];
Expand All @@ -958,7 +965,9 @@ namespace OpenRCT2::Config
std::vector<std::string> 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)
{
Expand Down Expand Up @@ -1010,6 +1019,10 @@ namespace OpenRCT2::Config
return true;
}
}
else if (chosenOption == exit)
{
ContextQuit();
}
if (possibleInstallPaths.empty())
{
return false;
Expand Down
1 change: 1 addition & 0 deletions src/openrct2/localisation/StringIds.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down