1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-24 05:17:46 +00:00

Rip out Proton support

This commit is contained in:
Joshua Goins 2023-12-20 18:02:36 -05:00
parent 22862ca14c
commit 63c5275f93

View file

@ -176,9 +176,7 @@ void GameRunner::launchExecutable(const Profile &profile, QProcess *process, con
#endif
}
#if defined(Q_OS_LINUX)
if (isGame) {
if (profile.gamescopeEnabled()) {
if (isGame && profile.gamescopeEnabled()) {
arguments.push_back(QStringLiteral("gamescope"));
if (profile.gamescopeFullscreen())
@ -196,8 +194,6 @@ void GameRunner::launchExecutable(const Profile &profile, QProcess *process, con
if (profile.gamescopeRefreshRate() > 0)
arguments.push_back(QStringLiteral("-r ") + QString::number(profile.gamescopeRefreshRate()));
}
}
#endif
#ifdef ENABLE_GAMEMODE
if (isGame && profile.gamemodeEnabled()) {
@ -219,58 +215,9 @@ void GameRunner::launchExecutable(const Profile &profile, QProcess *process, con
#endif
#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
if (m_launcher.isSteam()) {
const QDir steamDirectory = QProcessEnvironment::systemEnvironment().value(QStringLiteral("STEAM_COMPAT_CLIENT_INSTALL_PATH"));
const QDir compatData =
QProcessEnvironment::systemEnvironment().value(QStringLiteral("STEAM_COMPAT_DATA_PATH")); // TODO: do these have to exist on the root steam folder?
const QString steamAppsPath = steamDirectory.absoluteFilePath(QStringLiteral("steamapps/common"));
// Find the highest Proton version
QDirIterator it(steamAppsPath);
QDir highestVersion;
int highestVersionNum = 1;
while (it.hasNext()) {
QString dir = it.next();
QFileInfo fileInfo(dir);
if (!fileInfo.isDir()) {
continue;
}
QString dirName = fileInfo.fileName();
if (dirName.contains("Proton"_L1)) {
if (dirName == "Proton - Experimental"_L1) {
highestVersion.setPath(dir);
break;
} else {
QString version = dirName.remove("Proton "_L1);
// Exclude "BattlEye Runtime" and other unrelated things
if (version.contains('.'_L1)) {
// TODO: better error handling (they might never be invalid, but better safe than sorry)
QStringList parts = version.split('.'_L1);
int versionNum = parts[0].toInt();
// TODO: doesn't handle minor versions, not like they really exist anymore anyway
if (versionNum > highestVersionNum) {
highestVersionNum = versionNum;
highestVersion.setPath(dir);
}
}
}
}
}
env.insert(QStringLiteral("STEAM_COMPAT_CLIENT_INSTALL_PATH"), steamDirectory.absolutePath());
env.insert(QStringLiteral("STEAM_COMPAT_DATA_PATH"), compatData.absolutePath());
arguments.push_back(highestVersion.absoluteFilePath(QStringLiteral("proton")));
arguments.push_back(QStringLiteral("run"));
} else {
env.insert(QStringLiteral("WINEPREFIX"), profile.winePrefixPath());
arguments.push_back(profile.winePath());
}
#endif
arguments.append(args);