mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 12:28:40 +00:00
feat(boot-movie): add a Shuffle switch backed by Steam's startup movie shuffle setting (#2462)
* feat(boot-movie): add a Shuffle switch backed by Steam's startup movie shuffle setting * test(boot-movie): keep unrelated settings unchanged * fix(boot-movie): keep the Shuffle choice across reset, unreadable configs and running sessions * fix(boot-movie): track the Shuffle baseline per Steam home and only for values staging wrote * fix(boot-movie): adopt a Shuffle change made in the inactive Steam home before staging overwrites it * fix(boot-movie): keep the 60 fps note under the Installed movies row
This commit is contained in:
1 parent
cbcf39d7c2
commit
03812bb3b7
41 files changed
+372
-108
No files matched your search
@@ -150,8 +150,37 @@ object BootMovie {
|
||||
folder.listFiles()?.forEach { if (it.name != keep) it.delete() }
|
||||
}
|
||||
|
||||
internal fun syncShuffleFromSteam(context: Context, config: File) = syncShuffleFromSteam(context, listOf(config))
|
||||
|
||||
// Staging writes Shuffle and its baseline under the same lock, so a poll never reads a half-staged value as Steam's.
|
||||
internal fun syncShuffleFromSteam(context: Context, configs: List<File>) = synchronized(SessionFiles.STEAM_CONFIG) {
|
||||
val read = configs.mapNotNull { config -> SessionFiles.startupMovieShuffle(config)?.let { config to it } }
|
||||
val (known, unseen) = read.partition { (config, _) -> SessionPrefs.bootMovieShuffleSeen(context, config) != null }
|
||||
var changed = false
|
||||
known.forEach { (config, steam) ->
|
||||
if (SessionPrefs.bootMovieShuffleSeen(context, config) != steam) {
|
||||
SessionPrefs.setBootMovieShuffle(context, steam)
|
||||
changed = true
|
||||
}
|
||||
SessionPrefs.setBootMovieShuffleSeen(context, config, steam)
|
||||
}
|
||||
// A config read for the first time only sets the choice when no known config changed, so it cannot undo a change.
|
||||
unseen.forEach { (config, steam) ->
|
||||
if (!changed && SessionPrefs.bootMovieShuffle(context) != steam) {
|
||||
SessionPrefs.setBootMovieShuffle(context, steam)
|
||||
changed = true
|
||||
}
|
||||
SessionPrefs.setBootMovieShuffleSeen(context, config, steam)
|
||||
}
|
||||
}
|
||||
|
||||
fun syncFromSteam(context: Context): Boolean {
|
||||
val named = SessionFiles.startupMovieLocalPath(BootMovieLibrary.steamConfig(context)) ?: return false
|
||||
val active = BootMovieLibrary.steamConfig(context)
|
||||
syncShuffleFromSteam(
|
||||
context,
|
||||
BootMovieLibrary.steamRoots(context).map { File(it, "config/config.vdf") }.filter { it != active } + active,
|
||||
)
|
||||
val named = SessionFiles.startupMovieLocalPath(active) ?: return false
|
||||
val seen = SessionPrefs.bootMovieSteamSeen(context)
|
||||
if (named == seen) return false
|
||||
SessionPrefs.setBootMovieSteamSeen(context, named)
|
||||
|
||||
@@ -14,6 +14,9 @@ import com.droiddeck.launcher.runtime.ProotFastPath
|
||||
import java.io.File
|
||||
|
||||
object SessionFiles {
|
||||
// Session start and Flatpak staging can both rewrite Steam's config.vdf; one writer at a time.
|
||||
internal val STEAM_CONFIG = Any()
|
||||
|
||||
private const val TAG = "SessionFiles"
|
||||
private const val NO_PAD_SWITCH = "Download/droiddeck-no-pad"
|
||||
const val DIRECTAUDIO_DIR = "usr/local/lib/directaudio"
|
||||
@@ -357,6 +360,11 @@ object SessionFiles {
|
||||
"staged=$bigPictureMovieInstalled done=$done steam=${home.path} config: $before -> ${startupMoviePath(config)}",
|
||||
)
|
||||
if (startsSession) {
|
||||
synchronized(STEAM_CONFIG) {
|
||||
val shuffle = SessionPrefs.bootMovieShuffle(context)
|
||||
setStartupMovieShuffle(config, shuffle)
|
||||
if (startupMovieShuffle(config) == shuffle) SessionPrefs.setBootMovieShuffleSeen(context, config, shuffle)
|
||||
}
|
||||
disableIdleSleep(home)
|
||||
seedUserDefaults(home)
|
||||
}
|
||||
@@ -369,28 +377,30 @@ object SessionFiles {
|
||||
}
|
||||
|
||||
internal fun resetMissingStartupMovie(config: File, force: Boolean): Boolean {
|
||||
if (!config.isFile) return true
|
||||
val text = runCatching { config.readText() }.getOrElse {
|
||||
Log.w(TAG, "could not read Steam config to reset the startup movie", it)
|
||||
return false
|
||||
}
|
||||
val movie = activeStartupMovie(text) ?: return true
|
||||
val block = text.substring(movie.keyStart, movie.close + 1)
|
||||
val path = scalar(block, "LocalPath").orEmpty()
|
||||
if (path.isEmpty()) return true
|
||||
val missing = File(config.parentFile, "uioverrides/movies/" + path.removePrefix(BOOT_MOVIES_DIR))
|
||||
val gone = path.startsWith(BOOT_MOVIES_DIR) && !missing.isFile && (force || path == BOOT_MOVIE_PATH)
|
||||
if (!gone) return false
|
||||
val newline = if (text.contains("\r\n")) "\r\n" else "\n"
|
||||
val updated = setScalar(setScalar(block, "MovieID", "0", newline), "LocalPath", "", newline)
|
||||
val staged = File(config.parentFile, config.name + ".staged")
|
||||
return try {
|
||||
staged.writeText(text.replaceRange(movie.keyStart, movie.close + 1, updated))
|
||||
(staged.renameTo(config)).also { if (!it) staged.delete() }
|
||||
} catch (e: Exception) {
|
||||
staged.delete()
|
||||
Log.w(TAG, "could not reset Steam startup movie selection", e)
|
||||
false
|
||||
synchronized(STEAM_CONFIG) {
|
||||
if (!config.isFile) return true
|
||||
val text = runCatching { config.readText() }.getOrElse {
|
||||
Log.w(TAG, "could not read Steam config to reset the startup movie", it)
|
||||
return false
|
||||
}
|
||||
val movie = activeStartupMovie(text) ?: return true
|
||||
val block = text.substring(movie.keyStart, movie.close + 1)
|
||||
val path = scalar(block, "LocalPath").orEmpty()
|
||||
if (path.isEmpty()) return true
|
||||
val missing = File(config.parentFile, "uioverrides/movies/" + path.removePrefix(BOOT_MOVIES_DIR))
|
||||
val gone = path.startsWith(BOOT_MOVIES_DIR) && !missing.isFile && (force || path == BOOT_MOVIE_PATH)
|
||||
if (!gone) return false
|
||||
val newline = if (text.contains("\r\n")) "\r\n" else "\n"
|
||||
val updated = setScalar(setScalar(block, "MovieID", "0", newline), "LocalPath", "", newline)
|
||||
val staged = File(config.parentFile, config.name + ".staged")
|
||||
return try {
|
||||
staged.writeText(text.replaceRange(movie.keyStart, movie.close + 1, updated))
|
||||
(staged.renameTo(config)).also { if (!it) staged.delete() }
|
||||
} catch (e: Exception) {
|
||||
staged.delete()
|
||||
Log.w(TAG, "could not reset Steam startup movie selection", e)
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -491,6 +501,42 @@ object SessionFiles {
|
||||
return scalar(text.substring(movie.keyStart, movie.close + 1), "LocalPath")
|
||||
}
|
||||
|
||||
internal fun startupMovieShuffle(config: File): Boolean? {
|
||||
val text = runCatching { config.readText() }.getOrNull() ?: return null
|
||||
val movie = activeStartupMovie(text) ?: return false
|
||||
return scalar(text.substring(movie.keyStart, movie.close + 1), "Shuffle") == "1"
|
||||
}
|
||||
|
||||
internal fun withStartupMovieShuffle(text: String, on: Boolean): String {
|
||||
val newline = if (text.contains("\r\n")) "\r\n" else "\n"
|
||||
val value = if (on) "1" else "0"
|
||||
return listOfNotNull(customizationMovie(text), olderMovie(text)).sortedByDescending { it.keyStart }.fold(text) { acc, movie ->
|
||||
val block = acc.substring(movie.keyStart, movie.close + 1)
|
||||
if (!on && scalar(block, "Shuffle") == null) acc else acc.replaceRange(movie.keyStart, movie.close + 1, setScalar(block, "Shuffle", value, newline))
|
||||
}
|
||||
}
|
||||
|
||||
internal fun setStartupMovieShuffle(config: File, on: Boolean): Boolean {
|
||||
synchronized(STEAM_CONFIG) {
|
||||
if (!config.isFile) return false
|
||||
val text = runCatching { config.readText() }.getOrElse {
|
||||
Log.w(TAG, "could not read Steam config to set the startup movie shuffle", it)
|
||||
return false
|
||||
}
|
||||
val updated = withStartupMovieShuffle(text, on)
|
||||
if (updated == text) return true
|
||||
val staged = File(config.parentFile, config.name + ".staged")
|
||||
return try {
|
||||
staged.writeText(updated)
|
||||
staged.renameTo(config).also { if (!it) staged.delete() }
|
||||
} catch (e: Exception) {
|
||||
staged.delete()
|
||||
Log.w(TAG, "could not set Steam startup movie shuffle", e)
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal fun startupMovieBlock(config: File): String? {
|
||||
val text = runCatching { config.readText() }.getOrNull() ?: return null
|
||||
val parts = listOfNotNull(
|
||||
@@ -513,69 +559,71 @@ object SessionFiles {
|
||||
}
|
||||
|
||||
internal fun ensureStartupMovieDefault(config: File, force: Boolean = false): Boolean {
|
||||
val path = BOOT_MOVIE_PATH
|
||||
val legacyPath = "/uioverrides/movies/droiddeck-startup.webm"
|
||||
var text = if (config.isFile) runCatching { config.readText() }.getOrElse {
|
||||
Log.w(TAG, "could not read Steam config for startup movie", it)
|
||||
return false
|
||||
} else ""
|
||||
val newline = if (text.contains("\r\n")) "\r\n" else "\n"
|
||||
val custom = customizationMovie(text)
|
||||
val active = custom ?: olderMovie(text)
|
||||
if (active != null) {
|
||||
val block = text.substring(active.keyStart, active.close + 1)
|
||||
val selectedId = scalar(block, "MovieID")
|
||||
val selectedPath = scalar(block, "LocalPath")
|
||||
if (selectedPath == path && custom != null) {
|
||||
Log.i(TAG, "Steam startup movie is set to DroidDeck")
|
||||
return true
|
||||
}
|
||||
val legacyDefault = selectedId == "0" && selectedPath == legacyPath
|
||||
val hasExplicitSelection =
|
||||
(!selectedId.isNullOrEmpty() && selectedId != "0") || !selectedPath.isNullOrEmpty()
|
||||
if (!force && !legacyDefault && hasExplicitSelection && selectedPath != path) {
|
||||
Log.i(TAG, "Steam startup movie selection preserved")
|
||||
synchronized(STEAM_CONFIG) {
|
||||
val path = BOOT_MOVIE_PATH
|
||||
val legacyPath = "/uioverrides/movies/droiddeck-startup.webm"
|
||||
var text = if (config.isFile) runCatching { config.readText() }.getOrElse {
|
||||
Log.w(TAG, "could not read Steam config for startup movie", it)
|
||||
return false
|
||||
}
|
||||
}
|
||||
val targets = listOfNotNull(customizationMovie(text), olderMovie(text)).sortedByDescending { it.keyStart }
|
||||
for (target in targets) text = pointAt(text, target, path, newline)
|
||||
if (olderMovie(text) == null) {
|
||||
val steam = findSteamBlock(text)
|
||||
if (steam == null) {
|
||||
if (text.isNotBlank() && customizationMovie(text) == null) {
|
||||
Log.w(TAG, "Steam config has no Steam settings block; startup movie default not set")
|
||||
} else ""
|
||||
val newline = if (text.contains("\r\n")) "\r\n" else "\n"
|
||||
val custom = customizationMovie(text)
|
||||
val active = custom ?: olderMovie(text)
|
||||
if (active != null) {
|
||||
val block = text.substring(active.keyStart, active.close + 1)
|
||||
val selectedId = scalar(block, "MovieID")
|
||||
val selectedPath = scalar(block, "LocalPath")
|
||||
if (selectedPath == path && custom != null) {
|
||||
Log.i(TAG, "Steam startup movie is set to DroidDeck")
|
||||
return true
|
||||
}
|
||||
val legacyDefault = selectedId == "0" && selectedPath == legacyPath
|
||||
val hasExplicitSelection =
|
||||
(!selectedId.isNullOrEmpty() && selectedId != "0") || !selectedPath.isNullOrEmpty()
|
||||
if (!force && !legacyDefault && hasExplicitSelection && selectedPath != path) {
|
||||
Log.i(TAG, "Steam startup movie selection preserved")
|
||||
return false
|
||||
}
|
||||
if (text.isBlank()) {
|
||||
text = "\"InstallConfigStore\"${newline}{${newline}\t\"Software\"${newline}\t{${newline}\t\t\"Valve\"${newline}\t\t{${newline}\t\t\t\"Steam\"${newline}\t\t\t{${newline}"
|
||||
val section = startupMovieSection("\t\t\t\t", path, newline)
|
||||
text += section + newline + "\t\t\t}" + newline + "\t\t}" + newline + "\t}" + newline + "}"
|
||||
}
|
||||
val targets = listOfNotNull(customizationMovie(text), olderMovie(text)).sortedByDescending { it.keyStart }
|
||||
for (target in targets) text = pointAt(text, target, path, newline)
|
||||
if (olderMovie(text) == null) {
|
||||
val steam = findSteamBlock(text)
|
||||
if (steam == null) {
|
||||
if (text.isNotBlank() && customizationMovie(text) == null) {
|
||||
Log.w(TAG, "Steam config has no Steam settings block; startup movie default not set")
|
||||
return false
|
||||
}
|
||||
if (text.isBlank()) {
|
||||
text = "\"InstallConfigStore\"${newline}{${newline}\t\"Software\"${newline}\t{${newline}\t\t\"Valve\"${newline}\t\t{${newline}\t\t\t\"Steam\"${newline}\t\t\t{${newline}"
|
||||
val section = startupMovieSection("\t\t\t\t", path, newline)
|
||||
text += section + newline + "\t\t\t}" + newline + "\t\t}" + newline + "\t}" + newline + "}"
|
||||
}
|
||||
} else {
|
||||
val lineStart = text.lastIndexOf('\n', steam.close).let { if (it < 0) 0 else it + 1 }
|
||||
val indent = text.substring(lineStart, steam.close).takeWhile { it == '\t' || it == ' ' }
|
||||
val section = startupMovieSection(indent + "\t", path, newline)
|
||||
text = text.substring(0, lineStart) + section + newline + indent + text.substring(lineStart)
|
||||
}
|
||||
} else {
|
||||
val lineStart = text.lastIndexOf('\n', steam.close).let { if (it < 0) 0 else it + 1 }
|
||||
val indent = text.substring(lineStart, steam.close).takeWhile { it == '\t' || it == ' ' }
|
||||
val section = startupMovieSection(indent + "\t", path, newline)
|
||||
text = text.substring(0, lineStart) + section + newline + indent + text.substring(lineStart)
|
||||
}
|
||||
}
|
||||
if (customizationMovie(text) == null) text = withCustomization(text, path, newline)
|
||||
val staged = File(config.parentFile, config.name + ".staged")
|
||||
return try {
|
||||
config.parentFile?.mkdirs()
|
||||
staged.writeText(text)
|
||||
if (!staged.renameTo(config)) {
|
||||
if (customizationMovie(text) == null) text = withCustomization(text, path, newline)
|
||||
val staged = File(config.parentFile, config.name + ".staged")
|
||||
return try {
|
||||
config.parentFile?.mkdirs()
|
||||
staged.writeText(text)
|
||||
if (!staged.renameTo(config)) {
|
||||
staged.delete()
|
||||
Log.e(TAG, "could not write Steam startup movie selection")
|
||||
false
|
||||
} else {
|
||||
Log.i(TAG, "Steam startup movie default selected")
|
||||
true
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
staged.delete()
|
||||
Log.e(TAG, "could not write Steam startup movie selection")
|
||||
Log.w(TAG, "could not write Steam startup movie selection", e)
|
||||
false
|
||||
} else {
|
||||
Log.i(TAG, "Steam startup movie default selected")
|
||||
true
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
staged.delete()
|
||||
Log.w(TAG, "could not write Steam startup movie selection", e)
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -661,32 +709,34 @@ object SessionFiles {
|
||||
private val IDLE_SLEEP_TIMERS = listOf("IdleSuspendBatterySeconds", "IdleSuspendACSeconds")
|
||||
|
||||
internal fun disableIdleSleep(steamHome: File): Boolean {
|
||||
val config = File(steamHome, "config/config.vdf")
|
||||
val text = runCatching { config.readText() }.getOrNull() ?: return false
|
||||
val newline = if (text.contains("\r\n")) "\r\n" else "\n"
|
||||
val steam = findSteamBlock(text) ?: return false
|
||||
val system = findObject(text, "system", steam.open + 1, steam.close)
|
||||
val updated = if (system != null) {
|
||||
val block = text.substring(system.keyStart, system.close + 1)
|
||||
text.replaceRange(system.keyStart, system.close + 1, IDLE_SLEEP_TIMERS.fold(block) { acc, key -> setScalar(acc, key, "0", newline) })
|
||||
} else {
|
||||
val lineStart = text.lastIndexOf('\n', steam.close).let { if (it < 0) 0 else it + 1 }
|
||||
val indent = text.substring(lineStart, steam.close).takeWhile { it == '\t' || it == ' ' } + "\t"
|
||||
val section = (listOf(indent + "\"system\"", indent + "{") +
|
||||
IDLE_SLEEP_TIMERS.map { "$indent\t\"$it\"\t\t\"0\"" } + (indent + "}")).joinToString(newline) + newline
|
||||
text.substring(0, lineStart) + section + text.substring(lineStart)
|
||||
}
|
||||
val staged = File(config.parentFile, config.name + ".staged")
|
||||
return try {
|
||||
if (updated != text) {
|
||||
staged.writeText(updated)
|
||||
if (!staged.renameTo(config)) { staged.delete(); return false }
|
||||
synchronized(STEAM_CONFIG) {
|
||||
val config = File(steamHome, "config/config.vdf")
|
||||
val text = runCatching { config.readText() }.getOrNull() ?: return false
|
||||
val newline = if (text.contains("\r\n")) "\r\n" else "\n"
|
||||
val steam = findSteamBlock(text) ?: return false
|
||||
val system = findObject(text, "system", steam.open + 1, steam.close)
|
||||
val updated = if (system != null) {
|
||||
val block = text.substring(system.keyStart, system.close + 1)
|
||||
text.replaceRange(system.keyStart, system.close + 1, IDLE_SLEEP_TIMERS.fold(block) { acc, key -> setScalar(acc, key, "0", newline) })
|
||||
} else {
|
||||
val lineStart = text.lastIndexOf('\n', steam.close).let { if (it < 0) 0 else it + 1 }
|
||||
val indent = text.substring(lineStart, steam.close).takeWhile { it == '\t' || it == ' ' } + "\t"
|
||||
val section = (listOf(indent + "\"system\"", indent + "{") +
|
||||
IDLE_SLEEP_TIMERS.map { "$indent\t\"$it\"\t\t\"0\"" } + (indent + "}")).joinToString(newline) + newline
|
||||
text.substring(0, lineStart) + section + text.substring(lineStart)
|
||||
}
|
||||
val staged = File(config.parentFile, config.name + ".staged")
|
||||
return try {
|
||||
if (updated != text) {
|
||||
staged.writeText(updated)
|
||||
if (!staged.renameTo(config)) { staged.delete(); return false }
|
||||
}
|
||||
true
|
||||
} catch (e: Exception) {
|
||||
staged.delete()
|
||||
Log.w(TAG, "could not disable Steam's idle sleep", e)
|
||||
false
|
||||
}
|
||||
true
|
||||
} catch (e: Exception) {
|
||||
staged.delete()
|
||||
Log.w(TAG, "could not disable Steam's idle sleep", e)
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -738,7 +788,7 @@ object SessionFiles {
|
||||
}
|
||||
|
||||
private fun setScalar(block: String, key: String, value: String, newline: String): String {
|
||||
val pattern = Regex("(?m)^([\\t ]*\"${Regex.escape(key)}\"[\\t ]+)\"[^\"\\r\\n]*\"([\\t ]*)$")
|
||||
val pattern = Regex("(?m)^([\\t ]*\"${Regex.escape(key)}\"[\\t ]+)\"[^\"\\r\\n]*\"([\\t ]*(?://[^\\r\\n]*)?)$")
|
||||
val match = pattern.find(block)
|
||||
if (match != null) return block.replaceRange(match.range, match.groupValues[1] + "\"" + value + "\"" + match.groupValues[2])
|
||||
val close = block.lastIndexOf('}')
|
||||
|
||||
@@ -1229,6 +1229,13 @@ object SessionPrefs {
|
||||
fun setBootMovieApplyNext(context: Context, on: Boolean) { prefs(context).edit().putBoolean("bootMovieApplyNext", on).apply() }
|
||||
fun bootMovieSteamSeen(context: Context): String? = prefs(context).getString("bootMovieSteamSeen", null)
|
||||
fun setBootMovieSteamSeen(context: Context, path: String) { prefs(context).edit().putString("bootMovieSteamSeen", path).apply() }
|
||||
fun bootMovieShuffle(context: Context): Boolean = prefs(context).getBoolean("bootMovieShuffle", false)
|
||||
fun setBootMovieShuffle(context: Context, on: Boolean) { prefs(context).edit().putBoolean("bootMovieShuffle", on).apply() }
|
||||
fun bootMovieShuffleSeen(context: Context, config: java.io.File): Boolean? {
|
||||
val key = "bootMovieShuffleSeen:${config.path}"
|
||||
return prefs(context).takeIf { it.contains(key) }?.getBoolean(key, false)
|
||||
}
|
||||
fun setBootMovieShuffleSeen(context: Context, config: java.io.File, on: Boolean) { prefs(context).edit().putBoolean("bootMovieShuffleSeen:${config.path}", on).apply() }
|
||||
fun bootMovieCustomName(context: Context): String? = prefs(context).getString("bootMovieCustomName", null)
|
||||
fun setBootMovieCustomName(context: Context, name: String?) {
|
||||
prefs(context).edit().apply { if (name == null) remove("bootMovieCustomName") else putString("bootMovieCustomName", name) }.apply()
|
||||
|
||||
@@ -26,7 +26,7 @@ object SettingsReset {
|
||||
"guestHostname", "fexPreset", "forceSsbs", "logs", "gameDebugLogsEnabled", "enhancedDiagnosticsNext", "storageDiagnostics", "buildWatermark",
|
||||
"upscaler", "upscaleSharpness", "screenEffects", "textureAnisotropy", "textureLodBias",
|
||||
"steamDownloadsInBackground", "steam_offline", "bootMovie", "bootMovieSound", "bootMovieVolume", "bootMovieSeconds", "skipBootMovie",
|
||||
"bootMovieApplyNext", "bootMovieSteamSeen",
|
||||
"bootMovieApplyNext", "bootMovieSteamSeen", "bootMovieShuffle",
|
||||
"questDefaultsV1", "telemetryAuto", "telemetryOff", "statsStrip", "statsHud", "bottomHud", "bottomStripMetrics", "bottomStripTabs", "statsDash", "statsSpeedUnit",
|
||||
)
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ internal fun BootMovieGroup(s: ModeSettings, a: ModeSettingsActions, host: MenuH
|
||||
TabChip(stringResource(R.string.boot_movie_tab_sound), tab == MovieTab.SOUND, Modifier.weight(1f)) { tab = MovieTab.SOUND }
|
||||
}
|
||||
when (tab) {
|
||||
MovieTab.INSTALLED -> InstalledTab(a)
|
||||
MovieTab.INSTALLED -> InstalledTab(a, host)
|
||||
MovieTab.IMPORT -> ImportTab(s, a)
|
||||
MovieTab.REPO -> RepoTab(a)
|
||||
MovieTab.SOUND -> SoundTab(s, a, host)
|
||||
@@ -170,7 +170,7 @@ internal fun BootMovieGroup(s: ModeSettings, a: ModeSettingsActions, host: MenuH
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun InstalledTab(a: ModeSettingsActions) {
|
||||
private fun InstalledTab(a: ModeSettingsActions, host: MenuHost) {
|
||||
var browsing by remember { mutableStateOf(false) }
|
||||
val snapshot = rememberMovies(0, a.onBootMovieChanged)
|
||||
val current = snapshot?.let { snap -> snap.entries.firstOrNull { it.id == snap.selected }?.title }
|
||||
@@ -183,6 +183,12 @@ private fun InstalledTab(a: ModeSettingsActions) {
|
||||
modifier = Modifier.padding(horizontal = 14.dp).padding(bottom = 12.dp),
|
||||
)
|
||||
val app = LocalContext.current.applicationContext
|
||||
var shuffle by remember { mutableStateOf(SessionPrefs.bootMovieShuffle(app)) }
|
||||
LaunchedEffect(snapshot) { shuffle = SessionPrefs.bootMovieShuffle(app) }
|
||||
ToggleRow(
|
||||
host, "boot-movie-shuffle", stringResource(R.string.boot_movie_shuffle),
|
||||
stringResource(R.string.common_applies_next_session), shuffle,
|
||||
) { on -> shuffle = on; SessionPrefs.setBootMovieShuffle(app, on) }
|
||||
val scope = rememberCoroutineScope()
|
||||
var saving by remember { mutableStateOf(false) }
|
||||
val debugging = remember { com.droiddeck.launcher.agent.AgentAccess.commandsEnabled(app) }
|
||||
|
||||
@@ -3563,6 +3563,7 @@
|
||||
<string name="boot_movie_sound">الصوت</string>
|
||||
<string name="boot_movie_skip">تخطي مقطع بدء التشغيل</string>
|
||||
<string name="boot_movie_skip_hint">استخدم مقطعًا أسود مدته 0.1 ثانية كمقطع بدء تشغيل Steam. يسري في الجلسة التالية.</string>
|
||||
<string name="boot_movie_shuffle">عشوائي</string>
|
||||
<string name="boot_movie_custom">فيديو خاص بك</string>
|
||||
<string name="boot_movie_custom_hint">MP4 أو MOV أو MKV أو WebM. تُحوَّل الصيغ الأخرى والملفات الأكبر من %1$d ميغابايت إلى WebM بدقة 720p على الجهاز، حتى %2$d ثانية.</string>
|
||||
<string name="boot_movie_import">استيراد</string>
|
||||
|
||||
@@ -3385,6 +3385,7 @@
|
||||
<string name="boot_movie_sound">Sonido</string>
|
||||
<string name="boot_movie_skip">Omitir el video de inicio</string>
|
||||
<string name="boot_movie_skip_hint">Usa un clip negro de 0.1 segundos como video de inicio de Steam. Se aplica en la próxima sesión.</string>
|
||||
<string name="boot_movie_shuffle">Aleatorio</string>
|
||||
<string name="boot_movie_custom">Tu propio video</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV o WebM. Otros formatos y archivos de más de %1$d MB se convierten a WebM 720p en el dispositivo, hasta %2$d segundos.</string>
|
||||
<string name="boot_movie_import">Importar</string>
|
||||
|
||||
@@ -3407,6 +3407,7 @@
|
||||
<string name="boot_movie_sound">Звук</string>
|
||||
<string name="boot_movie_skip">Пропусни стартовото видео</string>
|
||||
<string name="boot_movie_skip_hint">Използвай 0,1-секунден черен клип като стартовото видео на Steam. Влиза в сила при следващата сесия.</string>
|
||||
<string name="boot_movie_shuffle">Разбъркване</string>
|
||||
<string name="boot_movie_custom">Собствено видео</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV или WebM. Други формати и файлове над %1$d MB се конвертират на устройството до WebM 720p, до %2$d секунди.</string>
|
||||
<string name="boot_movie_import">Импортиране</string>
|
||||
|
||||
@@ -3485,6 +3485,7 @@
|
||||
<string name="boot_movie_sound">Zvuk</string>
|
||||
<string name="boot_movie_skip">Přeskočit úvodní video</string>
|
||||
<string name="boot_movie_skip_hint">Použije se 0,1sekundový černý klip jako úvodní video při spuštění aplikace Steam. Projeví se v příští relaci.</string>
|
||||
<string name="boot_movie_shuffle">Náhodné pořadí</string>
|
||||
<string name="boot_movie_custom">Vlastní video</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV nebo WebM. Jiné formáty a soubory nad %1$d MB se v zařízení převedou na WebM 720p, nejvýše %2$d sekund.</string>
|
||||
<string name="boot_movie_import">Importovat</string>
|
||||
|
||||
@@ -3407,6 +3407,7 @@
|
||||
<string name="boot_movie_sound">Lyd</string>
|
||||
<string name="boot_movie_skip">Spring opstartsfilmen over</string>
|
||||
<string name="boot_movie_skip_hint">Brug et sort klip på 0,1 sekund som opstartsfilm i Steam. Gælder fra næste session.</string>
|
||||
<string name="boot_movie_shuffle">Bland</string>
|
||||
<string name="boot_movie_custom">Din egen video</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV eller WebM. Andre formater og filer over %1$d MB konverteres til 720p-WebM på enheden, op til %2$d sekunder.</string>
|
||||
<string name="boot_movie_import">Importér</string>
|
||||
|
||||
@@ -3407,6 +3407,7 @@
|
||||
<string name="boot_movie_sound">Ton</string>
|
||||
<string name="boot_movie_skip">Startvideo überspringen</string>
|
||||
<string name="boot_movie_skip_hint">Ein schwarzes Video von 0,1 Sekunden als Steam-Startvideo verwenden. Gilt ab der nächsten Sitzung.</string>
|
||||
<string name="boot_movie_shuffle">Zufallswiedergabe</string>
|
||||
<string name="boot_movie_custom">Eigenes Video</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV oder WebM. Andere Formate und Dateien über %1$d MB werden auf dem Gerät in 720p-WebM umgewandelt, bis %2$d Sekunden.</string>
|
||||
<string name="boot_movie_import">Importieren</string>
|
||||
|
||||
@@ -3407,6 +3407,7 @@
|
||||
<string name="boot_movie_sound">Ήχος</string>
|
||||
<string name="boot_movie_skip">Παράλειψη ταινίας εκκίνησης</string>
|
||||
<string name="boot_movie_skip_hint">Χρησιμοποιεί ένα μαύρο κλιπ 0,1 δευτερολέπτου ως ταινία εκκίνησης του Steam. Εφαρμόζεται στην επόμενη συνεδρία.</string>
|
||||
<string name="boot_movie_shuffle">Τυχαία σειρά</string>
|
||||
<string name="boot_movie_custom">Δικό σας βίντεο</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV ή WebM. Άλλες μορφές και αρχεία πάνω από %1$d MB μετατρέπονται στη συσκευή σε WebM 720p, έως %2$d δευτερόλεπτα.</string>
|
||||
<string name="boot_movie_import">Εισαγωγή</string>
|
||||
|
||||
@@ -3446,6 +3446,7 @@
|
||||
<string name="boot_movie_sound">Sonido</string>
|
||||
<string name="boot_movie_skip">Omitir vídeo de inicio</string>
|
||||
<string name="boot_movie_skip_hint">Usa un clip negro de 0,1 segundos como vídeo de inicio de Steam. Se aplicará en la próxima sesión.</string>
|
||||
<string name="boot_movie_shuffle">Aleatorio</string>
|
||||
<string name="boot_movie_custom">Tu propio vídeo</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV o WebM. Otros formatos y archivos de más de %1$d MB se convierten a WebM 720p en el dispositivo, hasta %2$d segundos.</string>
|
||||
<string name="boot_movie_import">Importar</string>
|
||||
|
||||
@@ -3407,6 +3407,7 @@
|
||||
<string name="boot_movie_sound">Ääni</string>
|
||||
<string name="boot_movie_skip">Ohita käynnistysvideo</string>
|
||||
<string name="boot_movie_skip_hint">Käytä 0,1 sekunnin mustaa leikettä Steam-käynnistysvideona. Otetaan käyttöön seuraavassa istunnossa.</string>
|
||||
<string name="boot_movie_shuffle">Satunnainen</string>
|
||||
<string name="boot_movie_custom">Oma video</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV tai WebM. Muut muodot ja yli %1$d Mt:n tiedostot muunnetaan laitteella 720p-WebM-muotoon, enintään %2$d sekuntia.</string>
|
||||
<string name="boot_movie_import">Tuo</string>
|
||||
|
||||
@@ -3445,6 +3445,7 @@
|
||||
<string name="boot_movie_sound">Son</string>
|
||||
<string name="boot_movie_skip">Ignorer la vidéo de démarrage</string>
|
||||
<string name="boot_movie_skip_hint">Utilise un clip noir de 0,1 seconde comme vidéo de démarrage de Steam. S’applique à la prochaine session.</string>
|
||||
<string name="boot_movie_shuffle">Aléatoire</string>
|
||||
<string name="boot_movie_custom">Votre propre vidéo</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV ou WebM. Les autres formats et les fichiers de plus de %1$d Mo sont convertis en WebM 720p sur l\'appareil, jusqu\'à %2$d secondes.</string>
|
||||
<string name="boot_movie_import">Importer</string>
|
||||
|
||||
@@ -3407,6 +3407,7 @@
|
||||
<string name="boot_movie_sound">आवाज़</string>
|
||||
<string name="boot_movie_skip">बूट मूवी छोड़ें</string>
|
||||
<string name="boot_movie_skip_hint">Steam की स्टार्टअप मूवी के रूप में 0.1 सेकंड की काली क्लिप इस्तेमाल करें। अगले सत्र से लागू होगा।</string>
|
||||
<string name="boot_movie_shuffle">शफ़ल</string>
|
||||
<string name="boot_movie_custom">अपना वीडियो</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV या WebM. दूसरे फ़ॉर्मैट और %1$d MB से बड़ी फ़ाइलें डिवाइस पर 720p WebM में बदली जाती हैं, %2$d सेकंड तक।</string>
|
||||
<string name="boot_movie_import">इंपोर्ट करें</string>
|
||||
|
||||
@@ -3407,6 +3407,7 @@
|
||||
<string name="boot_movie_sound">Hang</string>
|
||||
<string name="boot_movie_skip">Indítási videó kihagyása</string>
|
||||
<string name="boot_movie_skip_hint">Egy 0,1 másodperces fekete klipet használ a Steam indítási videójaként. A következő munkamenetben lép érvénybe.</string>
|
||||
<string name="boot_movie_shuffle">Véletlen sorrend</string>
|
||||
<string name="boot_movie_custom">Saját videó</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV vagy WebM. Más formátumokat és a %1$d MB-nál nagyobb fájlokat az eszköz 720p WebM-re alakítja, legfeljebb %2$d másodpercig.</string>
|
||||
<string name="boot_movie_import">Importálás</string>
|
||||
|
||||
@@ -3378,6 +3378,7 @@
|
||||
<string name="boot_movie_sound">Suara</string>
|
||||
<string name="boot_movie_skip">Lewati video pembukaan</string>
|
||||
<string name="boot_movie_skip_hint">Gunakan klip hitam berdurasi 0,1 detik sebagai video pembukaan Steam. Berlaku pada sesi berikutnya.</string>
|
||||
<string name="boot_movie_shuffle">Acak</string>
|
||||
<string name="boot_movie_custom">Video sendiri</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV, atau WebM. Format lain dan file di atas %1$d MB dikonversi ke WebM 720p di perangkat, hingga %2$d detik.</string>
|
||||
<string name="boot_movie_import">Impor</string>
|
||||
|
||||
@@ -3445,6 +3445,7 @@
|
||||
<string name="boot_movie_sound">Audio</string>
|
||||
<string name="boot_movie_skip">Salta il video di avvio</string>
|
||||
<string name="boot_movie_skip_hint">Usa una clip nera di 0,1 secondi come video di avvio di Steam. Dalla sessione successiva.</string>
|
||||
<string name="boot_movie_shuffle">Casuale</string>
|
||||
<string name="boot_movie_custom">Il tuo video</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV o WebM. Altri formati e file oltre %1$d MB vengono convertiti in WebM 720p sul dispositivo, fino a %2$d secondi.</string>
|
||||
<string name="boot_movie_import">Importa</string>
|
||||
|
||||
@@ -3378,6 +3378,7 @@
|
||||
<string name="boot_movie_sound">サウンド</string>
|
||||
<string name="boot_movie_skip">起動ムービーをスキップ</string>
|
||||
<string name="boot_movie_skip_hint">0.1 秒の黒いクリップを Steam の起動ムービーとして使用します。次回セッションから適用されます。</string>
|
||||
<string name="boot_movie_shuffle">シャッフル</string>
|
||||
<string name="boot_movie_custom">自分のムービー</string>
|
||||
<string name="boot_movie_custom_hint">MP4、MOV、MKV、WebM。その他の形式や %1$d MB を超えるファイルは、端末上で 720p の WebM に変換されます(%2$d 秒まで)。</string>
|
||||
<string name="boot_movie_import">インポート</string>
|
||||
|
||||
@@ -3378,6 +3378,7 @@
|
||||
<string name="boot_movie_sound">소리</string>
|
||||
<string name="boot_movie_skip">시작 동영상 건너뛰기</string>
|
||||
<string name="boot_movie_skip_hint">0.1초짜리 검은 화면 클립을 Steam 시작 동영상으로 사용합니다. 다음 세션부터 적용됩니다.</string>
|
||||
<string name="boot_movie_shuffle">셔플</string>
|
||||
<string name="boot_movie_custom">내 동영상</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV 또는 WebM. 다른 형식과 %1$d MB를 넘는 파일은 기기에서 720p WebM으로 변환됩니다(최대 %2$d초).</string>
|
||||
<string name="boot_movie_import">가져오기</string>
|
||||
|
||||
@@ -3378,6 +3378,7 @@
|
||||
<string name="boot_movie_sound">Bunyi</string>
|
||||
<string name="boot_movie_skip">Langkau filem permulaan</string>
|
||||
<string name="boot_movie_skip_hint">Gunakan klip hitam 0.1 saat sebagai filem permulaan Steam. Berkuat kuasa pada sesi seterusnya.</string>
|
||||
<string name="boot_movie_shuffle">Rawak</string>
|
||||
<string name="boot_movie_custom">Video anda sendiri</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV atau WebM. Format lain dan fail melebihi %1$d MB ditukar kepada WebM 720p pada peranti, sehingga %2$d saat.</string>
|
||||
<string name="boot_movie_import">Import</string>
|
||||
|
||||
@@ -3407,6 +3407,7 @@
|
||||
<string name="boot_movie_sound">Lyd</string>
|
||||
<string name="boot_movie_skip">Hopp over oppstartsfilmen</string>
|
||||
<string name="boot_movie_skip_hint">Bruk et svart klipp på 0,1 sekunder som oppstartsfilmen til Steam. Trer i kraft neste økt.</string>
|
||||
<string name="boot_movie_shuffle">Tilfeldig rekkefølge</string>
|
||||
<string name="boot_movie_custom">Din egen video</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV eller WebM. Andre formater og filer over %1$d MB konverteres til 720p-WebM på enheten, opptil %2$d sekunder.</string>
|
||||
<string name="boot_movie_import">Importer</string>
|
||||
|
||||
@@ -3407,6 +3407,7 @@
|
||||
<string name="boot_movie_sound">Geluid</string>
|
||||
<string name="boot_movie_skip">Opstartvideo overslaan</string>
|
||||
<string name="boot_movie_skip_hint">Gebruik een zwart fragment van 0,1 seconde als opstartvideo van Steam. Wordt toegepast in de volgende sessie.</string>
|
||||
<string name="boot_movie_shuffle">Willekeurig</string>
|
||||
<string name="boot_movie_custom">Eigen video</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV of WebM. Andere formaten en bestanden boven %1$d MB worden op het apparaat omgezet naar 720p-WebM, tot %2$d seconden.</string>
|
||||
<string name="boot_movie_import">Importeren</string>
|
||||
|
||||
@@ -3485,6 +3485,7 @@
|
||||
<string name="boot_movie_sound">Dźwięk</string>
|
||||
<string name="boot_movie_skip">Pomiń film startowy</string>
|
||||
<string name="boot_movie_skip_hint">Użyj 0,1-sekundowego czarnego klipu jako filmu startowego Steam. Zacznie obowiązywać w następnej sesji.</string>
|
||||
<string name="boot_movie_shuffle">Losowo</string>
|
||||
<string name="boot_movie_custom">Własny film</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV lub WebM. Inne formaty i pliki powyżej %1$d MB są konwertowane na urządzeniu do WebM 720p, do %2$d sekund.</string>
|
||||
<string name="boot_movie_import">Importuj</string>
|
||||
|
||||
@@ -3445,6 +3445,7 @@
|
||||
<string name="boot_movie_sound">Som</string>
|
||||
<string name="boot_movie_skip">Ignorar o vídeo de arranque</string>
|
||||
<string name="boot_movie_skip_hint">Utilizar um clipe preto de 0,1 segundos como vídeo de arranque do Steam. Aplica-se na próxima sessão.</string>
|
||||
<string name="boot_movie_shuffle">Aleatório</string>
|
||||
<string name="boot_movie_custom">O seu próprio vídeo</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV ou WebM. Outros formatos e ficheiros acima de %1$d MB são convertidos para WebM 720p no dispositivo, até %2$d segundos.</string>
|
||||
<string name="boot_movie_import">Importar</string>
|
||||
|
||||
@@ -3453,6 +3453,7 @@
|
||||
<string name="boot_movie_sound">Som</string>
|
||||
<string name="boot_movie_skip">Pular vídeo de inicialização</string>
|
||||
<string name="boot_movie_skip_hint">Use um clipe preto de 0,1 segundo como vídeo de inicialização do Steam. Aplica-se na próxima sessão.</string>
|
||||
<string name="boot_movie_shuffle">Aleatório</string>
|
||||
<string name="boot_movie_custom">Seu próprio vídeo</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV ou WebM. Outros formatos e arquivos acima de %1$d MB são convertidos para WebM 720p no aparelho, até %2$d segundos.</string>
|
||||
<string name="boot_movie_import">Importar</string>
|
||||
|
||||
@@ -3446,6 +3446,7 @@
|
||||
<string name="boot_movie_sound">Sunet</string>
|
||||
<string name="boot_movie_skip">Omite filmul de pornire</string>
|
||||
<string name="boot_movie_skip_hint">Folosește un clip negru de 0,1 secunde ca film de pornire pentru Steam. Se aplică la următoarea sesiune.</string>
|
||||
<string name="boot_movie_shuffle">Aleatoriu</string>
|
||||
<string name="boot_movie_custom">Videoclipul tău</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV sau WebM. Alte formate și fișierele de peste %1$d MB sunt convertite pe dispozitiv în WebM 720p, până la %2$d secunde.</string>
|
||||
<string name="boot_movie_import">Importă</string>
|
||||
|
||||
@@ -3485,6 +3485,7 @@
|
||||
<string name="boot_movie_sound">Звук</string>
|
||||
<string name="boot_movie_skip">Пропускать стартовое видео</string>
|
||||
<string name="boot_movie_skip_hint">Использовать 0,1-секундный чёрный клип в качестве стартового видео Steam. Применится в следующем сеансе.</string>
|
||||
<string name="boot_movie_shuffle">Случайный порядок</string>
|
||||
<string name="boot_movie_custom">Своё видео</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV или WebM. Другие форматы и файлы больше %1$d МБ преобразуются на устройстве в WebM 720p, до %2$d секунд.</string>
|
||||
<string name="boot_movie_import">Импорт</string>
|
||||
|
||||
@@ -3407,6 +3407,7 @@
|
||||
<string name="boot_movie_sound">Ljud</string>
|
||||
<string name="boot_movie_skip">Hoppa över uppstartsfilmen</string>
|
||||
<string name="boot_movie_skip_hint">Använd ett svart klipp på 0,1 sekunder som uppstartsfilm för Steam. Tillämpas nästa session.</string>
|
||||
<string name="boot_movie_shuffle">Blanda</string>
|
||||
<string name="boot_movie_custom">Egen video</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV eller WebM. Andra format och filer över %1$d MB konverteras till 720p-WebM på enheten, upp till %2$d sekunder.</string>
|
||||
<string name="boot_movie_import">Importera</string>
|
||||
|
||||
@@ -3378,6 +3378,7 @@
|
||||
<string name="boot_movie_sound">เสียง</string>
|
||||
<string name="boot_movie_skip">ข้ามวิดีโอเริ่มต้น</string>
|
||||
<string name="boot_movie_skip_hint">ใช้คลิปสีดำความยาว 0.1 วินาทีเป็นวิดีโอเริ่มต้นของ Steam มีผลในเซสชันถัดไป</string>
|
||||
<string name="boot_movie_shuffle">สุ่ม</string>
|
||||
<string name="boot_movie_custom">วิดีโอของคุณเอง</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV หรือ WebM รูปแบบอื่นและไฟล์ที่ใหญ่กว่า %1$d MB จะถูกแปลงเป็น WebM 720p บนอุปกรณ์ ความยาวไม่เกิน %2$d วินาที</string>
|
||||
<string name="boot_movie_import">นำเข้า</string>
|
||||
|
||||
@@ -3407,6 +3407,7 @@
|
||||
<string name="boot_movie_sound">Ses</string>
|
||||
<string name="boot_movie_skip">Açılış videosunu atla</string>
|
||||
<string name="boot_movie_skip_hint">Steam\'in açılış videosu olarak 0,1 saniyelik siyah bir klip kullanılır. Sonraki oturumda geçerli olur.</string>
|
||||
<string name="boot_movie_shuffle">Karıştır</string>
|
||||
<string name="boot_movie_custom">Kendi videon</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV veya WebM. Diğer biçimler ve %1$d MB üzeri dosyalar cihazda 720p WebM\'e dönüştürülür, en fazla %2$d saniye.</string>
|
||||
<string name="boot_movie_import">İçe aktar</string>
|
||||
|
||||
@@ -3485,6 +3485,7 @@
|
||||
<string name="boot_movie_sound">Звук</string>
|
||||
<string name="boot_movie_skip">Пропускати відео запуску</string>
|
||||
<string name="boot_movie_skip_hint">Використовувати 0,1-секундний чорний кліп як вступне відео Steam. Застосовується з наступного сеансу.</string>
|
||||
<string name="boot_movie_shuffle">Випадковий порядок</string>
|
||||
<string name="boot_movie_custom">Власне відео</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV або WebM. Інші формати й файли понад %1$d МБ перетворюються на пристрої на WebM 720p, до %2$d секунд.</string>
|
||||
<string name="boot_movie_import">Імпорт</string>
|
||||
|
||||
@@ -3378,6 +3378,7 @@
|
||||
<string name="boot_movie_sound">Âm thanh</string>
|
||||
<string name="boot_movie_skip">Bỏ qua phim khởi động</string>
|
||||
<string name="boot_movie_skip_hint">Dùng đoạn clip đen 0,1 giây làm phim khởi động của Steam. Áp dụng trong phiên chạy tiếp theo.</string>
|
||||
<string name="boot_movie_shuffle">Ngẫu nhiên</string>
|
||||
<string name="boot_movie_custom">Video của bạn</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV hoặc WebM. Định dạng khác và tệp trên %1$d MB được chuyển sang WebM 720p ngay trên thiết bị, tối đa %2$d giây.</string>
|
||||
<string name="boot_movie_import">Nhập</string>
|
||||
|
||||
@@ -3378,6 +3378,7 @@
|
||||
<string name="boot_movie_sound">声音</string>
|
||||
<string name="boot_movie_skip">跳过启动影片</string>
|
||||
<string name="boot_movie_skip_hint">用一段 0.1 秒的黑色片段作为 Steam 的启动影片。下次会话生效。</string>
|
||||
<string name="boot_movie_shuffle">随机播放</string>
|
||||
<string name="boot_movie_custom">自定义视频</string>
|
||||
<string name="boot_movie_custom_hint">MP4、MOV、MKV 或 WebM。其他格式及超过 %1$d MB 的文件会在设备上转换为 720p WebM,最长 %2$d 秒。</string>
|
||||
<string name="boot_movie_import">导入</string>
|
||||
|
||||
@@ -3375,6 +3375,7 @@
|
||||
<string name="boot_movie_sound">聲音</string>
|
||||
<string name="boot_movie_skip">跳過啟動影片</string>
|
||||
<string name="boot_movie_skip_hint">以 0.1 秒全黑片段作為 Steam 的啟動影片。下次工作階段生效。</string>
|
||||
<string name="boot_movie_shuffle">隨機播放</string>
|
||||
<string name="boot_movie_custom">自訂影片</string>
|
||||
<string name="boot_movie_custom_hint">MP4、MOV、MKV 或 WebM。其他格式及超過 %1$d MB 的檔案會在裝置上轉換為 720p WebM,最長 %2$d 秒。</string>
|
||||
<string name="boot_movie_import">匯入</string>
|
||||
|
||||
@@ -3375,6 +3375,7 @@
|
||||
<string name="boot_movie_sound">聲音</string>
|
||||
<string name="boot_movie_skip">跳過啟動影片</string>
|
||||
<string name="boot_movie_skip_hint">使用 0.1 秒的黑色影片片段作為 Steam 的啟動影片。將於下次工作階段生效。</string>
|
||||
<string name="boot_movie_shuffle">隨機播放</string>
|
||||
<string name="boot_movie_custom">自訂影片</string>
|
||||
<string name="boot_movie_custom_hint">MP4、MOV、MKV 或 WebM。其他格式及超過 %1$d MB 的檔案會在裝置上轉換為 720p WebM,最長 %2$d 秒。</string>
|
||||
<string name="boot_movie_import">匯入</string>
|
||||
|
||||
@@ -3621,6 +3621,7 @@
|
||||
<string name="boot_movie_sound">Sound</string>
|
||||
<string name="boot_movie_skip">Skip boot movie</string>
|
||||
<string name="boot_movie_skip_hint">Use a 0.1-second black clip as Steam’s startup movie. Applies next session.</string>
|
||||
<string name="boot_movie_shuffle">Shuffle</string>
|
||||
<string name="boot_movie_custom">Your own movie</string>
|
||||
<string name="boot_movie_custom_hint">MP4, MOV, MKV or WebM. Other formats and files over %1$d MB are converted to 720p WebM on the device, up to %2$d seconds.</string>
|
||||
<string name="boot_movie_import">Import</string>
|
||||
|
||||
@@ -94,6 +94,7 @@ class BootMovieTest {
|
||||
@Test fun resetCoversTheChoiceButNotTheImportedName() {
|
||||
assertTrue(SettingsReset.isSessionSetting("bootMovie"))
|
||||
assertTrue(SettingsReset.isSessionSetting("bootMovieSound"))
|
||||
assertTrue(SettingsReset.isSessionSetting("bootMovieShuffle"))
|
||||
assertFalse(SettingsReset.isSessionSetting("bootMovieCustomName"))
|
||||
}
|
||||
}
|
||||
@@ -63,4 +63,140 @@ class StartupMovieConfigTest {
|
||||
assertTrue(SessionFiles.resetMissingStartupMovie(file, false))
|
||||
assertNull(SessionFiles.startupMoviePath(file))
|
||||
}
|
||||
|
||||
@Test fun shuffleIsWrittenIntoBothMovieSectionsAndReadBack() {
|
||||
val file = config(SessionFiles.BOOT_MOVIE_PATH, "0", SessionFiles.BOOT_MOVIE_PATH)
|
||||
assertEquals(false, SessionFiles.startupMovieShuffle(file))
|
||||
assertTrue(SessionFiles.setStartupMovieShuffle(file, true))
|
||||
assertEquals(true, SessionFiles.startupMovieShuffle(file))
|
||||
assertEquals(2, Regex("\"Shuffle\"\\s+\"1\"").findAll(file.readText()).count())
|
||||
assertEquals(SessionFiles.BOOT_MOVIE_PATH, SessionFiles.startupMoviePath(file))
|
||||
}
|
||||
|
||||
@Test fun turningShuffleOffKeepsTheSelectedMovie() {
|
||||
val file = config(SessionFiles.BOOT_MOVIE_PATH, "0", "/uioverrides/movies/Undertale.webm")
|
||||
SessionFiles.setStartupMovieShuffle(file, true)
|
||||
assertTrue(SessionFiles.setStartupMovieShuffle(file, false))
|
||||
assertEquals(false, SessionFiles.startupMovieShuffle(file))
|
||||
assertEquals("/uioverrides/movies/Undertale.webm", SessionFiles.startupMoviePath(file))
|
||||
}
|
||||
|
||||
@Test fun shuffleOffLeavesAConfigWithoutTheKeyUntouched() {
|
||||
val file = config(SessionFiles.BOOT_MOVIE_PATH, "0", SessionFiles.BOOT_MOVIE_PATH)
|
||||
val before = file.readText()
|
||||
assertTrue(SessionFiles.setStartupMovieShuffle(file, false))
|
||||
assertEquals(before, file.readText())
|
||||
}
|
||||
|
||||
@Test fun shuffleDoesNotChangeOtherProgramSettings() {
|
||||
val file = config(SessionFiles.BOOT_MOVIE_PATH, "0", SessionFiles.BOOT_MOVIE_PATH)
|
||||
val text = file.readText().replace(
|
||||
"\t\t\t}\n\t\t}\n\t}\n",
|
||||
"\t\t\t}\n\t\t}\n\t\t\"OtherProgram\"\n\t\t{\n\t\t\t\"Shuffle\"\t\t\"0\"\n\t\t}\n\t}\n",
|
||||
)
|
||||
file.writeText(text)
|
||||
assertTrue(SessionFiles.setStartupMovieShuffle(file, true))
|
||||
val updated = file.readText()
|
||||
assertEquals(2, Regex("\"Shuffle\"\\s+\"1\"").findAll(updated).count())
|
||||
assertEquals(1, Regex("\"Shuffle\"\\s+\"0\"").findAll(updated).count())
|
||||
}
|
||||
|
||||
@Test fun shuffleIsNotAddedWhenThereIsNoMovieSection() {
|
||||
val file = folder.newFile().also { it.writeText("\"InstallConfigStore\"\n{\n}\n") }
|
||||
val before = file.readText()
|
||||
assertTrue(SessionFiles.setStartupMovieShuffle(file, true))
|
||||
assertEquals(before, file.readText())
|
||||
assertEquals(false, SessionFiles.startupMovieShuffle(file))
|
||||
}
|
||||
|
||||
@Test fun aShuffleChangedInSteamIsTakenOverAndOtherwiseTheChoiceIsKept() {
|
||||
val app = org.robolectric.RuntimeEnvironment.getApplication()
|
||||
app.getSharedPreferences("session", android.content.Context.MODE_PRIVATE).edit().clear().commit()
|
||||
val file = config(SessionFiles.BOOT_MOVIE_PATH, "0", SessionFiles.BOOT_MOVIE_PATH)
|
||||
BootMovie.syncShuffleFromSteam(app, file)
|
||||
assertFalse(SessionPrefs.bootMovieShuffle(app))
|
||||
SessionPrefs.setBootMovieShuffle(app, true)
|
||||
BootMovie.syncShuffleFromSteam(app, file)
|
||||
assertTrue(SessionPrefs.bootMovieShuffle(app))
|
||||
SessionFiles.setStartupMovieShuffle(file, true)
|
||||
BootMovie.syncShuffleFromSteam(app, file)
|
||||
SessionFiles.setStartupMovieShuffle(file, false)
|
||||
BootMovie.syncShuffleFromSteam(app, file)
|
||||
assertFalse(SessionPrefs.bootMovieShuffle(app))
|
||||
}
|
||||
|
||||
@Test fun anUnreadableConfigKeepsTheSavedShuffleChoice() {
|
||||
val app = org.robolectric.RuntimeEnvironment.getApplication()
|
||||
app.getSharedPreferences("session", android.content.Context.MODE_PRIVATE).edit().clear().commit()
|
||||
val file = config(SessionFiles.BOOT_MOVIE_PATH, "0", SessionFiles.BOOT_MOVIE_PATH)
|
||||
SessionPrefs.setBootMovieShuffle(app, true)
|
||||
SessionPrefs.setBootMovieShuffleSeen(app, file, true)
|
||||
val missing = File(folder.root, "missing.vdf")
|
||||
assertNull(SessionFiles.startupMovieShuffle(missing))
|
||||
BootMovie.syncShuffleFromSteam(app, missing)
|
||||
assertTrue(SessionPrefs.bootMovieShuffle(app))
|
||||
assertEquals(true, SessionPrefs.bootMovieShuffleSeen(app, file))
|
||||
}
|
||||
|
||||
@Test fun resetLeavesShuffleOffEvenWhenSteamStillHasItOn() {
|
||||
val app = org.robolectric.RuntimeEnvironment.getApplication()
|
||||
app.getSharedPreferences("session", android.content.Context.MODE_PRIVATE).edit().clear().commit()
|
||||
val file = config(SessionFiles.BOOT_MOVIE_PATH, "0", SessionFiles.BOOT_MOVIE_PATH)
|
||||
SessionFiles.setStartupMovieShuffle(file, true)
|
||||
SessionPrefs.setBootMovieShuffle(app, true)
|
||||
BootMovie.syncShuffleFromSteam(app, file)
|
||||
assertFalse(SettingsReset.isSessionSetting("bootMovieShuffleSeen:${file.path}"))
|
||||
app.getSharedPreferences("session", android.content.Context.MODE_PRIVATE).edit().remove("bootMovieShuffle").commit()
|
||||
BootMovie.syncShuffleFromSteam(app, file)
|
||||
assertFalse(SessionPrefs.bootMovieShuffle(app))
|
||||
}
|
||||
|
||||
@Test fun eachSteamHomeKeepsItsOwnShuffleBaseline() {
|
||||
val app = org.robolectric.RuntimeEnvironment.getApplication()
|
||||
app.getSharedPreferences("session", android.content.Context.MODE_PRIVATE).edit().clear().commit()
|
||||
val arm = config(SessionFiles.BOOT_MOVIE_PATH, "0", SessionFiles.BOOT_MOVIE_PATH)
|
||||
val x64 = config(SessionFiles.BOOT_MOVIE_PATH, "0", SessionFiles.BOOT_MOVIE_PATH)
|
||||
BootMovie.syncShuffleFromSteam(app, arm)
|
||||
BootMovie.syncShuffleFromSteam(app, x64)
|
||||
SessionFiles.setStartupMovieShuffle(arm, true)
|
||||
BootMovie.syncShuffleFromSteam(app, arm)
|
||||
assertTrue(SessionPrefs.bootMovieShuffle(app))
|
||||
BootMovie.syncShuffleFromSteam(app, x64)
|
||||
assertTrue(SessionPrefs.bootMovieShuffle(app))
|
||||
}
|
||||
|
||||
@Test fun aShuffleChangedInAnInactiveSteamHomeIsTakenOverBeforeTheActiveHome() {
|
||||
val app = org.robolectric.RuntimeEnvironment.getApplication()
|
||||
app.getSharedPreferences("session", android.content.Context.MODE_PRIVATE).edit().clear().commit()
|
||||
val inactive = config(SessionFiles.BOOT_MOVIE_PATH, "0", SessionFiles.BOOT_MOVIE_PATH)
|
||||
val active = config(SessionFiles.BOOT_MOVIE_PATH, "0", SessionFiles.BOOT_MOVIE_PATH)
|
||||
BootMovie.syncShuffleFromSteam(app, listOf(inactive, active))
|
||||
SessionFiles.setStartupMovieShuffle(inactive, true)
|
||||
BootMovie.syncShuffleFromSteam(app, listOf(inactive, active))
|
||||
assertTrue(SessionPrefs.bootMovieShuffle(app))
|
||||
}
|
||||
|
||||
@Test fun aChangeInAnInactiveHomeIsNotUndoneByAnActiveHomeReadForTheFirstTime() {
|
||||
val app = org.robolectric.RuntimeEnvironment.getApplication()
|
||||
app.getSharedPreferences("session", android.content.Context.MODE_PRIVATE).edit().clear().commit()
|
||||
val inactive = config(SessionFiles.BOOT_MOVIE_PATH, "0", SessionFiles.BOOT_MOVIE_PATH)
|
||||
val active = File(folder.root, "unreadable.vdf")
|
||||
BootMovie.syncShuffleFromSteam(app, listOf(inactive, active))
|
||||
SessionFiles.setStartupMovieShuffle(inactive, true)
|
||||
active.writeText(inactive.readText())
|
||||
SessionFiles.setStartupMovieShuffle(active, false)
|
||||
BootMovie.syncShuffleFromSteam(app, listOf(inactive, active))
|
||||
assertTrue(SessionPrefs.bootMovieShuffle(app))
|
||||
assertEquals(false, SessionPrefs.bootMovieShuffleSeen(app, active))
|
||||
}
|
||||
|
||||
@Test fun aShuffleLineWithATrailingCommentIsReplacedNotDuplicated() {
|
||||
val file = config(SessionFiles.BOOT_MOVIE_PATH, "0", SessionFiles.BOOT_MOVIE_PATH)
|
||||
file.writeText(file.readText().replace("\t\t\t\"LocalPath\"", "\t\t\t\"Shuffle\"\t\t\"1\" // set in Steam\n\t\t\t\"LocalPath\""))
|
||||
assertEquals(true, SessionFiles.startupMovieShuffle(file))
|
||||
assertTrue(SessionFiles.setStartupMovieShuffle(file, false))
|
||||
assertEquals(false, SessionFiles.startupMovieShuffle(file))
|
||||
assertEquals(1, Regex("\"Shuffle\"").findAll(file.readText().substringAfter("Customization")).count())
|
||||
assertTrue(file.readText().contains("\"0\" // set in Steam"))
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,9 @@ Settings → Boot movie has four tabs.
|
||||
|
||||
- **Installed**: "Browse" lists every movie Steam can play: DroidDeck's two, plus every `.webm` in Steam's
|
||||
`config/uioverrides/movies` folder (imported, installed from SteamDeckRepo, or put there by Steam). The list is re-read
|
||||
every two seconds, so a movie picked or removed inside Steam shows up, and a movie picked inside Steam becomes the choice.
|
||||
every two seconds, so a movie picked or removed inside Steam shows up, and a movie picked inside Steam becomes the choice. The Shuffle switch is Steam's own `Shuffle` setting (`startup_movie_shuffle` in
|
||||
Steam's client settings, `Shuffle` next to `MovieID` and `LocalPath`): it is written at the next session start, a change made in Steam is
|
||||
taken over, and with it off the selected movie plays as before.
|
||||
- **Import**: the same importer as before (copy, remux or on-device transcode to VP8/Opus). The result is written into
|
||||
Steam's movies folder, so Steam lists it as well.
|
||||
- **SteamDeckRepo**: browses `https://steamdeckrepo.com/api/posts` (`sort`, `device`, `search`, `page`; 12 posts a page).
|
||||
|
||||
Reference in new issue
Block a user