diff --git a/distribution/changelog.txt b/distribution/changelog.txt index c4449ff5fd..d0e3a44f0e 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -26,6 +26,7 @@ - Improved: [#7930] Automatically create folders for custom content. - Improved: [#7980] Show the full path of the scenario in the scenario select window. - Improved: [#7993] Allow assigning a keyboard shortcut for opening the tile inspector. +- Improved: [#8107] Support Discord release of RCT2. - Improved: Almost completely new Hungarian translation. - Removed: [#7929] Support for scenario text objects. diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index 3b6f339133..0ae4d03137 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -24,6 +24,7 @@ #include "../localisation/Language.h" #include "../network/network.h" #include "../paint/VirtualFloor.h" +#include "../platform/Platform2.h" #include "../platform/platform.h" #include "../scenario/Scenario.h" #include "../ui/UiContext.h" @@ -684,6 +685,12 @@ namespace Config } } + auto discordPath = Platform::GetFolderPath(SPECIAL_FOLDER::RCT2_DISCORD); + if (!discordPath.empty() && platform_original_game_data_exists(discordPath.c_str())) + { + return discordPath; + } + if (platform_original_game_data_exists(gExePath)) { return gExePath; diff --git a/src/openrct2/platform/Platform.Win32.cpp b/src/openrct2/platform/Platform.Win32.cpp index 3677325431..1e3b46337f 100644 --- a/src/openrct2/platform/Platform.Win32.cpp +++ b/src/openrct2/platform/Platform.Win32.cpp @@ -115,6 +115,19 @@ namespace Platform } return path; } + case SPECIAL_FOLDER::RCT2_DISCORD: + { +# ifdef __USE_SHGETKNOWNFOLDERPATH__ + auto path = WIN32_GetKnownFolderPath(FOLDERID_LocalAppData); +# else + auto path = WIN32_GetFolderPath(CSIDL_LOCAL_APPDATA); +# endif + if (!path.empty()) + { + path = Path::Combine(path, "DiscordGames\\RollerCoaster Tycoon 2 Triple Thrill Pack\\content\\Game"); + } + return path; + } default: return std::string(); } diff --git a/src/openrct2/platform/Platform2.h b/src/openrct2/platform/Platform2.h index 1c184cea0e..f61a17b38b 100644 --- a/src/openrct2/platform/Platform2.h +++ b/src/openrct2/platform/Platform2.h @@ -20,6 +20,8 @@ enum class SPECIAL_FOLDER USER_CONFIG, USER_DATA, USER_HOME, + + RCT2_DISCORD, }; namespace Platform