From d6d47d379f5c580c2c5b98ca1e27d06154646bc9 Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:05:24 -0500 Subject: [PATCH] fix(input): address review of per-game controls, binder, editor and Winlator import --- .../com/droiddeck/launcher/SessionActivity.kt | 4 +++- .../launcher/input/ControllerPrefs.kt | 14 +++++++---- .../launcher/input/InputLibraries.kt | 5 ++-- .../droiddeck/launcher/input/InputLibrary.kt | 5 ++-- .../launcher/input/WinlatorLayouts.kt | 12 +++++++--- .../droiddeck/launcher/ui/CommunityLayouts.kt | 5 ++-- .../launcher/ui/InputButtonsEditor.kt | 10 +++++--- .../launcher/ui/InputSettingsPage.kt | 23 ++++++++++++------- .../launcher/ui/InputSurfaceDialog.kt | 2 ++ .../launcher/ui/InputSurfaceEditorView.kt | 9 ++++---- .../main/res/values-ar/input_flow_strings.xml | 4 ++-- .../values-b+es+419/input_flow_strings.xml | 4 ++-- .../main/res/values-bg/input_flow_strings.xml | 4 ++-- .../main/res/values-cs/input_flow_strings.xml | 4 ++-- .../main/res/values-da/input_flow_strings.xml | 4 ++-- .../main/res/values-de/input_flow_strings.xml | 4 ++-- .../main/res/values-el/input_flow_strings.xml | 4 ++-- .../main/res/values-es/input_flow_strings.xml | 4 ++-- .../main/res/values-fi/input_flow_strings.xml | 4 ++-- .../main/res/values-fr/input_flow_strings.xml | 4 ++-- .../main/res/values-hi/input_flow_strings.xml | 4 ++-- .../main/res/values-hu/input_flow_strings.xml | 4 ++-- .../main/res/values-in/input_flow_strings.xml | 4 ++-- .../main/res/values-it/input_flow_strings.xml | 4 ++-- .../main/res/values-ja/input_flow_strings.xml | 4 ++-- .../main/res/values-ko/input_flow_strings.xml | 4 ++-- .../main/res/values-ms/input_flow_strings.xml | 4 ++-- .../main/res/values-nb/input_flow_strings.xml | 4 ++-- .../main/res/values-nl/input_flow_strings.xml | 4 ++-- .../main/res/values-pl/input_flow_strings.xml | 4 ++-- .../res/values-pt-rPT/input_flow_strings.xml | 4 ++-- .../main/res/values-pt/input_flow_strings.xml | 4 ++-- .../main/res/values-ro/input_flow_strings.xml | 4 ++-- .../main/res/values-ru/input_flow_strings.xml | 4 ++-- .../main/res/values-sv/input_flow_strings.xml | 4 ++-- .../main/res/values-th/input_flow_strings.xml | 4 ++-- .../main/res/values-tr/input_flow_strings.xml | 4 ++-- .../main/res/values-uk/input_flow_strings.xml | 4 ++-- .../main/res/values-vi/input_flow_strings.xml | 4 ++-- .../res/values-zh-rCN/input_flow_strings.xml | 4 ++-- .../res/values-zh-rHK/input_flow_strings.xml | 4 ++-- .../res/values-zh-rTW/input_flow_strings.xml | 4 ++-- .../main/res/values/input_flow_strings.xml | 4 ++-- .../launcher/input/InputLibraryGamesTest.kt | 20 ++++++++++++++++ .../launcher/input/WinlatorLayoutsTest.kt | 11 +++++++++ .../launcher/ui/SessionSecondScreenTest.kt | 5 ++-- 46 files changed, 159 insertions(+), 98 deletions(-) diff --git a/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt b/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt index cf41a43c9b..b24dba6c03 100644 --- a/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt +++ b/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt @@ -1370,8 +1370,10 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde if (nextGame != null) gameStarts++ gestureGame = nextGame refreshGestureConfig() + val inputChanges = inputGameKey() != SessionState.inputGame + if (inputChanges) releasePads() restoreGamePanel(nextGame) - if (inputGameKey() != SessionState.inputGame) { releasePads(); refreshInputProfile() } + if (inputGameKey() != SessionState.inputGame) refreshInputProfile() } if ( SessionState.mode == SessionService.MODE_STEAM && diff --git a/app/src/main/java/com/droiddeck/launcher/input/ControllerPrefs.kt b/app/src/main/java/com/droiddeck/launcher/input/ControllerPrefs.kt index 0b11a64135..7c003f553d 100644 --- a/app/src/main/java/com/droiddeck/launcher/input/ControllerPrefs.kt +++ b/app/src/main/java/com/droiddeck/launcher/input/ControllerPrefs.kt @@ -115,10 +115,16 @@ object ControllerPrefs { fun opacityFolded(context: Context) = prefs(context).getBoolean("opacityFolded", false) - /** Multiplies the old per-layout opacity into the global one, once. */ - fun foldOpacity(context: Context, layoutPercent: Int) { - val folded = (onScreenOpacity(context) * layoutPercent / 100f).toInt().coerceIn(onScreenOpacityRange) - prefs(context).edit().putInt("onScreenOpacity", folded).putBoolean("opacityFolded", true).commit() + /** Multiplies the old per-layout opacity into the global one, once. False when it could not be saved. */ + fun foldOpacity(context: Context, layoutPercent: Int): Boolean { + val p = prefs(context) + val before = onScreenOpacity(context) + val hadValue = p.contains("onScreenOpacity") + val folded = (before * layoutPercent / 100f).toInt().coerceIn(onScreenOpacityRange) + if (p.edit().putInt("onScreenOpacity", folded).putBoolean("opacityFolded", true).commit()) return true + // SharedPreferences keeps a failed commit's values in memory. + p.edit().apply { if (hadValue) putInt("onScreenOpacity", before) else remove("onScreenOpacity") }.remove("opacityFolded").apply() + return false } fun setAdaptiveSticks(context: Context, on: Boolean) { diff --git a/app/src/main/java/com/droiddeck/launcher/input/InputLibraries.kt b/app/src/main/java/com/droiddeck/launcher/input/InputLibraries.kt index a2f3c21ae3..d12edb3b0d 100644 --- a/app/src/main/java/com/droiddeck/launcher/input/InputLibraries.kt +++ b/app/src/main/java/com/droiddeck/launcher/input/InputLibraries.kt @@ -46,7 +46,8 @@ object InputLibraries { if (version < 12) library = barStockLayouts(library) if (version < 13) library = LegacyScreenKeyMigration.pin(library) if (version < 14) library = deckGamepadSurfaces(context, library) - if (version < 17) library = singleOpacity(context, library) + // Not tied to the version: a fold that could not be saved is tried again on the next read. + library = singleOpacity(context, library) if (version < 6 || !p.contains(LegacyScreenKeyMigration.BACKUP)) { val legacy = LegacyScreenKeyMigration.snapshot(context) if (legacy != null) { @@ -300,7 +301,7 @@ object InputLibraries { if (library.layouts.all { it.style.opacity == 100 }) return library if (!ControllerPrefs.opacityFolded(context)) { val main = runCatching { library.activeLayout(false, InputRole.PRIMARY) }.getOrNull()?.style?.opacity ?: 100 - ControllerPrefs.foldOpacity(context, main) + if (!ControllerPrefs.foldOpacity(context, main)) return library } return library.copy(layouts = library.layouts.map { it.copy(style = it.style.copy(opacity = 100)) }) } diff --git a/app/src/main/java/com/droiddeck/launcher/input/InputLibrary.kt b/app/src/main/java/com/droiddeck/launcher/input/InputLibrary.kt index e016021109..7f0070118f 100644 --- a/app/src/main/java/com/droiddeck/launcher/input/InputLibrary.kt +++ b/app/src/main/java/com/droiddeck/launcher/input/InputLibrary.kt @@ -190,7 +190,7 @@ data class InputLibrary( fun gameChanges(isDesktop: Boolean, game: String, only: InputRole? = null): Int { val current = games[game] ?: return 0 return current.parts.entries.filter { only == null || it.key == only }.sumOf { (role, part) -> - val base = copy(games = games - game).activePart(isDesktop, role) + val base = copy(games = games + (game to current.copy(parts = current.parts - role))).activePart(isDesktop, role, game) val mine = preset(part.bindings) val theirs = preset(base.bindings) val controls = (mine.controls.keys + theirs.controls.keys).count { (mine.controls[it] ?: InputAction.Native()) != (theirs.controls[it] ?: InputAction.Native()) } @@ -201,7 +201,8 @@ data class InputLibrary( val before = baseLayout?.elements?.firstOrNull { it.id == e.id } before == null || before != e || mine.action(e) != theirs.action(e) || (e.hasClick && mine.clickAction(e) != theirs.clickAction(e)) } + if (layout == null) 0 else baseLayout?.elements.orEmpty().count { e -> layout.elements.none { it.id == e.id } } - controls + keys + if (layout?.id == baseLayout?.id) 0 else elements + val styled = if (layout != null && layout.id != baseLayout?.id && layout.style != baseLayout?.style) 1 else 0 + controls + keys + styled + if (layout?.id == baseLayout?.id) 0 else elements } } fun withProfile(value: SavedInputProfile) = copy(profiles = profiles.filterNot { it.id == value.id } + value) diff --git a/app/src/main/java/com/droiddeck/launcher/input/WinlatorLayouts.kt b/app/src/main/java/com/droiddeck/launcher/input/WinlatorLayouts.kt index 4d961a11b7..b89300c5f4 100644 --- a/app/src/main/java/com/droiddeck/launcher/input/WinlatorLayouts.kt +++ b/app/src/main/java/com/droiddeck/launcher/input/WinlatorLayouts.kt @@ -32,6 +32,8 @@ object WinlatorLayouts { "KP_3" to 81, "KP_0" to 82, "KP_DEL" to 83, "F11" to 87, "F12" to 88, "KP_ENTER" to 96, "CTRL_R" to 97, "KP_DIVIDE" to 98, "PRTSCN" to 99, "ALT_R" to 100, "HOME" to 102, "UP" to 103, "PG_UP" to 104, "PRIOR" to 104, "LEFT" to 105, "RIGHT" to 106, "END" to 107, "DOWN" to 108, "PG_DOWN" to 109, "NEXT" to 109, "INSERT" to 110, "DEL" to 111, + // Older profiles name the left modifiers without a side. + "SHIFT" to 42, "CTRL" to 29, "ALT" to 56, ) private val gamepad: Map = mapOf( @@ -108,11 +110,15 @@ object WinlatorLayouts { val shape = when (e.optString("shape")) { "CIRCLE" -> InputButtonShape.CIRCLE; "RECT", "SQUARE" -> InputButtonShape.RECTANGLE; else -> InputButtonShape.ROUNDED } when (e.optString("type")) { "BUTTON" -> { - val binding = bindings.firstOrNull { it != "NONE" } ?: continue - val action = buttonAction(binding) ?: InputAction.Disabled + val bound = bindings.filter { it != "NONE" && it.isNotBlank() } + val binding = bound.firstOrNull() ?: continue + // A button presses every bound slot at once, so several keys make one chord. + val chord = bound.mapNotNull(::key).distinct().take(8) + val action = if (bound.size > 1 && chord.size == bound.size) InputAction.Keys(chord) + else buttonAction(binding) ?: InputAction.Disabled val trigger = action is InputAction.Native && (action.target == InputControl.LT || action.target == InputControl.RT) val (hw, hh) = when (e.optString("shape")) { "RECT", "ROUND_RECT" -> 4f to 2f; "SQUARE" -> 2.5f to 2.5f; else -> 3f to 3f } - place(if (trigger) InputElementKind.TRIGGER else InputElementKind.BUTTON, text.ifEmpty { label(binding) }, cx, cy, hw * scale, hh * scale, + place(if (trigger) InputElementKind.TRIGGER else InputElementKind.BUTTON, text.ifEmpty { if (chord.size > 1 && chord.size == bound.size) bound.joinToString("+") { label(it) }.take(80) else label(binding) }, cx, cy, hw * scale, hh * scale, action, shape, e.optBoolean("toggleSwitch")) } "D_PAD" -> place(InputElementKind.DPAD, text.ifEmpty { "D-pad" }, cx, cy, 7 * scale, 7 * scale, directionAction(bindings, InputElementKind.DPAD)) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/CommunityLayouts.kt b/app/src/main/java/com/droiddeck/launcher/ui/CommunityLayouts.kt index 15ae8720bc..71aaa69089 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/CommunityLayouts.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/CommunityLayouts.kt @@ -37,6 +37,7 @@ internal fun CommunityLayouts(role: InputRole, onUse: (Pair?>() } + val broken = remember { mutableStateMapOf() } var loading by remember { mutableStateOf(null) } LaunchedEffect(attempt) { failed = false @@ -54,7 +55,7 @@ internal fun CommunityLayouts(role: InputRole, onUse: (Pair for (file in list) { val title = file.removeSuffix(".icp").removeSuffix(".ICP") val preview = previews[file] - SettingsRow(title, null) { + SettingsRow(title, if (broken[file] == true) stringResource(R.string.flow_community_failed) else null) { Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp)) { preview?.let { InputLayoutThumbnail(it.first, role) } if (preview == null) SecondaryButton(stringResource(if (loading == file) R.string.flow_loading else R.string.flow_preview), @@ -67,7 +68,7 @@ internal fun CommunityLayouts(role: InputRole, onUse: (Pair l.withPreset(l.preset(bindingsId).let { it.copy(controls = it.controls + (selected to action)) }) } } .onSuccess { onChanged() }.onFailure { failure = it.message ?: context.getString(R.string.input_save_failed) } } - val changed = InputControl.padControls.filter { c -> + val changed = InputControl.entries.filter { c -> (preset.controls[c] ?: InputAction.Native()) != (base?.controls?.get(c) ?: InputAction.Native()) } BackHandlerCompat(onBack) @@ -160,10 +160,13 @@ internal fun ScopePill(text: String) { private fun ControllerDrawing(selected: InputControl, modifier: Modifier, onPick: (InputControl) -> Unit) { val context = LocalContext.current val pick by rememberUpdatedState(onPick) + val current by rememberUpdatedState(selected) AndroidView(factory = { InputSurfaceEditorView(it).apply { selectOnly = true; setBackgroundColor(android.graphics.Color.TRANSPARENT) } }, modifier = modifier.testTag("input-buttons-pad"), update = { view -> - view.onSelect = { id -> id?.removePrefix("legacy:")?.let(InputControl::fromId)?.let(pick) } - view.onResize = { _, _ -> } + view.onSelect = { id -> + val control = id?.removePrefix("legacy:")?.let(InputControl::fromId) + if (control != null) pick(control) else view.selected = "legacy:${current.id}" + } fun place() { if (view.width <= 0 || view.height <= 0) return val stock = LegacyGamepadLayout(context, view.width, view.height).elements().filter { it.id.startsWith("legacy:") } @@ -172,6 +175,7 @@ private fun ControllerDrawing(selected: InputControl, modifier: Modifier, onPick view.aspect = view.width.toFloat() / view.height view.elements = OnScreenLayout.editorElements(context, layout, view.width, view.height).filter { it.id.startsWith("legacy:") } } + view.onResize = { _, _ -> place() } view.selected = "legacy:${selected.id}" if (view.elements.isEmpty()) view.post { place() } }) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/InputSettingsPage.kt b/app/src/main/java/com/droiddeck/launcher/ui/InputSettingsPage.kt index 3d30b603cd..803ea0b7cc 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/InputSettingsPage.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/InputSettingsPage.kt @@ -274,15 +274,22 @@ private fun InputSettingsContent(onBack: () -> Unit, onChanged: () -> Unit, embe library.desktop == profileId -> "desktop" else -> "none" } - val builtIn = profileId == InputProfile.GAME || profileId == InputProfile.DESKTOP + fun applyDefault(l: InputLibrary, pick: String) = + l.copy(steam = if (pick == "game" || pick == "both") profileId else if (l.steam == profileId) InputProfile.GAME else l.steam, + desktop = if (pick == "desktop" || pick == "both") profileId else if (l.desktop == profileId) InputProfile.DESKTOP else l.desktop) + fun usesIn(l: InputLibrary) = when { + l.steam == profileId && l.desktop == profileId -> "both" + l.steam == profileId -> "game" + l.desktop == profileId -> "desktop" + else -> "none" + } + // A built-in profile is the fallback for its own mode, so it can't give that mode up. + val defaults = listOf("game" to stringResource(R.string.input_game_mode), "desktop" to stringResource(R.string.input_desktop_mode), + "both" to stringResource(R.string.flow_both_modes), "none" to stringResource(R.string.flow_no_mode)) + .filter { (pick, _) -> pick == uses || usesIn(applyDefault(library, pick)) == pick } SettingsGroup(stringResource(R.string.flow_default_for)) { - ChoiceRow(host, "profile-default", stringResource(R.string.flow_default_for), null, listOfNotNull( - "game" to stringResource(R.string.input_game_mode), "desktop" to stringResource(R.string.input_desktop_mode), - "both" to stringResource(R.string.flow_both_modes), if (builtIn) null else "none" to stringResource(R.string.flow_no_mode)), uses) { pick -> - update { l -> - l.copy(steam = if (pick == "game" || pick == "both") profileId else if (l.steam == profileId) InputProfile.GAME else l.steam, - desktop = if (pick == "desktop" || pick == "both") profileId else if (l.desktop == profileId) InputProfile.DESKTOP else l.desktop) - } + ChoiceRow(host, "profile-default", stringResource(R.string.flow_default_for), null, defaults, uses) { pick -> + update { applyDefault(it, pick) } } } SettingsGroup(stringResource(R.string.input_profile_controls)) { diff --git a/app/src/main/java/com/droiddeck/launcher/ui/InputSurfaceDialog.kt b/app/src/main/java/com/droiddeck/launcher/ui/InputSurfaceDialog.kt index f2f5cdde66..09d581b5c2 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/InputSurfaceDialog.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/InputSurfaceDialog.kt @@ -467,6 +467,8 @@ private fun DockedElementPanel(draft: SurfaceDraft, element: InputSurfaceElement LaunchedEffect(actionDraft.action) { if (actionDraft.action.validAs(control, element.takeUnless { clicking }, clicking)) draft.assign(element.id, actionDraft.action, clicking) } + // Undo, or any other change to the saved action, shows here too. + LaunchedEffect(current) { if (actionDraft.action != current) actionDraft.action = current } BoxWithConstraints(Modifier.fillMaxSize()) { Surface(Modifier.align(if (onRight) Alignment.CenterEnd else Alignment.CenterStart).padding(8.dp) .width(minOf(380.dp, maxWidth * .48f)).fillMaxHeight().testTag("input-editor-panel"), diff --git a/app/src/main/java/com/droiddeck/launcher/ui/InputSurfaceEditorView.kt b/app/src/main/java/com/droiddeck/launcher/ui/InputSurfaceEditorView.kt index 72a43ac506..de9a971103 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/InputSurfaceEditorView.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/InputSurfaceEditorView.kt @@ -132,10 +132,11 @@ internal class InputSurfaceEditorView(context: Context) : FrameLayout(context) { val sy = grid * width / height.coerceAtLeast(1) fun round(value: Float, step: Float) = (Math.round(value / step) * step) if (corner == 0) return e.copy(x = round(e.x, sx).coerceIn(0f, 1f - e.width), y = round(e.y, sy).coerceIn(0f, 1f - e.height)) - val right = if (corner and 2 != 0) round(e.x + e.width, sx).coerceIn(e.x + .03f, 1f) else e.x + e.width - val bottom = if (corner and 8 != 0) round(e.y + e.height, sy).coerceIn(e.y + .03f, 1f) else e.y + e.height - val left = if (corner and 1 != 0) round(e.x, sx).coerceIn(0f, right - .03f) else e.x - val top = if (corner and 4 != 0) round(e.y, sy).coerceIn(0f, bottom - .03f) else e.y + fun Float.within(low: Float, high: Float) = coerceIn(minOf(low, high), maxOf(low, high)) + val right = if (corner and 2 != 0) round(e.x + e.width, sx).within(e.x + .03f, 1f) else e.x + e.width + val bottom = if (corner and 8 != 0) round(e.y + e.height, sy).within(e.y + .03f, 1f) else e.y + e.height + val left = if (corner and 1 != 0) round(e.x, sx).within(0f, right - .03f) else e.x + val top = if (corner and 4 != 0) round(e.y, sy).within(0f, bottom - .03f) else e.y return e.copy(x = left, y = top, width = right - left, height = bottom - top).bounded() } diff --git a/app/src/main/res/values-ar/input_flow_strings.xml b/app/src/main/res/values-ar/input_flow_strings.xml index 567ea3f824..25304b7d5a 100644 --- a/app/src/main/res/values-ar/input_flow_strings.xml +++ b/app/src/main/res/values-ar/input_flow_strings.xml @@ -2,7 +2,7 @@ عناصر التحكم الافتراضي (%1$s) - %1$s: تم تغيير %2$d + تغييرات %1$s: %2$d حفظ التغييرات لـ تغييرات اللعبة الواحدة تُضاف فوق ملفها الشخصي. كل الألعاب @@ -30,7 +30,7 @@ الافتراضي لـ كلا الوضعين لا شيء - مثبّت في %1$d ألعاب + الألعاب المثبِّتة له: %1$d الخاصة بي المجتمع تخطيطات شاركها لاعبو Winlator. ترسل أزرارها مفاتيح لوحة المفاتيح والماوس. diff --git a/app/src/main/res/values-b+es+419/input_flow_strings.xml b/app/src/main/res/values-b+es+419/input_flow_strings.xml index 3efc80660f..7023e7ac7e 100644 --- a/app/src/main/res/values-b+es+419/input_flow_strings.xml +++ b/app/src/main/res/values-b+es+419/input_flow_strings.xml @@ -2,7 +2,7 @@ Controles Predeterminado (%1$s) - %1$s: %2$d cambiados + Cambios para %1$s: %2$d Guardar cambios para Los cambios de un juego se aplican sobre su perfil. Todos los juegos @@ -30,7 +30,7 @@ Predeterminado para Ambos modos Ninguno - Fijado por %1$d juegos + Juegos que lo fijan: %1$d Míos Comunidad Diseños compartidos por jugadores de Winlator. Sus botones envían teclas de teclado y mouse. diff --git a/app/src/main/res/values-bg/input_flow_strings.xml b/app/src/main/res/values-bg/input_flow_strings.xml index effa82fc34..859f9c2432 100644 --- a/app/src/main/res/values-bg/input_flow_strings.xml +++ b/app/src/main/res/values-bg/input_flow_strings.xml @@ -2,7 +2,7 @@ Управление По подразбиране (%1$s) - %1$s: променени %2$d + Промени за %1$s: %2$d Запазване на промените за Промените за една игра се добавят върху профила ѝ. Всички игри @@ -30,7 +30,7 @@ По подразбиране за И двата режима Нито един - Закачен от %1$d игри + Игри, които го закачат: %1$d Мои Общност Подредби, споделени от играчи на Winlator. Бутоните им изпращат клавиши от клавиатура и мишка. diff --git a/app/src/main/res/values-cs/input_flow_strings.xml b/app/src/main/res/values-cs/input_flow_strings.xml index 583ab6660b..fe37fa0a0e 100644 --- a/app/src/main/res/values-cs/input_flow_strings.xml +++ b/app/src/main/res/values-cs/input_flow_strings.xml @@ -2,7 +2,7 @@ Ovládání Výchozí (%1$s) - %1$s: změněno %2$d + Změny pro %1$s: %2$d Ukládat změny pro Změny pro jednu hru se přidávají k jejímu profilu. Všechny hry @@ -30,7 +30,7 @@ Výchozí pro Oba režimy Žádný - Připnuto hrami: %1$d + Hry, které ho připnuly: %1$d Moje Komunita Rozložení sdílená hráči Winlatoru. Jejich tlačítka posílají klávesy klávesnice a myši. diff --git a/app/src/main/res/values-da/input_flow_strings.xml b/app/src/main/res/values-da/input_flow_strings.xml index 701a0ba0cc..f7ad786053 100644 --- a/app/src/main/res/values-da/input_flow_strings.xml +++ b/app/src/main/res/values-da/input_flow_strings.xml @@ -2,7 +2,7 @@ Styring Standard (%1$s) - %1$s: %2$d ændret + Ændringer for %1$s: %2$d Gem ændringer for Ændringer for ét spil lægges oven på dets profil. Alle spil @@ -30,7 +30,7 @@ Standard for Begge tilstande Ingen - Fastgjort af %1$d spil + Spil, der har fastgjort den: %1$d Mine Fællesskab Layouts delt af Winlator-spillere. Deres knapper sender tastatur- og musetaster. diff --git a/app/src/main/res/values-de/input_flow_strings.xml b/app/src/main/res/values-de/input_flow_strings.xml index f673017d61..8f980388be 100644 --- a/app/src/main/res/values-de/input_flow_strings.xml +++ b/app/src/main/res/values-de/input_flow_strings.xml @@ -2,7 +2,7 @@ Steuerung Standard (%1$s) - %1$s: %2$d geändert + Änderungen für %1$s: %2$d Änderungen speichern für Änderungen für ein Spiel liegen über seinem Profil. Alle Spiele @@ -30,7 +30,7 @@ Standard für Beide Modi Keiner - Von %1$d Spielen festgelegt + Festlegende Spiele: %1$d Meine Community Von Winlator-Spielern geteilte Layouts. Ihre Tasten senden Tastatur- und Maustasten. diff --git a/app/src/main/res/values-el/input_flow_strings.xml b/app/src/main/res/values-el/input_flow_strings.xml index d28898847f..2101e90a6b 100644 --- a/app/src/main/res/values-el/input_flow_strings.xml +++ b/app/src/main/res/values-el/input_flow_strings.xml @@ -2,7 +2,7 @@ Χειριστήρια Προεπιλογή (%1$s) - %1$s: %2$d αλλαγές + Αλλαγές για %1$s: %2$d Αποθήκευση αλλαγών για Οι αλλαγές για ένα παιχνίδι μπαίνουν πάνω από το προφίλ του. Όλα τα παιχνίδια @@ -30,7 +30,7 @@ Προεπιλογή για Και τις δύο λειτουργίες Καμία - Καρφιτσωμένο από %1$d παιχνίδια + Παιχνίδια που το καρφιτσώνουν: %1$d Δικές μου Κοινότητα Διατάξεις που μοιράστηκαν παίκτες του Winlator. Τα κουμπιά τους στέλνουν πλήκτρα πληκτρολογίου και ποντικιού. diff --git a/app/src/main/res/values-es/input_flow_strings.xml b/app/src/main/res/values-es/input_flow_strings.xml index d241831f8b..475db8dc3e 100644 --- a/app/src/main/res/values-es/input_flow_strings.xml +++ b/app/src/main/res/values-es/input_flow_strings.xml @@ -2,7 +2,7 @@ Controles Predeterminado (%1$s) - %1$s: %2$d cambiados + Cambios para %1$s: %2$d Guardar cambios para Los cambios de un juego se aplican sobre su perfil. Todos los juegos @@ -30,7 +30,7 @@ Predeterminado para Ambos modos Ninguno - Fijado por %1$d juegos + Juegos que lo fijan: %1$d Míos Comunidad Diseños compartidos por jugadores de Winlator. Sus botones envían teclas de teclado y ratón. diff --git a/app/src/main/res/values-fi/input_flow_strings.xml b/app/src/main/res/values-fi/input_flow_strings.xml index 04f0b66885..1323968b93 100644 --- a/app/src/main/res/values-fi/input_flow_strings.xml +++ b/app/src/main/res/values-fi/input_flow_strings.xml @@ -2,7 +2,7 @@ Ohjaimet Oletus (%1$s) - %1$s: %2$d muutettu + Muutokset (%1$s): %2$d Tallenna muutokset Yhden pelin muutokset lisätään sen profiilin päälle. Kaikki pelit @@ -30,7 +30,7 @@ Oletus tilalle Molemmat tilat Ei mikään - Kiinnittänyt %1$d peliä + Sen kiinnittäneet pelit: %1$d Omat Yhteisö Winlator-pelaajien jakamat asettelut. Niiden painikkeet lähettävät näppäimistön ja hiiren painalluksia. diff --git a/app/src/main/res/values-fr/input_flow_strings.xml b/app/src/main/res/values-fr/input_flow_strings.xml index 4c5d7172c0..fe89d559be 100644 --- a/app/src/main/res/values-fr/input_flow_strings.xml +++ b/app/src/main/res/values-fr/input_flow_strings.xml @@ -2,7 +2,7 @@ Commandes Par défaut (%1$s) - %1$s : %2$d modifiés + Modifications pour %1$s : %2$d Enregistrer les changements pour Les changements pour un jeu s\'ajoutent à son profil. Tous les jeux @@ -30,7 +30,7 @@ Par défaut pour Les deux modes Aucun - Épinglé par %1$d jeux + Jeux qui l’épinglent : %1$d Les miennes Communauté Dispositions partagées par des joueurs de Winlator. Leurs boutons envoient des touches de clavier et de souris. diff --git a/app/src/main/res/values-hi/input_flow_strings.xml b/app/src/main/res/values-hi/input_flow_strings.xml index d85be9d102..061cf82353 100644 --- a/app/src/main/res/values-hi/input_flow_strings.xml +++ b/app/src/main/res/values-hi/input_flow_strings.xml @@ -2,7 +2,7 @@ कंट्रोल डिफ़ॉल्ट (%1$s) - %1$s: %2$d बदले गए + %1$s के बदलाव: %2$d बदलाव इसके लिए सहेजें किसी एक गेम के बदलाव उसकी प्रोफ़ाइल के ऊपर लागू होते हैं। सभी गेम @@ -30,7 +30,7 @@ इसके लिए डिफ़ॉल्ट दोनों मोड कोई नहीं - %1$d गेम में पिन + पिन करने वाले गेम: %1$d मेरे कम्युनिटी Winlator खिलाड़ियों के साझा किए लेआउट। इनके बटन कीबोर्ड और माउस कुंजियाँ भेजते हैं। diff --git a/app/src/main/res/values-hu/input_flow_strings.xml b/app/src/main/res/values-hu/input_flow_strings.xml index 125edf1337..ff9a62851e 100644 --- a/app/src/main/res/values-hu/input_flow_strings.xml +++ b/app/src/main/res/values-hu/input_flow_strings.xml @@ -2,7 +2,7 @@ Irányítás Alapértelmezett (%1$s) - %1$s: %2$d módosítva + Módosítások (%1$s): %2$d Változások mentése ehhez: Egy játék változásai a profilja fölé kerülnek. Összes játék @@ -30,7 +30,7 @@ Alapértelmezett ehhez Mindkét mód Egyik sem - %1$d játék rögzítette + Rögzítő játékok: %1$d Sajátok Közösség Winlator-játékosok által megosztott elrendezések. A gombjaik billentyűzet- és egérgombokat küldenek. diff --git a/app/src/main/res/values-in/input_flow_strings.xml b/app/src/main/res/values-in/input_flow_strings.xml index d950775b6d..cc2ac469e3 100644 --- a/app/src/main/res/values-in/input_flow_strings.xml +++ b/app/src/main/res/values-in/input_flow_strings.xml @@ -2,7 +2,7 @@ Kontrol Default (%1$s) - %1$s: %2$d diubah + Perubahan untuk %1$s: %2$d Simpan perubahan untuk Perubahan untuk satu game ditumpuk di atas profilnya. Semua game @@ -30,7 +30,7 @@ Default untuk Kedua mode Tidak ada - Disematkan oleh %1$d game + Game yang menyematkannya: %1$d Milik saya Komunitas Tata letak yang dibagikan pemain Winlator. Tombolnya mengirim tombol keyboard dan mouse. diff --git a/app/src/main/res/values-it/input_flow_strings.xml b/app/src/main/res/values-it/input_flow_strings.xml index a4e4e9ae90..369a9707a7 100644 --- a/app/src/main/res/values-it/input_flow_strings.xml +++ b/app/src/main/res/values-it/input_flow_strings.xml @@ -2,7 +2,7 @@ Controlli Predefinito (%1$s) - %1$s: %2$d modificati + Modifiche per %1$s: %2$d Salva le modifiche per Le modifiche per un gioco si aggiungono al suo profilo. Tutti i giochi @@ -30,7 +30,7 @@ Predefinito per Entrambe le modalità Nessuna - Fissato da %1$d giochi + Giochi che lo fissano: %1$d Miei Community Layout condivisi dai giocatori di Winlator. I loro pulsanti inviano tasti di tastiera e mouse. diff --git a/app/src/main/res/values-ja/input_flow_strings.xml b/app/src/main/res/values-ja/input_flow_strings.xml index ff8c3fd0cb..208df8c7b1 100644 --- a/app/src/main/res/values-ja/input_flow_strings.xml +++ b/app/src/main/res/values-ja/input_flow_strings.xml @@ -2,7 +2,7 @@ 操作 デフォルト (%1$s) - %1$s: %2$d 件変更 + %1$s の変更: %2$d 変更の保存先 ゲームごとの変更はそのプロファイルの上に重ねて適用されます。 すべてのゲーム @@ -30,7 +30,7 @@ デフォルトにするモード 両方のモード なし - %1$d 本のゲームで固定 + 固定しているゲーム: %1$d 自分 コミュニティ Winlator プレイヤーが共有したレイアウトです。ボタンはキーボードとマウスのキーを送ります。 diff --git a/app/src/main/res/values-ko/input_flow_strings.xml b/app/src/main/res/values-ko/input_flow_strings.xml index de9c998b5b..e3d2e63a3d 100644 --- a/app/src/main/res/values-ko/input_flow_strings.xml +++ b/app/src/main/res/values-ko/input_flow_strings.xml @@ -2,7 +2,7 @@ 컨트롤 기본값 (%1$s) - %1$s: %2$d개 변경됨 + %1$s 변경 사항: %2$d 변경 사항 저장 대상 한 게임의 변경 사항은 해당 프로필 위에 적용됩니다. 모든 게임 @@ -30,7 +30,7 @@ 기본값 모드 두 모드 모두 없음 - 게임 %1$d개에 고정됨 + 고정한 게임: %1$d 내 레이아웃 커뮤니티 Winlator 플레이어들이 공유한 레이아웃입니다. 버튼은 키보드와 마우스 키를 보냅니다. diff --git a/app/src/main/res/values-ms/input_flow_strings.xml b/app/src/main/res/values-ms/input_flow_strings.xml index 3aeec92f7e..993868d8d5 100644 --- a/app/src/main/res/values-ms/input_flow_strings.xml +++ b/app/src/main/res/values-ms/input_flow_strings.xml @@ -2,7 +2,7 @@ Kawalan Lalai (%1$s) - %1$s: %2$d diubah + Perubahan untuk %1$s: %2$d Simpan perubahan untuk Perubahan untuk satu permainan ditambah di atas profilnya. Semua permainan @@ -30,7 +30,7 @@ Lalai untuk Kedua-dua mod Tiada - Dipin oleh %1$d permainan + Permainan yang memin: %1$d Saya Komuniti Susun atur yang dikongsi pemain Winlator. Butangnya menghantar kekunci papan kekunci dan tetikus. diff --git a/app/src/main/res/values-nb/input_flow_strings.xml b/app/src/main/res/values-nb/input_flow_strings.xml index dae30d4dd8..cae5949865 100644 --- a/app/src/main/res/values-nb/input_flow_strings.xml +++ b/app/src/main/res/values-nb/input_flow_strings.xml @@ -2,7 +2,7 @@ Kontroller Standard (%1$s) - %1$s: %2$d endret + Endringer for %1$s: %2$d Lagre endringer for Endringer for ett spill legges oppå profilen til spillet. Alle spill @@ -30,7 +30,7 @@ Standard for Begge moduser Ingen - Festet av %1$d spill + Spill som har festet den: %1$d Mine Fellesskap Oppsett delt av Winlator-spillere. Knappene sender tastatur- og musetaster. diff --git a/app/src/main/res/values-nl/input_flow_strings.xml b/app/src/main/res/values-nl/input_flow_strings.xml index f1bdd6fec8..a261b3dc4f 100644 --- a/app/src/main/res/values-nl/input_flow_strings.xml +++ b/app/src/main/res/values-nl/input_flow_strings.xml @@ -2,7 +2,7 @@ Besturing Standaard (%1$s) - %1$s: %2$d gewijzigd + Wijzigingen voor %1$s: %2$d Wijzigingen opslaan voor Wijzigingen voor één game komen bovenop zijn profiel. Alle games @@ -30,7 +30,7 @@ Standaard voor Beide modi Geen - Vastgezet door %1$d games + Games die hem vastzetten: %1$d Van mij Community Indelingen gedeeld door Winlator-spelers. Hun knoppen sturen toetsenbord- en muistoetsen. diff --git a/app/src/main/res/values-pl/input_flow_strings.xml b/app/src/main/res/values-pl/input_flow_strings.xml index 9d7d041255..ad39cb0ade 100644 --- a/app/src/main/res/values-pl/input_flow_strings.xml +++ b/app/src/main/res/values-pl/input_flow_strings.xml @@ -2,7 +2,7 @@ Sterowanie Domyślny (%1$s) - %1$s: zmieniono %2$d + Zmiany dla %1$s: %2$d Zapisuj zmiany dla Zmiany dla jednej gry nakładają się na jej profil. Wszystkich gier @@ -30,7 +30,7 @@ Domyślny dla Obu trybów Żadnego - Przypięty przez gry: %1$d + Gry, które go przypięły: %1$d Moje Społeczność Układy udostępnione przez graczy Winlatora. Ich przyciski wysyłają klawisze klawiatury i myszy. diff --git a/app/src/main/res/values-pt-rPT/input_flow_strings.xml b/app/src/main/res/values-pt-rPT/input_flow_strings.xml index 5a799d9684..aa1e008c42 100644 --- a/app/src/main/res/values-pt-rPT/input_flow_strings.xml +++ b/app/src/main/res/values-pt-rPT/input_flow_strings.xml @@ -2,7 +2,7 @@ Controlos Predefinido (%1$s) - %1$s: %2$d alterados + Alterações em %1$s: %2$d Guardar alterações para As alterações de um jogo ficam por cima do respetivo perfil. Todos os jogos @@ -30,7 +30,7 @@ Predefinido para Ambos os modos Nenhum - Fixado por %1$d jogos + Jogos que o fixam: %1$d Os meus Comunidade Disposições partilhadas por jogadores do Winlator. Os botões enviam teclas de teclado e rato. diff --git a/app/src/main/res/values-pt/input_flow_strings.xml b/app/src/main/res/values-pt/input_flow_strings.xml index 9d90f8c67e..08a2378dbf 100644 --- a/app/src/main/res/values-pt/input_flow_strings.xml +++ b/app/src/main/res/values-pt/input_flow_strings.xml @@ -2,7 +2,7 @@ Controles Padrão (%1$s) - %1$s: %2$d alterados + Alterações em %1$s: %2$d Salvar alterações para As alterações de um jogo ficam por cima do perfil dele. Todos os jogos @@ -30,7 +30,7 @@ Padrão para Ambos os modos Nenhum - Fixado por %1$d jogos + Jogos que o fixam: %1$d Meus Comunidade Layouts compartilhados por jogadores do Winlator. Os botões enviam teclas de teclado e mouse. diff --git a/app/src/main/res/values-ro/input_flow_strings.xml b/app/src/main/res/values-ro/input_flow_strings.xml index 9a9b6cbeae..67cded52ed 100644 --- a/app/src/main/res/values-ro/input_flow_strings.xml +++ b/app/src/main/res/values-ro/input_flow_strings.xml @@ -2,7 +2,7 @@ Comenzi Implicit (%1$s) - %1$s: %2$d modificate + Modificări pentru %1$s: %2$d Salvează modificările pentru Modificările pentru un joc se adaugă peste profilul lui. Toate jocurile @@ -30,7 +30,7 @@ Implicit pentru Ambele moduri Niciunul - Fixat de %1$d jocuri + Jocuri care îl fixează: %1$d Ale mele Comunitate Aranjamente partajate de jucătorii Winlator. Butoanele lor trimit taste de tastatură și mouse. diff --git a/app/src/main/res/values-ru/input_flow_strings.xml b/app/src/main/res/values-ru/input_flow_strings.xml index 4e239a487e..13525d5ae7 100644 --- a/app/src/main/res/values-ru/input_flow_strings.xml +++ b/app/src/main/res/values-ru/input_flow_strings.xml @@ -2,7 +2,7 @@ Управление По умолчанию (%1$s) - %1$s: изменено %2$d + Изменения для %1$s: %2$d Сохранять изменения для Изменения для одной игры накладываются на её профиль. Всех игр @@ -30,7 +30,7 @@ По умолчанию для Обоих режимов Ни для какого - Закреплён в играх: %1$d + Игр, где он закреплён: %1$d Мои Сообщество Раскладки от игроков Winlator. Их кнопки отправляют клавиши клавиатуры и мыши. diff --git a/app/src/main/res/values-sv/input_flow_strings.xml b/app/src/main/res/values-sv/input_flow_strings.xml index 6a4b85f662..9f43b1ce51 100644 --- a/app/src/main/res/values-sv/input_flow_strings.xml +++ b/app/src/main/res/values-sv/input_flow_strings.xml @@ -2,7 +2,7 @@ Kontroller Standard (%1$s) - %1$s: %2$d ändrade + Ändringar för %1$s: %2$d Spara ändringar för Ändringar för ett spel läggs ovanpå dess profil. Alla spel @@ -30,7 +30,7 @@ Standard för Båda lägena Inget - Fäst av %1$d spel + Spel som fäst den: %1$d Mina Gemenskap Layouter som Winlator-spelare delat. Deras knappar skickar tangentbords- och mustangenter. diff --git a/app/src/main/res/values-th/input_flow_strings.xml b/app/src/main/res/values-th/input_flow_strings.xml index db27443bc6..5231cda37c 100644 --- a/app/src/main/res/values-th/input_flow_strings.xml +++ b/app/src/main/res/values-th/input_flow_strings.xml @@ -2,7 +2,7 @@ การควบคุม ค่าเริ่มต้น (%1$s) - %1$s: เปลี่ยน %2$d รายการ + การเปลี่ยนแปลงของ %1$s: %2$d บันทึกการเปลี่ยนแปลงสำหรับ การเปลี่ยนแปลงของเกมหนึ่งจะซ้อนทับโปรไฟล์ของเกมนั้น ทุกเกม @@ -30,7 +30,7 @@ ค่าเริ่มต้นสำหรับ ทั้งสองโหมด ไม่มี - ปักหมุดโดย %1$d เกม + เกมที่ปักหมุด: %1$d ของฉัน ชุมชน เลย์เอาต์ที่ผู้เล่น Winlator แชร์ไว้ ปุ่มจะส่งปุ่มคีย์บอร์ดและเมาส์ diff --git a/app/src/main/res/values-tr/input_flow_strings.xml b/app/src/main/res/values-tr/input_flow_strings.xml index 9f7afcd14d..6042a26b57 100644 --- a/app/src/main/res/values-tr/input_flow_strings.xml +++ b/app/src/main/res/values-tr/input_flow_strings.xml @@ -2,7 +2,7 @@ Kontroller Varsayılan (%1$s) - %1$s: %2$d değişti + %1$s için değişiklik: %2$d Değişiklikleri kaydet: Bir oyunun değişiklikleri profilinin üstüne eklenir. Tüm oyunlar @@ -30,7 +30,7 @@ Varsayılan olduğu mod İki mod da Hiçbiri - %1$d oyun sabitledi + Sabitleyen oyunlar: %1$d Benimkiler Topluluk Winlator oyuncularının paylaştığı düzenler. Düğmeleri klavye ve fare tuşları gönderir. diff --git a/app/src/main/res/values-uk/input_flow_strings.xml b/app/src/main/res/values-uk/input_flow_strings.xml index 631904e3be..e88fdba37a 100644 --- a/app/src/main/res/values-uk/input_flow_strings.xml +++ b/app/src/main/res/values-uk/input_flow_strings.xml @@ -2,7 +2,7 @@ Керування Типовий (%1$s) - %1$s: змінено %2$d + Зміни для %1$s: %2$d Зберігати зміни для Зміни для однієї гри накладаються на її профіль. Усіх ігор @@ -30,7 +30,7 @@ Типовий для Обох режимів Жодного - Закріплено в іграх: %1$d + Ігор, де його закріплено: %1$d Мої Спільнота Розташування від гравців Winlator. Їхні кнопки надсилають клавіші клавіатури та миші. diff --git a/app/src/main/res/values-vi/input_flow_strings.xml b/app/src/main/res/values-vi/input_flow_strings.xml index a10da2ca2b..2863aef355 100644 --- a/app/src/main/res/values-vi/input_flow_strings.xml +++ b/app/src/main/res/values-vi/input_flow_strings.xml @@ -2,7 +2,7 @@ Điều khiển Mặc định (%1$s) - %1$s: đã đổi %2$d + Thay đổi cho %1$s: %2$d Lưu thay đổi cho Thay đổi cho một trò chơi được đặt chồng lên hồ sơ của nó. Mọi trò chơi @@ -30,7 +30,7 @@ Mặc định cho Cả hai chế độ Không - Được %1$d trò chơi ghim + Trò chơi ghim: %1$d Của tôi Cộng đồng Bố cục do người chơi Winlator chia sẻ. Các nút gửi phím bàn phím và chuột. diff --git a/app/src/main/res/values-zh-rCN/input_flow_strings.xml b/app/src/main/res/values-zh-rCN/input_flow_strings.xml index eb4ab8ad9b..dcce9a708c 100644 --- a/app/src/main/res/values-zh-rCN/input_flow_strings.xml +++ b/app/src/main/res/values-zh-rCN/input_flow_strings.xml @@ -2,7 +2,7 @@ 控制 默认(%1$s) - %1$s:已更改 %2$d 项 + %1$s 的更改:%2$d 更改保存到 单个游戏的更改叠加在其配置文件之上。 所有游戏 @@ -30,7 +30,7 @@ 默认用于 两种模式 无 - 已被 %1$d 个游戏固定 + 固定它的游戏:%1$d 我的 社区 Winlator 玩家分享的布局。它们的按钮发送键盘和鼠标按键。 diff --git a/app/src/main/res/values-zh-rHK/input_flow_strings.xml b/app/src/main/res/values-zh-rHK/input_flow_strings.xml index acbb209fb4..d7232fbf60 100644 --- a/app/src/main/res/values-zh-rHK/input_flow_strings.xml +++ b/app/src/main/res/values-zh-rHK/input_flow_strings.xml @@ -2,7 +2,7 @@ 控制 預設(%1$s) - %1$s:已變更 %2$d 項 + %1$s 的變更:%2$d 變更儲存至 單一遊戲的變更會疊加在其設定檔之上。 所有遊戲 @@ -30,7 +30,7 @@ 預設用於 兩種模式 無 - 已被 %1$d 個遊戲固定 + 固定它的遊戲:%1$d 我的 社群 Winlator 玩家分享的佈局。其按鈕會傳送鍵盤及滑鼠按鍵。 diff --git a/app/src/main/res/values-zh-rTW/input_flow_strings.xml b/app/src/main/res/values-zh-rTW/input_flow_strings.xml index bbe4de2e26..91897d399c 100644 --- a/app/src/main/res/values-zh-rTW/input_flow_strings.xml +++ b/app/src/main/res/values-zh-rTW/input_flow_strings.xml @@ -2,7 +2,7 @@ 控制 預設(%1$s) - %1$s:已變更 %2$d 項 + %1$s 的變更:%2$d 變更儲存至 單一遊戲的變更會疊加在其設定檔之上。 所有遊戲 @@ -30,7 +30,7 @@ 預設用於 兩種模式 無 - 已被 %1$d 個遊戲固定 + 固定它的遊戲:%1$d 我的 社群 Winlator 玩家分享的版面配置。其按鈕會傳送鍵盤和滑鼠按鍵。 diff --git a/app/src/main/res/values/input_flow_strings.xml b/app/src/main/res/values/input_flow_strings.xml index 1ec72b9fe5..e5ab2bad36 100644 --- a/app/src/main/res/values/input_flow_strings.xml +++ b/app/src/main/res/values/input_flow_strings.xml @@ -2,7 +2,7 @@ Controls Default (%1$s) - %1$s: %2$d changed + Changes for %1$s: %2$d Save changes for Changes for one game sit on top of its profile. All games @@ -31,7 +31,7 @@ Default for Both modes Neither - Pinned by %1$d games + Games pinning it: %1$d Mine Community Layouts shared by Winlator players. Their buttons send keyboard and mouse keys. diff --git a/app/src/test/java/com/droiddeck/launcher/input/InputLibraryGamesTest.kt b/app/src/test/java/com/droiddeck/launcher/input/InputLibraryGamesTest.kt index 09dec78fb3..04b6136aac 100644 --- a/app/src/test/java/com/droiddeck/launcher/input/InputLibraryGamesTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/input/InputLibraryGamesTest.kt @@ -87,6 +87,26 @@ class InputLibraryGamesTest { assertTrue(cleared.games.getValue("620").parts.isEmpty()) } + @Test fun changesAreCountedAgainstTheGamesPinnedProfile() { + val base = library().duplicateProfile(InputProfile.GAME, "Racing", "racing") + val racing = base.profile("racing").binding(InputRole.PHYSICAL) + val pinned = base.withPreset(base.preset(racing).let { it.copy(controls = it.controls + (InputControl.A to InputAction.Keys(listOf(18)))) }) + .withGameProfile("620", "Portal 2", "racing") + val forked = pinned.withGamePart(false, "620", "Portal 2", InputRole.PHYSICAL) + assertEquals(0, forked.gameChanges(false, "620")) + val own = forked.activePart(false, InputRole.PHYSICAL, "620").bindings + val native = forked.withPreset(forked.preset(own).let { it.copy(controls = it.controls + (InputControl.A to InputAction.Native())) }) + assertEquals(1, native.gameChanges(false, "620")) + } + + @Test fun hidingAQuickButtonInAGamesLayoutCountsAsAChange() { + val forked = library().withGamePart(false, "620", "Portal 2", InputRole.PRIMARY) + val layout = forked.activeLayout(false, InputRole.PRIMARY, "620")!! + if (!layout.editable) return + val hidden = forked.withLayout(layout.withQuickButton(InputCommand.KEYBOARD, false)) + assertEquals(1, hidden.gameChanges(false, "620", InputRole.PRIMARY)) + } + @Test fun aGamesCopiesCantBeDeletedFromUnderIt() { val forked = library().withGamePart(false, "620", "Portal 2", InputRole.PHYSICAL) val id = forked.activePart(false, InputRole.PHYSICAL, "620").bindings diff --git a/app/src/test/java/com/droiddeck/launcher/input/WinlatorLayoutsTest.kt b/app/src/test/java/com/droiddeck/launcher/input/WinlatorLayoutsTest.kt index 6c3d48e27d..0c97bb285b 100644 --- a/app/src/test/java/com/droiddeck/launcher/input/WinlatorLayoutsTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/input/WinlatorLayoutsTest.kt @@ -75,6 +75,17 @@ class WinlatorLayoutsTest { WinlatorLayouts.fileUrl("Dark Souls 2.icp")) } + @Test fun multiKeyButtonsBecomeChordsAndOldModifierNamesWork() { + val raw = """{"cursorSpeed":1,"elements":[ + {"type":"BUTTON","shape":"RECT","bindings":["KEY_CTRL_L","KEY_C","NONE","NONE"],"scale":1,"x":0.5,"y":0.5,"text":""}, + {"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_SHIFT","NONE","NONE","NONE"],"scale":1,"x":0.2,"y":0.5,"text":""}, + {"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_ALT","KEY_CTRL","NONE","NONE"],"scale":1,"x":0.8,"y":0.5,"text":""}]}""" + val (layout, bindings) = WinlatorLayouts.import(raw, "x", InputLayoutScreen.MAIN, 1920, 1080)!! + val actions = layout.elements.map { bindings.elements.getValue(it.id) } + assertEquals(listOf(InputAction.Keys(listOf(29, 46)), InputAction.Keys(listOf(42)), InputAction.Keys(listOf(56, 29))), actions) + assertEquals("Ctrl l+C", layout.elements[0].name) + } + @Test fun rejectsAFileWithNothingToPlace() { assertNull(WinlatorLayouts.import("""{"cursorSpeed":1,"elements":[]}""", "x", InputLayoutScreen.MAIN, 100, 100)) } diff --git a/app/src/test/java/com/droiddeck/launcher/ui/SessionSecondScreenTest.kt b/app/src/test/java/com/droiddeck/launcher/ui/SessionSecondScreenTest.kt index b8d1ff276e..2cf884ae45 100644 --- a/app/src/test/java/com/droiddeck/launcher/ui/SessionSecondScreenTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/ui/SessionSecondScreenTest.kt @@ -30,7 +30,6 @@ import com.droiddeck.launcher.input.InputProfile import com.droiddeck.launcher.input.InputRole import com.droiddeck.launcher.input.InputElementKind import com.droiddeck.launcher.input.InputSurfaceElement -import com.droiddeck.launcher.input.InputSurfaceStyle import com.droiddeck.launcher.input.InputControl import org.junit.Assert.assertSame import org.junit.Assert.assertNotNull @@ -271,10 +270,10 @@ class SessionSecondScreenTest { shown.value = true ReflectionHelpers.setField(panel, "imeSeen", true) val controls = descendants(panel.window!!.decorView).filterIsInstance().single() - val element = InputSurfaceElement(InputControl.A, .3f, .2f, .2f, .2f, "updated") + val element = InputSurfaceElement(InputControl.A, .3f, .2f, .2f, .2f, "updated", opacity = .35f) InputLibraries.update(activity) { library -> val layout = library.activeLayout(false, InputRole.SECONDARY)!! - library.withLayout(layout.copy(elements = listOf(element), style = InputSurfaceStyle(opacity = 35))) + library.withLayout(layout.copy(elements = listOf(element))) } panel.refreshControls() assertSame(controls, descendants(panel.window!!.decorView).filterIsInstance().single())