diff --git a/app/src/debug/java/com/droiddeck/launcher/ui/LauncherPreviews.kt b/app/src/debug/java/com/droiddeck/launcher/ui/LauncherPreviews.kt index 0ab0ab8216..c235f28d80 100644 --- a/app/src/debug/java/com/droiddeck/launcher/ui/LauncherPreviews.kt +++ b/app/src/debug/java/com/droiddeck/launcher/ui/LauncherPreviews.kt @@ -60,6 +60,35 @@ private fun BottomPanelBar() = PreviewHost { @DroidDeckPreviews @Composable private fun SessionMenuDockedDisplayPreview() = DockedMenu(SessionDrawerPage.DISPLAY) @DroidDeckPreviews @Composable private fun BottomPanelBarPreview() = BottomPanelBar() +/** The Stardew Valley companion page, fed with the mod's messages. */ +@Composable +private fun BottomStardew() = PreviewHost { + val S = com.droiddeck.launcher.companion.StardewCompanion + val state = listOf( + """{"type":"game_info","saveName":"Sunny Farm"}""", + """{"type":"sdv_day","season":"spring","day":5,"year":1,"weekday":"Fri","timeOfDay":1330,"weatherToday":"Sunny","gold":12500,"energy":200,"maxEnergy":270,"health":90,"maxHealth":100,"location":"Farm"}""", + """{"type":"sdv_inventory","selected":2,"items":[{"slot":0,"id":"(T)Axe","name":"Axe"},{"slot":1,"id":"(T)Hoe","name":"Hoe"},{"slot":2,"id":"(O)24","name":"Parsnip","count":15},{"slot":4,"id":"(O)388","name":"Wood","count":99}]}""", + """{"type":"sdv_villagers","villagers":[{"name":"Haley","birthdayIn":0},{"name":"Abigail","birthdayIn":3}]}""", + """{"type":"sdv_quests","quests":[{"title":"Introductions","objective":"Meet 28 people (12 of 28)"},{"title":"How To Win Friends","objective":"Give a gift to someone"}]}""", + ).fold(com.droiddeck.launcher.companion.StardewCompanion.State()) { st, m -> S.reduce(st, m) } + androidx.compose.foundation.layout.Box(Modifier.size(640.dp, 420.dp).background(androidx.compose.material3.MaterialTheme.colorScheme.background)) { StardewPanel(state) {} } +} + +@DroidDeckPreviews @Composable private fun BottomStardewPreview() = BottomStardew() + +/** The Fallout 4 companion page, fed with a Thor Pip-Boy data message. */ +@Composable +private fun BottomPipBoy() = PreviewHost { + val rpg = com.droiddeck.launcher.companion.RpgCompanion + val state = rpg.reduce(rpg.FALLOUT_4, com.droiddeck.launcher.companion.RpgCompanion.State(), """{"type":"data","id":"droiddeck","data":{ + "player.stats":{"level":23,"hp":245,"hpMax":310,"ap":88,"apMax":105,"rads":65,"caps":1834,"weight":187.4,"weightMax":260}, + "player.inventory":[{"id":"0x102","name":"Service Pistol","count":1,"equipped":true,"fav":1},{"id":"0x236","name":"Med Kit","count":7,"fav":0}, + {"id":"0x303","name":"Clean Water","count":4,"fav":2}],"radio":{"enabled":true}}}""") + androidx.compose.foundation.layout.Box(Modifier.size(640.dp, 420.dp).background(androidx.compose.material3.MaterialTheme.colorScheme.background)) { RpgPanel(state, {}, {}) } +} + +@DroidDeckPreviews @Composable private fun BottomPipBoyPreview() = BottomPipBoy() + /** The Library and Stores tabs read store accounts, which load on a background thread. */ private val storesLoaded = { com.droiddeck.launcher.stores.StoresState.accountsLoaded } @@ -80,4 +109,6 @@ internal val previewCases: List = listOf( PreviewCase("session-menu-docked") { DockedMenu(SessionDrawerPage.CONTROLLER) }, PreviewCase("session-menu-docked-display") { DockedMenu(SessionDrawerPage.DISPLAY) }, PreviewCase("bottom-panel-bar") { BottomPanelBar() }, + PreviewCase("bottom-companion-stardew") { BottomStardew() }, + PreviewCase("bottom-companion-pipboy") { BottomPipBoy() }, ) diff --git a/app/src/main/java/com/droiddeck/launcher/companion/CompanionLink.kt b/app/src/main/java/com/droiddeck/launcher/companion/CompanionLink.kt new file mode 100644 index 0000000000..c48cf0b567 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/companion/CompanionLink.kt @@ -0,0 +1,69 @@ +package com.droiddeck.launcher.companion + +import com.droiddeck.launcher.session.LoopbackWebSocket +import kotlinx.coroutines.currentCoroutineContext +import kotlinx.coroutines.delay +import kotlinx.coroutines.ensureActive +import kotlinx.coroutines.isActive +import kotlinx.coroutines.suspendCancellableCoroutine +import java.util.concurrent.atomic.AtomicReference +import kotlin.concurrent.thread +import kotlin.coroutines.resume + +class CompanionLink(private val port: Int, private val path: String = "/") { + private val socket = AtomicReference(null) + + val connected: Boolean get() = socket.get() != null + + private val sender = java.util.concurrent.Executors.newSingleThreadExecutor { r -> Thread(r, "companion-send-$port").apply { isDaemon = true } } + + fun send(text: String): Boolean { + val ws = socket.get() ?: return false + sender.execute { runCatching { ws.send(text) } } + return true + } + + fun close() { + sender.shutdown() + } + + suspend fun run(onConnected: (Boolean) -> Unit, onText: (String) -> Unit, hello: String? = null) { + while (currentCoroutineContext().isActive) { + val ws = runCatching { LoopbackWebSocket(port, path) }.getOrNull() + if (ws == null) { + delay(RETRY_MS) + continue + } + socket.set(ws) + onConnected(true) + try { + hello?.let { runCatching { ws.send(it) } } + readUntilClosed(ws, onText) + } finally { + socket.set(null) + runCatching { ws.close() } + onConnected(false) + } + currentCoroutineContext().ensureActive() + delay(RETRY_MS) + } + } + + private suspend fun readUntilClosed(ws: LoopbackWebSocket, onText: (String) -> Unit) = suspendCancellableCoroutine { cont -> + val reader = thread(name = "companion-$port", isDaemon = true) { + try { + while (true) onText(ws.receive() ?: break) + } catch (_: Exception) { + } + if (cont.isActive) cont.resume(Unit) + } + cont.invokeOnCancellation { + runCatching { ws.close() } + reader.interrupt() + } + } + + private companion object { + const val RETRY_MS = 3_000L + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/companion/RpgCompanion.kt b/app/src/main/java/com/droiddeck/launcher/companion/RpgCompanion.kt new file mode 100644 index 0000000000..1feca7c41f --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/companion/RpgCompanion.kt @@ -0,0 +1,99 @@ +package com.droiddeck.launcher.companion + +import org.json.JSONArray +import org.json.JSONObject + +/** Vitals and quick slots read from SkyrimWebSocket (Skyrim) or Thor Pip-Boy (Fallout 4), which share a subscribe protocol. */ +object RpgCompanion { + const val SKYRIM_SE = 489830L + const val FALLOUT_4 = 377160L + const val SKYRIM_PORT = 8765 + const val PIPBOY_PORT = 8767 + + data class Bar(val key: String, val value: Float, val max: Float) + + data class Slot(val key: String, val label: String, val detail: String, val active: Boolean) + + data class State( + val bars: List = emptyList(), + val level: Int? = null, + val facts: List> = emptyList(), + val slots: List = emptyList(), + val radio: Boolean? = null, + ) + + fun port(appId: Long): Int = if (appId == FALLOUT_4) PIPBOY_PORT else SKYRIM_PORT + + fun subscribe(appId: Long): String = if (appId == FALLOUT_4) { + JSONObject().put("type", "subscribe").put("id", SUB).put("settings", JSONObject().put("frequency", 500)) + .put("fields", JSONArray(listOf("player.stats", "player.inventory", "radio"))).toString() + } else { + val fields = JSONObject() + for ((alias, key) in SKYRIM_FIELDS) fields.put(alias, key) + JSONObject().put("type", "subscribe").put("id", SUB) + .put("settings", JSONObject().put("frequency", 500).put("sendOnChange", true)).put("fields", fields).toString() + } + + fun reduce(appId: Long, state: State, text: String): State { + val m = runCatching { JSONObject(text) }.getOrNull() ?: return state + if (m.optString("type") != "data" || m.optString("id") != SUB) return state + return if (appId == FALLOUT_4) pipBoy(state, m.optJSONObject("data") ?: return state) + else skyrim(state, m.optJSONObject("fields") ?: return state) + } + + fun trigger(appId: Long, slot: Slot, seq: Int): String = if (appId == FALLOUT_4) { + JSONObject().put("type", "command").put("id", "dd-$seq").put("command", "toggle") + .put("params", JSONObject().put("id", slot.key)).toString() + } else { + JSONObject().put("type", "command").put("id", "dd-$seq").put("command", "hotkey_trigger").put("slot", slot.key.toInt()).toString() + } + + fun radio(on: Boolean, seq: Int): String = + JSONObject().put("type", "command").put("id", "dd-$seq").put("command", "radio").put("params", JSONObject().put("enable", on)).toString() + + private fun skyrim(state: State, f: JSONObject): State { + fun bar(key: String) = if (f.has(key) && f.has("$key.max")) Bar(key, f.optDouble(key).toFloat(), f.optDouble("$key.max").toFloat()) else null + val bars = listOfNotNull(bar("health"), bar("magicka"), bar("stamina")).ifEmpty { state.bars } + val slots = f.optJSONArray("hotkeys")?.let { arr -> + List(arr.length()) { arr.optJSONObject(it) }.filterNotNull().filter { it.optBoolean("bound") }.map { + Slot(it.optInt("slot").toString(), it.optString("name"), it.optString("school").ifEmpty { it.optString("categoryType") }, false) + } + } ?: state.slots + val facts = buildList { + if (f.has("weight") && f.has("carry")) add("weight" to "%.0f / %.0f".format(f.optDouble("weight"), f.optDouble("carry"))) + }.ifEmpty { state.facts } + return state.copy(bars = bars, level = if (f.has("level")) f.optInt("level") else state.level, facts = facts, slots = slots) + } + + private fun pipBoy(state: State, d: JSONObject): State { + var next = state + d.optJSONObject("player.stats")?.let { s -> + next = next.copy( + bars = listOf(Bar("hp", s.optDouble("hp").toFloat(), s.optDouble("hpMax").toFloat()), + Bar("ap", s.optDouble("ap").toFloat(), s.optDouble("apMax").toFloat())), + level = s.optInt("level"), + facts = listOf("caps" to s.optInt("caps").toString(), "rads" to s.optInt("rads").toString(), + "weight" to "%.0f / %.0f".format(s.optDouble("weight"), s.optDouble("weightMax"))), + ) + } + d.optJSONArray("player.inventory")?.let { inv -> + next = next.copy(slots = List(inv.length()) { inv.optJSONObject(it) }.filterNotNull() + .filter { it.has("fav") && it.optInt("fav", -1) >= 0 } + .sortedBy { it.optInt("fav") } + .map { Slot(it.optString("id"), it.optString("name"), countText(it), it.optBoolean("equipped")) }) + } + d.optJSONObject("radio")?.let { next = next.copy(radio = it.optBoolean("enabled")) } + return next + } + + private fun countText(item: JSONObject): String = item.optInt("count", 1).let { if (it > 1) "×$it" else "" } + + private const val SUB = "droiddeck" + private val SKYRIM_FIELDS = listOf( + "health" to "ActorValue::kHealth", "health.max" to "ActorValue::kHealth::Permanent", + "magicka" to "ActorValue::kMagicka", "magicka.max" to "ActorValue::kMagicka::Permanent", + "stamina" to "ActorValue::kStamina", "stamina.max" to "ActorValue::kStamina::Permanent", + "level" to "Player::Level", "weight" to "Player::InventoryWeight", "carry" to "Player::CarryWeight", + "hotkeys" to "Hotkey::Items", + ) +} diff --git a/app/src/main/java/com/droiddeck/launcher/companion/StardewCompanion.kt b/app/src/main/java/com/droiddeck/launcher/companion/StardewCompanion.kt new file mode 100644 index 0000000000..be8aba5b1f --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/companion/StardewCompanion.kt @@ -0,0 +1,86 @@ +package com.droiddeck.launcher.companion + +import org.json.JSONArray +import org.json.JSONObject + +object StardewCompanion { + const val APP_ID = 413150L + const val PORT = 7786 + const val HOTBAR = 12 + + data class Day( + val season: String, val day: Int, val year: Int, val weekday: String, val time: Int, + val weather: String, val weatherTomorrow: String, val gold: Long, + val energy: Int, val maxEnergy: Int, val health: Int, val maxHealth: Int, val location: String, + ) + + data class Item(val slot: Int, val id: String, val name: String, val count: Int, val quality: Int) + + data class Quest(val title: String, val objective: String, val daysLeft: Int, val complete: Boolean) + + data class Birthday(val name: String, val npc: String, val days: Int) + + data class State( + val save: String? = null, + val day: Day? = null, + val selected: Int = 0, + val items: List = emptyList(), + val quests: List = emptyList(), + val birthdays: List = emptyList(), + val sprites: Map = emptyMap(), + ) { + val inGame: Boolean get() = !save.isNullOrEmpty() + val hotbar: List get() = List(HOTBAR) { slot -> items.firstOrNull { it.slot == slot && it.id.isNotEmpty() } } + } + + fun reduce(state: State, text: String): State { + val m = runCatching { JSONObject(text) }.getOrNull() ?: return state + return when (m.optString("type")) { + "game_info" -> state.copy(save = m.optString("saveName")) + "sdv_day" -> state.copy(day = Day( + m.optString("season"), m.optInt("day"), m.optInt("year"), m.optString("weekday"), m.optInt("timeOfDay"), + m.optString("weatherToday"), m.optString("weatherTomorrow"), m.optLong("gold"), + m.optInt("energy"), m.optInt("maxEnergy"), m.optInt("health"), m.optInt("maxHealth"), m.optString("location"), + )) + "sdv_inventory" -> state.copy(selected = m.optInt("selected"), items = objects(m.optJSONArray("items")).map { + Item(it.optInt("slot"), it.optString("id"), it.optString("name"), it.optInt("count", 1), it.optInt("quality")) + }) + "sdv_quests" -> state.copy(quests = objects(m.optJSONArray("quests")).map { + Quest(it.optString("title"), it.optString("objective"), it.optInt("daysLeft", -1), flag(it, "complete")) + }) + "sdv_villagers" -> state.copy(birthdays = objects(m.optJSONArray("villagers")) + .filter { it.has("birthdayIn") && it.optInt("birthdayIn", -1) in 0..7 } + .map { Birthday(it.optString("name"), it.optString("npc"), it.optInt("birthdayIn")) } + .sortedBy { it.days }) + "sdv_sprite" -> { + val id = m.optString("id") + val png = m.optString("png") + if (id.isEmpty() || png.isEmpty()) state else state.copy(sprites = state.sprites + (id to png)) + } + else -> state + } + } + + fun selectSlot(slot: Int): String = JSONObject().put("type", "select_slot").put("slot", slot).toString() + + fun refresh(): String = JSONObject().put("type", "refresh").toString() + + /** 610 is 6:10 am; the game's clock runs past midnight up to 2600. */ + fun clock(time: Int, twelveHour: Boolean): String { + val hours = time / 100 % 24 + val minutes = time % 100 + if (!twelveHour) return "%d:%02d".format(hours, minutes) + val h = if (hours % 12 == 0) 12 else hours % 12 + return "%d:%02d %s".format(h, minutes, if (hours < 12) "am" else "pm") + } + + private fun flag(o: JSONObject, name: String): Boolean = when (val v = o.opt(name)) { + is Boolean -> v + is Number -> v.toInt() != 0 + is String -> v == "1" || v.equals("true", true) + else -> false + } + + private fun objects(array: JSONArray?): List = + if (array == null) emptyList() else List(array.length()) { array.optJSONObject(it) }.filterNotNull() +} diff --git a/app/src/main/java/com/droiddeck/launcher/input/SecondScreenMode.kt b/app/src/main/java/com/droiddeck/launcher/input/SecondScreenMode.kt index 536493572e..252bb69662 100644 --- a/app/src/main/java/com/droiddeck/launcher/input/SecondScreenMode.kt +++ b/app/src/main/java/com/droiddeck/launcher/input/SecondScreenMode.kt @@ -17,11 +17,12 @@ enum class SecondScreenMode(val id: String, @StringRes val label: Int, val bindi DASHBOARD("dashboard", R.string.second_mode_dashboard), GUIDES("guides", R.string.bottom_page_guides), MIRROR("mirror", R.string.bottom_page_mirror), + COMPANION("companion", R.string.bottom_page_companion), STEAM_QAM("steam-qam", R.string.bottom_qam_title), ART("art", R.string.bottom_art_title), DESKTOP("desktop", R.string.second_mode_desktop); - val sessionPanel: Boolean get() = this == GUIDES || this == MIRROR || this == STEAM_QAM || this == ART + val sessionPanel: Boolean get() = this == GUIDES || this == MIRROR || this == COMPANION || this == STEAM_QAM || this == ART val controls: Boolean get() = this == CUSTOM_CONTROLS || bindings != null diff --git a/app/src/main/java/com/droiddeck/launcher/ui/BottomCompanionPage.kt b/app/src/main/java/com/droiddeck/launcher/ui/BottomCompanionPage.kt new file mode 100644 index 0000000000..933f529aed --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/BottomCompanionPage.kt @@ -0,0 +1,241 @@ +package com.droiddeck.launcher.ui + +import android.graphics.BitmapFactory +import android.text.format.DateFormat +import android.util.Base64 +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.aspectRatio +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.DisposableEffect +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.FilterQuality +import androidx.compose.ui.graphics.ImageBitmap +import androidx.compose.ui.graphics.asImageBitmap +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.semantics.Role +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.droiddeck.launcher.R +import androidx.compose.ui.graphics.Color +import androidx.compose.foundation.layout.width +import com.droiddeck.launcher.companion.CompanionLink +import com.droiddeck.launcher.companion.RpgCompanion +import com.droiddeck.launcher.companion.StardewCompanion +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.delay +import kotlinx.coroutines.isActive +import kotlinx.coroutines.withContext + +private const val GAME_POLL_MS = 2_000L + +internal fun companionFor(appId: Long?): Long? = + appId?.takeIf { it == StardewCompanion.APP_ID || it == RpgCompanion.SKYRIM_SE || it == RpgCompanion.FALLOUT_4 } + +@Composable +internal fun CompanionPanel(runningGame: () -> String?) { + var appId by remember { mutableStateOf(runningGame()?.toLongOrNull()) } + LaunchedEffect(Unit) { + while (isActive) { + appId = runningGame()?.toLongOrNull() + delay(GAME_POLL_MS) + } + } + when (companionFor(appId)) { + StardewCompanion.APP_ID -> StardewLive() + RpgCompanion.SKYRIM_SE, RpgCompanion.FALLOUT_4 -> RpgLive(appId!!) + else -> PanelNote(stringResource(R.string.bottom_companion_none)) + } +} + +@Composable +private fun StardewLive() { + val link = remember { CompanionLink(StardewCompanion.PORT) } + var state by remember { mutableStateOf(StardewCompanion.State()) } + var connected by remember { mutableStateOf(false) } + DisposableEffect(link) { onDispose { link.close() } } + val off = BottomScreenLight.current.value == BottomScreenLight.OFF + LaunchedEffect(link, off) { + // The Stardew mod hides the game's HUD while a client is connected, so a dark bottom screen must not stay connected. + if (off) return@LaunchedEffect + withContext(Dispatchers.IO) { + link.run( + onConnected = { connected = it }, + onText = { text -> state = StardewCompanion.reduce(state, text) }, + hello = StardewCompanion.refresh(), + ) + } + } + when { + !connected -> PanelNote(stringResource(R.string.bottom_companion_stardew_missing)) + !state.inGame -> PanelNote(stringResource(R.string.bottom_companion_title_screen)) + else -> StardewPanel(state) { slot -> link.send(StardewCompanion.selectSlot(slot)) } + } +} + +@Composable +internal fun StardewPanel(state: StardewCompanion.State, onSlot: (Int) -> Unit) { + val pal = LocalPalette.current + val colors = MaterialTheme.colorScheme + val twelveHour = !DateFormat.is24HourFormat(LocalContext.current) + val sprites = remember(state.sprites) { state.sprites.mapValues { (_, png) -> decode(png) } } + Row(Modifier.fillMaxSize().padding(horizontal = 14.dp, vertical = 6.dp), horizontalArrangement = Arrangement.spacedBy(14.dp)) { + Column(Modifier.weight(1f).fillMaxHeight().verticalScroll(rememberScrollState())) { + state.day?.let { d -> + SettingsGroup(stringResource(R.string.bottom_companion_today)) { + PanelRow("${d.weekday} · ${d.season.replaceFirstChar { it.uppercase() }} ${d.day}", listOf(d.location, d.weather).filter { it.isNotEmpty() }.joinToString(" · "), + trailing = { PanelValue(StardewCompanion.clock(d.time, twelveHour)) }) + PanelRow(stringResource(R.string.bottom_companion_gold), trailing = { PanelValue("%,d".format(d.gold), CompanionGold) }) + MeterRow(stringResource(R.string.bottom_companion_energy), d.energy, d.maxEnergy, pal.good) + MeterRow(stringResource(R.string.bottom_companion_health), d.health, d.maxHealth, colors.error) + } + } + SettingsGroup(stringResource(R.string.bottom_companion_hotbar)) { + for (row in state.hotbar.withIndex().chunked(6)) Row(Modifier.fillMaxWidth().padding(horizontal = 8.dp, vertical = 4.dp), + horizontalArrangement = Arrangement.spacedBy(6.dp)) { + for ((slot, item) in row) { + val selected = slot == state.selected + Box( + Modifier.weight(1f).aspectRatio(1f).clip(RoundedCornerShape(8.dp)) + .background(if (selected) pal.signal.copy(alpha = 0.18f) else colors.surfaceVariant) + .border(1.dp, if (selected) pal.signal else pal.line2, RoundedCornerShape(8.dp)) + .clickable(role = Role.Button) { onSlot(slot) }.testTag("stardew-slot-$slot"), + contentAlignment = Alignment.Center, + ) { + val sprite = item?.let { sprites[it.id] } + if (sprite != null) Image(sprite, item.name, Modifier.fillMaxSize().padding(5.dp), filterQuality = FilterQuality.None) + else if (item != null) Text(item.name.take(3), fontSize = 10.sp, color = colors.onSurfaceVariant) + if (item != null && item.count > 1) Text("${item.count}", fontSize = 10.sp, fontWeight = FontWeight.Bold, + color = colors.onBackground, modifier = Modifier.align(Alignment.BottomEnd).padding(3.dp)) + } + } + } + } + } + Column(Modifier.weight(1f).fillMaxHeight().verticalScroll(rememberScrollState())) { + if (state.birthdays.isNotEmpty()) SettingsGroup(stringResource(R.string.bottom_companion_birthdays)) { + for (b in state.birthdays) PanelRow(b.name, + trailing = { PanelValue(if (b.days == 0) stringResource(R.string.bottom_companion_today) else stringResource(R.string.bottom_companion_in_days, b.days), + if (b.days == 0) pal.signal else colors.onSurfaceVariant) }) + } + if (state.quests.isNotEmpty()) SettingsGroup(stringResource(R.string.bottom_companion_quests)) { + for (q in state.quests) PanelRow(q.title, q.objective, selected = q.complete) + } + } + } +} + +@Composable +private fun RpgLive(appId: Long) { + val link = remember(appId) { CompanionLink(RpgCompanion.port(appId)) } + var state by remember(appId) { mutableStateOf(RpgCompanion.State()) } + var connected by remember(appId) { mutableStateOf(false) } + var seq by remember { mutableStateOf(0) } + DisposableEffect(link) { onDispose { link.close() } } + val off = BottomScreenLight.current.value == BottomScreenLight.OFF + LaunchedEffect(link, off) { + if (off) return@LaunchedEffect + withContext(Dispatchers.IO) { + link.run( + onConnected = { connected = it }, + onText = { text -> state = RpgCompanion.reduce(appId, state, text) }, + hello = RpgCompanion.subscribe(appId), + ) + } + } + if (!connected) { + PanelNote(stringResource(if (appId == RpgCompanion.FALLOUT_4) R.string.bottom_companion_pipboy_missing else R.string.bottom_companion_skyrim_missing)) + return + } + RpgPanel(state, + onSlot = { slot -> link.send(RpgCompanion.trigger(appId, slot, ++seq)) }, + onRadio = { on -> link.send(RpgCompanion.radio(on, ++seq)) }) +} + +@Composable +internal fun RpgPanel(state: RpgCompanion.State, onSlot: (RpgCompanion.Slot) -> Unit, onRadio: (Boolean) -> Unit) { + val pal = LocalPalette.current + val colors = MaterialTheme.colorScheme + Row(Modifier.fillMaxSize().padding(horizontal = 14.dp, vertical = 6.dp), horizontalArrangement = Arrangement.spacedBy(14.dp)) { + Column(Modifier.weight(1f).fillMaxHeight().verticalScroll(rememberScrollState())) { + SettingsGroup(stringResource(R.string.bottom_companion_character), detail = state.level?.let { stringResource(R.string.bottom_companion_level, it) }) { + for (bar in state.bars) { + val (label, color) = when (bar.key) { + "hp", "health" -> stringResource(R.string.bottom_companion_health) to colors.error + "magicka" -> stringResource(R.string.bottom_companion_magicka) to pal.primary + "stamina" -> stringResource(R.string.bottom_companion_stamina) to pal.good + else -> stringResource(R.string.bottom_companion_action_points) to pal.good + } + MeterRow(label, bar.value.toInt(), bar.max.toInt(), color) + } + for ((key, value) in state.facts) PanelRow( + when (key) { + "caps" -> stringResource(R.string.bottom_companion_caps) + "rads" -> stringResource(R.string.bottom_companion_rads) + else -> stringResource(R.string.bottom_companion_weight) + }, + trailing = { PanelValue(value) }, + ) + } + state.radio?.let { on -> + SettingsGroup(stringResource(R.string.bottom_companion_radio)) { + SettingsRow(stringResource(R.string.bottom_companion_radio), null) { ToggleSwitch(on, label = stringResource(R.string.bottom_companion_radio)) { onRadio(it) } } + } + } + } + Column(Modifier.weight(1f).fillMaxHeight().verticalScroll(rememberScrollState())) { + if (state.slots.isNotEmpty()) SettingsGroup(stringResource(R.string.bottom_companion_favorites)) { + for (slot in state.slots) PanelRow(slot.label, slot.detail.ifEmpty { null }, tag = "rpg-slot-${slot.key}", selected = slot.active, + onClick = { onSlot(slot) }) + } + } + } +} + +@Composable +private fun MeterRow(label: String, value: Int, max: Int, color: Color) { + val pal = LocalPalette.current + PanelRow(label, trailing = { + Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) { + Box(Modifier.width(72.dp).height(6.dp).clip(RoundedCornerShape(3.dp)).background(pal.line2)) { + Box(Modifier.fillMaxWidth(if (max > 0) (value.toFloat() / max).coerceIn(0f, 1f) else 0f).fillMaxHeight().background(color)) + } + PanelValue("$value / $max") + } + }) +} + +private val CompanionGold = Color(0xFFE2B33C) + +private fun decode(png: String): ImageBitmap? = runCatching { + val bytes = Base64.decode(png, Base64.DEFAULT) + BitmapFactory.decodeByteArray(bytes, 0, bytes.size)?.asImageBitmap() +}.getOrNull() diff --git a/app/src/main/java/com/droiddeck/launcher/ui/BottomScreenBar.kt b/app/src/main/java/com/droiddeck/launcher/ui/BottomScreenBar.kt index fe66a06396..ecd5aa53a8 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/BottomScreenBar.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/BottomScreenBar.kt @@ -243,6 +243,7 @@ internal val SecondScreenMode.icon: ImageVector get() = when (this) { SecondScreenMode.DASHBOARD -> Icons.Outlined.Dashboard SecondScreenMode.GUIDES -> Icons.Outlined.MenuBook SecondScreenMode.MIRROR -> Icons.Outlined.CropFree + SecondScreenMode.COMPANION -> Icons.Outlined.Extension SecondScreenMode.STEAM_QAM -> Icons.Outlined.ViewSidebar SecondScreenMode.ART -> Icons.Outlined.Wallpaper SecondScreenMode.DESKTOP -> Icons.Outlined.DesktopWindows diff --git a/app/src/main/java/com/droiddeck/launcher/ui/BottomSessionPanels.kt b/app/src/main/java/com/droiddeck/launcher/ui/BottomSessionPanels.kt index 10c6eac00b..ebe4908a1b 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/BottomSessionPanels.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/BottomSessionPanels.kt @@ -35,6 +35,7 @@ internal fun BottomSessionPanel(mode: SecondScreenMode, actions: BottomPageActio when (mode) { SecondScreenMode.GUIDES -> GuidesPanel(actions.runningGame) SecondScreenMode.MIRROR -> MirrorPanel(actions) + SecondScreenMode.COMPANION -> CompanionPanel(actions.runningGame) SecondScreenMode.STEAM_QAM -> SteamQamPanel() SecondScreenMode.ART -> ArtPanel(actions.runningGame) else -> Unit diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SecondScreenPresentation.kt b/app/src/main/java/com/droiddeck/launcher/ui/SecondScreenPresentation.kt index 73df657efe..12a23ee054 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/SecondScreenPresentation.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/SecondScreenPresentation.kt @@ -305,6 +305,7 @@ class SecondScreenPresentation( private fun light(state: BottomScreenLight) { screen = state + BottomScreenLight.current.value = state sleepView.visibility = if (state == BottomScreenLight.OFF) View.VISIBLE else View.GONE sleepView.alpha = 1f val w = window ?: return @@ -401,7 +402,7 @@ class SecondScreenPresentation( attachKeyboard() } SecondScreenMode.DASHBOARD -> renderDashboard() - SecondScreenMode.GUIDES, SecondScreenMode.MIRROR, SecondScreenMode.STEAM_QAM, SecondScreenMode.ART -> renderPanel(mode) + SecondScreenMode.GUIDES, SecondScreenMode.MIRROR, SecondScreenMode.COMPANION, SecondScreenMode.STEAM_QAM, SecondScreenMode.ART -> renderPanel(mode) SecondScreenMode.DESKTOP -> { root.addView(BottomDesktopPanel(context, onClose, onMenu, (onSteamMenu to onQam).takeIf { SessionState.mode == SessionService.MODE_STEAM }, onSwap, @@ -454,7 +455,7 @@ class SecondScreenPresentation( MirrorOptions.open.value = !MirrorOptions.open.value }) + extras) SecondScreenMode.DASHBOARD, SecondScreenMode.CUSTOM_CONTROLS, SecondScreenMode.GUIDES, - SecondScreenMode.ART -> model(extras) + SecondScreenMode.COMPANION, SecondScreenMode.ART -> model(extras) SecondScreenMode.TERMINAL -> model(listOf(BarExtra(context.getString(R.string.drawer_keyboard), icon = R.drawable.ic_bottom_keyboard, tag = "bottom-keyboard") { terminalPanel?.showKeyboard() }) + extras) else -> null @@ -540,6 +541,9 @@ internal enum class BottomScreenLight(val brightness: Float) { companion object { const val DIM_AFTER_MS = 60_000L + + /** The bottom screen's light, so panels can drop live connections while it is off. */ + val current = androidx.compose.runtime.mutableStateOf(ON) fun autoDims(mode: SecondScreenMode) = mode == SecondScreenMode.DASHBOARD } } diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt b/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt index 296040787b..55230927da 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt @@ -1439,7 +1439,7 @@ internal fun secondScreenModes(none: Boolean, deckPad: Boolean, dashboard: Boole (if (deckPad) listOf(SecondScreenMode.DECK_CONTROLS) else emptyList()) + listOf(SecondScreenMode.CUSTOM_CONTROLS) + (if (dashboard) listOf(SecondScreenMode.DASHBOARD) else emptyList()) + (if (dashboard && steam) listOf(SecondScreenMode.STEAM_QAM, SecondScreenMode.ART) else emptyList()) + - (if (dashboard) listOf(SecondScreenMode.GUIDES, SecondScreenMode.MIRROR) else emptyList()) + + (if (dashboard) listOf(SecondScreenMode.GUIDES, SecondScreenMode.MIRROR, SecondScreenMode.COMPANION) else emptyList()) + (if (desktop) listOf(SecondScreenMode.DESKTOP) else emptyList()) private val DRAWER_MIN_WIDTH = 300.dp diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 61101c0662..0eec577631 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -2187,6 +2187,23 @@ متابعة القراءة لا توجد أدلة Steam لهذه اللعبة بعد. تعذّر تحميل أدلة Steam. عد عندما تكون متصلًا. + المرافق + لا توجد صفحة مرافقة لهذه اللعبة بعد. توجد واحدة للعبة Stardew Valley. + ثبّت تعديل الشاشة المزدوجة للعبة Stardew Valley عبر SMAPI لترى مزرعتك هنا. + حمّل حفظًا لترى مزرعتك هنا. + الطاقة + الصحة + أعياد الميلاد هذا الأسبوع + المهام + ثبّت إضافة SkyrimWebSocket لـ SKSE لترى شخصيتك هنا. + ثبّت إضافة Thor Pip-Boy لـ F4SE لترى Pip-Boy هنا. + المستوى %1$d + السحر + القدرة على التحمل + نقاط الحركة + الأغطية + الإشعاع + المفضلة المرآة اسحب فوق جزء اللعبة الذي تريد عرضه هنا، مثل الخريطة المصغّرة. احفظ المنطقة @@ -2224,6 +2241,13 @@ المنطقة الشاشة العلوية التحجيم + اليوم + الذهب + شريط الأدوات + بعد %1$d أيام + الشخصية + الحمولة + الراديو الوصول السريع التخطيط: %1$s العرض الكامل diff --git a/app/src/main/res/values-b+es+419/strings.xml b/app/src/main/res/values-b+es+419/strings.xml index c8b385231a..2bd0317814 100644 --- a/app/src/main/res/values-b+es+419/strings.xml +++ b/app/src/main/res/values-b+es+419/strings.xml @@ -2182,6 +2182,23 @@ Seguir leyendo Este juego aún no tiene guías de Steam. No se pudieron cargar las guías de Steam. Vuelve a intentarlo cuando tengas conexión. + Compañero + Este juego aún no tiene página de compañero. Stardew Valley sí tiene una. + Instala el mod de doble pantalla de Stardew Valley para SMAPI para ver tu granja aquí. + Carga una partida para ver tu granja aquí. + Energía + Salud + Cumpleaños de esta semana + Misiones + Instala el plugin SkyrimWebSocket para SKSE para ver tu personaje aquí. + Instala el plugin Thor Pip-Boy para F4SE para ver tu Pip-Boy aquí. + Nivel %1$d + Magia + Aguante + Puntos de acción + Chapas + Radiación + Favoritos Espejo Arrastra sobre la parte del juego que quieras ver aquí, como el minimapa. Guardar región @@ -2219,6 +2236,13 @@ Región Pantalla superior Escalado + Hoy + Oro + Barra rápida + En %1$d días + Personaje + Peso cargado + Radio Acceso rápido Diseño: %1$s Ancho completo diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index 110f8a55ab..f607f871c0 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -2087,6 +2087,23 @@ Продължи четенето Все още няма ръководства в Steam за тази игра. Ръководствата в Steam не се заредиха. Опитайте отново, когато сте онлайн. + Придружител + Все още няма страница-придружител за тази игра. Stardew Valley има. + Инсталирайте мода за два екрана на Stardew Valley за SMAPI, за да виждате фермата си тук. + Заредете запис, за да видите фермата си тук. + Енергия + Здраве + Рождени дни тази седмица + Задачи + Инсталирайте приставката SkyrimWebSocket за SKSE, за да виждате героя си тук. + Инсталирайте приставката Thor Pip-Boy за F4SE, за да виждате своя Pip-Boy тук. + Ниво %1$d + Магия + Издръжливост + Точки за действие + Капачки + Радиация + Любими Огледало Плъзнете върху частта от играта, която да се показва тук, например мини картата. Запази областта @@ -2124,6 +2141,13 @@ Област Горен екран Мащабиране + Днес + Злато + Лента с предмети + След %1$d дни + Герой + Товар + Радио Бърз достъп Оформление: %1$s Цяла ширина diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 2e50bb1336..3713d9df80 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -2137,6 +2137,23 @@ Pokračovat ve čtení Pro tuto hru zatím nejsou žádné návody na Steamu. Návody ze Steamu se nepodařilo načíst. Zkuste to znovu, až budete online. + Společník + Pro tuto hru zatím není stránka společníka. Stardew Valley ji má. + Nainstalujte mód dvou obrazovek pro Stardew Valley (SMAPI) a uvidíte zde svou farmu. + Načtěte uloženou hru a uvidíte zde svou farmu. + Energie + Zdraví + Narozeniny tento týden + Úkoly + Nainstalujte plugin SkyrimWebSocket pro SKSE a uvidíte zde svou postavu. + Nainstalujte plugin Thor Pip-Boy pro F4SE a uvidíte zde svůj Pip-Boy. + Úroveň %1$d + Magie + Výdrž + Akční body + Víčka + Radiace + Oblíbené Zrcadlo Táhnutím označte část hry, která se tu má zobrazit, například minimapu. Uložit oblast @@ -2174,6 +2191,13 @@ Oblast Horní obrazovka Škálování + Dnes + Zlato + Lišta + Za %1$d dní + Postava + Nosnost + Rádio Rychlý přístup Rozložení: %1$s Plná šířka diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 5a4196b044..1987d882dc 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -2087,6 +2087,23 @@ Læs videre Der er endnu ingen Steam-guides til dette spil. Kunne ikke hente Steam-guides. Prøv igen, når du er online. + Ledsager + Der er endnu ingen ledsagerside til dette spil. Stardew Valley har en. + Installer Stardew Valleys dobbeltskærms-mod til SMAPI for at se din gård her. + Indlæs et gemt spil for at se din gård her. + Energi + Helbred + Fødselsdage denne uge + Opgaver + Installer SkyrimWebSocket-pluginnet til SKSE for at se din figur her. + Installer Thor Pip-Boy-pluginnet til F4SE for at se din Pip-Boy her. + Niveau %1$d + Magika + Udholdenhed + Handlingspoint + Kapsler + Stråling + Favoritter Spejl Træk hen over den del af spillet, der skal vises her, f.eks. minikortet. Gem område @@ -2124,6 +2141,13 @@ Område Øverste skærm Skalering + I dag + Guld + Værktøjslinje + Om %1$d dage + Figur + Bæreevne + Radio Hurtig adgang Layout: %1$s Fuld bredde diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index aac3fc1511..db535003aa 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -2079,6 +2079,23 @@ Weiterlesen Für dieses Spiel gibt es noch keine Steam-Anleitungen. Steam-Anleitungen konnten nicht geladen werden. Versuche es erneut, sobald du online bist. + Begleiter + Für dieses Spiel gibt es noch keine Begleitseite. Stardew Valley hat eine. + Installiere die Dual-Screen-Mod für Stardew Valley (SMAPI), um hier deinen Hof zu sehen. + Lade einen Spielstand, um hier deinen Hof zu sehen. + Energie + Gesundheit + Geburtstage diese Woche + Quests + Installiere das SKSE-Plugin SkyrimWebSocket, um hier deinen Charakter zu sehen. + Installiere das F4SE-Plugin Thor Pip-Boy, um hier deinen Pip-Boy zu sehen. + Stufe %1$d + Magicka + Ausdauer + Aktionspunkte + Kronkorken + Strahlung + Favoriten Spiegel Ziehe über den Teil des Spiels, der hier erscheinen soll, etwa die Minikarte. Bereich speichern @@ -2116,6 +2133,13 @@ Bereich Oberer Bildschirm Skalierung + Heute + Gold + Werkzeugleiste + In %1$d Tagen + Charakter + Traglast + Radio Schnellzugriff Layout: %1$s Volle Breite diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index d794d3e6f8..c6eccf25ce 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -2087,6 +2087,23 @@ Συνέχεια ανάγνωσης Δεν υπάρχουν ακόμη οδηγοί Steam για αυτό το παιχνίδι. Δεν ήταν δυνατή η φόρτωση των οδηγών Steam. Δοκιμάστε ξανά όταν είστε online. + Συνοδός + Δεν υπάρχει ακόμη σελίδα συνοδού για αυτό το παιχνίδι. Το Stardew Valley έχει. + Εγκαταστήστε το mod διπλής οθόνης του Stardew Valley για SMAPI για να βλέπετε εδώ τη φάρμα σας. + Φορτώστε μια αποθήκευση για να δείτε εδώ τη φάρμα σας. + Ενέργεια + Υγεία + Γενέθλια αυτή την εβδομάδα + Αποστολές + Εγκαταστήστε το πρόσθετο SkyrimWebSocket για SKSE για να βλέπετε εδώ τον χαρακτήρα σας. + Εγκαταστήστε το πρόσθετο Thor Pip-Boy για F4SE για να βλέπετε εδώ το Pip-Boy σας. + Επίπεδο %1$d + Μαγεία + Αντοχή + Πόντοι δράσης + Καπάκια + Ακτινοβολία + Αγαπημένα Καθρέφτης Σύρετε πάνω από το μέρος του παιχνιδιού που θέλετε να εμφανίζεται εδώ, όπως ο μικρός χάρτης. Αποθήκευση περιοχής @@ -2124,6 +2141,13 @@ Περιοχή Πάνω οθόνη Κλιμάκωση + Σήμερα + Χρυσός + Γραμμή εργαλείων + Σε %1$d ημέρες + Χαρακτήρας + Φορτίο + Ραδιόφωνο Γρήγορη πρόσβαση Διάταξη: %1$s Πλήρες πλάτος diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index ff610c995a..fed98db85f 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -2112,6 +2112,23 @@ Seguir leyendo Este juego aún no tiene guías de Steam. No se han podido cargar las guías de Steam. Vuelve a intentarlo cuando tengas conexión. + Compañero + Este juego aún no tiene página de compañero. Stardew Valley sí tiene una. + Instala el mod de doble pantalla de Stardew Valley para SMAPI para ver tu granja aquí. + Carga una partida para ver tu granja aquí. + Energía + Salud + Cumpleaños de esta semana + Misiones + Instala el plugin SkyrimWebSocket para SKSE para ver tu personaje aquí. + Instala el plugin Thor Pip-Boy para F4SE para ver tu Pip-Boy aquí. + Nivel %1$d + Magia + Aguante + Puntos de acción + Chapas + Radiación + Favoritos Espejo Arrastra sobre la parte del juego que quieras ver aquí, como el minimapa. Guardar región @@ -2149,6 +2166,13 @@ Región Pantalla superior Escalado + Hoy + Oro + Barra rápida + En %1$d días + Personaje + Peso cargado + Radio Acceso rápido Diseño: %1$s Ancho completo diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index d1cc0e9e7c..0b2289f4d8 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -2087,6 +2087,23 @@ Jatka lukemista Tälle pelille ei ole vielä Steam-oppaita. Steam-oppaiden lataus epäonnistui. Yritä uudelleen, kun olet verkossa. + Kumppani + Tälle pelille ei ole vielä kumppanisivua. Stardew Valleylla on. + Asenna Stardew Valleyn kaksoisnäyttömodi SMAPIlle nähdäksesi tilasi täällä. + Lataa tallennus nähdäksesi tilasi täällä. + Energia + Terveys + Syntymäpäivät tällä viikolla + Tehtävät + Asenna SKSE:n SkyrimWebSocket-liitännäinen nähdäksesi hahmosi täällä. + Asenna F4SE:n Thor Pip-Boy -liitännäinen nähdäksesi Pip-Boysi täällä. + Taso %1$d + Taikavoima + Kestävyys + Toimintapisteet + Korkit + Säteily + Suosikit Peili Vedä sen pelin osan yli, joka näytetään täällä, kuten minikartan. Tallenna alue @@ -2124,6 +2141,13 @@ Alue Ylänäyttö Skaalaus + Tänään + Kulta + Pikapalkki + %1$d päivän päästä + Hahmo + Kantokyky + Radio Pikavalikko Asettelu: %1$s Koko leveys diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index bb07bb7413..9138979916 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -2111,6 +2111,23 @@ Reprendre la lecture Ce jeu n’a pas encore de guides Steam. Impossible de charger les guides Steam. Réessayez une fois en ligne. + Compagnon + Ce jeu n’a pas encore de page compagnon. Stardew Valley en a une. + Installez le mod double écran de Stardew Valley pour SMAPI pour voir votre ferme ici. + Chargez une partie pour voir votre ferme ici. + Énergie + Santé + Anniversaires de la semaine + Quêtes + Installez le plugin SKSE SkyrimWebSocket pour voir votre personnage ici. + Installez le plugin F4SE Thor Pip-Boy pour voir votre Pip-Boy ici. + Niveau %1$d + Magie + Vigueur + Points d’action + Capsules + Radiations + Favoris Miroir Faites glisser sur la partie du jeu à afficher ici, comme la mini-carte. Enregistrer la zone @@ -2148,6 +2165,13 @@ Zone Écran du haut Mise à l’échelle + Aujourd’hui + Or + Barre d’outils + Dans %1$d jours + Personnage + Charge + Radio Accès rapide Disposition : %1$s Pleine largeur diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index 024ce87cf5..19165b5485 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -2087,6 +2087,23 @@ पढ़ना जारी रखें इस गेम के लिए अभी कोई Steam गाइड नहीं है। Steam गाइड लोड नहीं हो सके। ऑनलाइन होने पर फिर देखें। + साथी + इस गेम के लिए अभी कोई साथी पेज नहीं है। Stardew Valley के लिए है। + अपना फ़ार्म यहाँ देखने के लिए SMAPI के लिए Stardew Valley का डुअल-स्क्रीन मॉड इंस्टॉल करें। + अपना फ़ार्म यहाँ देखने के लिए कोई सेव लोड करें। + ऊर्जा + स्वास्थ्य + इस हफ़्ते के जन्मदिन + क्वेस्ट + अपना किरदार यहाँ देखने के लिए SKSE का SkyrimWebSocket प्लगइन इंस्टॉल करें। + अपना Pip-Boy यहाँ देखने के लिए F4SE का Thor Pip-Boy प्लगइन इंस्टॉल करें। + लेवल %1$d + मैजिका + स्टैमिना + एक्शन पॉइंट + कैप्स + रेडिएशन + पसंदीदा मिरर गेम का वह हिस्सा चुनने के लिए खींचें जो यहाँ दिखे, जैसे मिनीमैप। क्षेत्र सहेजें @@ -2124,6 +2141,13 @@ क्षेत्र ऊपर की स्क्रीन स्केलिंग + आज + सोना + हॉटबार + %1$d दिन में + किरदार + वज़न क्षमता + रेडियो क्विक एक्सेस लेआउट: %1$s पूरी चौड़ाई diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 7e62ecc22a..cb65736869 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -2087,6 +2087,23 @@ Olvasás folytatása Ehhez a játékhoz még nincs Steam-útmutató. Nem sikerült betölteni a Steam-útmutatókat. Próbáld újra, ha online vagy. + Társ + Ehhez a játékhoz még nincs társoldal. A Stardew Valley-hez van. + Telepítsd a Stardew Valley kétképernyős modját (SMAPI), hogy itt lásd a farmodat. + Tölts be egy mentést, hogy itt lásd a farmodat. + Energia + Életerő + E heti születésnapok + Küldetések + Telepítsd a SkyrimWebSocket SKSE-bővítményt, hogy itt lásd a karakteredet. + Telepítsd a Thor Pip-Boy F4SE-bővítményt, hogy itt lásd a Pip-Boyodat. + %1$d. szint + Mágia + Állóképesség + Akciópontok + Kupakok + Sugárzás + Kedvencek Tükör Húzd át a játék azon részét, amelyet itt szeretnél látni, például a minitérképet. Terület mentése @@ -2124,6 +2141,13 @@ Terület Felső képernyő Méretezés + Ma + Arany + Gyorssáv + %1$d nap múlva + Karakter + Teherbírás + Rádió Gyorselérés Elrendezés: %1$s Teljes szélesség diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index da1500f2ce..e0faaacfb5 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -2063,6 +2063,23 @@ Lanjutkan membaca Belum ada panduan Steam untuk game ini. Tidak dapat memuat panduan Steam. Coba lagi saat Anda online. + Pendamping + Belum ada halaman pendamping untuk game ini. Stardew Valley sudah punya. + Pasang mod layar ganda Stardew Valley untuk SMAPI agar pertanian Anda tampil di sini. + Muat simpanan untuk melihat pertanian Anda di sini. + Energi + Kesehatan + Ulang tahun minggu ini + Misi + Pasang plugin SKSE SkyrimWebSocket untuk melihat karakter Anda di sini. + Pasang plugin F4SE Thor Pip-Boy untuk melihat Pip-Boy Anda di sini. + Level %1$d + Magicka + Stamina + Poin aksi + Tutup botol + Radiasi + Favorit Cermin Seret di atas bagian game yang ingin ditampilkan di sini, seperti peta mini. Simpan area @@ -2100,6 +2117,13 @@ Area Layar atas Penskalaan + Hari ini + Emas + Hotbar + Dalam %1$d hari + Karakter + Beban + Radio Akses Cepat Tata letak: %1$s Lebar penuh diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index e589d4f152..bbe425d7bb 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -2103,6 +2103,23 @@ Continua a leggere Non ci sono ancora guide di Steam per questo gioco. Impossibile caricare le guide di Steam. Riprova quando sei online. + Compagno + Questo gioco non ha ancora una pagina compagno. Stardew Valley ne ha una. + Installa la mod a doppio schermo di Stardew Valley per SMAPI per vedere qui la tua fattoria. + Carica un salvataggio per vedere qui la tua fattoria. + Energia + Salute + Compleanni della settimana + Missioni + Installa il plugin SKSE SkyrimWebSocket per vedere qui il tuo personaggio. + Installa il plugin F4SE Thor Pip-Boy per vedere qui il tuo Pip-Boy. + Livello %1$d + Magicka + Vigore + Punti azione + Tappi + Radiazioni + Preferiti Specchio Trascina sulla parte del gioco da mostrare qui, come la minimappa. Salva area @@ -2140,6 +2157,13 @@ Area Schermo superiore Scalatura + Oggi + Oro + Barra rapida + Tra %1$d giorni + Personaggio + Peso trasportato + Radio Accesso rapido Layout: %1$s Larghezza piena diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index dbcc7566de..eed3845646 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -2063,6 +2063,23 @@ 続きを読む このゲームの Steam ガイドはまだありません。 Steam ガイドを読み込めませんでした。オンラインになってから再度お試しください。 + コンパニオン + このゲームのコンパニオンページはまだありません。Stardew Valley には対応しています。 + 農場をここに表示するには、SMAPI 用の Stardew Valley デュアルスクリーン MOD をインストールしてください。 + セーブデータを読み込むと、ここに農場が表示されます。 + スタミナ + 体力 + 今週の誕生日 + クエスト + キャラクターをここに表示するには、SKSE プラグイン SkyrimWebSocket をインストールしてください。 + Pip-Boy をここに表示するには、F4SE プラグイン Thor Pip-Boy をインストールしてください。 + レベル %1$d + マジカ + スタミナ + アクションポイント + キャップ + 放射線 + お気に入り ミラー ミニマップなど、ここに表示したいゲーム画面の部分をドラッグで選びます。 範囲を保存 @@ -2100,6 +2117,13 @@ 範囲 上画面 スケーリング + 今日 + ゴールド + ホットバー + %1$d 日後 + キャラクター + 所持重量 + ラジオ クイックアクセス レイアウト: %1$s 全幅 diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 666f543231..e6d0ed10d8 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -2063,6 +2063,23 @@ 이어서 읽기 이 게임에는 아직 Steam 가이드가 없습니다. Steam 가이드를 불러오지 못했습니다. 온라인 상태에서 다시 확인하세요. + 컴패니언 + 이 게임에는 아직 컴패니언 페이지가 없습니다. Stardew Valley는 지원합니다. + 농장을 여기에서 보려면 SMAPI용 Stardew Valley 듀얼 스크린 모드를 설치하세요. + 저장 파일을 불러오면 여기에 농장이 표시됩니다. + 기력 + 체력 + 이번 주 생일 + 퀘스트 + 캐릭터를 여기에서 보려면 SKSE 플러그인 SkyrimWebSocket을 설치하세요. + Pip-Boy를 여기에서 보려면 F4SE 플러그인 Thor Pip-Boy를 설치하세요. + 레벨 %1$d + 매지카 + 지구력 + 액션 포인트 + 캡 + 방사능 + 즐겨찾기 미러 미니맵처럼 여기에 표시할 게임 화면 부분을 드래그하세요. 영역 저장 @@ -2100,6 +2117,13 @@ 영역 위 화면 스케일링 + 오늘 + 골드 + 단축 바 + %1$d일 후 + 캐릭터 + 소지 무게 + 라디오 빠른 메뉴 레이아웃: %1$s 전체 너비 diff --git a/app/src/main/res/values-ms/strings.xml b/app/src/main/res/values-ms/strings.xml index 407b40ee13..25a79d7749 100644 --- a/app/src/main/res/values-ms/strings.xml +++ b/app/src/main/res/values-ms/strings.xml @@ -2063,6 +2063,23 @@ Sambung membaca Belum ada panduan Steam untuk permainan ini. Tidak dapat memuatkan panduan Steam. Cuba lagi apabila anda dalam talian. + Peneman + Belum ada halaman peneman untuk permainan ini. Stardew Valley ada. + Pasang mod dwi-skrin Stardew Valley untuk SMAPI untuk melihat ladang anda di sini. + Muatkan simpanan untuk melihat ladang anda di sini. + Tenaga + Kesihatan + Hari jadi minggu ini + Misi + Pasang pemalam SKSE SkyrimWebSocket untuk melihat watak anda di sini. + Pasang pemalam F4SE Thor Pip-Boy untuk melihat Pip-Boy anda di sini. + Tahap %1$d + Magicka + Stamina + Mata tindakan + Penutup botol + Radiasi + Kegemaran Cermin Seret ke atas bahagian permainan yang mahu dipaparkan di sini, seperti peta mini. Simpan kawasan @@ -2100,6 +2117,13 @@ Kawasan Skrin atas Penskalaan + Hari ini + Emas + Bar alat + Dalam %1$d hari + Watak + Beban + Radio Akses Pantas Susun atur: %1$s Lebar penuh diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index 12693088eb..d43d668076 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -2087,6 +2087,23 @@ Fortsett å lese Det finnes ingen Steam-guider for dette spillet ennå. Kunne ikke laste Steam-guider. Prøv igjen når du er på nett. + Følgesvenn + Det finnes ingen følgesvennside for dette spillet ennå. Stardew Valley har en. + Installer Stardew Valleys tosjermsmod for SMAPI for å se gården din her. + Last inn en lagring for å se gården din her. + Energi + Helse + Bursdager denne uken + Oppdrag + Installer SKSE-tillegget SkyrimWebSocket for å se figuren din her. + Installer F4SE-tillegget Thor Pip-Boy for å se Pip-Boyen din her. + Nivå %1$d + Magika + Utholdenhet + Handlingspoeng + Korker + Stråling + Favoritter Speil Dra over den delen av spillet som skal vises her, for eksempel minikartet. Lagre område @@ -2124,6 +2141,13 @@ Område Øvre skjerm Skalering + I dag + Gull + Verktøylinje + Om %1$d dager + Figur + Bæreevne + Radio Hurtigtilgang Oppsett: %1$s Full bredde diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 78b607a56f..664df23d1a 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -2087,6 +2087,23 @@ Verder lezen Er zijn nog geen Steam-handleidingen voor deze game. Kan Steam-handleidingen niet laden. Probeer het opnieuw wanneer je online bent. + Metgezel + Er is nog geen metgezelpagina voor deze game. Stardew Valley heeft er een. + Installeer de dual-screen-mod voor Stardew Valley (SMAPI) om hier je boerderij te zien. + Laad een opgeslagen spel om hier je boerderij te zien. + Energie + Gezondheid + Verjaardagen deze week + Opdrachten + Installeer de SKSE-plugin SkyrimWebSocket om hier je personage te zien. + Installeer de F4SE-plugin Thor Pip-Boy om hier je Pip-Boy te zien. + Niveau %1$d + Magicka + Uithoudingsvermogen + Actiepunten + Doppen + Straling + Favorieten Spiegel Sleep over het deel van de game dat hier moet verschijnen, zoals de minikaart. Gebied opslaan @@ -2124,6 +2141,13 @@ Gebied Bovenste scherm Schalen + Vandaag + Goud + Werkbalk + Over %1$d dagen + Personage + Draaggewicht + Radio Snelle toegang Indeling: %1$s Volledige breedte diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 44d6469e19..a128a8766b 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -2137,6 +2137,23 @@ Czytaj dalej Ta gra nie ma jeszcze poradników na Steam. Nie udało się wczytać poradników ze Steam. Spróbuj ponownie, gdy będziesz online. + Towarzysz + Ta gra nie ma jeszcze strony towarzysza. Stardew Valley ma. + Zainstaluj mod dwóch ekranów do Stardew Valley (SMAPI), aby widzieć tu swoją farmę. + Wczytaj zapis, aby zobaczyć tu swoją farmę. + Energia + Zdrowie + Urodziny w tym tygodniu + Zadania + Zainstaluj wtyczkę SKSE SkyrimWebSocket, aby widzieć tu swoją postać. + Zainstaluj wtyczkę F4SE Thor Pip-Boy, aby widzieć tu swojego Pip-Boya. + Poziom %1$d + Magia + Wytrzymałość + Punkty akcji + Kapsle + Promieniowanie + Ulubione Lustro Przeciągnij po fragmencie gry, który ma się tu wyświetlać, np. minimapie. Zapisz obszar @@ -2174,6 +2191,13 @@ Obszar Górny ekran Skalowanie + Dziś + Złoto + Pasek + Za %1$d dni + Postać + Udźwig + Radio Szybki dostęp Układ: %1$s Pełna szerokość diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index c1be72f2b9..88d50d9c8b 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -2117,6 +2117,23 @@ Continuar a ler Ainda não há guias Steam para este jogo. Não foi possível carregar os guias Steam. Tente novamente quando estiver online. + Companheiro + Este jogo ainda não tem página de companheiro. Stardew Valley tem. + Instale o mod de ecrã duplo do Stardew Valley para SMAPI para ver aqui a sua quinta. + Carregue um jogo guardado para ver aqui a sua quinta. + Energia + Saúde + Aniversários da semana + Missões + Instale o plugin SKSE SkyrimWebSocket para ver aqui a sua personagem. + Instale o plugin F4SE Thor Pip-Boy para ver aqui o seu Pip-Boy. + Nível %1$d + Magia + Vigor + Pontos de ação + Caricas + Radiação + Favoritos Espelho Arraste sobre a parte do jogo que deve aparecer aqui, como o minimapa. Guardar região @@ -2154,6 +2171,13 @@ Região Ecrã superior Escala + Hoje + Ouro + Barra rápida + Dentro de %1$d dias + Personagem + Peso transportado + Rádio Acesso rápido Esquema: %1$s Largura total diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index fd9d27cf9e..ed5334347c 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -2125,6 +2125,23 @@ Continuar lendo Ainda não há guias Steam para este jogo. Não foi possível carregar os guias Steam. Tente de novo quando estiver online. + Companheiro + Este jogo ainda não tem página de companheiro. Stardew Valley tem. + Instale o mod de tela dupla do Stardew Valley para SMAPI para ver sua fazenda aqui. + Carregue um save para ver sua fazenda aqui. + Energia + Saúde + Aniversários da semana + Missões + Instale o plugin SKSE SkyrimWebSocket para ver seu personagem aqui. + Instale o plugin F4SE Thor Pip-Boy para ver seu Pip-Boy aqui. + Nível %1$d + Magia + Vigor + Pontos de ação + Tampinhas + Radiação + Favoritos Espelho Arraste sobre a parte do jogo que deve aparecer aqui, como o minimapa. Salvar região @@ -2162,6 +2179,13 @@ Região Tela superior Escala + Hoje + Ouro + Barra rápida + Em %1$d dias + Personagem + Peso carregado + Rádio Acesso rápido Layout: %1$s Largura total diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index f55b4d1d0a..9debc2d9b0 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -2112,6 +2112,23 @@ Continuă lectura Încă nu există ghiduri Steam pentru acest joc. Ghidurile Steam nu s-au putut încărca. Încearcă din nou când ești online. + Însoțitor + Acest joc nu are încă o pagină de însoțitor. Stardew Valley are. + Instalează modul cu ecran dublu pentru Stardew Valley (SMAPI) ca să-ți vezi ferma aici. + Încarcă o salvare ca să-ți vezi ferma aici. + Energie + Sănătate + Zile de naștere săptămâna aceasta + Misiuni + Instalează pluginul SKSE SkyrimWebSocket ca să-ți vezi personajul aici. + Instalează pluginul F4SE Thor Pip-Boy ca să-ți vezi Pip-Boy-ul aici. + Nivelul %1$d + Magie + Rezistență + Puncte de acțiune + Capace + Radiații + Favorite Oglindă Trage peste partea din joc care să apară aici, de exemplu minimapa. Salvează zona @@ -2149,6 +2166,13 @@ Zonă Ecranul de sus Scalare + Azi + Aur + Bara rapidă + Peste %1$d zile + Personaj + Greutate purtată + Radio Acces rapid Aspect: %1$s Lățime completă diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 41788dff0f..1c54249feb 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -2138,6 +2138,23 @@ Продолжить чтение Для этой игры пока нет руководств Steam. Не удалось загрузить руководства Steam. Попробуйте снова, когда будете в сети. + Компаньон + Для этой игры пока нет страницы-компаньона. Для Stardew Valley есть. + Установите мод двух экранов для Stardew Valley (SMAPI), чтобы видеть здесь свою ферму. + Загрузите сохранение, чтобы увидеть здесь свою ферму. + Энергия + Здоровье + Дни рождения на этой неделе + Задания + Установите плагин SKSE SkyrimWebSocket, чтобы видеть здесь своего персонажа. + Установите плагин F4SE Thor Pip-Boy, чтобы видеть здесь свой Pip-Boy. + Уровень %1$d + Магия + Запас сил + Очки действия + Крышки + Радиация + Избранное Зеркало Проведите по части игры, которую нужно показывать здесь, например по мини-карте. Сохранить область @@ -2175,6 +2192,13 @@ Область Верхний экран Масштабирование + Сегодня + Золото + Панель + Через %1$d дн. + Персонаж + Переносимый вес + Радио Быстрый доступ Макет: %1$s Во всю ширину diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 22d522eeb7..4bfba90a8f 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -2087,6 +2087,23 @@ Fortsätt läsa Det finns inga Steam-guider för det här spelet ännu. Det gick inte att läsa in Steam-guider. Försök igen när du är online. + Följeslagare + Det finns ingen följeslagarsida för det här spelet ännu. Stardew Valley har en. + Installera Stardew Valleys tvåskärmsmod för SMAPI för att se din gård här. + Läs in ett sparat spel för att se din gård här. + Energi + Hälsa + Födelsedagar den här veckan + Uppdrag + Installera SKSE-tillägget SkyrimWebSocket för att se din karaktär här. + Installera F4SE-tillägget Thor Pip-Boy för att se din Pip-Boy här. + Nivå %1$d + Magicka + Uthållighet + Handlingspoäng + Kapsyler + Strålning + Favoriter Spegel Dra över den del av spelet som ska visas här, till exempel minikartan. Spara område @@ -2124,6 +2141,13 @@ Område Övre skärm Skalning + I dag + Guld + Snabbfält + Om %1$d dagar + Karaktär + Bärvikt + Radio Snabbåtkomst Layout: %1$s Full bredd diff --git a/app/src/main/res/values-th/strings.xml b/app/src/main/res/values-th/strings.xml index 467a38be9b..adbed749e7 100644 --- a/app/src/main/res/values-th/strings.xml +++ b/app/src/main/res/values-th/strings.xml @@ -2063,6 +2063,23 @@ อ่านต่อ ยังไม่มีคู่มือ Steam สำหรับเกมนี้ โหลดคู่มือ Steam ไม่ได้ ลองอีกครั้งเมื่อออนไลน์ + คู่หู + ยังไม่มีหน้าคู่หูสำหรับเกมนี้ Stardew Valley มีแล้ว + ติดตั้งม็อดจอคู่ของ Stardew Valley สำหรับ SMAPI เพื่อดูฟาร์มของคุณที่นี่ + โหลดเซฟเพื่อดูฟาร์มของคุณที่นี่ + พลังงาน + พลังชีวิต + วันเกิดสัปดาห์นี้ + เควสต์ + ติดตั้งปลั๊กอิน SKSE SkyrimWebSocket เพื่อดูตัวละครของคุณที่นี่ + ติดตั้งปลั๊กอิน F4SE Thor Pip-Boy เพื่อดู Pip-Boy ของคุณที่นี่ + เลเวล %1$d + มานา + สตามินา + แอ็กชันพอยต์ + ฝาขวด + รังสี + รายการโปรด กระจก ลากครอบส่วนของเกมที่ต้องการแสดงที่นี่ เช่น มินิแมป บันทึกพื้นที่ @@ -2100,6 +2117,13 @@ พื้นที่ จอบน การปรับขนาด + วันนี้ + ทอง + แถบเครื่องมือ + อีก %1$d วัน + ตัวละคร + น้ำหนักที่แบก + วิทยุ เข้าถึงด่วน เลย์เอาต์: %1$s เต็มความกว้าง diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index ee3cbaf460..5977498007 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -2079,6 +2079,23 @@ Okumaya devam et Bu oyun için henüz Steam rehberi yok. Steam rehberleri yüklenemedi. Çevrimiçi olduğunuzda tekrar deneyin. + Yardımcı + Bu oyun için henüz bir yardımcı sayfası yok. Stardew Valley için var. + Çiftliğinizi burada görmek için Stardew Valley çift ekran modunu (SMAPI) kurun. + Çiftliğinizi burada görmek için bir kayıt yükleyin. + Enerji + Sağlık + Bu haftaki doğum günleri + Görevler + Karakterinizi burada görmek için SKSE eklentisi SkyrimWebSocket\'i kurun. + Pip-Boy\'unuzu burada görmek için F4SE eklentisi Thor Pip-Boy\'u kurun. + Seviye %1$d + Büyü + Dayanıklılık + Aksiyon puanı + Kapaklar + Radyasyon + Favoriler Ayna Burada gösterilecek oyun bölümünün üzerinden sürükleyin, örneğin mini harita. Bölgeyi kaydet @@ -2116,6 +2133,13 @@ Bölge Üst ekran Ölçekleme + Bugün + Altın + Kısayol çubuğu + %1$d gün sonra + Karakter + Taşıma ağırlığı + Radyo Hızlı Erişim Düzen: %1$s Tam genişlik diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index ab823d6ed6..0e40d66239 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -2137,6 +2137,23 @@ Продовжити читання Для цієї гри ще немає посібників Steam. Не вдалося завантажити посібники Steam. Спробуйте знову, коли будете онлайн. + Компаньйон + Для цієї гри ще немає сторінки-компаньйона. Для Stardew Valley є. + Встановіть мод двох екранів для Stardew Valley (SMAPI), щоб бачити тут свою ферму. + Завантажте збереження, щоб побачити тут свою ферму. + Енергія + Здоров’я + Дні народження цього тижня + Завдання + Встановіть плагін SKSE SkyrimWebSocket, щоб бачити тут свого персонажа. + Встановіть плагін F4SE Thor Pip-Boy, щоб бачити тут свій Pip-Boy. + Рівень %1$d + Магія + Витривалість + Очки дії + Кришки + Радіація + Вибране Дзеркало Проведіть по частині гри, яку треба показувати тут, наприклад по мінікарті. Зберегти область @@ -2174,6 +2191,13 @@ Область Верхній екран Масштабування + Сьогодні + Золото + Панель + Через %1$d дн. + Персонаж + Вага ноші + Радіо Швидкий доступ Макет: %1$s На всю ширину diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index 2c7fcfcd12..3f76174a68 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -2063,6 +2063,23 @@ Đọc tiếp Trò chơi này chưa có hướng dẫn Steam nào. Không tải được hướng dẫn Steam. Hãy thử lại khi bạn trực tuyến. + Đồng hành + Trò chơi này chưa có trang đồng hành. Stardew Valley đã có. + Cài mod hai màn hình của Stardew Valley cho SMAPI để xem nông trại của bạn tại đây. + Tải một bản lưu để xem nông trại của bạn tại đây. + Năng lượng + Máu + Sinh nhật tuần này + Nhiệm vụ + Cài plugin SKSE SkyrimWebSocket để xem nhân vật của bạn tại đây. + Cài plugin F4SE Thor Pip-Boy để xem Pip-Boy của bạn tại đây. + Cấp %1$d + Ma lực + Thể lực + Điểm hành động + Nắp chai + Phóng xạ + Yêu thích Phản chiếu Kéo qua phần trò chơi muốn hiển thị ở đây, chẳng hạn bản đồ nhỏ. Lưu vùng @@ -2100,6 +2117,13 @@ Vùng Màn hình trên Thu phóng + Hôm nay + Vàng + Thanh công cụ + Sau %1$d ngày + Nhân vật + Trọng lượng mang + Radio Truy cập nhanh Bố cục: %1$s Toàn chiều rộng diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 66089e8d7d..52df29b54b 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -2140,6 +2140,23 @@ 继续阅读 此游戏还没有 Steam 指南。 无法加载 Steam 指南。请在联网后重试。 + 伴侣页 + 此游戏还没有伴侣页。Stardew Valley 已支持。 + 安装 Stardew Valley 的 SMAPI 双屏模组,即可在这里查看你的农场。 + 载入存档后,这里会显示你的农场。 + 体力 + 生命值 + 本周生日 + 任务 + 安装 SKSE 插件 SkyrimWebSocket,即可在这里查看你的角色。 + 安装 F4SE 插件 Thor Pip-Boy,即可在这里查看你的 Pip-Boy。 + 等级 %1$d + 法力 + 耐力 + 行动点数 + 瓶盖 + 辐射 + 收藏 镜像 拖动框选要在这里显示的游戏区域,例如小地图。 保存区域 @@ -2177,6 +2194,13 @@ 区域 上屏 缩放 + 今天 + 金币 + 快捷栏 + %1$d 天后 + 角色 + 负重 + 收音机 快速访问 布局:%1$s 全宽 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 661357f97f..65b8bebf00 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -2062,6 +2062,23 @@ 繼續閱讀 此遊戲暫時沒有 Steam 指南。 無法載入 Steam 指南。請在連線後再試。 + 伴侶頁 + 此遊戲暫時沒有伴侶頁。Stardew Valley 已支援。 + 安裝 Stardew Valley 的 SMAPI 雙屏模組,即可在這裡查看你的農場。 + 載入存檔後,這裡會顯示你的農場。 + 體力 + 生命值 + 本週生日 + 任務 + 安裝 SKSE 插件 SkyrimWebSocket,即可在這裡查看你的角色。 + 安裝 F4SE 插件 Thor Pip-Boy,即可在這裡查看你的 Pip-Boy。 + 等級 %1$d + 魔力 + 耐力 + 行動點數 + 瓶蓋 + 輻射 + 最愛 鏡像 拖曳框選要在這裡顯示的遊戲區域,例如小地圖。 儲存區域 @@ -2099,6 +2116,13 @@ 區域 上屏 縮放 + 今天 + 金幣 + 快捷列 + %1$d 天後 + 角色 + 負重 + 收音機 快速存取 版面配置:%1$s 全寬 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 223a0e5fed..23e329b6d7 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -2062,6 +2062,23 @@ 繼續閱讀 此遊戲尚無 Steam 指南。 無法載入 Steam 指南。請在連線後再試。 + 夥伴頁 + 此遊戲尚無夥伴頁。Stardew Valley 已支援。 + 安裝 Stardew Valley 的 SMAPI 雙螢幕模組,即可在這裡查看你的農場。 + 載入存檔後,這裡會顯示你的農場。 + 體力 + 生命值 + 本週生日 + 任務 + 安裝 SKSE 外掛 SkyrimWebSocket,即可在這裡查看你的角色。 + 安裝 F4SE 外掛 Thor Pip-Boy,即可在這裡查看你的 Pip-Boy。 + 等級 %1$d + 魔力 + 耐力 + 行動點數 + 瓶蓋 + 輻射 + 最愛 鏡像 拖曳框選要在這裡顯示的遊戲區域,例如小地圖。 儲存區域 @@ -2099,6 +2116,13 @@ 區域 上螢幕 縮放 + 今天 + 金幣 + 快捷列 + %1$d 天後 + 角色 + 負重 + 收音機 快速存取 版面配置:%1$s 全寬 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7e1f0a70c6..65bd50a784 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2358,6 +2358,23 @@ Continue reading There are no Steam guides for this game yet. Could not load Steam guides. Check back once you are online. + Companion + There is no companion page for this game yet. Stardew Valley has one. + Install the Stardew Valley dual-screen mod for SMAPI to see your farm here. + Load a save to see your farm here. + Energy + Health + Birthdays this week + Quests + Install the SkyrimWebSocket SKSE plugin to see your character here. + Install the Thor Pip-Boy F4SE plugin to see your Pip-Boy here. + Level %1$d + Magicka + Stamina + Action points + Caps + Rads + Favorites Mirror Drag over the part of the game to show here, such as the minimap. Save region @@ -2406,6 +2423,13 @@ Region Top screen Scaling + Today + Gold + Hotbar + In %1$d days + Character + Carry weight + Radio Quick Access Layout: %1$s Full width diff --git a/app/src/test/java/com/droiddeck/launcher/companion/RpgCompanionTest.kt b/app/src/test/java/com/droiddeck/launcher/companion/RpgCompanionTest.kt new file mode 100644 index 0000000000..6a9c811a62 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/companion/RpgCompanionTest.kt @@ -0,0 +1,75 @@ +package com.droiddeck.launcher.companion + +import org.json.JSONObject +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.annotation.Config + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [33]) +class RpgCompanionTest { + @Test + fun pipBoyStatsFavoritesAndRadio() { + val data = """{"type":"data","id":"droiddeck","data":{ + "player.stats":{"level":23,"hp":245,"hpMax":310,"ap":88,"apMax":105,"rads":65,"caps":1834,"weight":187.4,"weightMax":260}, + "player.inventory":[ + {"id":"0x101","name":"Old Laser Rifle","type":"weapon","count":1,"equipped":true}, + {"id":"0x102","name":"Service Pistol","type":"weapon","count":1,"equipped":false,"fav":1}, + {"id":"0x236","name":"Med Kit","type":"aid","count":7,"equipped":false,"fav":0}], + "radio":{"enabled":true}}}""" + val s = RpgCompanion.reduce(RpgCompanion.FALLOUT_4, RpgCompanion.State(), data) + assertEquals(23, s.level) + assertEquals(listOf("hp", "ap"), s.bars.map { it.key }) + assertEquals(310f, s.bars[0].max) + assertEquals(listOf("Med Kit", "Service Pistol"), s.slots.map { it.label }) + assertEquals("×7", s.slots[0].detail) + assertEquals(true, s.radio) + assertEquals("1834", s.facts.toMap()["caps"]) + + val toggle = JSONObject(RpgCompanion.trigger(RpgCompanion.FALLOUT_4, s.slots[1], 3)) + assertEquals("toggle", toggle.getString("command")) + assertEquals("0x102", toggle.getJSONObject("params").getString("id")) + assertEquals(false, JSONObject(RpgCompanion.radio(false, 4)).getJSONObject("params").getBoolean("enable")) + } + + @Test + fun skyrimVitalsAndHotkeys() { + val data = """{"type":"data","id":"droiddeck","ts":1,"fields":{ + "health":320.5,"health.max":400,"magicka":180,"magicka.max":200,"stamina":99.25,"stamina.max":150, + "level":31,"weight":210.2,"carry":300, + "hotkeys":[{"slot":1,"bound":true,"kind":"spell","name":"Flames","school":"Destruction"},{"slot":2,"bound":false}, + {"slot":3,"bound":true,"kind":"item","name":"Iron Sword","categoryType":"Weapon"}]}}""" + val s = RpgCompanion.reduce(RpgCompanion.SKYRIM_SE, RpgCompanion.State(), data) + assertEquals(listOf("health", "magicka", "stamina"), s.bars.map { it.key }) + assertEquals(31, s.level) + assertEquals(listOf("1", "3"), s.slots.map { it.key }) + assertEquals("Destruction", s.slots[0].detail) + assertEquals("210 / 300", s.facts.toMap()["weight"]) + assertNull(s.radio) + + val partial = RpgCompanion.reduce(RpgCompanion.SKYRIM_SE, s, """{"type":"data","id":"droiddeck","fields":{"level":32}}""") + assertEquals(32, partial.level) + assertEquals(3, partial.bars.size) + + val hotkey = JSONObject(RpgCompanion.trigger(RpgCompanion.SKYRIM_SE, s.slots[1], 9)) + assertEquals("hotkey_trigger", hotkey.getString("command")) + assertEquals(3, hotkey.getInt("slot")) + } + + @Test + fun subscriptionsAndForeignMessages() { + val skyrim = JSONObject(RpgCompanion.subscribe(RpgCompanion.SKYRIM_SE)) + assertEquals("Hotkey::Items", skyrim.getJSONObject("fields").getString("hotkeys")) + assertTrue(skyrim.getJSONObject("settings").getBoolean("sendOnChange")) + assertEquals("player.stats", JSONObject(RpgCompanion.subscribe(RpgCompanion.FALLOUT_4)).getJSONArray("fields").getString(0)) + val s = RpgCompanion.State(level = 5) + assertEquals(s, RpgCompanion.reduce(RpgCompanion.FALLOUT_4, s, """{"type":"hello","server":"ThorPipBoy"}""")) + assertEquals(s, RpgCompanion.reduce(RpgCompanion.FALLOUT_4, s, """{"type":"data","id":"other","data":{}}""")) + assertEquals(8767, RpgCompanion.port(RpgCompanion.FALLOUT_4)) + assertEquals(8765, RpgCompanion.port(RpgCompanion.SKYRIM_SE)) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/companion/StardewCompanionTest.kt b/app/src/test/java/com/droiddeck/launcher/companion/StardewCompanionTest.kt new file mode 100644 index 0000000000..8f0f74ad77 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/companion/StardewCompanionTest.kt @@ -0,0 +1,114 @@ +package com.droiddeck.launcher.companion + +import com.droiddeck.launcher.session.LoopbackWebSocket +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.annotation.Config +import java.io.DataInputStream +import java.net.ServerSocket +import java.security.MessageDigest +import java.util.Base64 +import kotlin.concurrent.thread + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [33]) +class StardewCompanionTest { + @Test + fun reducesTheModsMessages() { + var s = StardewCompanion.State() + assertFalse(s.inGame) + s = StardewCompanion.reduce(s, """{"type":"game_info","gameId":"stardew","saveName":"Sunny Farm"}""") + s = StardewCompanion.reduce(s, """{"type":"sdv_day","season":"spring","day":5,"year":1,"weekday":"Fri","timeOfDay":1330, + "weatherToday":"sunny","weatherTomorrow":"rain","gold":12500,"energy":200,"maxEnergy":270,"health":90,"maxHealth":100,"location":"Farm"}""") + s = StardewCompanion.reduce(s, """{"type":"sdv_inventory","selected":2,"capacity":36,"items":[ + {"slot":0,"id":"(T)Axe","name":"Axe","count":1,"quality":0}, + {"slot":2,"id":"(O)24","name":"Parsnip","count":15,"quality":1}, + {"slot":3,"id":"","name":"","count":0}, + {"slot":20,"id":"(O)388","name":"Wood","count":99}]}""") + s = StardewCompanion.reduce(s, """{"type":"sdv_quests","quests":[{"index":0,"title":"Introductions","objective":"Meet 28 people","daysLeft":-1,"complete":"0"}]}""") + s = StardewCompanion.reduce(s, """{"type":"sdv_villagers","villagers":[ + {"name":"Abigail","npc":"Abigail","birthdayIn":3},{"name":"Haley","npc":"Haley","birthdayIn":0},{"name":"Sam","npc":"Sam","birthdayIn":20}]}""") + s = StardewCompanion.reduce(s, """{"type":"sdv_sprite","id":"(O)24","png":"iVBORw0KGgo="}""") + s = StardewCompanion.reduce(s, "not json") + s = StardewCompanion.reduce(s, """{"type":"sdv_mines","deepest":40}""") + + assertTrue(s.inGame) + assertEquals("Sunny Farm", s.save) + assertEquals(1330, s.day!!.time) + assertEquals(12500L, s.day!!.gold) + assertEquals(2, s.selected) + assertEquals(12, s.hotbar.size) + assertEquals("Axe", s.hotbar[0]!!.name) + assertNull(s.hotbar[1]) + assertEquals(15, s.hotbar[2]!!.count) + assertNull(s.hotbar[3]) + assertEquals(listOf("Haley", "Abigail"), s.birthdays.map { it.name }) + assertFalse(s.quests.single().complete) + assertEquals("iVBORw0KGgo=", s.sprites["(O)24"]) + + assertFalse(StardewCompanion.reduce(s, """{"type":"game_info","saveName":""}""").inGame) + } + + @Test + fun commandsAndClock() { + assertEquals("""{"type":"select_slot","slot":4}""", StardewCompanion.selectSlot(4)) + assertEquals("6:10 am", StardewCompanion.clock(610, true)) + assertEquals("12:00 pm", StardewCompanion.clock(1200, true)) + assertEquals("1:30 am", StardewCompanion.clock(2530, true)) + assertEquals("18:40", StardewCompanion.clock(1840, false)) + } + + @Test + fun talksToALoopbackWebSocketServer() { + val server = ServerSocket(0) + var received: String? = null + val worker = thread { + server.accept().use { client -> + val input = DataInputStream(client.getInputStream()) + val headers = generateSequence { readLine(input) }.takeWhile { it.isNotEmpty() }.toList() + val key = headers.first { it.startsWith("Sec-WebSocket-Key:") }.substringAfter(':').trim() + val accept = Base64.getEncoder().encodeToString( + MessageDigest.getInstance("SHA-1").digest((key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11").toByteArray())) + val out = client.getOutputStream() + out.write("HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: $accept\r\n\r\n".toByteArray()) + val big = "x".repeat(300) + for (text in listOf("""{"type":"game_info","saveName":"A"}""", big)) { + val bytes = text.toByteArray() + out.write(0x81) + if (bytes.size < 126) out.write(bytes.size) else { out.write(126); out.write(bytes.size shr 8); out.write(bytes.size and 0xFF) } + out.write(bytes) + } + out.flush() + val b0 = input.read() + val len = input.read() and 0x7F + val mask = ByteArray(4).also(input::readFully) + val payload = ByteArray(len).also(input::readFully) + for (i in payload.indices) payload[i] = (payload[i].toInt() xor mask[i % 4].toInt()).toByte() + if (b0 == 0x81) received = String(payload) + } + } + LoopbackWebSocket(server.localPort).use { ws -> + assertEquals("""{"type":"game_info","saveName":"A"}""", ws.receive()) + assertEquals(300, ws.receive()!!.length) + ws.send(StardewCompanion.refresh()) + } + worker.join(5_000) + server.close() + assertEquals("""{"type":"refresh"}""", received) + } + + private fun readLine(input: DataInputStream): String? { + val sb = StringBuilder() + while (true) { + val c = input.read() + if (c < 0) return null + if (c == '\n'.code) return sb.toString().trimEnd('\r') + sb.append(c.toChar()) + } + } +} diff --git a/docs/development/bottom-screen-companion-api.md b/docs/development/bottom-screen-companion-api.md new file mode 100644 index 0000000000..c0dd87c22a --- /dev/null +++ b/docs/development/bottom-screen-companion-api.md @@ -0,0 +1,137 @@ +# Bottom screen: companion API for PC games + +Part of the [bottom screen research](bottom-screen.md). Researched 2026-11-26 against `main` at `d788afc12`. Phase 1 has started (Stardew, Skyrim and Fallout 4 adapters); see the status in the overview. + +Let games and mods running in the Linux and Proton session drive pages on DroidDeck's bottom screen: live state (health, money, map position, inventory, quests) and touch commands back into the game. + +## Use cases + +- **RPGs**: a Pip-Boy for Fallout 4, inventory and quests for Skyrim and Fallout: New Vegas, equipment swaps by touch. +- **Sims and management**: Stardew Valley's day, bag, bundles and calendar; RimWorld colonists and alerts; Project Zomboid's status. +- **Open world**: GTA's radio, weapons, wanted level and GPS-to-blip. +- **Racing and flight**: the telemetry dashboards DroidDeck already has. +- **Speedrunning**: LiveSplit splits for any game with an auto-splitter. + +## Companions people already use + +Several Thor companions already run against PC games in Wine, and two document DroidDeck as a supported launcher. Each is a separate Android app paired with a game-side mod that serves state on loopback. + +| Companion | Game-side piece | Transport | +| --- | --- | --- | +| [Thor Pip-Boy](https://github.com/harmssi/thor-pipboy) (Fallout 4, **targets DroidDeck**) | F4SE plugin | WebSocket on `127.0.0.1:8767`, protocol copied from SkyrimWebSocket; commands `toggle`, `equip`, `use`, `radio`; raw access to the game's Pip-Boy data | +| [Grand Theft Companion](https://github.com/BrianJr03/GrandTheftCompanion) (GTA IV and V, **documents DroidDeck setup**) | `.asi` via Ultimate ASI Loader (IV) or ScriptHookV (V); needs `WINEDLLOVERRIDES=dinput8=n,b` in Steam launch options | JSON on `127.0.0.1:47801` at 20 Hz with a hello frame; radio, weapon, GPS and cheat commands. Its map page is a crop of the minimap | +| [AYN Thor dual-screen mods](https://github.com/JoeCorrell/AYN-Thor-Dualscreen-Mods) (Stardew Valley, for WEMU) | SMAPI mod | Hand-written RFC 6455 WebSocket on `127.0.0.1:7786` (".NET's WebSocket server wraps Windows components Wine does not implement"). No auth. Replays the latest message of each kind on connect, computes nothing without a client, hides the game HUD while one is attached. Sprites sent once as base64 PNG with nine-patch insets. Commands: `select_slot`, `move_item`, `eat_slot`, `sort_bag`, `shift_toolbar`, `craft_recipe` and others. Optional UDP beacon on 7787. The [Barry client](https://github.com/project-barry/stardew-dual-screen/blob/main/docs/protocol.md) documents the schema and ships a mock server | +| [SkyrimWebSocket](https://github.com/andreyvelsk/SkyrimWebSocket) + SkyrimWebMonitor | SKSE plugin | WebSocket on `127.0.0.1:8765`. Client-driven `subscribe` with frequency, send-on-change and aliased fields; `query`, `heartbeat`, `command` → `commandResult` ([protocol](https://github.com/andreyvelsk/SkyrimWebSocket/blob/main/PROTOCOL.md)). Client is a web app | +| [SkyrimSE-DualScreen](https://github.com/Plus-Cloud/SkyrimSE-DualScreen) | `SkyrimAYN.dll` | A 384 KiB memory-mapped file with a seqlock header ([layout](https://github.com/Plus-Cloud/SkyrimSE-DualScreen/blob/main/native/shared-memory.md)). Only works with its own bundled Wine | +| FNVDS (Fallout: New Vegas) | xNVSE plugin | TCP on `127.0.0.1:47888` | +| FFXII Companion | LUA Script Loader script reading memory, gated on the game build | JSON files in shared storage; commands as request files | +| [ZomboidDS](https://github.com/Space001000/ZomboidDS) (Project Zomboid on a Java port) | Lua and Java mod | WebSocket `ws://127.0.0.1:7786/ws` (**the same port as the Stardew mod**), envelope `{v,type,seq,data}`, hello first, full-state topics replayed on connect, `command_result`, `capabilities[]`, icons over HTTP ([protocol](https://github.com/Space001000/ZomboidDS/blob/main/protocol/PROTOCOL.md)) | + +Lessons: + +- Every project invents its own port and schema; two already collide on 7786. +- Each needs its own Android app on the bottom screen. Thor Pip-Boy warns that bringing it to the front "lowers DroidDeck's priority and could get the game killed" while Fallout 4 is loading. Pages drawn inside DroidDeck's own bottom-screen Presentation avoid that. +- The good protocols share a shape: hello with capabilities, complete state per topic replayed on connect, commands with ids and results, assets sent once and cached. +- Mods should do no work while nobody is watching (the Stardew mod and SkyrimWebSocket both do this). + +## Game-side APIs a companion could consume + +| Source | Protocol | Works in Proton on ARM? | +| --- | --- | --- | +| SKSE, F4SE, xNVSE plugins | Any socket from a Windows DLL | Yes, proven by the companions above | +| ScriptHookV / ASI plugins | Any socket | Yes, proven | +| [RIMAPI](https://github.com/IlyaChichkov/RIMAPI) (RimWorld) | REST and SSE on `localhost:8765`, 120+ endpoints, extensible by other mods | Likely (Unity, Mono) | +| [Hollow Knight tracker](https://github.com/kingkiller39/HollowKnightRandomizerTracker2.8) | WebSocket on `localhost:11420` | Likely | +| [Ficsit Remote Monitoring](https://docs.ficsit.app/ficsitremotemonitoring/latest/webserver.html) (Satisfactory) | HTTP and WebSocket on 8080 | The game is heavy for ARM | +| [Valheim WebMap](https://github.com/kylepaulsen/ValheimWebMap) | BepInEx, HTTP and WebSocket on 3000 | Server-side mod | +| Cyberpunk 2077 | CET plus RedSocket, used by [Crowd Control](https://crowdcontrol.live/guides/cyberpunk2077/) | Unknown; heavy | +| Fallout 4 Pip-Boy app protocol | UDP 28000 discovery, binary stream on TCP 27000 ([reverse-engineered](https://github.com/luckydonald/JavaPipBoyServer/blob/master/PROTOCOL.md)) | Broken in the current game build per Thor Pip-Boy | +| CS2 / Dota 2 Game State Integration | The game POSTs JSON to a URI declared in a cfg file | Protocol is a good model; the games are unrealistic on ARM | +| ETS2 / ATS telemetry SDK | Shared memory; needs an in-Wine relay such as [Funbit's server](https://github.com/Funbit/ets2-telemetry-server) | With a relay | +| [LiveSplit server](https://github.com/LiveSplit/LiveSplit.Server) | Text commands on TCP 16834 | Yes | +| Discord Rich Presence | Named pipe `\\.\pipe\discord-ipc-0` with JSON frames | A Wine-side pipe sink would give presence data for any game that integrates Discord | +| Racing UDP, War Thunder, Elite Dangerous | Already consumed by DroidDeck (below) | Yes | + +Generic memory readers that publish JSON are another model: [tosu](https://github.com/KotRikD/tosu) serves osu! state on a WebSocket, and LiveSplit's ASL and [WASM auto-splitters](https://github.com/alexknauth/hollowknight-autosplit-wasm) are per-game pointer descriptions that a Rust runtime (livesplit-core) evaluates. + +## What DroidDeck already has + +Paths are under [`app/src/main/java/com/droiddeck/launcher/`](../../app/src/main/java/com/droiddeck/launcher/). + +- **Shared loopback.** proot creates no network namespace and the bwrap shim ignores `--unshare-net`, so the guest's `127.0.0.1` is the app's `127.0.0.1` ([`core/NetworkReport.kt`](../../app/src/main/java/com/droiddeck/launcher/core/NetworkReport.kt), `tools/linuxfs/overlay/usr/local/bin/droiddeck-bwrap`). A Windows game in Proton can connect to a socket the app opens, and the app can connect to a socket a mod opens. +- **Telemetry template.** [`session/GameTelemetry.kt`](../../app/src/main/java/com/droiddeck/launcher/session/GameTelemetry.kt) parses Codemasters (UDP 20777), Forza (5300) and OutGauge (4444) packets, War Thunder's `http://127.0.0.1:8111/state` and Elite Dangerous's `Status.json` read straight from the Proton prefix. [`ui/BottomTelemetryPage.kt`](../../app/src/main/java/com/droiddeck/launcher/ui/BottomTelemetryPage.kt) runs one listener per source, marks data stale after 3 s, reports busy ports and unknown formats, and draws dashboards. [`session/TelemetryOutput.kt`](../../app/src/main/java/com/droiddeck/launcher/session/TelemetryOutput.kt) edits a game's config in its prefix (with a backup) to turn telemetry on. This is the first version of the companion API: built-in adapters for known games. +- **Agent channel.** `droiddeck-agent` in the guest and [`agent/AgentGuest.kt`](../../app/src/main/java/com/droiddeck/launcher/agent/AgentGuest.kt) talk through request and response files in a shared directory, plus watched state files (`focus.json` and others). `steamEval` reaches Steam's UI over the DevTools port. +- **Installing mods.** [`session/WinComponents.kt`](../../app/src/main/java/com/droiddeck/launcher/session/WinComponents.kt) installs per-game components from the [DroidDeck-Components](https://github.com/Droid-Deck/DroidDeck-Components) catalog: download, extract, copy DLLs and files, DLL overrides, registration. That covers the DLL side of SKSE, F4SE, ScriptHookV, ASI Loader and BepInEx. It stages files only under `system32` or `syswow64`, so mods that live in the game's own folder (Thor Pip-Boy's F4SE plugin and F4SE itself) need a game-directory install step, and F4SE also needs the launch option that starts `f4se_loader.exe`. Per-game environment overrides ([`session/GameEnvironmentStore.kt`](../../app/src/main/java/com/droiddeck/launcher/session/GameEnvironmentStore.kt)) reach the game through the `steam-compatibility` wrapper, including `WINEDLLOVERRIDES`. There is no SMAPI or BepInEx installer yet. +- **A second guest on the bottom screen.** The bottom KDE desktop is a second compositor in its own process with its own `/run/droiddeck`, so the main guest cannot see its Wayland socket. A debug-gated run queue in [`droiddeck-desktop`](../../tools/linuxfs/desktop/droiddeck-desktop) runs scripts there with `WAYLAND_DISPLAY=wayland-1 DISPLAY=:1`, which is a seed for a "run on bottom" command. + +## Proposed design + +### Phase 1: adapters for existing companions + +DroidDeck connects as a client to the servers mods already open and draws their pages natively in the bottom-screen Presentation: + +- Stardew (port 7786, WEMU protocol), Skyrim and Fallout 4 (SkyrimWebSocket protocol on 8765 and Thor Pip-Boy on 8767), GTA (47801), RIMAPI, the Hollow Knight tracker, LiveSplit. +- Probe only the ports known for the focused app id, so a busy port never confuses two games. +- Offer the mod itself through the components catalog, so setup is one toggle in the game's settings. This needs two installer additions first: copying into the game's directory, and setting the game's launch option to the script extender's loader. + +This gives working showcases without writing any mods, and a reason to define the shared state model first. + +### Phase 2: DroidDeck's own protocol + +For new mods, DroidDeck is the server and mods are clients: + +- **Transport.** WebSocket at `ws://127.0.0.1:/companion/v1`, and newline-delimited JSON over raw TCP on the same port (detected from the first bytes). Clients are trivial under Wine; servers inside Wine are not (the Stardew mod had to hand-write one). Several mods or games can attach at once. +- **Discovery.** DroidDeck sets `DROIDDECK_COMPANION_URL`, `DROIDDECK_COMPANION_TOKEN` (random per launch) and `DROIDDECK_APPID` in the game's environment through the existing game-environment path, and writes the same values to a known file in the prefix for processes that lose the environment. +- **Security.** Any Android app can reach loopback, so the token is required in `hello` within about 2 s or the connection closes. No remote bind. Commands that change the game need a per-mod user toggle. Limits on frame and asset sizes. +- **Envelope.** `{"v":1,"type":…,"seq":n,…}`. + +| Direction | Message | Purpose | +| --- | --- | --- | +| game → DroidDeck | `hello{token, game{appid, build}, mod{id, version}, capabilities[]}` | Identify and authenticate | +| | `declare{states{key: {type, unit, min, max}}}` | Describe the state keys the mod publishes | +| | `state{topic, data}` | Complete value of a topic, never a diff; DroidDeck keeps the latest and replays it when a page opens | +| | `asset{id: sha256, mime, nine_patch, filter}` + binary frame | Art sent once and cached across sessions by content hash | +| | `event{toast \| haptic \| sound}` | Notifications | +| | `result{id, ok, error}` | Command outcome | +| DroidDeck → game | `welcome{session, screen{w, h}}` | Accept the connection | +| | `visibility{visible, topics[], hz}` | Tell the mod what is on screen so it computes nothing else | +| | `command{id, name, args}` | Touch actions | +| | `input{button}` | Pass L/R or similar when a page claims them | +| | `ping` | Liveness | + +A small C header and a C# client file would let SKSE, F4SE, ASI and BepInEx/SMAPI authors adopt it in an afternoon. + +### Phase 3: pages + +- **Declarative pages** in a `.ddpage` zip (`manifest.json` plus assets), modelled on Eden Duo's [package format](https://github.com/igawa6/eden-duo-companions/blob/main/docs/PACKAGE_FORMAT.md) but drawn with DroidDeck's own components: + - `pages[]` of widgets (`label`, `value`, `bar`, `grid`, `list`, `image`, `map`, `button`) bound to state keys, with `repeat` over arrays; + - actions `command`, `page` and `input` on tap, hold and swipe; + - a settings page backed by the mod's options; + - host values (`@device.*`, `@perf.*`) so pages can mix game and device data. +- **Normalized core keys**, the lesson from SimHub, whose dashboards work across many games because readers map them onto one property tree: `player.health`, `player.money`, `location.name`, `map.{x,y,heading}`, `inventory[]`, `quests[]`, `game.time`. A generic RPG page then works for any mod that provides them. +- **WebView escape hatch** for richer pages, in the style of EmuLnk's [theme API](https://github.com/EmuLnk/emulnk-repo/wiki/Theme-API): `window.droiddeck.onState` and `.send`. This also hosts existing web clients like SkyrimWebMonitor unchanged. +- Pages ship inside the mod, or from a catalog repository like the components catalog. + +### Phase 4: run on bottom + +A `droiddeck-run-bottom -- ` command, like Armada's `armada-run-bottom`, that opens a guest program on the bottom screen with touch. Kanto Gear's separate-window mode and second-monitor mods would then work as they are. Unity games could render to `Display.displays[1]` (the Silksong Android approach) if the bottom panel is exposed as a second output to the guest. Builds on the bottom desktop's run queue, or on binding its runtime directory into the main guest. + +### Phase 5: memory profiles (only if demand) + +Per-game JSON pointer profiles, gated on the Steam build id, evaluated on the Android side against the game process, in the style of Eden Duo or LiveSplit's auto-splitters. Strict version gating with a "needs build X" page, as Eden Duo does. Highest maintenance cost; only for popular games without mod support. + +## Open questions + +- Whether a single port and token for every game is enough, or each session gets its own port. +- How pages and mods are versioned together, and what happens when a mod is newer than the page. +- Which component installs belong in the catalog (SKSE, F4SE, ScriptHookV, ASI Loader, SMAPI, BepInEx) and how they interact with Steam updates of the game. +- Asking the authors of Thor Pip-Boy, Grand Theft Companion and the Stardew mod whether they would also speak DroidDeck's protocol. +- Touch commands that change game state while the game is paused or loading. + +## Milestones + +1. Stardew adapter (port 7786) with a native page, and the SMAPI mod offered through components. +2. Skyrim and Fallout 4 adapters (SkyrimWebSocket protocol), GTA adapter. +3. DroidDeck protocol server, C and C# clients, `.ddpage` renderer, normalized keys. +4. Run on bottom. +5. Memory profiles. diff --git a/docs/development/bottom-screen.md b/docs/development/bottom-screen.md index ba0ce9d065..4efcebdd64 100644 --- a/docs/development/bottom-screen.md +++ b/docs/development/bottom-screen.md @@ -1,6 +1,6 @@ # Bottom screen: research and proposals -Researched 2026-11-26 against `main` at `d788afc12` (0.7.11). This document records what other dual-screen Android projects put on the second screen, how they get their data, where DroidDeck stood at that commit, and the features we want to build. "DroidDeck today" is that researched baseline; each proposal's **Status** line says what has been built since, and proposals without one are not scheduled. Two proposals have their own documents: [region mirror](bottom-screen-region-mirror.md) and [guides tab](bottom-screen-guides.md). +Researched 2026-11-26 against `main` at `d788afc12` (0.7.11). This document records what other dual-screen Android projects put on the second screen, how they get their data, where DroidDeck stood at that commit, and the features we want to build. "DroidDeck today" is that researched baseline; each proposal's **Status** line says what has been built since, and proposals without one are not scheduled. Three proposals have their own documents: [region mirror](bottom-screen-region-mirror.md), [guides tab](bottom-screen-guides.md) and [companion API](bottom-screen-companion-api.md). The starting point was WULFF DEN's survey video [Dual screen Android apps are getting crazy](https://youtu.be/dAiuG2A-wkc) (2026-11-26). It covers the AYN Thor and Retroid Pocket Duo, and most of its apps come from the [GAFT list](https://andreyvelsk.github.io/GAFT) of Thor apps. @@ -167,10 +167,12 @@ Details: [bottom-screen-guides.md](bottom-screen-guides.md). ### 8. Companion API for PC games -**Status:** not built here; the first adapters (Stardew Valley, Skyrim SE, Fallout 4) follow in their own change. +**Status:** phase 1 started, as its own bottom-screen panel (Companion in the panel picker), drawn with the settings groups and rows. It connects over loopback only while shown and while the bottom screen is lit: Stardew Valley (the dual-screen SMAPI mod on 7786: day, gold, energy, health, a tappable hotbar, birthdays, quests), Skyrim SE (SkyrimWebSocket on 8765) and Fallout 4 (Thor Pip-Boy on 8767: vitals, caps, rads, carry weight, favorites to equip or use, radio). Code: [`companion/`](../../app/src/main/java/com/droiddeck/launcher/companion/), [`ui/BottomCompanionPage.kt`](../../app/src/main/java/com/droiddeck/launcher/ui/BottomCompanionPage.kt). Let mods running in Proton drive native bottom-screen pages over loopback. Thor Pip-Boy (Fallout 4) and Grand Theft Companion (GTA) already run against DroidDeck as separate apps, and the Stardew, Skyrim and RimWorld ecosystems have servers we can adapt to. Plan: adapters for those first, then DroidDeck's own token-authenticated protocol with declarative pages and normalized state keys, then "run on bottom", then memory profiles only if needed. The existing racing, War Thunder and Elite Dangerous telemetry is the first set of built-in adapters. +Details: [bottom-screen-companion-api.md](bottom-screen-companion-api.md). + ### 9. Steam's Quick Access menu on the bottom screen **Status:** built as its own panel (Quick Access in the panel picker, Steam sessions only) and checked on a Retroid Pocket Duo Lite Plus in Big Picture and in a game. The bottom screen shows Steam's real Quick Access menu: notifications, friends and chat, quick settings, performance, soundtracks and help, plus Decky Loader's tab and its plugins when Decky is enabled. Taps, drags and scrolling go to it; the controller stays on the top screen, so the d-pad drives the library or the game while the menu stays open. Code: [`session/SteamQam.kt`](../../app/src/main/java/com/droiddeck/launcher/session/SteamQam.kt), [`ui/BottomSteamQamPanel.kt`](../../app/src/main/java/com/droiddeck/launcher/ui/BottomSteamQamPanel.kt), [`droiddeck-qam-relay`](../../tools/linuxfs/overlay/usr/local/bin/droiddeck-qam-relay). diff --git a/docs/development/evidence/bottom-companion-pipboy-preview-2026-11-27.png b/docs/development/evidence/bottom-companion-pipboy-preview-2026-11-27.png new file mode 100644 index 0000000000..609829723b Binary files /dev/null and b/docs/development/evidence/bottom-companion-pipboy-preview-2026-11-27.png differ diff --git a/docs/development/evidence/bottom-companion-stardew-preview-2026-11-27.png b/docs/development/evidence/bottom-companion-stardew-preview-2026-11-27.png new file mode 100644 index 0000000000..7539ac65a5 Binary files /dev/null and b/docs/development/evidence/bottom-companion-stardew-preview-2026-11-27.png differ diff --git a/docs/development/evidence/bottom-screen-companion-empty-bottom-2026-11-27.png b/docs/development/evidence/bottom-screen-companion-empty-bottom-2026-11-27.png new file mode 100644 index 0000000000..0c8a87785c Binary files /dev/null and b/docs/development/evidence/bottom-screen-companion-empty-bottom-2026-11-27.png differ