Close #22470: Set default paths for rct1/rct2 saves on Android

This commit is contained in:
Harry Hopkinson 2024-09-29 12:06:05 +01:00 committed by GitHub
parent 4c7d5e70c7
commit e3dc02441a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 67 additions and 22 deletions

View file

@ -4,6 +4,7 @@
- Feature: [#15642] Track design placement can now use construction modifier keys (ctrl/shift).
- Feature: [#21521] [Plugin] Add hook 'park.guest.softcap.calculate' called before calculating the soft guest cap.
- Feature: [#22694] Park graphs have tooltips and can be resized like finance graphs.
- Improved: [#22470] Android: automatically detect RCT2 installs in /sdcard/rct2.
- Improved: [#22777] Add long flat-to-steep track pieces to the Wooden and Classic Wooden Roller Coasters.
- Change: [#22494] Themes window now displays colours and checkboxes vertically.
- Change: [#22596] Land ownership fixes described by .parkpatch files are now only considered on scenarios.

View file

@ -678,15 +678,7 @@ namespace OpenRCT2::Config
{
LOG_VERBOSE("config_find_rct1_path(...)");
static constexpr u8string_view searchLocations[] = {
R"(C:\Program Files\Steam\steamapps\common\Rollercoaster Tycoon Deluxe)",
R"(C:\Program Files (x86)\Steam\steamapps\common\Rollercoaster Tycoon Deluxe)",
R"(C:\GOG Games\RollerCoaster Tycoon Deluxe)",
R"(C:\Program Files\GalaxyClient\Games\RollerCoaster Tycoon Deluxe)",
R"(C:\Program Files (x86)\GalaxyClient\Games\RollerCoaster Tycoon Deluxe)",
R"(C:\Program Files\Hasbro Interactive\RollerCoaster Tycoon)",
R"(C:\Program Files (x86)\Hasbro Interactive\RollerCoaster Tycoon)",
};
static std::vector<u8string_view> searchLocations = Platform::GetSearchablePathsRCT1();
for (const auto& location : searchLocations)
{
@ -723,19 +715,7 @@ namespace OpenRCT2::Config
{
LOG_VERBOSE("config_find_rct2_path(...)");
static constexpr u8string_view searchLocations[] = {
R"(C:\Program Files\Steam\steamapps\common\Rollercoaster Tycoon 2)",
R"(C:\Program Files (x86)\Steam\steamapps\common\Rollercoaster Tycoon 2)",
R"(C:\GOG Games\RollerCoaster Tycoon 2 Triple Thrill Pack)",
R"(C:\Program Files\GalaxyClient\Games\RollerCoaster Tycoon 2 Triple Thrill Pack)",
R"(C:\Program Files (x86)\GalaxyClient\Games\RollerCoaster Tycoon 2 Triple Thrill Pack)",
R"(C:\Program Files\Atari\RollerCoaster Tycoon 2)",
R"(C:\Program Files (x86)\Atari\RollerCoaster Tycoon 2)",
R"(C:\Program Files\Infogrames\RollerCoaster Tycoon 2)",
R"(C:\Program Files (x86)\Infogrames\RollerCoaster Tycoon 2)",
R"(C:\Program Files\Infogrames Interactive\RollerCoaster Tycoon 2)",
R"(C:\Program Files (x86)\Infogrames Interactive\RollerCoaster Tycoon 2)",
};
static std::vector<u8string_view> searchLocations = Platform::GetSearchablePathsRCT2();
for (const auto& location : searchLocations)
{

View file

@ -192,6 +192,16 @@ namespace OpenRCT2::Platform
AndroidClassLoader::_classLoader, AndroidClassLoader::_findClassMethod,
env->NewStringUTF(std::string(name).c_str())));
}
std::vector<std::string_view> GetSearchablePathsRCT1()
{
return { "/sdcard/rct1" };
}
std::vector<std::string_view> GetSearchablePathsRCT2()
{
return { "/sdcard/rct2" };
}
} // namespace OpenRCT2::Platform
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* pjvm, void* reserved)

View file

@ -333,6 +333,16 @@ namespace OpenRCT2::Platform
return u8"Rollercoaster Tycoon 2";
}
std::vector<std::string_view> GetSearchablePathsRCT1()
{
return {};
}
std::vector<std::string_view> GetSearchablePathsRCT2()
{
return {};
}
# ifndef NO_TTF
std::string GetFontPath(const TTFFontDescriptor& font)
{

View file

@ -888,6 +888,36 @@ namespace OpenRCT2::Platform
return false;
}
std::vector<std::string_view> GetSearchablePathsRCT1()
{
return {
R"(C:\Program Files\Steam\steamapps\common\Rollercoaster Tycoon Deluxe)",
R"(C:\Program Files (x86)\Steam\steamapps\common\Rollercoaster Tycoon Deluxe)",
R"(C:\GOG Games\RollerCoaster Tycoon Deluxe)",
R"(C:\Program Files\GalaxyClient\Games\RollerCoaster Tycoon Deluxe)",
R"(C:\Program Files (x86)\GalaxyClient\Games\RollerCoaster Tycoon Deluxe)",
R"(C:\Program Files\Hasbro Interactive\RollerCoaster Tycoon)",
R"(C:\Program Files (x86)\Hasbro Interactive\RollerCoaster Tycoon)",
};
}
std::vector<std::string_view> GetSearchablePathsRCT2()
{
return {
R"(C:\Program Files\Steam\steamapps\common\Rollercoaster Tycoon 2)",
R"(C:\Program Files (x86)\Steam\steamapps\common\Rollercoaster Tycoon 2)",
R"(C:\GOG Games\RollerCoaster Tycoon 2 Triple Thrill Pack)",
R"(C:\Program Files\GalaxyClient\Games\RollerCoaster Tycoon 2 Triple Thrill Pack)",
R"(C:\Program Files (x86)\GalaxyClient\Games\RollerCoaster Tycoon 2 Triple Thrill Pack)",
R"(C:\Program Files\Atari\RollerCoaster Tycoon 2)",
R"(C:\Program Files (x86)\Atari\RollerCoaster Tycoon 2)",
R"(C:\Program Files\Infogrames\RollerCoaster Tycoon 2)",
R"(C:\Program Files (x86)\Infogrames\RollerCoaster Tycoon 2)",
R"(C:\Program Files\Infogrames Interactive\RollerCoaster Tycoon 2)",
R"(C:\Program Files (x86)\Infogrames Interactive\RollerCoaster Tycoon 2)",
};
}
} // namespace OpenRCT2::Platform
#endif

View file

@ -14,6 +14,7 @@
#include "../core/StringTypes.h"
#include <ctime>
#include <vector>
#ifdef _WIN32
# define PATH_SEPARATOR u8"\\"
@ -126,6 +127,9 @@ namespace OpenRCT2::Platform
bool SSE41Available();
bool AVX2Available();
std::vector<std::string_view> GetSearchablePathsRCT1();
std::vector<std::string_view> GetSearchablePathsRCT2();
} // namespace OpenRCT2::Platform
#ifdef __ANDROID__

View file

@ -280,6 +280,16 @@ namespace OpenRCT2::Platform
}
}
}
std::vector<std::string_view> GetSearchablePathsRCT1()
{
return {};
}
std::vector<std::string_view> GetSearchablePathsRCT2()
{
return {};
}
}
#endif