mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-21 20:27:45 +00:00
When running on the Steam Deck, launcher mode is now handled
Steamworks recommends not using launchers on the Deck, but it has a special mode that specifically enables a KB/M layout to assist - we now enable that before launching the game.
This commit is contained in:
parent
8d7f6afa0a
commit
3df6e79fad
3 changed files with 24 additions and 2 deletions
|
@ -4,5 +4,9 @@ class LauncherCore;
|
|||
|
||||
class SteamAPI {
|
||||
public:
|
||||
SteamAPI(LauncherCore& core);
|
||||
explicit SteamAPI(LauncherCore& core);
|
||||
|
||||
void setLauncherMode(bool isLauncher);
|
||||
|
||||
bool isDeck() const;
|
||||
};
|
|
@ -58,6 +58,8 @@ void LauncherCore::buildRequest(const ProfileSettings& settings, QNetworkRequest
|
|||
}
|
||||
|
||||
void LauncherCore::launchGame(const ProfileSettings& profile, const LoginAuth& auth) {
|
||||
steamApi->setLauncherMode(false);
|
||||
|
||||
#ifdef ENABLE_WATCHDOG
|
||||
if (profile.enableWatchdog) {
|
||||
watchdog->launchGame(profile, auth);
|
||||
|
@ -486,6 +488,8 @@ LauncherCore::LauncherCore(bool isSteam)
|
|||
#endif
|
||||
|
||||
readInitialInformation();
|
||||
|
||||
steamApi->setLauncherMode(true);
|
||||
}
|
||||
|
||||
ProfileSettings& LauncherCore::getProfile(int index) {
|
||||
|
|
|
@ -17,4 +17,18 @@ SteamAPI::SteamAPI(LauncherCore& core) {
|
|||
qDebug() << "Failed to initialize steam api!";
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void SteamAPI::setLauncherMode(bool isLauncher) {
|
||||
#ifdef ENABLE_STEAM
|
||||
SteamUtils()->SetGameLauncherMode(isLauncher);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool SteamAPI::isDeck() const {
|
||||
#ifdef ENABLE_STEAM
|
||||
return SteamUtils()->IsSteamRunningOnSteamDeck();
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue