Update Steam path detection for Linux (#21948)

* Update Steam path detection for Linux

As Steam now uses Proton to install Windows version natively, update
paths so they get found automatically

* Use new Steam path detection on Linux only

This restores Steam path detection on macOS as it doesn't have Proton
This commit is contained in:
Michał Janiszewski 2024-05-02 15:05:22 +02:00 committed by GitHub
parent 9f69b532b1
commit 4e8f578075
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 39 additions and 13 deletions

View File

@ -151,6 +151,16 @@ namespace Platform
return {};
}
u8string GetRCT1SteamDir()
{
return {};
}
u8string GetRCT2SteamDir()
{
return {};
}
# ifndef NO_TTF
std::string GetFontPath(const TTFFontDescriptor& font)
{

View File

@ -299,7 +299,15 @@ namespace Platform
return {};
}
auto steamPath = Path::Combine(homeDir, u8".local/share/Steam/ubuntu12_32/steamapps/content");
// Prefer new path for Steam, which is the default when using with Proton
auto steamPath = Path::Combine(homeDir, u8".local/share/Steam/steamapps/common");
if (Path::DirectoryExists(steamPath))
{
return steamPath;
}
// Fallback paths
steamPath = Path::Combine(homeDir, u8".local/share/Steam/ubuntu12_32/steamapps/content");
if (Path::DirectoryExists(steamPath))
{
return steamPath;
@ -310,10 +318,19 @@ namespace Platform
{
return steamPath;
}
return {};
}
u8string GetRCT1SteamDir()
{
return u8"Rollercoaster Tycoon Deluxe";
}
u8string GetRCT2SteamDir()
{
return u8"Rollercoaster Tycoon 2";
}
# ifndef NO_TTF
std::string GetFontPath(const TTFFontDescriptor& font)
{

View File

@ -369,17 +369,6 @@ namespace Platform
datetime64 utcNow = epochAsTicks + utcEpochTicks;
return utcNow;
}
u8string GetRCT1SteamDir()
{
return u8"app_285310" PATH_SEPARATOR u8"depot_285311";
}
u8string GetRCT2SteamDir()
{
return u8"app_285330" PATH_SEPARATOR u8"depot_285331";
}
} // namespace Platform
#endif

View File

@ -252,6 +252,16 @@ namespace Platform
return {};
}
u8string GetRCT1SteamDir()
{
return u8"app_285310" PATH_SEPARATOR u8"depot_285311";
}
u8string GetRCT2SteamDir()
{
return u8"app_285330" PATH_SEPARATOR u8"depot_285331";
}
std::string GetFontPath(const TTFFontDescriptor& font)
{
@autoreleasepool