diff --git a/README.md b/README.md index 6f7b6dbaaa..1473653c81 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ DroidDeck brings the SteamOS experience to Android: Valve's Steam client in Big ## Requirements and install -Use Android 9 or newer on a supported Adreno device (730 or newer, or 8xx). Adreno 6xx is experimental: DirectX 11 uses DXVK 2 and may run, and DirectX 12 games can still crash. Mali, Xclipse, PowerVR, and Adreno 710 are unsupported. No root is required. Allow about 3 GB for the runtime and 1.1 GB more for the desktop and emulators. Install the APK from [Releases](https://github.com/Droid-Deck/DroidDeck/releases), install the Linux runtime, then press **Play** and sign in. Steam downloads on first launch. Install **Desktop & apps** to use the desktop and emulators. The **Store** installs Linux apps and games from Flathub (ARM64 builds) with Flatpak; with additional options to install Appimages and set up scripts. **Stores** (Setup › Stores › "Show Stores in the rail") signs in to GOG, Epic Games and Amazon Games, browses their catalogs and libraries, downloads games into the Games storage and adds each one to the Steam client as a non-Steam game, so it launches through Proton like everything else; the cog on its chip row sets which tab a store opens on, whether installs go to Steam, and the download speed tier. +Use Android 9 or newer on a supported Adreno device (730 or newer, or 8xx). Adreno 6xx is experimental: DirectX 11 uses DXVK 2 and may run, and DirectX 12 games can still crash. Mali, Xclipse, PowerVR, and Adreno 710 are unsupported. No root is required. Allow about 3 GB for the runtime and 1.1 GB more for the desktop and emulators. Install the APK from [Releases](https://github.com/Droid-Deck/DroidDeck/releases), install the Linux runtime, then press **Play** and sign in. Steam downloads on first launch. Install **Desktop & apps** to use the desktop and emulators. The **Store** installs Linux apps and games from Flathub (ARM64 builds) with Flatpak; with additional options to install Appimages and set up scripts. **Stores** (Setup › Stores › "Show Stores in the rail") signs in to GOG, Epic Games and Amazon Games, browses their catalogs and libraries, downloads games into the Games storage and adds each one to the Steam client as a non-Steam game, so it launches through Proton like everything else; the cog on its chip row sets which tab a store opens on and the download speed tier. Before Steam launches, you must turn off **Restrict child processes** in Developer options. If this option is not available in developer settings (Android 12 and 13 devices), first launch of Steam will present a "Fix it for me" button, which will help automate the setup process. diff --git a/app/src/main/java/com/droiddeck/launcher/MainActivity.kt b/app/src/main/java/com/droiddeck/launcher/MainActivity.kt index 3758034f79..271a9fec72 100644 --- a/app/src/main/java/com/droiddeck/launcher/MainActivity.kt +++ b/app/src/main/java/com/droiddeck/launcher/MainActivity.kt @@ -165,7 +165,6 @@ class MainActivity : ComponentActivity() { private var animationsEnabled by mutableStateOf(true) private var storeEnabled by mutableStateOf(false) private var gameStoresEnabled by mutableStateOf(false) - private var gameStoresAddToSteam by mutableStateOf(true) private var gameStoresSpeedTier by mutableStateOf("fast") private var storesOpenTab by mutableStateOf(SessionPrefs.STORES_OPEN_LIBRARY) private var mic by mutableStateOf(false) @@ -528,7 +527,6 @@ class MainActivity : ComponentActivity() { animationsEnabled = SessionPrefs.animationsEnabled(this) storeEnabled = SessionPrefs.storeEnabled(this) gameStoresEnabled = SessionPrefs.gameStoresEnabled(this) - gameStoresAddToSteam = SessionPrefs.gameStoresAddToSteam(this) gameStoresSpeedTier = SessionPrefs.gameStoresSpeedTier(this) storesOpenTab = SessionPrefs.storesOpenTab(this) applyLauncherFullscreen() @@ -585,7 +583,6 @@ class MainActivity : ComponentActivity() { animationsEnabled = animationsEnabled, storeEnabled = storeEnabled, gameStoresEnabled = gameStoresEnabled, - gameStoresAddToSteam = gameStoresAddToSteam, gameStoresSpeedTier = gameStoresSpeedTier, storesOpenTab = storesOpenTab, storeDownloadsActive = com.droiddeck.launcher.stores.StoresState.activeDownloads, @@ -717,7 +714,6 @@ class MainActivity : ComponentActivity() { }, onStoreEnabled = { on -> SessionPrefs.setStoreEnabled(this, on); storeEnabled = on }, onGameStoresEnabled = { on -> SessionPrefs.setGameStoresEnabled(this, on); gameStoresEnabled = on; if (on) com.droiddeck.launcher.stores.StoresState.refresh(this) }, - onGameStoresAddToSteam = { on -> SessionPrefs.setGameStoresAddToSteam(this, on); gameStoresAddToSteam = on }, onGameStoresSpeedTier = { tier -> SessionPrefs.setGameStoresSpeedTier(this, tier); gameStoresSpeedTier = tier }, onStoresOpenTab = { tab -> SessionPrefs.setStoresOpenTab(this, tab); storesOpenTab = tab }, onLibraryChanged = { refreshAddedGames(); refresh() }, diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/AddedGames.kt b/app/src/main/java/com/droiddeck/launcher/frontend/AddedGames.kt index 446ef5724a..2c402e2cd5 100644 --- a/app/src/main/java/com/droiddeck/launcher/frontend/AddedGames.kt +++ b/app/src/main/java/com/droiddeck/launcher/frontend/AddedGames.kt @@ -143,9 +143,8 @@ object AddedGames { private fun scanGame(context: Context, folder: File, out: MutableList) { run { + // A store install carries a sidecar; every one of them is a shortcut. val sidecar = StoreGameSidecar.read(folder) - // A store install the user keeps out of Steam: not a shortcut, so not listed here. - if (sidecar != null && !sidecar.addToSteam) return val candidates = candidates(folder) val picked = SessionPrefs.addedGameExe(context, folder.path) val chosen = picked.takeIf { it.isNotEmpty() }?.let { File(it) }?.takeIf { it.isFile } diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt index 0d1c639926..fc103d55e0 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt @@ -60,13 +60,6 @@ object SessionPrefs { prefs(context).edit().putBoolean("gameStoresEnabled", on).apply() } - /** Whether a game a store installs is added to the Steam client's library as a shortcut. On by default. */ - fun gameStoresAddToSteam(context: Context): Boolean = prefs(context).getBoolean("gameStoresAddToSteam", true) - - fun setGameStoresAddToSteam(context: Context, on: Boolean) { - prefs(context).edit().putBoolean("gameStoresAddToSteam", on).apply() - } - /** The store download engine's speed tier (stores/download/StoreDownloadTier ids); Fast unless chosen otherwise. */ fun gameStoresSpeedTier(context: Context): String = prefs(context).getString("gameStoresSpeedTier", "fast") ?: "fast" diff --git a/app/src/main/java/com/droiddeck/launcher/stores/StoreGameSidecar.kt b/app/src/main/java/com/droiddeck/launcher/stores/StoreGameSidecar.kt index 5a97ee0ddf..a7602ac566 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/StoreGameSidecar.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/StoreGameSidecar.kt @@ -12,8 +12,8 @@ import java.io.File * the shortcut after the store's title and to tag the game with its [store]. [launcher] is the * small .bat the install writes when the game needs arguments or environment at launch (Epic's * identity arguments, Amazon's FuelPump variables): a Steam shortcut can only carry a fixed Exe, - * so the launcher is what the shortcut runs and [exe] is what it starts. [addToSteam] off keeps - * the game out of the client's library (Setup › Stores, or the game page's "Add to Steam"). + * so the launcher is what the shortcut runs and [exe] is what it starts. Every store install is a + * Steam shortcut; there is no switch for it (an `addToSteam` field in an older sidecar is ignored). * * Paths are relative to the game folder with forward slashes, so the folder can move between * storage volumes and stay valid. @@ -28,7 +28,6 @@ class StoreGameSidecar( val env: Map = emptyMap(), val installVersion: String = "", val installedAt: Long = 0L, - val addToSteam: Boolean = true, val cover: String? = null, val hero: String? = null, /** Per-store identifiers the launcher needs again (Epic namespace / catalog id, Amazon entitlement). */ @@ -40,9 +39,9 @@ class StoreGameSidecar( fun copy( exe: String = this.exe, launcher: String? = this.launcher, args: List = this.args, env: Map = this.env, installVersion: String = this.installVersion, - installedAt: Long = this.installedAt, addToSteam: Boolean = this.addToSteam, - cover: String? = this.cover, hero: String? = this.hero, extra: Map = this.extra, - ) = StoreGameSidecar(store, id, title, exe, launcher, args, env, installVersion, installedAt, addToSteam, cover, hero, extra) + installedAt: Long = this.installedAt, cover: String? = this.cover, hero: String? = this.hero, + extra: Map = this.extra, + ) = StoreGameSidecar(store, id, title, exe, launcher, args, env, installVersion, installedAt, cover, hero, extra) fun toJson(): JSONObject = JSONObject().apply { put("version", VERSION) @@ -55,7 +54,6 @@ class StoreGameSidecar( if (env.isNotEmpty()) put("env", JSONObject(env as Map<*, *>)) if (installVersion.isNotEmpty()) put("installVersion", installVersion) if (installedAt > 0L) put("installedAt", installedAt) - put("addToSteam", addToSteam) if (!cover.isNullOrEmpty()) put("cover", cover) if (!hero.isNullOrEmpty()) put("hero", hero) if (extra.isNotEmpty()) put("extra", JSONObject(extra as Map<*, *>)) @@ -102,7 +100,6 @@ class StoreGameSidecar( store, id, title, exe, launcher, args, env, installVersion = o.optString("installVersion", ""), installedAt = o.optLong("installedAt", 0L), - addToSteam = o.optBoolean("addToSteam", true), cover = o.optString("cover", "").ifEmpty { null }, hero = o.optString("hero", "").ifEmpty { null }, extra = extra, diff --git a/app/src/main/java/com/droiddeck/launcher/stores/StoreInstalls.kt b/app/src/main/java/com/droiddeck/launcher/stores/StoreInstalls.kt index 3d190797b2..dcc770c4b6 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/StoreInstalls.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/StoreInstalls.kt @@ -5,7 +5,6 @@ import android.util.Log import com.droiddeck.launcher.frontend.AddedGames import com.droiddeck.launcher.frontend.LibraryCache import com.droiddeck.launcher.frontend.Library -import com.droiddeck.launcher.session.SessionPrefs import java.io.File /** @@ -28,8 +27,7 @@ object StoreInstalls { */ fun complete(context: Context, folder: File, sidecar: StoreGameSidecar) { val app = context.applicationContext - val withLauncher = StoreLaunch.writeLauncher(folder, sidecar) - withLauncher.copy(addToSteam = sidecar.addToSteam && SessionPrefs.gameStoresAddToSteam(app)).write(folder) + StoreLaunch.writeLauncher(folder, sidecar).write(folder) // The art first, so the listing written below already carries it for the client's grid. StoreArt.fetchInto(folder, sidecar) register(app) @@ -48,17 +46,6 @@ object StoreInstalls { } } - /** Flips whether the game is a Steam shortcut; the listing follows. Off the main thread. */ - fun setAddToSteam(context: Context, game: InstalledStoreGame, on: Boolean, onDone: () -> Unit) { - val app = context.applicationContext - Thread({ - game.sidecar.copy(addToSteam = on).write(game.folder) - register(app) - StoresState.logLine("${if (on) "added" else "removed"} Steam shortcut for \"${game.sidecar.title}\"") - StoresState.post(onDone) - }, "stores-steam-toggle").start() - } - /** * Removes a store game: its folder with the sidecar, then the shortcut (the listing without * it makes the writer drop the entry; the live client is asked too). Blocking. diff --git a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndGames.kt b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndGames.kt index 4b10fff073..60a3255415 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndGames.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndGames.kt @@ -223,7 +223,7 @@ private fun ColumnScope.GameHeroCopy(g: Library.SteamGame, titleSize: androidx.c Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) { SourceChip(g.source) Text( - (lastPlayedText(g.lastPlayed) ?: libraryLabel(g.library)).uppercase(), + (lastPlayedText(g.lastPlayed) ?: libraryLabel(g)).uppercase(), fontSize = 12.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 1.2.sp, color = LocalPalette.current.signal, maxLines = 1, overflow = TextOverflow.Ellipsis, ) @@ -336,11 +336,15 @@ private fun playedSpan(lastPlayed: Long): String? { ).toString() } +/** + * Where a never-played game lives, beside its source chip: Steam's library, the Games storage for + * a store install (the chip names the store), "Custom game" for a folder the user added. + */ @Composable -private fun libraryLabel(library: String): String = when (library) { - "internal" -> stringResource(R.string.games_internal) - Library.ADDED -> stringResource(R.string.games_added) - else -> library +private fun libraryLabel(g: Library.SteamGame): String = when { + g.library != Library.ADDED -> if (g.library == "internal") stringResource(R.string.games_internal) else g.library + g.source != Library.ADDED -> stringResource(R.string.games_store_storage) + else -> stringResource(R.string.games_custom) } /** diff --git a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndScreen.kt b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndScreen.kt index deaafbb205..05e6cc4b18 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndScreen.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndScreen.kt @@ -131,8 +131,6 @@ class FrontEndState( val storeEnabled: Boolean = false, /** The Stores section (GOG, Epic Games, Amazon Games), turned on in Setup. */ val gameStoresEnabled: Boolean = false, - /** Setup › Stores: a game a store installs is added to Steam's library as a shortcut. */ - val gameStoresAddToSteam: Boolean = true, /** Setup › Stores: the download engine's speed tier (stores/download/StoreDownloadTier ids). */ val gameStoresSpeedTier: String = "fast", /** Setup › Stores: the tab a signed-in store opens on (SessionPrefs.STORES_OPEN_LIBRARY / STORE). */ @@ -190,7 +188,6 @@ class FrontEndActions( val onAnimationsEnabled: (Boolean) -> Unit = {}, val onStoreEnabled: (Boolean) -> Unit = {}, val onGameStoresEnabled: (Boolean) -> Unit = {}, - val onGameStoresAddToSteam: (Boolean) -> Unit = {}, val onGameStoresSpeedTier: (String) -> Unit = {}, val onStoresOpenTab: (String) -> Unit = {}, /** The Games list rebuilt now: a store install or removal changed what is on disk. */ diff --git a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndSetup.kt b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndSetup.kt index 00c0b08d27..e59de4b687 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndSetup.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndSetup.kt @@ -373,11 +373,7 @@ internal fun SetupPanel( host, "stores-enabled", stringResource(R.string.setup_stores_show), stringResource(R.string.setup_stores_show_hint), s.gameStoresEnabled, ) { a.onGameStoresEnabled(it) } - ToggleRow( - host, "stores-add-to-steam", stringResource(R.string.setup_stores_add_to_steam), - stringResource(R.string.setup_stores_add_to_steam_hint), s.gameStoresAddToSteam, - ) { a.onGameStoresAddToSteam(it) } - // The same three rows as the Stores page's own cog, for whoever looks here first. + // The same rows as the Stores page's own cog, for whoever looks here first. SettingsRow(stringResource(R.string.setup_stores_open_on), stringResource(R.string.setup_stores_open_on_hint)) { SegmentedTabs( listOf(SessionPrefs.STORES_OPEN_LIBRARY to stringResource(R.string.stores_tab_library), SessionPrefs.STORES_OPEN_STORE to stringResource(R.string.stores_tab_store)), diff --git a/app/src/main/java/com/droiddeck/launcher/ui/StoresDetail.kt b/app/src/main/java/com/droiddeck/launcher/ui/StoresDetail.kt index ae1cee04d5..72e7b6350e 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/StoresDetail.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/StoresDetail.kt @@ -39,7 +39,6 @@ import coil.compose.AsyncImage import com.droiddeck.launcher.R import com.droiddeck.launcher.stores.CatalogItem import com.droiddeck.launcher.stores.Store -import com.droiddeck.launcher.stores.StoreInstalls import com.droiddeck.launcher.stores.StoresState import com.droiddeck.launcher.stores.download.DownloadState import com.droiddeck.launcher.stores.formatBytes @@ -84,10 +83,8 @@ internal fun StoreGameDetail(store: Store, key: String, s: FrontEndState, a: Fro when { installed != null -> { PrimaryButton(stringResource(R.string.games_launch), main = true, icon = Icons.Filled.PlayArrow, enabled = !s.busy) { launchStoreGame(ctx, store, id, s, a) } - val inSteam = installed.sidecar.addToSteam - SecondaryButton(if (inSteam) stringResource(R.string.stores_in_steam) else stringResource(R.string.stores_add_to_steam)) { - StoreInstalls.setAddToSteam(ctx, installed, !inSteam) { StoresState.refresh(ctx); a.onLibraryChanged() } - } + // Every install is a shortcut; the chip just says so. + ActionChip(stringResource(R.string.stores_in_steam), ok = true) s.steamGames.firstOrNull { it.source == store.id && it.storeId == id }?.protonPrefix?.takeIf { it.isDirectory }?.let { dir -> SecondaryButton(stringResource(R.string.games_prefix)) { a.onBrowseFiles(dir) } } @@ -146,12 +143,7 @@ internal fun StoreGameDetail(store: Store, key: String, s: FrontEndState, a: Fro Store.AMAZON -> stringResource(R.string.stores_kv_launched_by_amazon) Store.GOG -> stringResource(R.string.stores_kv_launched_by_value) }) - KeyValue(stringResource(R.string.stores_kv_steam), when { - installed != null && installed.sidecar.addToSteam -> stringResource(R.string.stores_kv_steam_on) - installed != null -> stringResource(R.string.stores_kv_steam_off) - s.gameStoresAddToSteam -> stringResource(R.string.stores_kv_steam_on) - else -> stringResource(R.string.stores_kv_steam_off) - }) + KeyValue(stringResource(R.string.stores_kv_steam), stringResource(R.string.stores_kv_steam_on)) } } if (wide) Row(horizontalArrangement = Arrangement.spacedBy(24.dp)) { diff --git a/app/src/main/java/com/droiddeck/launcher/ui/StoresDownloads.kt b/app/src/main/java/com/droiddeck/launcher/ui/StoresDownloads.kt index e0759ad741..76ee75cf42 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/StoresDownloads.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/StoresDownloads.kt @@ -198,8 +198,9 @@ private fun SettingCard(label: String, note: String, control: @Composable () -> } /** - * The chip row's cog: the section's own settings in a small card - which tab a store opens on, - * whether installs go to Steam, the speed tier. Setup › Stores repeats them under its gate. + * The chip row's cog: the section's own settings in a small card - which tab a store opens on + * and the speed tier. Setup › Stores repeats them under its gate. Every install is added to Steam; + * that is not a choice. */ @Composable internal fun StoresSettingsDialog(s: FrontEndState, a: FrontEndActions, onDismiss: () -> Unit) { @@ -215,9 +216,6 @@ internal fun StoresSettingsDialog(s: FrontEndState, a: FrontEndActions, onDismis s.storesOpenTab, ) { a.onStoresOpenTab(it) } } - SettingsRow(stringResource(R.string.setup_stores_add_to_steam), stringResource(R.string.setup_stores_add_to_steam_hint)) { - ToggleSwitch(s.gameStoresAddToSteam, label = stringResource(R.string.setup_stores_add_to_steam)) { a.onGameStoresAddToSteam(it) } - } SettingsRow(stringResource(R.string.setup_stores_speed), stringResource(R.string.setup_stores_speed_hint)) { SegmentedTabs(StoreDownloadTier.ALL.map { it.id to stringResource(it.label) }, s.gameStoresSpeedTier) { a.onGameStoresSpeedTier(it) } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a0a6552371..4556a10f02 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -926,6 +926,8 @@ Last played %1$s Internal storage Added game + Custom game + Games storage The best pair for this GPU, kept up to date Pick a pair yourself Checking for drivers… @@ -1965,8 +1967,6 @@ Stores Show Stores in the rail GOG, Epic Games and Amazon Games libraries, with the download manager. - Add installed store games to Steam - Creates a non-Steam shortcut so the game shows in Steam\'s Deck UI with Steam Input. Open a store on Which tab a signed-in store opens when its chip is picked. Download speed tier @@ -2029,7 +2029,6 @@ in your library store ✓ In Steam - Add to Steam Uninstall Press again to uninstall Steam picks the game up when it next starts; launch it from there, or start Steam now. @@ -2052,8 +2051,7 @@ Steam and Proton · Epic sign-in per launch, EOS overlay off Steam and Proton · Amazon Games Services variables set Steam - shortcut added on install (Deck UI + Steam Input) - no shortcut (Stores settings) + added to Steam on install (Deck UI + Steam Input) No downloads. Install something from a library. Paused Queued diff --git a/app/src/test/java/com/droiddeck/launcher/frontend/AddedGamesStoreScanTest.kt b/app/src/test/java/com/droiddeck/launcher/frontend/AddedGamesStoreScanTest.kt index fde8bb6d31..6284086c7e 100644 --- a/app/src/test/java/com/droiddeck/launcher/frontend/AddedGamesStoreScanTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/frontend/AddedGamesStoreScanTest.kt @@ -19,12 +19,12 @@ import org.robolectric.annotation.Config class AddedGamesStoreScanTest { private val app get() = RuntimeEnvironment.getApplication() - private fun install(store: Store, id: String, title: String, exe: String, addToSteam: Boolean = true, launcher: Boolean = false): File { + private fun install(store: Store, id: String, title: String, exe: String, launcher: Boolean = false): File { SessionPrefs.setGameStorage(app, SessionPrefs.GAME_STORAGE_OFF, "") val folder = File(StoreInstallRoot.storeDir(StoreInstallRoot.installRoot(app), store), StoreInstallRoot.folderName(title, id)) File(folder, exe).apply { parentFile!!.mkdirs(); writeText("game") } File(folder, "unins000.exe").writeText("uninstaller") - var sidecar = StoreGameSidecar(store, id, title, exe, addToSteam = addToSteam, args = if (launcher) listOf("-EpicPortal") else emptyList()) + var sidecar = StoreGameSidecar(store, id, title, exe, args = if (launcher) listOf("-EpicPortal") else emptyList()) if (launcher) sidecar = StoreLaunch.writeLauncher(folder, sidecar) sidecar.write(folder) return folder @@ -51,9 +51,11 @@ class AddedGamesStoreScanTest { assertEquals(Store.EPIC.id, game.source) } - @Test fun aStoreGameKeptOutOfSteamIsNotListed() { - val folder = install(Store.AMAZON, "amzn1.adg.product.x", "Yakuza 0", "Yakuza0.exe", addToSteam = false) - assertTrue(AddedGames.scan(app).none { it.folder.absolutePath == folder.absolutePath }) + @Test fun anOlderSidecarsSteamSwitchIsIgnoredEveryInstallIsListed() { + val folder = install(Store.AMAZON, "amzn1.adg.product.x", "Yakuza 0", "Yakuza0.exe") + val file = StoreGameSidecar.file(folder) + file.writeText(file.readText().replaceFirst("{", "{\"addToSteam\": false,")) + assertTrue(AddedGames.scan(app).any { it.folder.absolutePath == folder.absolutePath }) } @Test fun theListingCarriesTheLauncherAndTheTitle() { diff --git a/app/src/test/java/com/droiddeck/launcher/stores/StoreGameSidecarTest.kt b/app/src/test/java/com/droiddeck/launcher/stores/StoreGameSidecarTest.kt index bf1971db68..a3836dc941 100644 --- a/app/src/test/java/com/droiddeck/launcher/stores/StoreGameSidecarTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/stores/StoreGameSidecarTest.kt @@ -16,7 +16,7 @@ class StoreGameSidecarTest { private val sample = StoreGameSidecar( Store.EPIC, "abc123", "Celeste", "Celeste.exe", launcher = ".droiddeck-launch.bat", args = listOf("-EpicPortal", "-epicusername=\"Some One\""), env = mapOf("FOO" to "bar"), - installVersion = "1.4.0", installedAt = 1700000000L, addToSteam = false, cover = "https://x/c.jpg", + installVersion = "1.4.0", installedAt = 1700000000L, cover = "https://x/c.jpg", extra = mapOf("namespace" to "ns"), ) @@ -31,14 +31,13 @@ class StoreGameSidecarTest { assertEquals(sample.env, back.env) assertEquals("1.4.0", back.installVersion) assertEquals(1700000000L, back.installedAt) - assertFalse(back.addToSteam) assertEquals("https://x/c.jpg", back.cover) assertEquals("ns", back.extra["namespace"]) } @Test fun defaultsWhenFieldsAreAbsent() { - val back = StoreGameSidecar.parse("""{"store":"gog","id":"1","title":"T","exe":"bin\\game.exe"}""")!! - assertTrue(back.addToSteam) + val back = StoreGameSidecar.parse("""{"store":"gog","id":"1","title":"T","exe":"bin\\game.exe","addToSteam":false}""")!! + // An older sidecar's Steam switch is read past, not acted on. assertEquals("bin/game.exe", back.exe) assertNull(back.launcher) assertTrue(back.args.isEmpty()) diff --git a/docs/development/stores.md b/docs/development/stores.md index 72fbe29e70..bb337ea064 100644 --- a/docs/development/stores.md +++ b/docs/development/stores.md @@ -34,13 +34,14 @@ sidecar afterwards. "env": {"FUEL_DIR": "C:\\ProgramData\\Amazon Games Services\\Legacy"}, "installVersion": "1.4.0", "installedAt": 1759900000000, - "addToSteam": true, // false keeps the game out of the Steam client (and the Games tab) "cover": "https://...", "hero": "https://...", "extra": {"namespace": "...", "catalogItemId": "..."} } ``` `StoreGameSidecar.parse` refuses anything whose `exe` or `launcher` would point outside the folder. +Every store install is a Steam shortcut; an `addToSteam` field in a sidecar from an earlier build is +read past and ignored. ## Registration with Steam @@ -85,7 +86,6 @@ each manager runs its Java fetch loop. |---|---|---| | Show Stores in the rail | `SessionPrefs.gameStoresEnabled` (off) | Setup › Stores | | Open a store on: Library · Store | `SessionPrefs.storesOpenTab` (library) | the chip row's cog, Setup › Stores | -| Add installed store games to Steam | `SessionPrefs.gameStoresAddToSteam` (on) | the cog, Setup › Stores | | Download speed tier | `SessionPrefs.gameStoresSpeedTier` (fast) | the cog, Setup › Stores, Downloads | | Downloads at a time | `SessionPrefs.gameStoresParallel` (1) | Downloads | diff --git a/docs/progress-log.md b/docs/progress-log.md index 9e4935b825..3f4c979a8a 100644 --- a/docs/progress-log.md +++ b/docs/progress-log.md @@ -21,9 +21,14 @@ without it and Setup says "Stores engine not built"). downloading. The page is full width: four chips (GOG · Epic · Amazon · Downloads, a signed-in dot per store) and a cog at the row's end whose popup holds the section's own settings - which tab a store opens on (`storesOpenTab`, Library by default; applied on chip tap, never while the - user is switching tabs by hand), "Add installed store games to Steam" (`gameStoresAddToSteam`, - on), and the speed tier (`gameStoresSpeedTier`, Balanced / Fast / Max = 16 / 32 / 96 requests in - flight). Setup repeats the rows under the gate. A signed-out store shows its sign-in card first. + user is switching tabs by hand) and the speed tier (`gameStoresSpeedTier`, Balanced / Fast / + Max = 16 / 32 / 96 requests in flight). Setup repeats the rows under the gate. A signed-out store + shows its sign-in card first. Every install is added to Steam - the user's call: "Add to Steam + shouldn't be optional, automatic" - so the switch an earlier build had (`gameStoresAddToSteam`, + the sidecar's `addToSteam`, the page's "Add to Steam" button) is gone; an older sidecar's field + is read past and ignored, and the game page shows a passive "In Steam" chip. The Games hero's + eyebrow for a never-played store game reads "Games storage" (the chip names the store), and + "Custom game" for a hand-added folder; Steam titles keep their library label. - **A store game is an added game.** The install lands at `/Games//` (the SD library's folder when one is chosen, else the runtime's own `/root/Games/Stores`) with a `.droiddeck-store.json` sidecar (store, id, title, exe, launcher, args, env, version,