mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 13:55:58 +00:00
Start a launcher-run game without scanning its folder and keep Play on Starting until it launches (#2586)
* Start a launcher-run game without scanning its folder and keep Play on Starting until it launches * Create the shared added-games cache under one lock * Read a rewritten game manifest again instead of reusing the saved ranking * Tie a saved ranking to the declared executables that exist
This commit is contained in:
1 parent
6d1a0d9fd0
commit
b3ebd54d87
6 files changed
+83
-23
No files matched your search
@@ -49,9 +49,14 @@ object NoSteamLaunch {
|
||||
return com.droiddeck.launcher.core.GameResolution.resolve(choice, output)
|
||||
}
|
||||
|
||||
fun needsAddedGame(game: Library.SteamGame): Boolean = game.library == Library.ADDED && !viaBattleNet(game)
|
||||
|
||||
private fun viaBattleNet(game: Library.SteamGame): Boolean =
|
||||
game.library == Library.ADDED && game.source == com.droiddeck.launcher.stores.Store.BATTLENET.id
|
||||
|
||||
fun command(game: Library.SteamGame, added: AddedGames.Game?): Command? = when {
|
||||
game.library == Library.EPIC_LAUNCHER -> Command(EPIC, listOf("run"), game.name)
|
||||
game.library == Library.ADDED && game.source == com.droiddeck.launcher.stores.Store.BATTLENET.id ->
|
||||
viaBattleNet(game) ->
|
||||
game.storeId?.let(com.droiddeck.launcher.runtime.BattleNet::title)?.let { Command(BATTLENET, listOf("launch", it.code), game.name) }
|
||||
game.library == Library.ADDED -> added?.let { a -> a.steamAppId?.let { Command(PROTON_RUN, listOf("--app", it.toString()), a.name) } ?: addedCommand(a) }
|
||||
game.appId > 0 -> Command(PROTON_RUN, listOf("--app", game.appId.toString()), game.name)
|
||||
@@ -70,7 +75,7 @@ object NoSteamLaunch {
|
||||
|
||||
fun addedGame(context: Context, game: Library.SteamGame): AddedGames.Game? {
|
||||
val id = game.appId.toLong() and 0xFFFFFFFFL
|
||||
val one = game.gameFiles?.let { AddedGames.single(context, it.path) }
|
||||
val one = game.gameFiles?.let { AddedGames.single(context, it.path, reuse = true) }
|
||||
return one?.takeIf { settingsId(it) == id } ?: AddedGames.scan(context).firstOrNull { settingsId(it) == id }
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user