Skip to content

Play your own Switch games on iPhone/iPad — one-click macOS app, no terminal. | 把 Switch 游戏装进 iPhone:图形界面一键构建,不用命令行。Bring your own game.

iOS layout editor: clearer resets, translated Done, a layout that fits every phone

v0lumehib44c8382c299
diff --git a/frontend-ios/README.md b/frontend-ios/README.md
index b6058341..c5604f9d 100644
--- a/frontend-ios/README.md
+++ b/frontend-ios/README.md
@@ -63,7 +63,7 @@ The caller returns changed values through `games`. The views keep no second copy
| `FolderPicker` | `DocumentFolderPicker` is a `UIDocumentPickerViewController` for a folder, opened in place. Tests use a fake. | `DocumentPicker` in `dm/ios/Sources/Launcher.swift` |
| Log | Show log reads the tail (256 KB) of `log.txt` in the game's data folder, else the app's folder, into a read-only sheet. | |
| Update | `ShellHostConfig.updateURL` is opened by Update app. | |
-| Touch controls | The shell settings' Touch controls group, for every game: a preview of the controls on a phone held sideways (`TouchControlsPreview`, which mirrors the engine's `DmPadGeometry.h` for that screen) the Size row (small, medium, large) and the Left stick row (corner, higher, inward, the preview marks the default place with a dashed ring). `ShellSettingsStore.touchSize` and `touchStick` store them, and `gameDefaults` passes them to the engine as `DM_TOUCH_SIZE` and `DM_TOUCH_STICK` (medium and the corner are the engine's own and are not passed). The engine keeps a choice off a screen too small for it. Every game also gets `DM_TOUCH_HINT`, the words the engine shows once per launch where the 3D layout's undrawn right stick is (`ios.host.touchHint`). Every game gets the quit prompt's words as `DM_HOME_QUIT_TEXT` (`ios.host.quit*`, five lines in `home_quit.h`'s order, as the Mac launcher passes them): the engine shows the prompt when the player picks Quit in the in-game menu (the gear) or holds a controller's Home button. The Arrangement row opens the layout editor (`TouchLayoutEditorView`, #414): the controls of one layout (2D or 3D, over the picture, and on an iPad or a foldable also below it) on this device's screen, dragged in steps of a quarter key, or chosen and moved with the arrows, a controller (A picks up, the D-pad moves, A or B puts down) or VoiceOver's actions, with Put back and Reset. A spot the engine would refuse (on another control, outside the area) turns red and sends the control back. `TouchLayout` holds the offsets and writes the engine's value, `ShellSettingsStore.touchLayout` stores it and `gameDefaults` passes it as `DM_TOUCH_LAYOUT` (nothing moved: not passed). `PadGeo` is a Swift copy of the engine's geometry, pinned to the engine's points by `TouchLayoutTests`, so the editor keeps only what the engine draws. `TouchControlsCaptureTests` renders the group and the editor on the Mac. | `dm/ios/Sources/DmPadGeometry.h`, `quit_prompt.h` (patches 0065 to 0068, 0070) |
+| Touch controls | The shell settings' Touch controls group, for every game: a preview of the controls on a phone held sideways (`TouchControlsPreview`, which mirrors the engine's `DmPadGeometry.h` for that screen) the Size row (small, medium, large) and the Left stick row (corner, higher, inward, the preview marks the default place with a dashed ring). `ShellSettingsStore.touchSize` and `touchStick` store them, and `gameDefaults` passes them to the engine as `DM_TOUCH_SIZE` and `DM_TOUCH_STICK` (medium and the corner are the engine's own and are not passed). The engine keeps a choice off a screen too small for it. Every game also gets `DM_TOUCH_HINT`, the words the engine shows once per launch where the 3D layout's undrawn right stick is (`ios.host.touchHint`). Every game gets the quit prompt's words as `DM_HOME_QUIT_TEXT` (`ios.host.quit*`, five lines in `home_quit.h`'s order, as the Mac launcher passes them): the engine shows the prompt when the player picks Quit in the in-game menu (the gear) or holds a controller's Home button. The Arrangement row opens the layout editor (`TouchLayoutEditorView`, #414): the controls of one layout (2D or 3D, over the picture, and on an iPad or a foldable also below it) on this device's screen, dragged in steps of a quarter key, or chosen and moved with the arrows, a controller (A picks up, the D-pad moves, A or B puts down) or VoiceOver's actions, with Reset this control and Reset all controls (which asks first, in place, and starts on Cancel). Held sideways the preview takes the room left of a column that scrolls, with the arrows in one row. A spot the engine would refuse (on another control, outside the area) turns red and sends the control back. `TouchLayout` holds the offsets and writes the engine's value, `ShellSettingsStore.touchLayout` stores it and `gameDefaults` passes it as `DM_TOUCH_LAYOUT` (nothing moved: not passed). `PadGeo` is a Swift copy of the engine's geometry, pinned to the engine's points by `TouchLayoutTests`, so the editor keeps only what the engine draws. `TouchControlsCaptureTests` renders the group and the editor on the Mac. | `dm/ios/Sources/DmPadGeometry.h`, `quit_prompt.h` (patches 0065 to 0068, 0070) |
| Controllers | `ShellHostModel.startControllers()` runs `GamepadAdapter` and fills `controllers` (`ControllerInfo`) and `input` (`ShellInput`). Global mappings are stored in `ShellSettingsStore.padMap`, individual overrides in the game's suite under `GameDefaults.padMapKey`. At launch, each button resolves game > global > default and is passed to the engine as `DM_PAD_MAP`. A profile's own `DM_PAD_MAP` row takes precedence. Touch controls and shell navigation keep their original mapping. | |
```swift
diff --git a/frontend-ios/Sources/ShellHost/Resources/Localizable.xcstrings b/frontend-ios/Sources/ShellHost/Resources/Localizable.xcstrings
index 4727d00c..e217302b 100644
--- a/frontend-ios/Sources/ShellHost/Resources/Localizable.xcstrings
+++ b/frontend-ios/Sources/ShellHost/Resources/Localizable.xcstrings
@@ -301,12 +301,36 @@
},
"Done": {
"localizations": {
+ "de": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Fertig"
+ }
+ },
"en": {
"stringUnit": {
"state": "translated",
"value": "Done"
}
},
+ "fr": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "OK"
+ }
+ },
+ "it": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Fine"
+ }
+ },
+ "sv": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Klar"
+ }
+ },
"zh-Hans": {
"stringUnit": {
"state": "translated",
diff --git a/frontend-ios/Sources/ShellUI/LibraryView.swift b/frontend-ios/Sources/ShellUI/LibraryView.swift
index 42d856be..5af85eae 100644
--- a/frontend-ios/Sources/ShellUI/LibraryView.swift
+++ b/frontend-ios/Sources/ShellUI/LibraryView.swift
@@ -518,7 +518,9 @@ public struct LibraryView: View {
else if padMapping?.row != nil { closePadRow() }
else if padMapping != nil { closePadMapping() }
else if choice != nil { closeChoice() }
- else if let touchLayout { if touchLayout.held { touchLayout.putDown() } else { closeTouchLayout() } }
+ else if let touchLayout {
+ if touchLayout.held { touchLayout.putDown() } else if touchLayout.confirmingReset { touchLayout.cancelReset() } else { closeTouchLayout() }
+ }
else if helpGameID != nil { closeHelp() }
else if deleteGameID != nil { closeDelete() }
else if controllersOpen { controllersOpen = false; focus.id = "lib.controllers" }
diff --git a/frontend-ios/Sources/ShellUI/Resources/Localizable.xcstrings b/frontend-ios/Sources/ShellUI/Resources/Localizable.xcstrings
index 2d1489dc..612d179b 100644
--- a/frontend-ios/Sources/ShellUI/Resources/Localizable.xcstrings
+++ b/frontend-ios/Sources/ShellUI/Resources/Localizable.xcstrings
@@ -2061,12 +2061,36 @@
},
"Done": {
"localizations": {
+ "de": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Fertig"
+ }
+ },
"en": {
"stringUnit": {
"state": "translated",
"value": "Done"
}
},
+ "fr": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "OK"
+ }
+ },
+ "it": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Fine"
+ }
+ },
+ "sv": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Klar"
+ }
+ },
"zh-Hans": {
"stringUnit": {
"state": "translated",
@@ -3792,7 +3816,7 @@
"de": {
"stringUnit": {
"state": "translated",
- "value": "Aufteilung"
+ "value": "Tastenlayout"
}
},
"en": {
@@ -5553,42 +5577,42 @@
}
}
},
- "Put back": {
+ "Put every control of the %@ layout back in its built-in place?": {
"localizations": {
"de": {
"stringUnit": {
"state": "translated",
- "value": "Zurückstellen"
+ "value": "Alle Tasten des %@-Layouts an ihren Standardplatz zurücksetzen?"
}
},
"en": {
"stringUnit": {
"state": "translated",
- "value": "Put back"
+ "value": "Put every control of the %@ layout back in its built-in place?"
}
},
"fr": {
"stringUnit": {
"state": "translated",
- "value": "Remettre"
+ "value": "Remettre toutes les commandes de l’agencement %@ à leur place par défaut ?"
}
},
"it": {
"stringUnit": {
"state": "translated",
- "value": "Rimetti"
+ "value": "Rimettere tutti i comandi dello schema %@ al loro posto predefinito?"
}
},
"sv": {
"stringUnit": {
"state": "translated",
- "value": "Lägg tillbaka"
+ "value": "Flytta alla kontroller i %@-layouten tillbaka till standardplatsen?"
}
},
"zh-Hans": {
"stringUnit": {
"state": "translated",
- "value": "放回原位"
+ "value": "把 %@ 布局的所有按键放回默认位置?"
}
}
}
@@ -5761,42 +5785,82 @@
}
}
},
- "Reset this layout": {
+ "Reset all controls": {
+ "localizations": {
+ "de": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Alle Tasten zurücksetzen"
+ }
+ },
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Reset all controls"
+ }
+ },
+ "fr": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Réinitialiser toutes les commandes"
+ }
+ },
+ "it": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Ripristina tutti i comandi"
+ }
+ },
+ "sv": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Återställ alla kontroller"
+ }
+ },
+ "zh-Hans": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "重置所有按键"
+ }
+ }
+ }
+ },
+ "Reset this control": {
"localizations": {
"de": {
"stringUnit": {
"state": "translated",
- "value": "Dieses Layout zurücksetzen"
+ "value": "Diese Taste zurücksetzen"
}
},
"en": {
"stringUnit": {
"state": "translated",
- "value": "Reset this layout"
+ "value": "Reset this control"
}
},
"fr": {
"stringUnit": {
"state": "translated",
- "value": "Réinitialiser cet agencement"
+ "value": "Réinitialiser cette commande"
}
},
"it": {
"stringUnit": {
"state": "translated",
- "value": "Ripristina questo schema"
+ "value": "Ripristina questo comando"
}
},
"sv": {
"stringUnit": {
"state": "translated",
- "value": "Återställ den här layouten"
+ "value": "Återställ den här kontrollen"
}
},
"zh-Hans": {
"stringUnit": {
"state": "translated",
- "value": "重置此布局"
+ "value": "重置此按键"
}
}
}
@@ -6705,6 +6769,46 @@
}
}
},
+ "Switch in the game with the button at the top centre. 3D adds the D-pad, L3 and R3.": {
+ "localizations": {
+ "de": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Im Spiel umschalten mit der Taste oben in der Mitte. 3D hat zusätzlich Steuerkreuz, L3 und R3."
+ }
+ },
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Switch in the game with the button at the top centre. 3D adds the D-pad, L3 and R3."
+ }
+ },
+ "fr": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "En jeu, changez avec le bouton en haut au centre. Le 3D ajoute la croix, L3 et R3."
+ }
+ },
+ "it": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Nel gioco si cambia con il pulsante in alto al centro. Il 3D aggiunge la croce direzionale, L3 e R3."
+ }
+ },
+ "sv": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Byt i spelet med knappen överst i mitten. 3D har även styrkors, L3 och R3."
+ }
+ },
+ "zh-Hans": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "游戏中用顶部中间的按钮切换。3D 另有十字键、L3 和 R3。"
+ }
+ }
+ }
+ },
"Tap a button to change what it sends.": {
"localizations": {
"de": {
diff --git a/frontend-ios/Sources/ShellUI/TouchLayoutEditorModel.swift b/frontend-ios/Sources/ShellUI/TouchLayoutEditorModel.swift
index 4c40ee0f..3a4c5b3f 100644
--- a/frontend-ios/Sources/ShellUI/TouchLayoutEditorModel.swift
+++ b/frontend-ios/Sources/ShellUI/TouchLayoutEditorModel.swift
@@ -24,6 +24,8 @@ import UIKit
private(set) var rejectCount = 0
/// The last move had no room: the line under the preview says so until the next move.
private(set) var rejected = false
+ /// Reset all was asked for and waits for its answer: the editor asks before it puts every control of the shown layout back.
+ private(set) var confirmingReset = false
init(store: ShellSettingsStore = .current, sideways: PadScreen = .proMax, upright: PadScreen? = nil, kind: TouchLayout.Kind = .threeD) {
self.store = store
@@ -44,7 +46,7 @@ import UIKit
editing.kind = kind
editing.screen = kind.split ? (upright ?? sideways) : sideways
if let s = selected, !s.drawn(full: kind.full) { selected = nil }
- held = false; rejected = false
+ held = false; rejected = false; confirmingReset = false
}
func setTogether(_ on: Bool) {
editing.together = on
@@ -102,10 +104,14 @@ import UIKit
rejected = false
save()
}
- /// Every control of the shown layout back to its built-in place.
+ /// Reset all: ask first. Nothing to reset asks nothing.
+ func askReset() { if !layoutIsBuiltIn { confirmingReset = true } }
+ func cancelReset() { confirmingReset = false }
+ /// Every control of the shown layout back to its built-in place (the answer to askReset).
func reset() {
editing.reset()
rejected = false
+ confirmingReset = false
save()
}
diff --git a/frontend-ios/Sources/ShellUI/TouchLayoutEditorView.swift b/frontend-ios/Sources/ShellUI/TouchLayoutEditorView.swift
index bdec51dd..62507203 100644
--- a/frontend-ios/Sources/ShellUI/TouchLayoutEditorView.swift
+++ b/frontend-ios/Sources/ShellUI/TouchLayoutEditorView.swift
@@ -4,11 +4,14 @@ import SwiftUI
/// this device's screen at its own proportions. Drag a control and it snaps to steps of a quarter key. Where it would cover another
/// control or leave its area it turns red and goes back when let go. The area it may use shows while it is chosen. A chosen control also
/// moves step by step with the arrows, a controller (A picks it up, the D-pad moves it, A or B puts it down) or VoiceOver's actions.
-/// Put back and Reset return one control or the whole layout to the built-in places. The engine places every control again on the
+/// Reset this control and Reset all controls return one control or the whole shown layout to the built-in places, Reset all after
+/// a question. The engine places every control again on the
/// device, so nothing the editor stores can break a game's layout.
struct TouchLayoutEditorView: View {
@Bindable var model: TouchLayoutEditorModel
var close: () -> Void
+ /// Where the column beside the preview starts scrolled: the top, or the end for the captures of what lies below.
+ var columnAnchor: UnitPoint = .top
@Environment(\.shellFocus) private var focus
@Environment(\.accessibilityReduceMotion) private var reduceMotion
/// The drag in progress: the control, where its offset started, and the spot drawn under the finger when the engine refuses it.
@@ -22,31 +25,29 @@ struct TouchLayoutEditorView: View {
var travelled: CGFloat = 0
}
- /// The width of each button role, the same in every language (the longest label fits at the type's size).
+ /// The width of the Arrange button in the shell settings, the same in every language (the longest label fits at the type's size).
static let buttonWidth: CGFloat = 148
- static let arrowSize: CGFloat = 52
+ static let arrowSize: CGFloat = 48
var body: some View {
GeometryReader { proxy in
// Held sideways the preview takes the room the column beside it leaves: on a phone it is then nearly as large as the game.
- let wide = proxy.size.width > proxy.size.height * 1.1 && proxy.size.width >= 640
+ let wide = proxy.size.width > proxy.size.height * 1.1 && proxy.size.width >= 600
if wide {
- let column: CGFloat = 340, aspect = screen.size.width / screen.size.height
- let w = max(200, min(proxy.size.width - column - 22 - 40, (proxy.size.height - 32 - 70) * aspect))
- HStack(alignment: .top, spacing: 22) {
- // The preview, and under it what is chosen with the buttons that act on it.
- VStack(alignment: .leading, spacing: 14) {
- canvas.frame(width: w, height: w / aspect)
- HStack(alignment: .center, spacing: 10) { status; buttons }
- }
- .padding(.vertical, 16)
+ let column = Self.column(width: proxy.size.width), aspect = screen.size.width / screen.size.height
+ let w = max(200, min(proxy.size.width - column - 20 - 32, (proxy.size.height - 24) * aspect))
+ HStack(alignment: .top, spacing: 20) {
+ canvas.frame(width: w, height: w / aspect)
+ .frame(maxHeight: .infinity)
+ // Everything else scrolls in the column: on the smallest phone it is taller than the screen.
ScrollView {
- VStack(alignment: .leading, spacing: 16) { header; pickers; panel(compact: true) }.padding(.vertical, 16)
+ VStack(alignment: .leading, spacing: 14) { header; pickers; panel(compact: true) }.padding(.vertical, 12)
}
- .scrollIndicators(.hidden)
+ .scrollIndicators(.automatic)
+ .defaultScrollAnchor(columnAnchor)
.frame(width: column)
}
- .padding(.horizontal, 20)
+ .padding(.horizontal, 16)
.frame(maxWidth: .infinity)
} else {
ScrollView {
@@ -72,6 +73,9 @@ struct TouchLayoutEditorView: View {
.sensoryFeedback(.warning, trigger: model.rejectCount)
}
+ /// The column beside the preview held sideways: about a third of the width, never narrower than the buttons need.
+ static func column(width: CGFloat) -> CGFloat { min(340, max(250, (width * 0.34).rounded())) }
+
// MARK: Header and pickers
private var header: some View {
@@ -93,6 +97,7 @@ struct TouchLayoutEditorView: View {
private var pickers: some View {
VStack(alignment: .leading, spacing: 12) {
let layoutRow = SettingRow(id: Self.layoutRow, label: ShellStrings.text("Layout"),
+ note: ShellStrings.text("Switch in the game with the button at the top centre. 3D adds the D-pad, L3 and R3."),
kind: .choice([SettingOption("2d", "2D"), SettingOption("3d", "3D")]),
value: model.kind.full ? "3d" : "2d")
SettingControl(gameID: Self.gameID, row: layoutRow, targetPrefix: "lay.row.") { value in
@@ -124,12 +129,12 @@ struct TouchLayoutEditorView: View {
context.scaleBy(x: k, y: k)
drawBackdrop(g, in: &context)
if let active { drawGuides(for: active, g, k: k, in: &context) }
- for c in g.drawnControls where !isActive(c, active) { draw(c, g, in: &context) }
+ for c in g.drawnControls where !isActive(c, active) { draw(c, g, k: k, in: &context) }
}
if let active {
Canvas { context, _ in
context.scaleBy(x: k, y: k)
- for c in g.drawnControls where isActive(c, active) { draw(c, g, highlight: drag?.refused == nil ? .chosen : .refused, in: &context) }
+ for c in g.drawnControls where isActive(c, active) { draw(c, g, k: k, highlight: drag?.refused == nil ? .chosen : .refused, in: &context) }
}
.offset(x: activeOffset(g).width * k, y: activeOffset(g).height * k)
.allowsHitTesting(false)
@@ -195,16 +200,27 @@ struct TouchLayoutEditorView: View {
private enum Highlight { case none, chosen, refused }
- private func draw(_ c: TouchLayout.Control, _ g: PadGeo, highlight: Highlight = .none, in context: inout GraphicsContext) {
- var style = PadDrawing.Style()
+ /// The keys in the editor: brighter than in the settings' small preview, with lines of the same width at every preview size. The
+ /// chosen control is filled cream with dark type and a soft halo, a refused spot red, so it reads at a glance.
+ private func draw(_ c: TouchLayout.Control, _ g: PadGeo, k: CGFloat, highlight: Highlight = .none, in context: inout GraphicsContext) {
+ var style = PadDrawing.Style(fill: .white.opacity(0.17), line: .white.opacity(0.62), text: .white.opacity(0.9), ring: .white.opacity(0.07),
+ lineWidth: 1.5 / k)
+ var halo: Color?
switch highlight {
case .none: break
case .chosen:
- style.fill = ShellPalette.cream.opacity(model.held ? 0.42 : 0.26); style.line = ShellPalette.cream; style.text = .white; style.lineWidth = 2.5
+ style.fill = ShellPalette.cream.opacity(model.held ? 1 : 0.9); style.line = ShellPalette.cream; style.text = .black.opacity(0.85)
+ style.ring = ShellPalette.cream.opacity(0.22); style.lineWidth = 2.5 / k
+ halo = ShellPalette.cream.opacity(model.held ? 0.5 : 0.32)
case .refused:
- style.fill = DeleteStyle.red.opacity(0.32); style.line = DeleteStyle.red; style.text = .white; style.lineWidth = 2.5
+ style.fill = DeleteStyle.red.opacity(0.9); style.line = DeleteStyle.red; style.text = .white
+ style.ring = DeleteStyle.red.opacity(0.25); style.lineWidth = 2.5 / k
+ halo = DeleteStyle.red.opacity(0.4)
+ }
+ for shape in Self.shapes(c, g) {
+ if let halo { context.stroke(PadDrawing.outline(shape), with: .color(halo), lineWidth: (model.held ? 12 : 9) / k) }
+ PadDrawing.draw(shape, in: &context, style: style)
}
- for shape in Self.shapes(c, g) { PadDrawing.draw(shape, in: &context, style: style) }
}
/// The drawn shapes of one control, in the gamepad's look.
@@ -283,7 +299,7 @@ struct TouchLayoutEditorView: View {
.accessibilityAction(named: ShellStrings.text("Move down")) { voiceOverMove(c, 0, 1) }
.accessibilityAction(named: ShellStrings.text("Move left")) { voiceOverMove(c, -1, 0) }
.accessibilityAction(named: ShellStrings.text("Move right")) { voiceOverMove(c, 1, 0) }
- .accessibilityAction(named: ShellStrings.text("Put back")) { model.select(c); model.putBack() }
+ .accessibilityAction(named: ShellStrings.text("Reset this control")) { model.select(c); model.putBack() }
.shellTarget("lay.ctl.\(c.rawValue)", radius: max(box.width, box.height) * k / 2) { model.pickUp(c) }
.allowsHitTesting(false)
}
@@ -298,76 +314,128 @@ struct TouchLayoutEditorView: View {
// MARK: The panel
- /// The arrows, the diamond's switch and the note. compact: the status and the buttons sit under the preview instead.
+ /// What is chosen, the arrows, the diamond's switch, the two resets and the note. compact: the column beside the preview, with the
+ /// arrows in one row. Otherwise the arrows in a cross with the resets beside them, or under them where the width is short.
private func panel(compact: Bool) -> some View {
- VStack(alignment: .leading, spacing: 16) {
- if compact {
- arrows.frame(maxWidth: .infinity)
- } else {
+ VStack(alignment: .leading, spacing: 14) {
+ VStack(alignment: .leading, spacing: 14) {
status
- // The arrows with the two buttons beside them, or below them side by side, or below them stacked: whatever the width holds.
- ViewThatFits(in: .horizontal) {
- HStack(alignment: .center, spacing: 18) { arrows; VStack(alignment: .leading, spacing: 10) { buttons } }
- VStack(alignment: .leading, spacing: 14) { arrows; HStack(spacing: 10) { buttons } }
- VStack(alignment: .leading, spacing: 14) { arrows; VStack(alignment: .leading, spacing: 10) { buttons } }
+ if compact {
+ arrowRow.frame(maxWidth: .infinity)
+ } else {
+ ViewThatFits(in: .horizontal) {
+ HStack(alignment: .center, spacing: 18) { arrowCross; resets.frame(width: Self.resetWidth) }
+ VStack(alignment: .leading, spacing: 14) { arrowCross.frame(maxWidth: .infinity); resets }
+ }
}
+ let together = SettingRow(id: Self.togetherRow, label: ShellStrings.text("Move A B X Y together"),
+ kind: .toggle(on: "1", off: "0"), value: model.together ? "1" : "0")
+ SettingControl(gameID: Self.gameID, row: together, targetPrefix: "lay.row.") { model.setTogether($0 == "1") }
+ .equatable()
}
- let together = SettingRow(id: Self.togetherRow, label: ShellStrings.text("Move A B X Y together"),
- kind: .toggle(on: "1", off: "0"), value: model.together ? "1" : "0")
- SettingControl(gameID: Self.gameID, row: together, targetPrefix: "lay.row.") { model.setTogether($0 == "1") }
- .equatable()
+ .shellCard(padding: compact ? 14 : 18)
+ if compact { resets }
Text(ShellStrings.text("Drag a control to move it. Tap one to choose it, then move it step by step with the arrows. Where a control would cover another or leave the screen, it goes back. For every game."))
.shellType(ShellType.note).foregroundStyle(.white.opacity(0.5)).fixedSize(horizontal: false, vertical: true)
}
- .shellCard()
}
- /// Put back (the chosen control) and Reset (the shown layout), each of the same fixed width in every language.
- @ViewBuilder private var buttons: some View {
- Button(ShellStrings.text("Put back")) { model.putBack() }
- .buttonStyle(ShellButtonStyle(fills: true)).frame(width: Self.buttonWidth)
- .disabled(model.selected.map { !model.editing.isMoved($0) } ?? true)
- .accessibilityIdentifier("touchLayout.putBack")
- .shellTarget("lay.putBack", enabled: model.selected.map { model.editing.isMoved($0) } ?? false) { model.putBack() }
- Button(ShellStrings.text("Reset")) { model.reset() }
- .buttonStyle(ShellButtonStyle(fills: true, destructive: true)).frame(width: Self.buttonWidth)
- .disabled(model.layoutIsBuiltIn)
- .accessibilityLabel(ShellStrings.text("Reset this layout"))
- .accessibilityIdentifier("touchLayout.reset")
- .shellTarget("lay.reset", enabled: !model.layoutIsBuiltIn) { model.reset() }
+ /// The width of the two resets beside the arrows on an upright screen, the same in every language.
+ static let resetWidth: CGFloat = 236
+
+ /// Reset this control (the chosen one) and Reset all controls (the shown layout), one above the other and as wide as each other.
+ /// Reset all asks first, in place, and the question starts on Cancel: it takes the button's place in the focus.
+ private var resets: some View {
+ VStack(alignment: .leading, spacing: 8) {
+ let canPutBack = model.selected.map { model.editing.isMoved($0) } ?? false
+ Button { model.putBack() } label: { resetLabel("Reset this control", "arrow.uturn.backward") }
+ .buttonStyle(ShellButtonStyle(fills: true))
+ .disabled(!canPutBack)
+ .accessibilityIdentifier("touchLayout.putBack")
+ .shellTarget("lay.putBack", enabled: canPutBack) { model.putBack() }
+ if model.confirmingReset {
+ VStack(alignment: .leading, spacing: 8) {
+ Text(ShellStrings.text("Put every control of the \(model.kind.full ? "3D" : "2D") layout back in its built-in place?"))
+ .shellType(ShellType.note).foregroundStyle(.white.opacity(0.85)).fixedSize(horizontal: false, vertical: true)
+ .accessibilityIdentifier("touchLayout.resetQuestion")
+ Button { model.reset() } label: { resetLabel("Reset all controls", "arrow.counterclockwise") }
+ .buttonStyle(ShellButtonStyle(fills: true, destructive: true))
+ .accessibilityIdentifier("touchLayout.resetConfirm")
+ .shellTarget("lay.resetConfirm") { model.reset() }
+ Button { model.cancelReset() } label: { Text(ShellStrings.text("Cancel")).lineLimit(1).minimumScaleFactor(0.8) }
+ .buttonStyle(ShellButtonStyle(fills: true))
+ .accessibilityIdentifier("touchLayout.resetCancel")
+ .shellTarget("lay.reset") { model.cancelReset() }
+ }
+ .padding(10)
+ .background(DeleteStyle.red.opacity(0.08), in: RoundedRectangle(cornerRadius: 12))
+ .overlay(RoundedRectangle(cornerRadius: 12).strokeBorder(DeleteStyle.red.opacity(0.35)))
+ } else {
+ Button { model.askReset() } label: { resetLabel("Reset all controls", "arrow.counterclockwise") }
+ .buttonStyle(ShellButtonStyle(fills: true, destructive: true))
+ .disabled(model.layoutIsBuiltIn)
+ .accessibilityIdentifier("touchLayout.reset")
+ .shellTarget("lay.reset", enabled: !model.layoutIsBuiltIn) { model.askReset() }
+ }
+ }
+ }
+
+ private func resetLabel(_ text: String.LocalizationValue, _ symbol: String) -> some View {
+ Label { Text(ShellStrings.text(text)).lineLimit(1).minimumScaleFactor(0.75) } icon: { Image(systemName: symbol) }
}
- /// The chosen control and what to do next, or why it went back.
+ /// The chosen control and what to do next, or why it went back. It takes the card's whole width, so the words never wrap word by word.
private var status: some View {
- VStack(alignment: .leading, spacing: 4) {
- if let c = model.selected {
- let m = model.editing.mover(c)
- Text(m.title).shellType(ShellType.cardTitle)
- Text(model.rejected ? ShellStrings.text("No room there. It went back to where it was.")
- : model.held ? ShellStrings.text("Move it with the D-pad. A or B puts it down.")
- : ShellStrings.text(model.editing.isMoved(m) ? "Moved" : "In its place"))
- .shellType(ShellType.note)
- .foregroundStyle(model.rejected ? DeleteStyle.red : .white.opacity(0.6))
- } else {
- Text(ShellStrings.text("Choose a control")).shellType(ShellType.cardTitle)
- Text(model.rejected ? ShellStrings.text("No room there. It went back to where it was.") : ShellStrings.text("Tap a control in the picture."))
- .shellType(ShellType.note).foregroundStyle(model.rejected ? DeleteStyle.red : .white.opacity(0.6))
+ HStack(alignment: .center, spacing: 12) {
+ Image(systemName: model.selected == nil ? "hand.tap" : model.held ? "hand.draw" : "scope")
+ .font(.system(size: 17, weight: .semibold))
+ .foregroundStyle(model.rejected ? DeleteStyle.red : ShellPalette.cream)
+ .frame(width: 36, height: 36)
+ .background((model.rejected ? DeleteStyle.red : ShellPalette.cream).opacity(0.14), in: Circle())
+ .accessibilityHidden(true)
+ VStack(alignment: .leading, spacing: 3) {
+ if let c = model.selected {
+ let m = model.editing.mover(c)
+ Text(m.title).shellType(ShellType.cardTitle)
+ Text(model.rejected ? ShellStrings.text("No room there. It went back to where it was.")
+ : model.held ? ShellStrings.text("Move it with the D-pad. A or B puts it down.")
+ : ShellStrings.text(model.editing.isMoved(m) ? "Moved" : "In its place"))
+ .shellType(ShellType.note)
+ .foregroundStyle(model.rejected ? DeleteStyle.red : .white.opacity(0.65))
+ } else {
+ Text(ShellStrings.text("Choose a control")).shellType(ShellType.cardTitle)
+ Text(model.rejected ? ShellStrings.text("No room there. It went back to where it was.") : ShellStrings.text("Tap a control in the picture."))
+ .shellType(ShellType.note).foregroundStyle(model.rejected ? DeleteStyle.red : .white.opacity(0.65))
+ }
}
+ .fixedSize(horizontal: false, vertical: true)
+ .frame(maxWidth: .infinity, alignment: .leading)
}
- .frame(maxWidth: .infinity, minHeight: 44, alignment: .leading)
+ .frame(minHeight: 44)
.accessibilityElement(children: .combine)
.accessibilityIdentifier("touchLayout.status")
}
- /// Four arrows in a cross: one step of the chosen control each.
- private var arrows: some View {
- let enabled = model.selected != nil
+ /// The four arrows in one row, held sideways where height is short: one step of the chosen control each.
+ private var arrowRow: some View {
+ HStack(spacing: 8) {
+ arrow("chevron.left", "Move left", "left", -1, 0)
+ arrow("chevron.up", "Move up", "up", 0, -1)
+ arrow("chevron.down", "Move down", "down", 0, 1)
+ arrow("chevron.right", "Move right", "right", 1, 0)
+ }
+ .disabled(model.selected == nil)
+ }
+
+ /// Four arrows in a cross, on an upright screen.
+ private var arrowCross: some View {
+ let gap = Color.clear.frame(width: Self.arrowSize, height: Self.arrowSize)
return Grid(horizontalSpacing: 6, verticalSpacing: 6) {
- GridRow { Color.clear.frame(width: Self.arrowSize, height: Self.arrowSize); arrow("chevron.up", "Move up", "up", 0, -1); Color.clear.frame(width: Self.arrowSize, height: Self.arrowSize) }
- GridRow { arrow("chevron.left", "Move left", "left", -1, 0); Color.clear.frame(width: Self.arrowSize, height: Self.arrowSize); arrow("chevron.right", "Move right", "right", 1, 0) }
- GridRow { Color.clear.frame(width: Self.arrowSize, height: Self.arrowSize); arrow("chevron.down", "Move down", "down", 0, 1); Color.clear.frame(width: Self.arrowSize, height: Self.arrowSize) }
+ GridRow { gap; arrow("chevron.up", "Move up", "up", 0, -1); gap }
+ GridRow { arrow("chevron.left", "Move left", "left", -1, 0); gap; arrow("chevron.right", "Move right", "right", 1, 0) }
+ GridRow { gap; arrow("chevron.down", "Move down", "down", 0, 1); gap }
}
- .disabled(!enabled)
+ .disabled(model.selected == nil)
}
private func arrow(_ symbol: String, _ label: String.LocalizationValue, _ id: String, _ dx: Int, _ dy: Int) -> some View {
diff --git a/frontend-ios/Tests/ShellUITests/ShellStringsTests.swift b/frontend-ios/Tests/ShellUITests/ShellStringsTests.swift
index 225b563c..afe83e9b 100644
--- a/frontend-ios/Tests/ShellUITests/ShellStringsTests.swift
+++ b/frontend-ios/Tests/ShellUITests/ShellStringsTests.swift
@@ -92,4 +92,41 @@ import Testing
#expect(try text("zh-Hans") != "Done")
#expect(ShellStrings.bundle.path(forResource: "zh-Hant", ofType: "lproj") == nil, "Traditional Chinese has no catalog and falls back")
}
+
+ // MARK: The touch layout editor speaks every language of the app
+
+ /// The layout editor showed an English Done in a German screen: `ios.ui.done` was only in en and zh. Every text the editor asks for
+ /// (read from its source, an interpolation as %@) has all six languages now, so a new text without them fails here.
+ @Test func everyTextOfTheLayoutEditorHasEveryLanguage() throws {
+ let source = try String(contentsOf: URL(fileURLWithPath: #filePath).deletingLastPathComponent().deletingLastPathComponent()
+ .deletingLastPathComponent().appendingPathComponent("Sources/ShellUI/TouchLayoutEditorView.swift"), encoding: .utf8)
+ let literal = try Regex(#"ShellStrings\.text\("((?:[^"\\]|\\\([^)]*\))*)"\)"#)
+ let interpolation = try Regex(#"\\\([^)]*\)"#)
+ var keys = Set(source.matches(of: literal).compactMap { $0.output[1].substring.map(String.init) }.map { $0.replacing(interpolation, with: "%@") })
+ // Passed on as LocalizationValue: the arrows' names and the two resets.
+ keys.formUnion(["Move up", "Move down", "Move left", "Move right", "Reset this control", "Reset all controls", "Moved", "In its place"])
+ #expect(keys.contains("Done") && keys.contains("Put every control of the %@ layout back in its built-in place?"), "\(keys.sorted())")
+ let strings = try table("Localizable", in: "ShellUI")
+ // Names that read the same in some languages: the language files leave them out on purpose (GermanLocalizationTests).
+ keys.subtract(["Minus", "Plus"])
+ for key in keys.sorted() {
+ let localizations = ((strings[key] as? [String: Any])?["localizations"] as? [String: Any]) ?? [:]
+ for language in ["en", "zh-Hans", "de", "sv", "fr", "it"] {
+ let value = ((localizations[language] as? [String: Any])?["stringUnit"] as? [String: Any])?["value"] as? String ?? ""
+ #expect(!value.isEmpty, "\"\(key)\" lacks \(language)")
+ }
+ }
+ }
+
+ @Test func theTwoResetsOfTheEditorReadDifferentlyInEveryLanguage() throws {
+ let strings = try table("Localizable", in: "ShellUI")
+ func value(_ key: String, _ language: String) -> String? {
+ (((strings[key] as? [String: Any])?["localizations"] as? [String: Any])?[language] as? [String: Any])
+ .flatMap { ($0["stringUnit"] as? [String: Any])?["value"] as? String }
+ }
+ for language in ["en", "zh-Hans", "de", "sv", "fr", "it"] {
+ let one = try #require(value("Reset this control", language)), all = try #require(value("Reset all controls", language))
+ #expect(one != all, "\(language)")
+ }
+ }
}
diff --git a/frontend-ios/Tests/ShellUITests/TouchControlsCaptureTests.swift b/frontend-ios/Tests/ShellUITests/TouchControlsCaptureTests.swift
index 5a6d0d0c..9a6db15a 100644
--- a/frontend-ios/Tests/ShellUITests/TouchControlsCaptureTests.swift
+++ b/frontend-ios/Tests/ShellUITests/TouchControlsCaptureTests.swift
@@ -86,6 +86,33 @@ final class TouchControlsCaptureTests: XCTestCase {
try capture("touch-settings-arranged", width: 402, height: 1400, ShellSettingsView(store: store, actions: ShellActions(), onClose: {}))
}
+ /// The editor on real screens, inside each device's safe area (what the view gets on the device), with the outside drawn black: the
+ /// smallest and the largest iPhone held sideways, an iPhone with a notch, and an iPad held sideways. A chosen control in 3D.
+ func testCaptureTheLayoutEditorOnDevices() throws {
+ struct Device { var name: String; var window: CGSize; var insets: EdgeInsets; var pad = false }
+ let devices = [
+ Device(name: "se", window: CGSize(width: 667, height: 375), insets: EdgeInsets()),
+ Device(name: "mini", window: CGSize(width: 812, height: 375), insets: EdgeInsets(top: 0, leading: 50, bottom: 21, trailing: 50)),
+ Device(name: "promax", window: CGSize(width: 956, height: 440), insets: EdgeInsets(top: 0, leading: 62, bottom: 21, trailing: 62)),
+ Device(name: "ipad", window: CGSize(width: 1376, height: 1032), insets: EdgeInsets(top: 24, leading: 0, bottom: 20, trailing: 0), pad: true),
+ ]
+ for d in devices {
+ let screens = TouchLayoutScreens.device(window: d.window, insets: d.insets, isPad: d.pad)
+ let m = TouchLayoutEditorModel(store: store(), sideways: screens.sideways, upright: screens.upright, kind: .threeD)
+ m.select(.face)
+ let view = TouchLayoutEditorView(model: m, close: {}).padding(d.insets).background(Color.black)
+ try capture("touch-editor-device-\(d.name)", width: d.window.width, height: d.window.height, view)
+ // The end of the column, with a moved control and Reset all asking: nothing below is cut off, it scrolls.
+ let asking = TouchLayoutEditorModel(store: store(), sideways: screens.sideways, upright: screens.upright, kind: .threeD)
+ asking.select(.face); asking.nudge(dx: -2, dy: -2); asking.askReset()
+ try capture("touch-editor-device-\(d.name)-end", width: d.window.width, height: d.window.height,
+ TouchLayoutEditorView(model: asking, close: {}, columnAnchor: .bottom).padding(d.insets).background(Color.black))
+ let none = TouchLayoutEditorModel(store: store(), sideways: screens.sideways, upright: screens.upright, kind: .twoD)
+ try capture("touch-editor-device-\(d.name)-2d", width: d.window.width, height: d.window.height,
+ TouchLayoutEditorView(model: none, close: {}).padding(d.insets).background(Color.black))
+ }
+ }
+
private func captureGroup(_ name: String, _ values: [String: String]) throws {
let s = store(values)
let group = SettingsGroup(title: ShellStrings.text("Touch controls")) {
diff --git a/frontend-ios/Tests/ShellUITests/TouchControlsTests.swift b/frontend-ios/Tests/ShellUITests/TouchControlsTests.swift
index 82d1b0eb..a616f7b3 100644
--- a/frontend-ios/Tests/ShellUITests/TouchControlsTests.swift
+++ b/frontend-ios/Tests/ShellUITests/TouchControlsTests.swift
@@ -69,6 +69,33 @@ import Testing
}
}
+ /// Reset all controls asks first: the first press only asks, Cancel keeps every move, the answer resets the shown layout alone.
+ @MainActor @Test func resetAllAsksBeforeItActs() {
+ let store = store()
+ let m = TouchLayoutEditorModel(store: store, kind: .threeD)
+ m.askReset()
+ #expect(!m.confirmingReset, "nothing moved, nothing to ask")
+ m.setKind(.twoD); m.select(.stick); m.nudge(dx: 0, dy: -1)
+ m.setKind(.threeD); m.select(.face); m.nudge(dx: -1, dy: 0)
+ let moved = store.touchLayout
+ m.askReset()
+ #expect(m.confirmingReset && store.touchLayout == moved && !m.layoutIsBuiltIn)
+ m.cancelReset()
+ #expect(!m.confirmingReset && store.touchLayout == moved)
+ m.askReset(); m.setKind(.twoD)
+ #expect(!m.confirmingReset, "another layout drops the question")
+ m.setKind(.threeD); m.askReset(); m.reset()
+ #expect(!m.confirmingReset && m.layoutIsBuiltIn)
+ #expect(store.touchLayout.isEmpty(.threeD) && !store.touchLayout.isEmpty(.twoD), "the 2D layout keeps its move")
+ }
+
+ /// The column beside the preview held sideways fits the smallest phone and never grows past the buttons' room on an iPad.
+ @Test func theSidewaysColumnFitsEveryPhone() {
+ #expect(TouchLayoutEditorView.column(width: 667) == 250)
+ #expect(TouchLayoutEditorView.column(width: 832) == 283)
+ #expect(TouchLayoutEditorView.column(width: 1376) == 340)
+ }
+
@Test func theSizesKeepTheirOrder() {
#expect(TouchPadPreviewGeometry(size: "small").u < TouchPadPreviewGeometry(size: "medium").u)
#expect(TouchPadPreviewGeometry(size: "large").u > TouchPadPreviewGeometry(size: "medium").u)
diff --git a/frontend/l10n/de.json b/frontend/l10n/de.json
index f9f1a1ce..af2338db 100644
--- a/frontend/l10n/de.json
+++ b/frontend/l10n/de.json
@@ -629,6 +629,7 @@
"homeQuit.title": "%@ beenden?",
"install.reveal": "Im Finder zeigen",
"ios.host.deleteFailed": "Einige Dateien von %@ konnten nicht gelöscht werden.",
+ "ios.host.done": "Fertig",
"ios.host.padOff": "Aus",
"ios.host.padOn": "An",
"ios.host.padSameAsAllGames": "Wie alle Spiele",
@@ -651,6 +652,7 @@
"ios.ui.deleteSaves": "Auch Spielstände löschen",
"ios.ui.deleteSavesOff": "Spielstände bleiben, außer du löschst sie ausdrücklich mit.",
"ios.ui.deleteSavesOn": "Die Spielstände werden auch gelöscht und lassen sich nicht wiederherstellen.",
+ "ios.ui.done": "Fertig",
"ios.ui.off": "Aus",
"ios.ui.on": "An",
"ios.ui.opensChoiceList": "Öffnet die Auswahlliste",
@@ -718,7 +720,8 @@
"ios.ui.touchHeld": "Mit dem Steuerkreuz verschieben. A oder B legt sie ab.",
"ios.ui.touchInPlace": "An ihrem Platz",
"ios.ui.touchLarge": "Groß",
- "ios.ui.touchLayout": "Aufteilung",
+ "ios.ui.touchLayout": "Tastenlayout",
+ "ios.ui.touchLayoutNote": "Im Spiel umschalten mit der Taste oben in der Mitte. 3D hat zusätzlich Steuerkreuz, L3 und R3.",
"ios.ui.touchMedium": "Mittel",
"ios.ui.touchMoveDown": "Nach unten",
"ios.ui.touchMoveLeft": "Nach links",
@@ -729,8 +732,9 @@
"ios.ui.touchNoRoomBack": "Dort ist kein Platz. Die Taste ist zurück an ihrem Platz.",
"ios.ui.touchOverPicture": "Über dem Bild",
"ios.ui.touchPreview": "Vorschau der Touch-Steuerung",
- "ios.ui.touchPutBack": "Zurückstellen",
- "ios.ui.touchResetLayout": "Dieses Layout zurücksetzen",
+ "ios.ui.touchPutBack": "Diese Taste zurücksetzen",
+ "ios.ui.touchResetAsk": "Alle Tasten des %@-Layouts an ihren Standardplatz zurücksetzen?",
+ "ios.ui.touchResetLayout": "Alle Tasten zurücksetzen",
"ios.ui.touchScreen": "Bildschirm",
"ios.ui.touchSize": "Größe",
"ios.ui.touchSizeNote": "Für alle Spiele. Ist der Bildschirm für eine Wahl zu klein, bleiben die Tasten näher an ihrem alten Platz.",
diff --git a/frontend/l10n/en.json b/frontend/l10n/en.json
index 5cb97874..f66f0b73 100644
--- a/frontend/l10n/en.json
+++ b/frontend/l10n/en.json
@@ -837,6 +837,7 @@
"ios.ui.touchInPlace": "In its place",
"ios.ui.touchLarge": "Large",
"ios.ui.touchLayout": "Layout",
+ "ios.ui.touchLayoutNote": "Switch in the game with the button at the top centre. 3D adds the D-pad, L3 and R3.",
"ios.ui.touchMedium": "Medium",
"ios.ui.touchMoveDown": "Move down",
"ios.ui.touchMoveLeft": "Move left",
@@ -847,8 +848,9 @@
"ios.ui.touchNoRoomBack": "No room there. It went back to where it was.",
"ios.ui.touchOverPicture": "Over the picture",
"ios.ui.touchPreview": "Preview of the touch controls",
- "ios.ui.touchPutBack": "Put back",
- "ios.ui.touchResetLayout": "Reset this layout",
+ "ios.ui.touchPutBack": "Reset this control",
+ "ios.ui.touchResetAsk": "Put every control of the %@ layout back in its built-in place?",
+ "ios.ui.touchResetLayout": "Reset all controls",
"ios.ui.touchScreen": "Screen",
"ios.ui.touchSize": "Size",
"ios.ui.touchSizeNote": "For every game. On a screen too small for a choice, the controls stay closer to where they were.",
diff --git a/frontend/l10n/fr.json b/frontend/l10n/fr.json
index 08a409dc..09295194 100644
--- a/frontend/l10n/fr.json
+++ b/frontend/l10n/fr.json
@@ -628,6 +628,7 @@
"homeQuit.title": "Quitter %@ ?",
"install.reveal": "Afficher dans le Finder",
"ios.host.deleteFailed": "Certains fichiers de %@ n’ont pas pu être supprimés.",
+ "ios.host.done": "OK",
"ios.host.padController": "Manette",
"ios.host.padOff": "Désactivé",
"ios.host.padOn": "Activé",
@@ -651,6 +652,7 @@
"ios.ui.deleteSaves": "Supprimer aussi les sauvegardes",
"ios.ui.deleteSavesOff": "Les sauvegardes restent, sauf si vous choisissez de les supprimer aussi.",
"ios.ui.deleteSavesOn": "Les sauvegardes sont aussi supprimées et ne peuvent pas être récupérées.",
+ "ios.ui.done": "OK",
"ios.ui.off": "Désactivé",
"ios.ui.on": "Activé",
"ios.ui.opensChoiceList": "Ouvre la liste des choix",
@@ -721,6 +723,7 @@
"ios.ui.touchInPlace": "À sa place",
"ios.ui.touchLarge": "Grande",
"ios.ui.touchLayout": "Agencement",
+ "ios.ui.touchLayoutNote": "En jeu, changez avec le bouton en haut au centre. Le 3D ajoute la croix, L3 et R3.",
"ios.ui.touchMedium": "Moyenne",
"ios.ui.touchMoveDown": "Vers le bas",
"ios.ui.touchMoveLeft": "Vers la gauche",
@@ -731,8 +734,9 @@
"ios.ui.touchNoRoomBack": "Pas de place ici. La commande est revenue à sa place.",
"ios.ui.touchOverPicture": "Sur l’image",
"ios.ui.touchPreview": "Aperçu des commandes tactiles",
- "ios.ui.touchPutBack": "Remettre",
- "ios.ui.touchResetLayout": "Réinitialiser cet agencement",
+ "ios.ui.touchPutBack": "Réinitialiser cette commande",
+ "ios.ui.touchResetAsk": "Remettre toutes les commandes de l’agencement %@ à leur place par défaut ?",
+ "ios.ui.touchResetLayout": "Réinitialiser toutes les commandes",
"ios.ui.touchScreen": "Écran",
"ios.ui.touchSize": "Taille",
"ios.ui.touchSizeNote": "Pour tous les jeux. Sur un écran trop petit pour un choix, les commandes restent plus près de leur place.",
diff --git a/frontend/l10n/it.json b/frontend/l10n/it.json
index d02fb92c..bd03f5b3 100644
--- a/frontend/l10n/it.json
+++ b/frontend/l10n/it.json
@@ -628,6 +628,7 @@
"homeQuit.title": "Uscire da %@?",
"install.reveal": "Mostra nel Finder",
"ios.host.deleteFailed": "Alcuni file di %@ non sono stati eliminati.",
+ "ios.host.done": "Fine",
"ios.host.padController": "Controller",
"ios.host.padOff": "Disattivato",
"ios.host.padOn": "Attivato",
@@ -651,6 +652,7 @@
"ios.ui.deleteSaves": "Elimina anche i salvataggi",
"ios.ui.deleteSavesOff": "I salvataggi restano, a meno che tu non scelga di eliminarli.",
"ios.ui.deleteSavesOn": "Anche i salvataggi vengono eliminati e non si possono recuperare.",
+ "ios.ui.done": "Fine",
"ios.ui.off": "Disattivato",
"ios.ui.on": "Attivato",
"ios.ui.opensChoiceList": "Apre l’elenco delle scelte",
@@ -722,6 +724,7 @@
"ios.ui.touchInPlace": "Al suo posto",
"ios.ui.touchLarge": "Grande",
"ios.ui.touchLayout": "Schema",
+ "ios.ui.touchLayoutNote": "Nel gioco si cambia con il pulsante in alto al centro. Il 3D aggiunge la croce direzionale, L3 e R3.",
"ios.ui.touchMedium": "Media",
"ios.ui.touchMoveDown": "Giù",
"ios.ui.touchMoveLeft": "A sinistra",
@@ -732,8 +735,9 @@
"ios.ui.touchNoRoomBack": "Non c’è spazio. Il comando è tornato al suo posto.",
"ios.ui.touchOverPicture": "Sopra l’immagine",
"ios.ui.touchPreview": "Anteprima dei comandi touch",
- "ios.ui.touchPutBack": "Rimetti",
- "ios.ui.touchResetLayout": "Ripristina questo schema",
+ "ios.ui.touchPutBack": "Ripristina questo comando",
+ "ios.ui.touchResetAsk": "Rimettere tutti i comandi dello schema %@ al loro posto predefinito?",
+ "ios.ui.touchResetLayout": "Ripristina tutti i comandi",
"ios.ui.touchScreen": "Schermo",
"ios.ui.touchSize": "Dimensione",
"ios.ui.touchSizeNote": "Per tutti i giochi. Su uno schermo troppo piccolo per una scelta, i comandi restano più vicini al loro posto.",
diff --git a/frontend/l10n/sv.json b/frontend/l10n/sv.json
index 11f7dfcf..3701c245 100644
--- a/frontend/l10n/sv.json
+++ b/frontend/l10n/sv.json
@@ -470,6 +470,7 @@
"homeQuit.title": "Avsluta %@?",
"install.reveal": "Visa i Finder",
"ios.host.deleteFailed": "Några filer för %@ kunde inte raderas.",
+ "ios.host.done": "Klar",
"ios.host.padController": "Handkontroll",
"ios.host.padOff": "Av",
"ios.host.padOn": "På",
@@ -493,6 +494,7 @@
"ios.ui.deleteSaves": "Radera även sparfiler",
"ios.ui.deleteSavesOff": "Sparfilerna ligger kvar om du inte väljer att radera dem också.",
"ios.ui.deleteSavesOn": "Sparfilerna raderas också och kan inte återställas.",
+ "ios.ui.done": "Klar",
"ios.ui.off": "Av",
"ios.ui.on": "På",
"ios.ui.opensChoiceList": "Öppnar listan med val",
@@ -564,6 +566,7 @@
"ios.ui.touchInPlace": "På sin plats",
"ios.ui.touchLarge": "Stor",
"ios.ui.touchLayout": "Layout",
+ "ios.ui.touchLayoutNote": "Byt i spelet med knappen överst i mitten. 3D har även styrkors, L3 och R3.",
"ios.ui.touchMedium": "Mellan",
"ios.ui.touchMoveDown": "Ned",
"ios.ui.touchMoveLeft": "Vänster",
@@ -574,8 +577,9 @@
"ios.ui.touchNoRoomBack": "Ingen plats där. Kontrollen gick tillbaka dit den var.",
"ios.ui.touchOverPicture": "Över bilden",
"ios.ui.touchPreview": "Förhandsvisning av pekkontrollerna",
- "ios.ui.touchPutBack": "Lägg tillbaka",
- "ios.ui.touchResetLayout": "Återställ den här layouten",
+ "ios.ui.touchPutBack": "Återställ den här kontrollen",
+ "ios.ui.touchResetAsk": "Flytta alla kontroller i %@-layouten tillbaka till standardplatsen?",
+ "ios.ui.touchResetLayout": "Återställ alla kontroller",
"ios.ui.touchScreen": "Skärm",
"ios.ui.touchSize": "Storlek",
"ios.ui.touchSizeNote": "För alla spel. På en skärm som är för liten för ett val stannar kontrollerna närmare sin plats.",
diff --git a/frontend/l10n/zh.json b/frontend/l10n/zh.json
index 2a0d504c..6cf62c95 100644
--- a/frontend/l10n/zh.json
+++ b/frontend/l10n/zh.json
@@ -838,6 +838,7 @@
"ios.ui.touchInPlace": "在原位",
"ios.ui.touchLarge": "大",
"ios.ui.touchLayout": "布局",
+ "ios.ui.touchLayoutNote": "游戏中用顶部中间的按钮切换。3D 另有十字键、L3 和 R3。",
"ios.ui.touchMedium": "中",
"ios.ui.touchMoveDown": "下移",
"ios.ui.touchMoveLeft": "左移",
@@ -848,8 +849,9 @@
"ios.ui.touchNoRoomBack": "那里放不下,已回到原来的位置。",
"ios.ui.touchOverPicture": "叠在画面上",
"ios.ui.touchPreview": "触控按键预览",
- "ios.ui.touchPutBack": "放回原位",
- "ios.ui.touchResetLayout": "重置此布局",
+ "ios.ui.touchPutBack": "重置此按键",
+ "ios.ui.touchResetAsk": "把 %@ 布局的所有按键放回默认位置?",
+ "ios.ui.touchResetLayout": "重置所有按键",
"ios.ui.touchScreen": "屏幕",
"ios.ui.touchSize": "大小",
"ios.ui.touchSizeNote": "适用于所有游戏。屏幕放不下所选设置时,按键会尽量留在原来的位置附近。",