@rydr/game-sdk 7.0.0 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/dist/protocol/glyphs.d.ts +7 -0
- package/dist/protocol/glyphs.d.ts.map +1 -1
- package/dist/protocol/glyphs.js +26 -0
- package/dist/protocol/glyphs.js.map +1 -1
- package/dist/protocol/version.d.ts +1 -1
- package/dist/protocol/version.js +1 -1
- package/dist/three/perf-overlay.d.ts +52 -2
- package/dist/three/perf-overlay.d.ts.map +1 -1
- package/dist/three/perf-overlay.js +188 -3
- package/dist/three/perf-overlay.js.map +1 -1
- package/dist/ui/README.md +119 -0
- package/dist/ui/controller/combo-demo.d.ts +74 -0
- package/dist/ui/controller/combo-demo.d.ts.map +1 -0
- package/dist/ui/controller/combo-demo.js +295 -0
- package/dist/ui/controller/combo-demo.js.map +1 -0
- package/dist/ui/controller/combo-strip.d.ts +36 -0
- package/dist/ui/controller/combo-strip.d.ts.map +1 -0
- package/dist/ui/controller/combo-strip.js +66 -0
- package/dist/ui/controller/combo-strip.js.map +1 -0
- package/dist/ui/controller/control-trainer.d.ts +132 -0
- package/dist/ui/controller/control-trainer.d.ts.map +1 -0
- package/dist/ui/controller/control-trainer.js +570 -0
- package/dist/ui/controller/control-trainer.js.map +1 -0
- package/dist/ui/controller/controller-map.d.ts +82 -0
- package/dist/ui/controller/controller-map.d.ts.map +1 -0
- package/dist/ui/controller/controller-map.js +291 -0
- package/dist/ui/controller/controller-map.js.map +1 -0
- package/dist/ui/controller/controller-pad.d.ts +122 -0
- package/dist/ui/controller/controller-pad.d.ts.map +1 -0
- package/dist/ui/controller/controller-pad.js +200 -0
- package/dist/ui/controller/controller-pad.js.map +1 -0
- package/dist/ui/controller/index.d.ts +26 -0
- package/dist/ui/controller/index.d.ts.map +1 -0
- package/dist/ui/controller/index.js +26 -0
- package/dist/ui/controller/index.js.map +1 -0
- package/dist/ui/controller/input-chip.d.ts +100 -0
- package/dist/ui/controller/input-chip.d.ts.map +1 -0
- package/dist/ui/controller/input-chip.js +322 -0
- package/dist/ui/controller/input-chip.js.map +1 -0
- package/dist/ui/controller/layouts/dualsense.d.ts +12 -0
- package/dist/ui/controller/layouts/dualsense.d.ts.map +1 -0
- package/dist/ui/controller/layouts/dualsense.js +64 -0
- package/dist/ui/controller/layouts/dualsense.js.map +1 -0
- package/dist/ui/controller/layouts/index.d.ts +20 -0
- package/dist/ui/controller/layouts/index.d.ts.map +1 -0
- package/dist/ui/controller/layouts/index.js +34 -0
- package/dist/ui/controller/layouts/index.js.map +1 -0
- package/dist/ui/controller/layouts/joycon.d.ts +21 -0
- package/dist/ui/controller/layouts/joycon.d.ts.map +1 -0
- package/dist/ui/controller/layouts/joycon.js +76 -0
- package/dist/ui/controller/layouts/joycon.js.map +1 -0
- package/dist/ui/controller/layouts/switch-pro.d.ts +12 -0
- package/dist/ui/controller/layouts/switch-pro.d.ts.map +1 -0
- package/dist/ui/controller/layouts/switch-pro.js +60 -0
- package/dist/ui/controller/layouts/switch-pro.js.map +1 -0
- package/dist/ui/controller/layouts/xbox.d.ts +11 -0
- package/dist/ui/controller/layouts/xbox.d.ts.map +1 -0
- package/dist/ui/controller/layouts/xbox.js +59 -0
- package/dist/ui/controller/layouts/xbox.js.map +1 -0
- package/dist/ui/controller/layouts/zwift.d.ts +27 -0
- package/dist/ui/controller/layouts/zwift.d.ts.map +1 -0
- package/dist/ui/controller/layouts/zwift.js +62 -0
- package/dist/ui/controller/layouts/zwift.js.map +1 -0
- package/dist/ui/controller/pad-svg.d.ts +105 -0
- package/dist/ui/controller/pad-svg.d.ts.map +1 -0
- package/dist/ui/controller/pad-svg.js +289 -0
- package/dist/ui/controller/pad-svg.js.map +1 -0
- package/dist/ui/controller/parts-map.d.ts +96 -0
- package/dist/ui/controller/parts-map.d.ts.map +1 -0
- package/dist/ui/controller/parts-map.js +187 -0
- package/dist/ui/controller/parts-map.js.map +1 -0
- package/dist/ui/controller/styles.d.ts +19 -0
- package/dist/ui/controller/styles.d.ts.map +1 -0
- package/dist/ui/controller/styles.js +364 -0
- package/dist/ui/controller/styles.js.map +1 -0
- package/dist/ui/controller/tokens.d.ts +106 -0
- package/dist/ui/controller/tokens.d.ts.map +1 -0
- package/dist/ui/controller/tokens.js +50 -0
- package/dist/ui/controller/tokens.js.map +1 -0
- package/dist/ui/controller/types.d.ts +157 -0
- package/dist/ui/controller/types.d.ts.map +1 -0
- package/dist/ui/controller/types.js +61 -0
- package/dist/ui/controller/types.js.map +1 -0
- package/dist/ui/index.d.ts +8 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +8 -0
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/keycap.d.ts +14 -0
- package/dist/ui/keycap.d.ts.map +1 -1
- package/dist/ui/keycap.js +5 -0
- package/dist/ui/keycap.js.map +1 -1
- package/dist/ui/showcase/gallery.d.ts +13 -1
- package/dist/ui/showcase/gallery.d.ts.map +1 -1
- package/dist/ui/showcase/gallery.js.map +1 -1
- package/dist/ui/showcase/index.d.ts.map +1 -1
- package/dist/ui/showcase/index.js +257 -1
- package/dist/ui/showcase/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* INPUT CHIP — the small pictogram for one control, and the atom both controller views are built from.
|
|
3
|
+
*
|
|
4
|
+
* One factory, five renderers, chosen by the token:
|
|
5
|
+
*
|
|
6
|
+
* DIAMOND_* → `createKeycap` (the kit's existing face-button keycap)
|
|
7
|
+
* UP/DOWN/LEFT/RIGHT, R* → `createDpadKeycap` (the kit's chevron-on-steel keycap)
|
|
8
|
+
* LT / RT / OPTIONS → `createLabelKeycap` (the kit's pill: "L2"/"ZL", "Menu"/"Options"/"+")
|
|
9
|
+
* LSTICK / RSTICK → a stick pictogram, cap centred inside four outward arrows
|
|
10
|
+
* LSTICK / RSTICK :direction → the same pictogram with ONE arrow, cap already slid that way
|
|
11
|
+
* LSTICK_PRESS / RSTICK_PRESS → a stick pictogram of the cap CLICKED: sunk inside a collar,
|
|
12
|
+
* with a chevron pressing down into it
|
|
13
|
+
*
|
|
14
|
+
* The sticks are pictures rather than lettered chips throughout, because that is the one control where
|
|
15
|
+
* the letter tells a rider nothing: "L3" does not say *click the stick*, and it changes per brand on
|
|
16
|
+
* top of that. The printed label still reaches them through the chip's tooltip and assistive tech.
|
|
17
|
+
*
|
|
18
|
+
* All the button shapes REUSE the keycap kit rather than redrawing it, so a control looks identical in a
|
|
19
|
+
* controls legend and in an in-game prompt — same shape, same per-role hue, same letter for the rider's
|
|
20
|
+
* own pad. Only the shapes the kit didn't have are new, and they're inline SVG built with
|
|
21
|
+
* `createElementNS` from string path constants, exactly as `keycap.ts` does with its `CHEVRON`: this SDK
|
|
22
|
+
* ships **no non-TS assets** and adds no build step.
|
|
23
|
+
*
|
|
24
|
+
* **Press wiring lives here, not in the keycap.** The keycaps are built without their own `press`
|
|
25
|
+
* option, because `createDpadKeycap("UP")` listens for `UP` and there is no way to ask it to listen for
|
|
26
|
+
* `RUP` instead. Doing it in one place covers all five renderers uniformly and lets the combo demo drive
|
|
27
|
+
* exactly the same `setPressed` path that real input drives.
|
|
28
|
+
*/
|
|
29
|
+
import { bumperLabel, buttonLabel, DEFAULT_GLYPH_SET } from "../../protocol/glyphs.js";
|
|
30
|
+
import { createKeycap, createDpadKeycap, createLabelKeycap } from "../keycap.js";
|
|
31
|
+
import { injectPadCss } from "./styles.js";
|
|
32
|
+
import { isShellControl, parseToken, STICK_DIR_VECTOR } from "./tokens.js";
|
|
33
|
+
const NS = "http://www.w3.org/2000/svg";
|
|
34
|
+
/** The style used when a caller doesn't ask for one. */
|
|
35
|
+
export const DEFAULT_STICK_STYLE = "profile";
|
|
36
|
+
/**
|
|
37
|
+
* Plan-view geometry. The well is deliberately SMALL for its box: the direction arrows sit **outside**
|
|
38
|
+
* its rim, in clear air.
|
|
39
|
+
*
|
|
40
|
+
* They used to sit inside it, and that was the bug — the well's rim is stroked in `currentColor` and so
|
|
41
|
+
* is the arrow, so an arrow tip reaching the rim fused into it and the whole thing read as a blob
|
|
42
|
+
* instead of an arrow. Nothing that has to stay legible should touch that ring.
|
|
43
|
+
*/
|
|
44
|
+
const WELL_R = 6.6;
|
|
45
|
+
const CAP_R = 3.8;
|
|
46
|
+
/** Outline chevron pointing OUTWARD, clear of the well rim. */
|
|
47
|
+
const STICK_ARROW = "M9.3 4 L12 1 L14.7 4";
|
|
48
|
+
/** The same cue as a SOLID triangle — heavier, and far more legible at chip size. */
|
|
49
|
+
const STICK_TRI = "M12 0.6 L14.9 4 L9.1 4 Z";
|
|
50
|
+
/** A solid triangle for the glyph style, whose disc has no rim to collide with. */
|
|
51
|
+
const STICK_TRI_FAR = "M12 1.2 L15.2 5.6 L8.8 5.6 Z";
|
|
52
|
+
/** The four rotations that turn one arrow into the "any direction" cue. */
|
|
53
|
+
const OMNI_ROTATIONS = [0, 90, 180, 270];
|
|
54
|
+
/** Chevron pointing DOWN at the well from outside it — the top-down style's "click" cue. */
|
|
55
|
+
const STICK_PRESS_ARROW = "M9.4 1 L12 3.8 L14.6 1";
|
|
56
|
+
/** Solid arrow pressing DOWN onto the thumb pad of the side-view stick. */
|
|
57
|
+
const STICK_PRESS_TRI = "M12 7.4 L9.4 3.4 L14.6 3.4 Z";
|
|
58
|
+
/** Solid arrow pointing DOWN *inside* the glyph style's heavy ring. */
|
|
59
|
+
const STICK_PRESS_TRI_IN = "M12 16.8 L8.3 9.6 L15.7 9.6 Z";
|
|
60
|
+
/** The side-view stick: a socket ellipse, a tapering shaft, and a rounded thumb pad. */
|
|
61
|
+
const STICK_SHAFT = "M9.8 19 L10.9 12.6 L13.1 12.6 L14.2 19 Z";
|
|
62
|
+
/** How far the cap slides at full deflection, in the pictogram's own 24-unit box. Kept under
|
|
63
|
+
* `WELL_R - CAP_R` so a fully-deflected cap still reads as *inside* its well rather than escaping it. */
|
|
64
|
+
const PIC_TRAVEL = 2.6;
|
|
65
|
+
const ARROW_ROT = { up: 0, right: 90, down: 180, left: 270 };
|
|
66
|
+
/** Lesson colours. Kept beside the CSS block that mirrors them for the plain chips. */
|
|
67
|
+
const STATE_COLOR = {
|
|
68
|
+
idle: null, // null = whatever setColored would give
|
|
69
|
+
hint: "#ffffff",
|
|
70
|
+
active: "#38bdf8",
|
|
71
|
+
done: "#22c55e",
|
|
72
|
+
};
|
|
73
|
+
/** Toggle the three state classes on a plain chip. */
|
|
74
|
+
function classState(node, state) {
|
|
75
|
+
node.classList.toggle("rydr-pad-hint", state === "hint");
|
|
76
|
+
node.classList.toggle("rydr-pad-active", state === "active");
|
|
77
|
+
node.classList.toggle("rydr-pad-done", state === "done");
|
|
78
|
+
}
|
|
79
|
+
const DIAMONDS = ["DIAMOND_UP", "DIAMOND_DOWN", "DIAMOND_LEFT", "DIAMOND_RIGHT"];
|
|
80
|
+
/** A right-stick direction draws the same chevron keycap as its left-hand twin. */
|
|
81
|
+
const DIR_OF_BUTTON = {
|
|
82
|
+
UP: "UP", DOWN: "DOWN", LEFT: "LEFT", RIGHT: "RIGHT",
|
|
83
|
+
RUP: "UP", RDOWN: "DOWN", RLEFT: "LEFT", RRIGHT: "RIGHT",
|
|
84
|
+
};
|
|
85
|
+
function svgEl(tag, attrs, className) {
|
|
86
|
+
const node = document.createElementNS(NS, tag);
|
|
87
|
+
if (className)
|
|
88
|
+
node.setAttribute("class", className);
|
|
89
|
+
for (const [k, v] of Object.entries(attrs))
|
|
90
|
+
node.setAttribute(k, String(v));
|
|
91
|
+
return node;
|
|
92
|
+
}
|
|
93
|
+
/** A plain rounded-rect chip carrying short text — the shoulder rectangle and the system chip. */
|
|
94
|
+
function textChip(text, extraClass = "") {
|
|
95
|
+
const span = document.createElement("span");
|
|
96
|
+
span.className = `rydr-pad-chip ${extraClass}`.trim();
|
|
97
|
+
span.textContent = text;
|
|
98
|
+
return span;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* A directional chip renders ALREADY deflected — that is the information ("push it left"). The combo
|
|
102
|
+
* demo calls `setDeflection(0, 0)` first and eases in, so it starts from centre there instead.
|
|
103
|
+
*/
|
|
104
|
+
function seatCap(cap, mode, travel = PIC_TRAVEL) {
|
|
105
|
+
if (mode === "omni" || mode === "press")
|
|
106
|
+
return;
|
|
107
|
+
const [vx, vy] = STICK_DIR_VECTOR[mode];
|
|
108
|
+
cap.setAttribute("transform", `translate(${vx * travel} ${-vy * travel})`);
|
|
109
|
+
}
|
|
110
|
+
/** Emit the direction cue(s): one arrow for a direction, four for "any direction", none for a click. */
|
|
111
|
+
function addArrows(svg, mode, d, cls) {
|
|
112
|
+
if (mode === "press")
|
|
113
|
+
return;
|
|
114
|
+
const rots = mode === "omni" ? OMNI_ROTATIONS : [ARROW_ROT[mode]];
|
|
115
|
+
for (const rot of rots)
|
|
116
|
+
svg.appendChild(svgEl("path", { d, transform: `rotate(${rot} 12 12)` }, cls));
|
|
117
|
+
}
|
|
118
|
+
/** Plan view, light outline chevrons. The click is concentric rings + a chevron pressing in. */
|
|
119
|
+
function drawTopDown(svg, mode) {
|
|
120
|
+
svg.appendChild(svgEl("circle", { cx: 12, cy: 12, r: WELL_R }, "rydr-pad-stickpic-well"));
|
|
121
|
+
if (mode === "press") {
|
|
122
|
+
svg.appendChild(svgEl("path", { d: STICK_PRESS_ARROW }, "rydr-pad-stickpic-arrow"));
|
|
123
|
+
svg.appendChild(svgEl("circle", { cx: 12, cy: 12, r: 4.9 }, "rydr-pad-stickpic-ring"));
|
|
124
|
+
const cap = svgEl("circle", { cx: 12, cy: 13, r: 3 }, "rydr-pad-stickpic-cap");
|
|
125
|
+
svg.appendChild(cap);
|
|
126
|
+
return cap;
|
|
127
|
+
}
|
|
128
|
+
addArrows(svg, mode, STICK_ARROW, "rydr-pad-stickpic-arrow");
|
|
129
|
+
const cap = svgEl("circle", { cx: 12, cy: 12, r: CAP_R }, "rydr-pad-stickpic-cap");
|
|
130
|
+
seatCap(cap, mode);
|
|
131
|
+
svg.appendChild(cap);
|
|
132
|
+
return cap;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* The hybrid: plan view with SOLID arrows for directions, and a SIDE view for the click.
|
|
136
|
+
*
|
|
137
|
+
* Switching viewpoint for the click is the whole point. Pressing a stick is motion along the viewing
|
|
138
|
+
* axis, which a plan view physically cannot depict — hence the ambiguity between "click" and "push
|
|
139
|
+
* down" that the other two styles have to work around with rings and insets. From the side it's just a
|
|
140
|
+
* stick with an arrow on top of it.
|
|
141
|
+
*/
|
|
142
|
+
function drawProfile(svg, mode) {
|
|
143
|
+
if (mode === "press") {
|
|
144
|
+
svg.appendChild(svgEl("path", { d: STICK_PRESS_TRI }, "rydr-pad-stickpic-fill"));
|
|
145
|
+
svg.appendChild(svgEl("ellipse", { cx: 12, cy: 20, rx: 7.5, ry: 2.4 }, "rydr-pad-stickpic-base"));
|
|
146
|
+
svg.appendChild(svgEl("path", { d: STICK_SHAFT }, "rydr-pad-stickpic-shaft"));
|
|
147
|
+
const cap = svgEl("rect", { x: 7.4, y: 8.4, width: 9.2, height: 4.8, rx: 2.4 }, "rydr-pad-stickpic-cap");
|
|
148
|
+
svg.appendChild(cap);
|
|
149
|
+
return cap;
|
|
150
|
+
}
|
|
151
|
+
svg.appendChild(svgEl("circle", { cx: 12, cy: 12, r: WELL_R }, "rydr-pad-stickpic-well"));
|
|
152
|
+
addArrows(svg, mode, STICK_TRI, "rydr-pad-stickpic-fill");
|
|
153
|
+
const cap = svgEl("circle", { cx: 12, cy: 12, r: CAP_R }, "rydr-pad-stickpic-cap");
|
|
154
|
+
seatCap(cap, mode);
|
|
155
|
+
svg.appendChild(cap);
|
|
156
|
+
return cap;
|
|
157
|
+
}
|
|
158
|
+
/** The bold console-UI mark: a solid disc and solid triangles; the click is a heavy ring with an arrow in it. */
|
|
159
|
+
function drawGlyph(svg, mode) {
|
|
160
|
+
if (mode === "press") {
|
|
161
|
+
svg.appendChild(svgEl("circle", { cx: 12, cy: 12, r: 8.8 }, "rydr-pad-stickpic-bigring"));
|
|
162
|
+
const cap = svgEl("path", { d: STICK_PRESS_TRI_IN }, "rydr-pad-stickpic-fill");
|
|
163
|
+
svg.appendChild(cap);
|
|
164
|
+
return cap;
|
|
165
|
+
}
|
|
166
|
+
addArrows(svg, mode, STICK_TRI_FAR, "rydr-pad-stickpic-fill");
|
|
167
|
+
const cap = svgEl("circle", { cx: 12, cy: 12, r: 5.4 }, "rydr-pad-stickpic-cap");
|
|
168
|
+
seatCap(cap, mode);
|
|
169
|
+
svg.appendChild(cap);
|
|
170
|
+
return cap;
|
|
171
|
+
}
|
|
172
|
+
const STICK_DRAW = {
|
|
173
|
+
topdown: drawTopDown,
|
|
174
|
+
profile: drawProfile,
|
|
175
|
+
glyph: drawGlyph,
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* The stick pictogram. Three things must be tellable apart at a glance on a trainer screen:
|
|
179
|
+
*
|
|
180
|
+
* "omni" — the whole stick, free movement: FOUR outward arrows
|
|
181
|
+
* a dir — the stick pushed one way: ONE arrow that way, cap already slid there
|
|
182
|
+
* "press" — the stick CLICKED straight down (`LSTICK_PRESS`)
|
|
183
|
+
*
|
|
184
|
+
* Sticks are pictures rather than lettered chips because that is the one control where the letter tells
|
|
185
|
+
* a rider nothing — "L3" does not say *click the stick*, and it changes per brand on top of that. The
|
|
186
|
+
* printed label still reaches them through the chip's tooltip. See {@link StickPictogramStyle} for the
|
|
187
|
+
* three drawing conventions and why a click is the hard case.
|
|
188
|
+
*/
|
|
189
|
+
function stickChip(mode, style) {
|
|
190
|
+
const wrap = document.createElement("span");
|
|
191
|
+
wrap.className = `rydr-pad-chip stick ${style}`;
|
|
192
|
+
const svg = svgEl("svg", { viewBox: "0 0 24 24" });
|
|
193
|
+
const cap = STICK_DRAW[style](svg, mode);
|
|
194
|
+
wrap.appendChild(svg);
|
|
195
|
+
return { el: wrap, cap };
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Build the chip for one control.
|
|
199
|
+
*
|
|
200
|
+
* Always returns something drawable: an unrecognised token falls through to a text chip carrying
|
|
201
|
+
* `buttonLabel`'s own fallback (the name itself), so a caller can never render an empty box.
|
|
202
|
+
*/
|
|
203
|
+
export function createInputChip(token, opts = {}) {
|
|
204
|
+
injectPadCss();
|
|
205
|
+
const set = opts.glyphSet ?? DEFAULT_GLYPH_SET;
|
|
206
|
+
const stickStyle = opts.stickStyle ?? DEFAULT_STICK_STYLE;
|
|
207
|
+
const parsed = parseToken(token);
|
|
208
|
+
let el;
|
|
209
|
+
let setPressed;
|
|
210
|
+
let setDeflection = () => { };
|
|
211
|
+
let disposeInner = () => { };
|
|
212
|
+
/**
|
|
213
|
+
* How this renderer shows a lesson state. Plain chips toggle CSS classes; the keycap-backed ones must
|
|
214
|
+
* go through `Keycap.setAccent`, because their face colour lives in an inline `--c` property that a
|
|
215
|
+
* stylesheet rule can't outrank. Assigned in each branch below.
|
|
216
|
+
*/
|
|
217
|
+
let setState;
|
|
218
|
+
/** The control whose real presses this chip reflects (a stick pictogram has none). */
|
|
219
|
+
let pressName;
|
|
220
|
+
if (parsed.kind === "stick") {
|
|
221
|
+
const { el: node, cap } = stickChip(parsed.dir ?? "omni", stickStyle);
|
|
222
|
+
el = node;
|
|
223
|
+
node.title = parsed.stick === "LSTICK" ? "Left stick" : "Right stick";
|
|
224
|
+
setPressed = (on) => node.classList.toggle("pressed", on);
|
|
225
|
+
setState = (s) => classState(node, s);
|
|
226
|
+
setDeflection = (x, y) => {
|
|
227
|
+
cap.setAttribute("transform", `translate(${(x * PIC_TRAVEL).toFixed(2)} ${(-y * PIC_TRAVEL).toFixed(2)})`);
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
else if (isShellControl(parsed.name)) {
|
|
231
|
+
// The rider's resistance − / +, i.e. the UPPER shoulders. Same rectangle as a trigger, because
|
|
232
|
+
// that's what they physically are — but lettered from the bumper table, and NOT press-wired, since
|
|
233
|
+
// a game never receives these (see `ShellControl`). A source that does see them drives `setState`.
|
|
234
|
+
const left = parsed.name === "LB";
|
|
235
|
+
const node = textChip(bumperLabel(set, left ? "left" : "right"), "shoulder shell");
|
|
236
|
+
el = node;
|
|
237
|
+
node.title = left ? "Upper left shoulder (resistance −)" : "Upper right shoulder (resistance +)";
|
|
238
|
+
setPressed = (on) => node.classList.toggle("pressed", on);
|
|
239
|
+
setState = (s) => classState(node, s);
|
|
240
|
+
}
|
|
241
|
+
else if (parsed.name === "LSTICK_PRESS" || parsed.name === "RSTICK_PRESS") {
|
|
242
|
+
// Clicking a stick is its own gesture, so it gets its own picture rather than a "L3"/"LS" chip.
|
|
243
|
+
// The brand letter still reaches the rider through the tooltip and assistive tech.
|
|
244
|
+
const { el: node } = stickChip("press", stickStyle);
|
|
245
|
+
el = node;
|
|
246
|
+
const side = parsed.name === "LSTICK_PRESS" ? "Left" : "Right";
|
|
247
|
+
node.title = `${side} stick click (${buttonLabel(set, parsed.name)})`;
|
|
248
|
+
setPressed = (on) => node.classList.toggle("pressed", on);
|
|
249
|
+
setState = (s) => classState(node, s);
|
|
250
|
+
pressName = parsed.name;
|
|
251
|
+
}
|
|
252
|
+
else if (DIAMONDS.includes(parsed.name)) {
|
|
253
|
+
const keycap = createKeycap(parsed.name, {
|
|
254
|
+
variant: "solo",
|
|
255
|
+
animate: false, // a legend shouldn't pulse — that's the attract cue, not a label
|
|
256
|
+
colored: opts.colored ?? true,
|
|
257
|
+
glyphSet: set,
|
|
258
|
+
});
|
|
259
|
+
el = keycap.el;
|
|
260
|
+
setPressed = keycap.setPressed;
|
|
261
|
+
// Keycaps get their colour from an inline custom property, so the state goes through setAccent. The
|
|
262
|
+
// kit's own attract pulse doubles as the "do this" cue — it already means exactly that.
|
|
263
|
+
setState = (s) => { keycap.setAccent?.(STATE_COLOR[s]); keycap.setAnimated(s === "hint"); };
|
|
264
|
+
disposeInner = keycap.dispose;
|
|
265
|
+
pressName = parsed.name;
|
|
266
|
+
}
|
|
267
|
+
else if (DIR_OF_BUTTON[parsed.name]) {
|
|
268
|
+
const keycap = createDpadKeycap(DIR_OF_BUTTON[parsed.name], {
|
|
269
|
+
variant: "solo",
|
|
270
|
+
animate: false,
|
|
271
|
+
glyphSet: set,
|
|
272
|
+
});
|
|
273
|
+
el = keycap.el;
|
|
274
|
+
setPressed = keycap.setPressed;
|
|
275
|
+
setState = (s) => { keycap.setAccent?.(STATE_COLOR[s]); keycap.setAnimated(s === "hint"); };
|
|
276
|
+
disposeInner = keycap.dispose;
|
|
277
|
+
pressName = parsed.name;
|
|
278
|
+
}
|
|
279
|
+
else if (parsed.name === "LT" || parsed.name === "RT" || parsed.name === "OPTIONS") {
|
|
280
|
+
// The kit's own LABEL keycap — a pill for a button printed with a word rather than a letter: "L2" /
|
|
281
|
+
// "ZL" / "LT" for a trigger, "Menu" / "Options" / "+" for OPTIONS. This used to be a hand-rolled
|
|
282
|
+
// rectangle here, which duplicated `createLabelKeycap` outright once 7.0.0 added it; reusing it also
|
|
283
|
+
// means a shoulder reads identically in a legend and in an in-game prompt, and OPTIONS prints its
|
|
284
|
+
// real printed word instead of a generic ☰.
|
|
285
|
+
const keycap = createLabelKeycap(parsed.name, { animate: false, glyphSet: set });
|
|
286
|
+
el = keycap.el;
|
|
287
|
+
el.title =
|
|
288
|
+
parsed.name === "OPTIONS" ? "Options" : parsed.name === "LT" ? "Left trigger" : "Right trigger";
|
|
289
|
+
setPressed = keycap.setPressed;
|
|
290
|
+
setState = (st) => { keycap.setAccent?.(STATE_COLOR[st]); keycap.setAnimated(st === "hint"); };
|
|
291
|
+
disposeInner = keycap.dispose;
|
|
292
|
+
pressName = parsed.name;
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
// Anything a future protocol adds. `buttonLabel` falls back to the name itself, so this can never
|
|
296
|
+
// render an empty box.
|
|
297
|
+
const node = textChip(buttonLabel(set, parsed.name), "system");
|
|
298
|
+
el = node;
|
|
299
|
+
node.title = parsed.name;
|
|
300
|
+
setPressed = (on) => node.classList.toggle("pressed", on);
|
|
301
|
+
setState = (s) => classState(node, s);
|
|
302
|
+
pressName = parsed.name;
|
|
303
|
+
}
|
|
304
|
+
const off = pressName
|
|
305
|
+
? opts.press?.onButton((e) => {
|
|
306
|
+
if (e.name === pressName)
|
|
307
|
+
setPressed(e.edge === "down");
|
|
308
|
+
})
|
|
309
|
+
: undefined;
|
|
310
|
+
return {
|
|
311
|
+
el,
|
|
312
|
+
setPressed,
|
|
313
|
+
setDeflection,
|
|
314
|
+
setState,
|
|
315
|
+
dispose: () => {
|
|
316
|
+
off?.();
|
|
317
|
+
disposeInner();
|
|
318
|
+
el.remove();
|
|
319
|
+
},
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
//# sourceMappingURL=input-chip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-chip.js","sourceRoot":"","sources":["../../../src/ui/controller/input-chip.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAC;AACtG,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAsC,MAAM,cAAc,CAAC;AACrH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,gBAAgB,EAAoD,MAAM,aAAa,CAAC;AA4C7H,MAAM,EAAE,GAAG,4BAA4B,CAAC;AAqBxC,wDAAwD;AACxD,MAAM,CAAC,MAAM,mBAAmB,GAAwB,SAAS,CAAC;AAElE;;;;;;;GAOG;AACH,MAAM,MAAM,GAAG,GAAG,CAAC;AACnB,MAAM,KAAK,GAAG,GAAG,CAAC;AAClB,+DAA+D;AAC/D,MAAM,WAAW,GAAG,sBAAsB,CAAC;AAC3C,qFAAqF;AACrF,MAAM,SAAS,GAAG,0BAA0B,CAAC;AAC7C,mFAAmF;AACnF,MAAM,aAAa,GA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AAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;QAC1D,CAAC,CAAC;QACJ,CAAC,CAAC,SAAS,CAAC;IAEd,OAAO;QACL,EAAE;QACF,UAAU;QACV,aAAa;QACb,QAAQ;QACR,OAAO,EAAE,GAAG,EAAE;YACZ,GAAG,EAAE,EAAE,CAAC;YACR,YAAY,EAAE,CAAC;YACf,EAAE,CAAC,MAAM,EAAE,CAAC;QACd,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DualSense / DualShock arrangement — D-pad high-left, face diamond high-right, and both sticks LOW
|
|
3
|
+
* and SYMMETRIC (the visible difference from an Xbox pad), with the touchpad between them.
|
|
4
|
+
*
|
|
5
|
+
* Face glyphs are drawn as VECTORS rather than text: ✕ ◯ ▢ △ render inconsistently across fonts, and
|
|
6
|
+
* ✕ in particular is often substituted with a heavier multiplication sign — exactly the detail a
|
|
7
|
+
* PlayStation owner notices. This is the one place the drawing does not go through `buttonLabel()`,
|
|
8
|
+
* and it is deliberate: the shapes ARE the lettering for this family.
|
|
9
|
+
*/
|
|
10
|
+
import { type PadLayout } from "../types.js";
|
|
11
|
+
export declare const DUALSENSE_LAYOUT: PadLayout;
|
|
12
|
+
//# sourceMappingURL=dualsense.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dualsense.d.ts","sourceRoot":"","sources":["../../../../src/ui/controller/layouts/dualsense.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAQzE,eAAO,MAAM,gBAAgB,EAAE,SA+C9B,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DualSense / DualShock arrangement — D-pad high-left, face diamond high-right, and both sticks LOW
|
|
3
|
+
* and SYMMETRIC (the visible difference from an Xbox pad), with the touchpad between them.
|
|
4
|
+
*
|
|
5
|
+
* Face glyphs are drawn as VECTORS rather than text: ✕ ◯ ▢ △ render inconsistently across fonts, and
|
|
6
|
+
* ✕ in particular is often substituted with a heavier multiplication sign — exactly the detail a
|
|
7
|
+
* PlayStation owner notices. This is the one place the drawing does not go through `buttonLabel()`,
|
|
8
|
+
* and it is deliberate: the shapes ARE the lettering for this family.
|
|
9
|
+
*/
|
|
10
|
+
import { PAD_VIEWBOX, PAD_BODY_PATH } from "../types.js";
|
|
11
|
+
// Drawn centred on (0,0) in a ~12-unit box, then translated onto the part.
|
|
12
|
+
const CROSS = "M-4.6-4.6 L4.6 4.6 M4.6-4.6 L-4.6 4.6";
|
|
13
|
+
const CIRCLE = "M0-5.2 A5.2 5.2 0 1 1 -0.01 -5.2";
|
|
14
|
+
const SQUARE = "M-4.4-4.4 H4.4 V4.4 H-4.4 Z";
|
|
15
|
+
const TRIANGLE = "M0-5.4 L5 4 H-5 Z";
|
|
16
|
+
export const DUALSENSE_LAYOUT = {
|
|
17
|
+
brand: "playstation",
|
|
18
|
+
displayName: "PlayStation-style controller",
|
|
19
|
+
viewBox: PAD_VIEWBOX,
|
|
20
|
+
body: { d: PAD_BODY_PATH },
|
|
21
|
+
// High-left, mirroring the face diamond's height.
|
|
22
|
+
dpad: {
|
|
23
|
+
up: { geom: { kind: "rect", x: 59, y: 37, w: 10, h: 11, rx: 2 }, label: "D-pad up" },
|
|
24
|
+
down: { geom: { kind: "rect", x: 59, y: 58, w: 10, h: 11, rx: 2 }, label: "D-pad down" },
|
|
25
|
+
left: { geom: { kind: "rect", x: 48, y: 48, w: 11, h: 10, rx: 2 }, label: "D-pad left" },
|
|
26
|
+
right: { geom: { kind: "rect", x: 69, y: 48, w: 11, h: 10, rx: 2 }, label: "D-pad right" },
|
|
27
|
+
},
|
|
28
|
+
face: {
|
|
29
|
+
top: { geom: { kind: "circle", cx: 176, cy: 36, r: 9.5 }, glyphPath: TRIANGLE, label: "Triangle (top)" },
|
|
30
|
+
right: { geom: { kind: "circle", cx: 193, cy: 53, r: 9.5 }, glyphPath: CIRCLE, label: "Circle (right) — back" },
|
|
31
|
+
bottom: { geom: { kind: "circle", cx: 176, cy: 70, r: 9.5 }, glyphPath: CROSS, label: "Cross (bottom) — confirm" },
|
|
32
|
+
left: { geom: { kind: "circle", cx: 159, cy: 53, r: 9.5 }, glyphPath: SQUARE, label: "Square (left)" },
|
|
33
|
+
},
|
|
34
|
+
bumpers: {
|
|
35
|
+
l: { geom: { kind: "rect", x: 60, y: 2, w: 46, h: 12, rx: 6 }, glyph: "L1", label: "L1 — the shell's resistance −, not the game's" },
|
|
36
|
+
r: { geom: { kind: "rect", x: 134, y: 2, w: 46, h: 12, rx: 6 }, glyph: "R1", label: "R1 — the shell's resistance +, not the game's" },
|
|
37
|
+
},
|
|
38
|
+
triggers: {
|
|
39
|
+
l: {
|
|
40
|
+
geom: { kind: "rect", x: 66, y: -18, w: 34, h: 13, rx: 6 },
|
|
41
|
+
meter: { x: 68, y: -16, w: 30, h: 9, rx: 4 },
|
|
42
|
+
glyph: "L2",
|
|
43
|
+
label: "L2 trigger",
|
|
44
|
+
},
|
|
45
|
+
r: {
|
|
46
|
+
geom: { kind: "rect", x: 140, y: -18, w: 34, h: 13, rx: 6 },
|
|
47
|
+
meter: { x: 142, y: -16, w: 30, h: 9, rx: 4 },
|
|
48
|
+
glyph: "R2",
|
|
49
|
+
label: "R2 trigger",
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
// Both low and symmetric about the centre line.
|
|
53
|
+
sticks: {
|
|
54
|
+
l: { cx: 98, cy: 80, well: 16, cap: 11, travel: 5, label: "Left stick" },
|
|
55
|
+
r: { cx: 142, cy: 80, well: 16, cap: 11, travel: 5, label: "Right stick" },
|
|
56
|
+
},
|
|
57
|
+
system: {
|
|
58
|
+
select: { geom: { kind: "rect", x: 105, y: 32, w: 6, h: 10, rx: 2 }, label: "Create — the shell's, not the game's" },
|
|
59
|
+
start: { geom: { kind: "rect", x: 129, y: 32, w: 6, h: 10, rx: 2 }, label: "Options" },
|
|
60
|
+
home: { geom: { kind: "circle", cx: 120, cy: 92, r: 5 }, label: "PS button — the shell's, not the game's" },
|
|
61
|
+
},
|
|
62
|
+
decor: [{ geom: { kind: "rect", x: 101, y: 40, w: 38, h: 22, rx: 4 }, opacity: 0.5 }],
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=dualsense.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dualsense.js","sourceRoot":"","sources":["../../../../src/ui/controller/layouts/dualsense.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,WAAW,EAAE,aAAa,EAAkB,MAAM,aAAa,CAAC;AAEzE,2EAA2E;AAC3E,MAAM,KAAK,GAAG,uCAAuC,CAAC;AACtD,MAAM,MAAM,GAAG,kCAAkC,CAAC;AAClD,MAAM,MAAM,GAAG,6BAA6B,CAAC;AAC7C,MAAM,QAAQ,GAAG,mBAAmB,CAAC;AAErC,MAAM,CAAC,MAAM,gBAAgB,GAAc;IACzC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,8BAA8B;IAC3C,OAAO,EAAE,WAAW;IACpB,IAAI,EAAE,EAAE,CAAC,EAAE,aAAa,EAAE;IAC1B,kDAAkD;IAClD,IAAI,EAAE;QACJ,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE;QACpF,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,KAAK,E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E,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;CACtF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Silhouette selection.
|
|
3
|
+
*
|
|
4
|
+
* Keyed on {@link PadBrandKey} — a {@link GlyphSet} plus the shapes that need their own drawing
|
|
5
|
+
* regardless of lettering. A Joy-Con pair is a Nintendo device but is two slim halves, so `"joycon"` is
|
|
6
|
+
* a *drawing* key reachable only by asking for it explicitly; a pad reporting the `nintendo` glyph set
|
|
7
|
+
* gets the Pro Controller shell.
|
|
8
|
+
*
|
|
9
|
+
* Anything unrecognised gets the Xbox pad, whose lettering is also the fallback glyph set — the same
|
|
10
|
+
* fallback `buttonLabel()` applies, so the shape and the letters can never disagree.
|
|
11
|
+
*/
|
|
12
|
+
import type { PadBrandKey, PadLayout } from "../types.js";
|
|
13
|
+
import { XBOX_LAYOUT } from "./xbox.js";
|
|
14
|
+
import { DUALSENSE_LAYOUT } from "./dualsense.js";
|
|
15
|
+
import { SWITCH_PRO_LAYOUT } from "./switch-pro.js";
|
|
16
|
+
import { JOYCON_LAYOUT } from "./joycon.js";
|
|
17
|
+
import { ZWIFT_LAYOUT } from "./zwift.js";
|
|
18
|
+
export declare function layoutForBrand(brand: PadBrandKey): PadLayout;
|
|
19
|
+
export { XBOX_LAYOUT, DUALSENSE_LAYOUT, SWITCH_PRO_LAYOUT, JOYCON_LAYOUT, ZWIFT_LAYOUT };
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/controller/layouts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CAe5D;AAED,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Silhouette selection.
|
|
3
|
+
*
|
|
4
|
+
* Keyed on {@link PadBrandKey} — a {@link GlyphSet} plus the shapes that need their own drawing
|
|
5
|
+
* regardless of lettering. A Joy-Con pair is a Nintendo device but is two slim halves, so `"joycon"` is
|
|
6
|
+
* a *drawing* key reachable only by asking for it explicitly; a pad reporting the `nintendo` glyph set
|
|
7
|
+
* gets the Pro Controller shell.
|
|
8
|
+
*
|
|
9
|
+
* Anything unrecognised gets the Xbox pad, whose lettering is also the fallback glyph set — the same
|
|
10
|
+
* fallback `buttonLabel()` applies, so the shape and the letters can never disagree.
|
|
11
|
+
*/
|
|
12
|
+
import { XBOX_LAYOUT } from "./xbox.js";
|
|
13
|
+
import { DUALSENSE_LAYOUT } from "./dualsense.js";
|
|
14
|
+
import { SWITCH_PRO_LAYOUT } from "./switch-pro.js";
|
|
15
|
+
import { JOYCON_LAYOUT } from "./joycon.js";
|
|
16
|
+
import { ZWIFT_LAYOUT } from "./zwift.js";
|
|
17
|
+
export function layoutForBrand(brand) {
|
|
18
|
+
switch (brand) {
|
|
19
|
+
case "joycon":
|
|
20
|
+
return JOYCON_LAYOUT;
|
|
21
|
+
case "playstation":
|
|
22
|
+
return DUALSENSE_LAYOUT;
|
|
23
|
+
case "nintendo":
|
|
24
|
+
return SWITCH_PRO_LAYOUT;
|
|
25
|
+
case "zwift":
|
|
26
|
+
return ZWIFT_LAYOUT;
|
|
27
|
+
// 8BitDo / Steam / Stadia / generic are X-input devices carrying Xbox lettering.
|
|
28
|
+
case "xbox":
|
|
29
|
+
default:
|
|
30
|
+
return XBOX_LAYOUT;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export { XBOX_LAYOUT, DUALSENSE_LAYOUT, SWITCH_PRO_LAYOUT, JOYCON_LAYOUT, ZWIFT_LAYOUT };
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/controller/layouts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,UAAU,cAAc,CAAC,KAAkB;IAC/C,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,QAAQ;YACX,OAAO,aAAa,CAAC;QACvB,KAAK,aAAa;YAChB,OAAO,gBAAgB,CAAC;QAC1B,KAAK,UAAU;YACb,OAAO,iBAAiB,CAAC;QAC3B,KAAK,OAAO;YACV,OAAO,YAAY,CAAC;QACtB,iFAAiF;QACjF,KAAK,MAAM,CAAC;QACZ;YACE,OAAO,WAAW,CAAC;IACvB,CAAC;AACH,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Joy-Con pair — two slim halves side by side rather than one shell.
|
|
3
|
+
*
|
|
4
|
+
* A paired set is fused into a SINGLE device by the browser (`"Joy-Con (L/R)"`, the same shape as a
|
|
5
|
+
* Pro Controller), so this is one drawing for one device, and drawing both halves is what the rider is
|
|
6
|
+
* actually holding.
|
|
7
|
+
*
|
|
8
|
+
* Left half: stick up top, the four separate direction buttons below it, `−` and Capture.
|
|
9
|
+
* Right half: the face diamond up top, stick below, `+` and Home.
|
|
10
|
+
*
|
|
11
|
+
* The glyphs here sit in their TRUE PHYSICAL places — X top, A right, B bottom, Y left, exactly as on
|
|
12
|
+
* the hardware — because that is what the positional vocabulary means. (The platform additionally has
|
|
13
|
+
* to correct for Chromium reporting this pad's face indices by printed letter rather than by position;
|
|
14
|
+
* the SDK never sees raw indices, so that correction has no counterpart here.)
|
|
15
|
+
*
|
|
16
|
+
* Reachable only via an explicit `brand: "joycon"` — a Joy-Con reports the `nintendo` glyph set, which
|
|
17
|
+
* on its own resolves to the Pro Controller silhouette.
|
|
18
|
+
*/
|
|
19
|
+
import { type PadLayout } from "../types.js";
|
|
20
|
+
export declare const JOYCON_LAYOUT: PadLayout;
|
|
21
|
+
//# sourceMappingURL=joycon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"joycon.d.ts","sourceRoot":"","sources":["../../../../src/ui/controller/layouts/joycon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAa1D,eAAO,MAAM,aAAa,EAAE,SAgD3B,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Joy-Con pair — two slim halves side by side rather than one shell.
|
|
3
|
+
*
|
|
4
|
+
* A paired set is fused into a SINGLE device by the browser (`"Joy-Con (L/R)"`, the same shape as a
|
|
5
|
+
* Pro Controller), so this is one drawing for one device, and drawing both halves is what the rider is
|
|
6
|
+
* actually holding.
|
|
7
|
+
*
|
|
8
|
+
* Left half: stick up top, the four separate direction buttons below it, `−` and Capture.
|
|
9
|
+
* Right half: the face diamond up top, stick below, `+` and Home.
|
|
10
|
+
*
|
|
11
|
+
* The glyphs here sit in their TRUE PHYSICAL places — X top, A right, B bottom, Y left, exactly as on
|
|
12
|
+
* the hardware — because that is what the positional vocabulary means. (The platform additionally has
|
|
13
|
+
* to correct for Chromium reporting this pad's face indices by printed letter rather than by position;
|
|
14
|
+
* the SDK never sees raw indices, so that correction has no counterpart here.)
|
|
15
|
+
*
|
|
16
|
+
* Reachable only via an explicit `brand: "joycon"` — a Joy-Con reports the `nintendo` glyph set, which
|
|
17
|
+
* on its own resolves to the Pro Controller silhouette.
|
|
18
|
+
*/
|
|
19
|
+
import { PAD_VIEWBOX } from "../types.js";
|
|
20
|
+
import { buttonLabel } from "../../../protocol/glyphs.js";
|
|
21
|
+
const L = (n) => buttonLabel("nintendo", n);
|
|
22
|
+
/** Two rounded-rect shells: left x 24–104, right x 136–216, both y 16–142. */
|
|
23
|
+
const BODY = "M 46 16 H 82 A 22 22 0 0 1 104 38 V 120 A 22 22 0 0 1 82 142 H 46 " +
|
|
24
|
+
"A 22 22 0 0 1 24 120 V 38 A 22 22 0 0 1 46 16 Z " +
|
|
25
|
+
"M 158 16 H 194 A 22 22 0 0 1 216 38 V 120 A 22 22 0 0 1 194 142 H 158 " +
|
|
26
|
+
"A 22 22 0 0 1 136 120 V 38 A 22 22 0 0 1 158 16 Z";
|
|
27
|
+
export const JOYCON_LAYOUT = {
|
|
28
|
+
brand: "joycon",
|
|
29
|
+
displayName: "Joy-Con pair",
|
|
30
|
+
viewBox: PAD_VIEWBOX,
|
|
31
|
+
body: { d: BODY },
|
|
32
|
+
// The left half's four discrete direction buttons (not a cross).
|
|
33
|
+
dpad: {
|
|
34
|
+
up: { geom: { kind: "circle", cx: 64, cy: 84, r: 6 }, label: "Up" },
|
|
35
|
+
down: { geom: { kind: "circle", cx: 64, cy: 110, r: 6 }, label: "Down" },
|
|
36
|
+
left: { geom: { kind: "circle", cx: 51, cy: 97, r: 6 }, label: "Left" },
|
|
37
|
+
right: { geom: { kind: "circle", cx: 77, cy: 97, r: 6 }, label: "Right" },
|
|
38
|
+
},
|
|
39
|
+
// Right half, in TRUE physical positions — X top, A right, B bottom, Y left.
|
|
40
|
+
face: {
|
|
41
|
+
top: { geom: { kind: "circle", cx: 176, cy: 31, r: 9 }, glyph: L("DIAMOND_UP"), label: `${L("DIAMOND_UP")} button (top)` },
|
|
42
|
+
right: { geom: { kind: "circle", cx: 193, cy: 48, r: 9 }, glyph: L("DIAMOND_RIGHT"), label: `${L("DIAMOND_RIGHT")} button (right) — back` },
|
|
43
|
+
bottom: { geom: { kind: "circle", cx: 176, cy: 65, r: 9 }, glyph: L("DIAMOND_DOWN"), label: `${L("DIAMOND_DOWN")} button (bottom) — confirm` },
|
|
44
|
+
left: { geom: { kind: "circle", cx: 159, cy: 48, r: 9 }, glyph: L("DIAMOND_LEFT"), label: `${L("DIAMOND_LEFT")} button (left)` },
|
|
45
|
+
},
|
|
46
|
+
// Shoulders sit on each half's own top edge, not on a shared spine.
|
|
47
|
+
bumpers: {
|
|
48
|
+
l: { geom: { kind: "rect", x: 30, y: 2, w: 62, h: 11, rx: 5 }, glyph: "L", label: "L — the shell's resistance −, not the game's" },
|
|
49
|
+
r: { geom: { kind: "rect", x: 148, y: 2, w: 62, h: 11, rx: 5 }, glyph: "R", label: "R — the shell's resistance +, not the game's" },
|
|
50
|
+
},
|
|
51
|
+
triggers: {
|
|
52
|
+
l: {
|
|
53
|
+
geom: { kind: "rect", x: 32, y: -18, w: 58, h: 13, rx: 6 },
|
|
54
|
+
meter: { x: 34, y: -16, w: 54, h: 9, rx: 4 },
|
|
55
|
+
glyph: L("LT"),
|
|
56
|
+
label: "ZL trigger",
|
|
57
|
+
},
|
|
58
|
+
r: {
|
|
59
|
+
geom: { kind: "rect", x: 150, y: -18, w: 58, h: 13, rx: 6 },
|
|
60
|
+
meter: { x: 152, y: -16, w: 54, h: 9, rx: 4 },
|
|
61
|
+
glyph: L("RT"),
|
|
62
|
+
label: "ZR trigger",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
sticks: {
|
|
66
|
+
l: { cx: 64, cy: 44, well: 15, cap: 10, travel: 5, label: "Left stick" },
|
|
67
|
+
r: { cx: 176, cy: 100, well: 15, cap: 10, travel: 5, label: "Right stick" },
|
|
68
|
+
},
|
|
69
|
+
system: {
|
|
70
|
+
select: { geom: { kind: "circle", cx: 88, cy: 28, r: 5 }, glyph: "−", label: "Minus — the shell's, not the game's" },
|
|
71
|
+
start: { geom: { kind: "circle", cx: 152, cy: 28, r: 5 }, glyph: "+", label: "Plus" },
|
|
72
|
+
home: { geom: { kind: "circle", cx: 176, cy: 128, r: 6 }, label: "Home — the shell's, not the game's" },
|
|
73
|
+
},
|
|
74
|
+
decor: [{ geom: { kind: "rect", x: 59, y: 124, w: 10, h: 10, rx: 2 }, opacity: 0.5 }],
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=joycon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"joycon.js","sourceRoot":"","sources":["../../../../src/ui/controller/layouts/joycon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG1D,MAAM,CAAC,GAAG,CAAC,CAAa,EAAU,EAAE,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;AAEhE,8EAA8E;AAC9E,MAAM,IAAI,GACR,oEAAoE;IACpE,kDAAkD;IAClD,wEAAwE;IACxE,mDAAmD,CAAC;AAEtD,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,cAAc;IAC3B,OAAO,EAAE,WAAW;IACpB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KAAK,EAAE,qCAAqC,EAAE;QACpH,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE;QACrF,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,oCAAoC,EAAE;KACxG;IACD,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;CACtF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Switch Pro arrangement — the diagonal mirror of Xbox: left stick high-left, D-pad low-left, face
|
|
3
|
+
* diamond high-right, right stick low-right.
|
|
4
|
+
*
|
|
5
|
+
* Note the face glyphs: `A` sits on the RIGHT and `B` on the BOTTOM, the mirror of an Xbox pad. That
|
|
6
|
+
* inversion is the single most likely thing to get wrong here, and it is exactly why parts are keyed
|
|
7
|
+
* by position and the letters come from `buttonLabel()` instead of being assumed. A game asking for
|
|
8
|
+
* `DIAMOND_DOWN` still lights the BOTTOM button on this pad — only the letter printed on it changes.
|
|
9
|
+
*/
|
|
10
|
+
import { type PadLayout } from "../types.js";
|
|
11
|
+
export declare const SWITCH_PRO_LAYOUT: PadLayout;
|
|
12
|
+
//# sourceMappingURL=switch-pro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch-pro.d.ts","sourceRoot":"","sources":["../../../../src/ui/controller/layouts/switch-pro.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAMzE,eAAO,MAAM,iBAAiB,EAAE,SA8C/B,CAAC"}
|