feat: choose Steam or Desktop to open when DroidDeck starts (#1993)

This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-11-02 07:03:02 -05:00
1 parent 55da0afd06
commit 2bc6985ae3
37 files changed
+103 -87

No files matched your search

@@ -960,10 +960,17 @@ object SessionPrefs {
prefs(context).edit().apply { if (name == null) remove("bootMovieCustomName") else putString("bootMovieCustomName", name) }.apply()
}
fun runSteamAtStartup(context: Context): Boolean = prefs(context).getBoolean("runSteamAtStartup", false)
const val STARTUP_OFF = ""
const val STARTUP_STEAM = "steam"
const val STARTUP_DESKTOP = "desktop"
fun setRunSteamAtStartup(context: Context, on: Boolean) {
prefs(context).edit().putBoolean("runSteamAtStartup", on).apply()
fun startupSession(context: Context): String {
val p = prefs(context)
return p.getString("startupSession", null) ?: if (p.getBoolean("runSteamAtStartup", false)) STARTUP_STEAM else STARTUP_OFF
}
fun setStartupSession(context: Context, id: String) {
prefs(context).edit().putString("startupSession", id).remove("runSteamAtStartup").apply()
}
fun addedGamesDirs(context: Context): List<String> {
@@ -11,7 +11,7 @@ object SettingsReset {
private const val TAG = "SettingsReset"
internal val SESSION_KEYS = setOf(
"orientation", "launcherFullscreen", "animations", "theme", "runSteamAtStartup", "addedGamesArt",
"orientation", "launcherFullscreen", "animations", "theme", "runSteamAtStartup", "startupSession", "addedGamesArt",
"dualScreenMode", "dualScreenSessionMode", "dualScreenLauncher", "dualScreenSessionControls",
"gameStoresEnabled", "gameStoresSpeedTier", "gameStoresParallel", "storesOpenTab", "storesShowMature",
"storesInstallLanguage",