@rydr/game-sdk 8.13.0 → 8.15.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/dist/protocol/identity.d.ts +39 -0
- package/dist/protocol/identity.d.ts.map +1 -1
- package/dist/protocol/version.d.ts +1 -1
- package/dist/protocol/version.js +1 -1
- package/dist/three/README.md +132 -4
- package/dist/three/character/riders.d.ts.map +1 -1
- package/dist/three/character/riders.js.map +1 -1
- package/dist/three/controller/index.d.ts +2 -0
- package/dist/three/controller/index.d.ts.map +1 -1
- package/dist/three/controller/index.js +2 -0
- package/dist/three/controller/index.js.map +1 -1
- package/dist/three/controller/joycon-designs.d.ts +15 -1
- package/dist/three/controller/joycon-designs.d.ts.map +1 -1
- package/dist/three/controller/joycon-designs.js +302 -60
- package/dist/three/controller/joycon-designs.js.map +1 -1
- package/dist/three/controller/joycon-object.d.ts +216 -0
- package/dist/three/controller/joycon-object.d.ts.map +1 -0
- package/dist/three/controller/joycon-object.js +578 -0
- package/dist/three/controller/joycon-object.js.map +1 -0
- package/dist/three/controller/joycon-spec.d.ts +116 -4
- package/dist/three/controller/joycon-spec.d.ts.map +1 -1
- package/dist/three/controller/joycon-spec.js +128 -22
- package/dist/three/controller/joycon-spec.js.map +1 -1
- package/dist/three/controller/press-pulse.d.ts +89 -0
- package/dist/three/controller/press-pulse.d.ts.map +1 -0
- package/dist/three/controller/press-pulse.js +309 -0
- package/dist/three/controller/press-pulse.js.map +1 -0
- package/dist/three/controller/three-pad-renderer.d.ts +11 -22
- package/dist/three/controller/three-pad-renderer.d.ts.map +1 -1
- package/dist/three/controller/three-pad-renderer.js +44 -258
- package/dist/three/controller/three-pad-renderer.js.map +1 -1
- package/dist/three/rider/three-rider-rig.d.ts +12 -0
- package/dist/three/rider/three-rider-rig.d.ts.map +1 -1
- package/dist/three/rider/three-rider-rig.js +102 -9
- package/dist/three/rider/three-rider-rig.js.map +1 -1
- package/dist/ui/README.md +133 -7
- package/dist/ui/choice-card.d.ts +8 -0
- package/dist/ui/choice-card.d.ts.map +1 -1
- package/dist/ui/choice-card.js +1 -1
- package/dist/ui/choice-card.js.map +1 -1
- package/dist/ui/controller/controller-pad.d.ts +105 -2
- package/dist/ui/controller/controller-pad.d.ts.map +1 -1
- package/dist/ui/controller/controller-pad.js +347 -16
- package/dist/ui/controller/controller-pad.js.map +1 -1
- package/dist/ui/controller/renderer.d.ts +13 -0
- package/dist/ui/controller/renderer.d.ts.map +1 -1
- package/dist/ui/controller/renderer.js.map +1 -1
- package/dist/ui/controller/styles.js +50 -1
- package/dist/ui/controller/styles.js.map +1 -1
- package/dist/ui/dialogue-card.d.ts +8 -0
- package/dist/ui/dialogue-card.d.ts.map +1 -1
- package/dist/ui/dialogue-card.js +1 -1
- package/dist/ui/dialogue-card.js.map +1 -1
- package/dist/ui/hud-placement.d.ts +81 -0
- package/dist/ui/hud-placement.d.ts.map +1 -0
- package/dist/ui/hud-placement.js +74 -0
- package/dist/ui/hud-placement.js.map +1 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +1 -0
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/rider-rig.d.ts +108 -10
- package/dist/ui/rider-rig.d.ts.map +1 -1
- package/dist/ui/rider-rig.js +299 -48
- package/dist/ui/rider-rig.js.map +1 -1
- package/dist/ui/solo-labeled-diamond.d.ts +13 -0
- package/dist/ui/solo-labeled-diamond.d.ts.map +1 -1
- package/dist/ui/solo-labeled-diamond.js +1 -1
- package/dist/ui/solo-labeled-diamond.js.map +1 -1
- package/package.json +4 -2
|
@@ -32,12 +32,101 @@
|
|
|
32
32
|
* set changes, restoring anything currently held. Callers keep their handle and need to know nothing.
|
|
33
33
|
*/
|
|
34
34
|
import { DEFAULT_GLYPH_SET } from "../../protocol/glyphs.js";
|
|
35
|
+
import { anchorHudHost, applyHudPlacement } from "../hud-placement.js";
|
|
35
36
|
import { layoutForBrand } from "./layouts/index.js";
|
|
36
|
-
import { DPAD_DIRECTIONS, litPartOfButton, litPartOfControl, triggerSideOfPart } from "./parts-map.js";
|
|
37
|
+
import { anchorPartOfToken, anchorTokenOf, DPAD_DIRECTIONS, litPartOfButton, litPartOfControl, triggerSideOfPart, } from "./parts-map.js";
|
|
37
38
|
import { STICK_LIT_DEADZONE } from "./pad-svg.js";
|
|
38
39
|
import { createSvgPadRenderer, } from "./renderer.js";
|
|
39
40
|
import { injectPadCss } from "./styles.js";
|
|
41
|
+
import { isShellControl, parseToken, STICK_DIR_VECTOR, } from "./tokens.js";
|
|
40
42
|
const DPAD_NAMES = ["UP", "DOWN", "LEFT", "RIGHT"];
|
|
43
|
+
/** Narrowest the pad may be drawn. Below this the button lettering stops being readable. */
|
|
44
|
+
const MIN_PAD_WIDTH = 120;
|
|
45
|
+
/** Gap between a caption and the control it names, px. Enough to clear the key, not to float free. */
|
|
46
|
+
const CAPTION_GAP = 8;
|
|
47
|
+
/** How far a hinted stick is leaned, of its full travel. Enough to read, not a shove. */
|
|
48
|
+
const HINT_STICK_DEFLECTION = 0.8;
|
|
49
|
+
/** One full sweep of a hinted WHOLE stick, ms. Slow — it is an instruction, not an animation reel. */
|
|
50
|
+
const HINT_STICK_SWEEP_MS = 2400;
|
|
51
|
+
/** One push-and-return of a hinted DIRECTIONAL stick, ms. */
|
|
52
|
+
const HINT_STICK_PUSH_MS = 1150;
|
|
53
|
+
/** Fraction of a directional cycle spent held at the end of the push, before coming back. */
|
|
54
|
+
const HINT_STICK_DWELL = 0.3;
|
|
55
|
+
/**
|
|
56
|
+
* Accept either vocabulary: a flat list of controls, or the same {@link ControlAction}s the callout
|
|
57
|
+
* views take.
|
|
58
|
+
*
|
|
59
|
+
* Both are right for different callers. A game that only wants keys lit passes tokens and writes no
|
|
60
|
+
* labels; a game that already has its action list — because it feeds `mountControllerMap` on its
|
|
61
|
+
* controls screen — passes that same list here and gets the HUD version of it, with no second
|
|
62
|
+
* description of its own controls to keep in sync.
|
|
63
|
+
*/
|
|
64
|
+
function highlightTokens(highlight) {
|
|
65
|
+
const tokens = [];
|
|
66
|
+
const captions = [];
|
|
67
|
+
for (const entry of highlight) {
|
|
68
|
+
if (typeof entry === "string") {
|
|
69
|
+
tokens.push(entry);
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
tokens.push(...entry.combo);
|
|
73
|
+
// `anchorTokenOf` is the same rule the callout views use to pick which control a card points at —
|
|
74
|
+
// the first NON-GENERIC token, so "LT + ✕" captions the ✕ rather than the trigger every combo has.
|
|
75
|
+
const anchor = anchorTokenOf(entry);
|
|
76
|
+
const part = anchor ? anchorPartOfToken(anchor) : undefined;
|
|
77
|
+
if (part && entry.label)
|
|
78
|
+
captions.push({ part, label: entry.label });
|
|
79
|
+
}
|
|
80
|
+
return { tokens, captions };
|
|
81
|
+
}
|
|
82
|
+
function resolveHighlight(tokens) {
|
|
83
|
+
const parts = new Set();
|
|
84
|
+
const sticks = new Map();
|
|
85
|
+
let needsShellOwned = false;
|
|
86
|
+
for (const token of tokens) {
|
|
87
|
+
const parsed = parseToken(token);
|
|
88
|
+
if (parsed.kind === "stick") {
|
|
89
|
+
const side = parsed.stick === "LSTICK" ? "l" : "r";
|
|
90
|
+
sticks.set(side, parsed.dir ? STICK_DIR_VECTOR[parsed.dir] : undefined);
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (isShellControl(parsed.name))
|
|
94
|
+
needsShellOwned = true;
|
|
95
|
+
const part = litPartOfControl(parsed.name);
|
|
96
|
+
if (part)
|
|
97
|
+
parts.add(part);
|
|
98
|
+
}
|
|
99
|
+
return { parts, sticks, needsShellOwned };
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Where a hinted stick's cap should be right now.
|
|
103
|
+
*
|
|
104
|
+
* A hinted BUTTON can say "press me" by throbbing in place, because a button only does one thing. A
|
|
105
|
+
* stick cannot: it is the one control whose whole meaning is WHERE IT GOES, so a stick that only
|
|
106
|
+
* changes colour has said nothing. "Se déplacer" in particular — a bare `"LSTICK"` — is precisely an
|
|
107
|
+
* instruction about motion, and a motionless cap is the one drawing that cannot express it.
|
|
108
|
+
*
|
|
109
|
+
* So the two cases move, and they move differently, because they are different instructions:
|
|
110
|
+
*
|
|
111
|
+
* - **Any direction** (`"LSTICK"`) — the cap sweeps a slow circle. It is the only shape that says "all
|
|
112
|
+
* of them" rather than naming one.
|
|
113
|
+
* - **One direction** (`"LSTICK:left"`) — the cap pushes that way, dwells, and comes back, on a loop.
|
|
114
|
+
* The RETURN is what makes it an instruction rather than a state: a cap parked at the edge reads as
|
|
115
|
+
* a stick that is already being held, which is the opposite of "push it".
|
|
116
|
+
*/
|
|
117
|
+
function hintStickAt(dir, now) {
|
|
118
|
+
if (!dir) {
|
|
119
|
+
const a = ((now % HINT_STICK_SWEEP_MS) / HINT_STICK_SWEEP_MS) * Math.PI * 2;
|
|
120
|
+
return [Math.cos(a) * HINT_STICK_DEFLECTION, Math.sin(a) * HINT_STICK_DEFLECTION];
|
|
121
|
+
}
|
|
122
|
+
// Out, hold, back. The ease is the same cubic in both directions, so the push and the release have
|
|
123
|
+
// the same weight — a fast push with a slow return would read as a spring, i.e. as a real press.
|
|
124
|
+
const t = (now % HINT_STICK_PUSH_MS) / HINT_STICK_PUSH_MS;
|
|
125
|
+
const half = (1 - HINT_STICK_DWELL) / 2;
|
|
126
|
+
const phase = t < half ? t / half : t < half + HINT_STICK_DWELL ? 1 : (1 - t) / half;
|
|
127
|
+
const e = phase < 0.5 ? 4 * phase ** 3 : 1 - (-2 * phase + 2) ** 3 / 2;
|
|
128
|
+
return [dir[0] * e * HINT_STICK_DEFLECTION, dir[1] * e * HINT_STICK_DEFLECTION];
|
|
129
|
+
}
|
|
41
130
|
/** Explicit option → what the rider's hardware reports → the SDK-wide fallback. */
|
|
42
131
|
function resolveGlyphSet(opts) {
|
|
43
132
|
return opts.glyphSet ?? opts.press?.hardware?.current?.glyphSet ?? DEFAULT_GLYPH_SET;
|
|
@@ -58,7 +147,28 @@ export function mountControllerPad(host, opts = {}) {
|
|
|
58
147
|
root.style.setProperty("--pad-accent", opts.accent);
|
|
59
148
|
root.style.setProperty("--pad-glow", opts.accent);
|
|
60
149
|
}
|
|
150
|
+
if (opts.hintColor) {
|
|
151
|
+
// The flat drawing's half of `hintColor`; the 3D renderer is handed the value itself, below.
|
|
152
|
+
root.style.setProperty("--pad-hint", opts.hintColor);
|
|
153
|
+
root.style.setProperty("--pad-hint-stroke", opts.hintColor);
|
|
154
|
+
}
|
|
61
155
|
host.appendChild(root);
|
|
156
|
+
/** Free width wins over the preset class, which is a `max-width`. Both are written so it can't lose. */
|
|
157
|
+
function applyWidth(px) {
|
|
158
|
+
const w = Math.max(MIN_PAD_WIDTH, px);
|
|
159
|
+
root.style.width = `${w}px`;
|
|
160
|
+
root.style.maxWidth = `${w}px`;
|
|
161
|
+
}
|
|
162
|
+
if (opts.width != null)
|
|
163
|
+
applyWidth(opts.width);
|
|
164
|
+
let placement = opts.place ? { ...opts.place } : undefined;
|
|
165
|
+
if (placement) {
|
|
166
|
+
root.classList.add("rydr-pad--placed");
|
|
167
|
+
// Promoting a static host is the one style this component writes outside its own subtree — see
|
|
168
|
+
// `hud-placement.ts`, where that is documented as observable.
|
|
169
|
+
anchorHudHost(host, placement);
|
|
170
|
+
applyHudPlacement(root, placement);
|
|
171
|
+
}
|
|
62
172
|
const live = !opts.ghost && opts.press != null;
|
|
63
173
|
const source = opts.press;
|
|
64
174
|
const hasAxis = live && typeof source?.axis === "function";
|
|
@@ -86,6 +196,20 @@ export function mountControllerPad(host, opts = {}) {
|
|
|
86
196
|
}
|
|
87
197
|
return parts;
|
|
88
198
|
};
|
|
199
|
+
/** What is currently marked "press this". Re-applied after every rebuild, like the held buttons. */
|
|
200
|
+
let hint = highlightTokens(opts.highlight ?? []);
|
|
201
|
+
let highlight = resolveHighlight(hint.tokens);
|
|
202
|
+
/** Print the labels? Default: yes as soon as there are any. */
|
|
203
|
+
let captionsOn = opts.captions ?? true;
|
|
204
|
+
/** The caption layer. Declared up here because `build()` has to re-parent it after a pad swap. */
|
|
205
|
+
let captionLayer;
|
|
206
|
+
/**
|
|
207
|
+
* The animation loop's handle. Declared HERE, with the mount-time state, rather than beside the loop
|
|
208
|
+
* itself further down: `applyHighlight` starts the loop and runs during mount, so a `let` sitting
|
|
209
|
+
* next to `frame()` is still in its temporal dead zone when that happens — which threw
|
|
210
|
+
* `Cannot access 'raf' before initialization` and took the whole mount down with it.
|
|
211
|
+
*/
|
|
212
|
+
let raf = 0;
|
|
89
213
|
function build() {
|
|
90
214
|
// Dispose the outgoing renderer BEFORE dropping its node: a three.js one holds a WebGL context and
|
|
91
215
|
// GPU buffers that clearing the DOM would leak. The flat renderer has nothing to release, so this
|
|
@@ -95,17 +219,135 @@ export function mountControllerPad(host, opts = {}) {
|
|
|
95
219
|
renderer = makeRenderer(layout, {
|
|
96
220
|
labels: opts.labels ?? true,
|
|
97
221
|
accent: opts.accent,
|
|
98
|
-
|
|
222
|
+
hintColor: opts.hintColor,
|
|
223
|
+
// A highlight naming `LB`/`RB`/`MENU` implies permission to light it: asking for a control to be
|
|
224
|
+
// pointed at and forbidding it from lighting is not a coherent request. Read off the CURRENT
|
|
225
|
+
// highlight rather than the initial option, so `setHighlight` can introduce one.
|
|
226
|
+
allowShellOwned: opts.allowShellOwned || highlight.needsShellOwned,
|
|
99
227
|
});
|
|
100
228
|
driver = renderer.driver;
|
|
101
229
|
root.textContent = "";
|
|
102
230
|
root.appendChild(renderer.node);
|
|
231
|
+
// `textContent = ""` just took the caption layer with it. It is created after the first `build()`,
|
|
232
|
+
// hence the guard; every later rebuild (a pad swap) puts it back on top of the new drawing.
|
|
233
|
+
if (captionLayer)
|
|
234
|
+
root.appendChild(captionLayer);
|
|
103
235
|
driver.setAvailable(availableParts());
|
|
104
236
|
renderer.resize();
|
|
105
237
|
for (const cb of projectionCbs)
|
|
106
238
|
renderer.onProjectionChange?.(cb);
|
|
107
239
|
}
|
|
108
240
|
build();
|
|
241
|
+
/**
|
|
242
|
+
* What a part should go back to when it is NOT pressed.
|
|
243
|
+
*
|
|
244
|
+
* A hint is a standing instruction — "press this" — so a hinted key the rider actually presses has to
|
|
245
|
+
* return to the hint on release rather than going dark. Without this the first press would silently
|
|
246
|
+
* cancel the very thing the pad was asking for.
|
|
247
|
+
*/
|
|
248
|
+
const restStateOf = (part) => (highlight.parts.has(part) ? "hint" : "off");
|
|
249
|
+
/** The parts behind everything the rider is holding right now. */
|
|
250
|
+
function heldParts() {
|
|
251
|
+
const parts = new Set();
|
|
252
|
+
for (const name of held) {
|
|
253
|
+
const part = litPartOfControl(name);
|
|
254
|
+
if (part)
|
|
255
|
+
parts.add(part);
|
|
256
|
+
}
|
|
257
|
+
return parts;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Paint the current highlight. Called on mount, after a rebuild, and on `setHighlight`.
|
|
261
|
+
*
|
|
262
|
+
* A part the rider is HOLDING is skipped: hinting it would be an `on → hint → on` round trip once
|
|
263
|
+
* `applyAllHeld` puts the press back, and the 3D renderer marks a press on the EDGE into a pressed
|
|
264
|
+
* state — so it would fire a second press pulse on a key nobody pressed again. The press is already
|
|
265
|
+
* the right thing on screen, and `restStateOf` lands the hint under it on release.
|
|
266
|
+
*/
|
|
267
|
+
function applyHighlight() {
|
|
268
|
+
const down = heldParts();
|
|
269
|
+
for (const part of highlight.parts) {
|
|
270
|
+
if (!down.has(part))
|
|
271
|
+
driver.setPartState(part, "hint");
|
|
272
|
+
}
|
|
273
|
+
// Only the COLOUR is seeded here; the position is the loop's, which starts below. A hinted stick
|
|
274
|
+
// has to move to mean anything — see `hintStickAt`.
|
|
275
|
+
for (const [side, dir] of highlight.sticks) {
|
|
276
|
+
const [x, y] = hintStickAt(dir, performance.now());
|
|
277
|
+
driver.setStick(side, x, y, "hint");
|
|
278
|
+
}
|
|
279
|
+
startFrames();
|
|
280
|
+
}
|
|
281
|
+
applyHighlight();
|
|
282
|
+
// ── the captions ────────────────────────────────────────────────────────────────────────────────
|
|
283
|
+
//
|
|
284
|
+
// DOM over the drawing, positioned from `partRect` — never measured off a node. That is the same
|
|
285
|
+
// discipline the map's leader lines and the spotlight's tags follow, and it is what makes one
|
|
286
|
+
// implementation correct on both renderers: the flat pad answers from its viewBox, the 3D one
|
|
287
|
+
// projects from its camera, and this code cannot tell which it is talking to.
|
|
288
|
+
captionLayer = document.createElement("div");
|
|
289
|
+
captionLayer.className = "rydr-pad-hints";
|
|
290
|
+
root.appendChild(captionLayer);
|
|
291
|
+
/** Rebuild the caption elements. Cheap — there are at most a handful. */
|
|
292
|
+
function buildCaptions() {
|
|
293
|
+
if (!captionLayer)
|
|
294
|
+
return;
|
|
295
|
+
captionLayer.textContent = "";
|
|
296
|
+
// `perspective` is the renderer saying "I draw a lit object, not a flat diagram" — the one thing a
|
|
297
|
+
// caption has to know, because a chip that is right over a diagram reads as a sticker on a shell.
|
|
298
|
+
captionLayer.classList.toggle("on-3d", renderer?.perspective === true);
|
|
299
|
+
if (!captionsOn)
|
|
300
|
+
return;
|
|
301
|
+
for (const c of hint.captions) {
|
|
302
|
+
const el = document.createElement("div");
|
|
303
|
+
el.className = "rydr-pad-hint";
|
|
304
|
+
el.textContent = c.label;
|
|
305
|
+
el.dataset.part = c.part;
|
|
306
|
+
captionLayer.appendChild(el);
|
|
307
|
+
}
|
|
308
|
+
placeCaptions();
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Put every caption over its control.
|
|
312
|
+
*
|
|
313
|
+
* Above the part, except where that would push it off the top of the drawing — a shoulder key sits
|
|
314
|
+
* at the very top of the pad, and a caption clipped by the host is worse than one sitting below its
|
|
315
|
+
* control. Coalesced into one frame because the projection can change several times per frame while
|
|
316
|
+
* the pad rolls.
|
|
317
|
+
*/
|
|
318
|
+
let placeRaf = 0;
|
|
319
|
+
function placeCaptions() {
|
|
320
|
+
if (placeRaf || !captionsOn)
|
|
321
|
+
return;
|
|
322
|
+
placeRaf = requestAnimationFrame(() => {
|
|
323
|
+
placeRaf = 0;
|
|
324
|
+
const host = root.getBoundingClientRect();
|
|
325
|
+
if (host.width < 1 || !captionLayer)
|
|
326
|
+
return;
|
|
327
|
+
for (const el of captionLayer.children) {
|
|
328
|
+
const node = el;
|
|
329
|
+
const rect = renderer?.partRect(node.dataset.part);
|
|
330
|
+
if (!rect) {
|
|
331
|
+
node.style.display = "none";
|
|
332
|
+
continue;
|
|
333
|
+
}
|
|
334
|
+
node.style.display = "";
|
|
335
|
+
const above = rect.top - host.top > node.offsetHeight + CAPTION_GAP;
|
|
336
|
+
node.classList.toggle("below", !above);
|
|
337
|
+
node.style.left = `${rect.left - host.left + rect.width / 2}px`;
|
|
338
|
+
node.style.top = above
|
|
339
|
+
? `${rect.top - host.top - CAPTION_GAP}px`
|
|
340
|
+
: `${rect.bottom - host.top + CAPTION_GAP}px`;
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
buildCaptions();
|
|
345
|
+
// The pad moves on its own (a 3D pad rolling to show a trigger) and with its host (a resize, a font
|
|
346
|
+
// swapping in). A caption placed once and never again is left behind by both.
|
|
347
|
+
const captionRo = new ResizeObserver(() => placeCaptions());
|
|
348
|
+
captionRo.observe(root);
|
|
349
|
+
projectionCbs.add(placeCaptions);
|
|
350
|
+
renderer?.onProjectionChange?.(placeCaptions);
|
|
109
351
|
/**
|
|
110
352
|
* Apply one button's state to the drawing.
|
|
111
353
|
*
|
|
@@ -119,7 +361,8 @@ export function mountControllerPad(host, opts = {}) {
|
|
|
119
361
|
const part = litPartOfControl(name);
|
|
120
362
|
if (!part)
|
|
121
363
|
return;
|
|
122
|
-
|
|
364
|
+
// `restStateOf`, not `off`: releasing a key the pad is ASKING for must leave the ask standing.
|
|
365
|
+
driver.setPartState(part, down ? "on" : restStateOf(part));
|
|
123
366
|
const meter = triggerSideOfPart(part);
|
|
124
367
|
if (meter)
|
|
125
368
|
driver.setMeter(meter, down ? 1 : 0);
|
|
@@ -143,29 +386,54 @@ export function mountControllerPad(host, opts = {}) {
|
|
|
143
386
|
held.add(name);
|
|
144
387
|
applyAllHeld();
|
|
145
388
|
}
|
|
146
|
-
// ── axis polling
|
|
147
|
-
|
|
148
|
-
|
|
389
|
+
// ── axis polling, and the hinted sticks ─────────────────────────────────────────────────────────
|
|
390
|
+
//
|
|
391
|
+
// One loop drives both, because they write to the same two caps and two writers would fight every
|
|
392
|
+
// frame. It runs whenever there is something to animate — real axes to poll, a hinted stick to move,
|
|
393
|
+
// or both — which is why the guard is not simply `hasAxis` any more.
|
|
394
|
+
function frame(now) {
|
|
149
395
|
raf = requestAnimationFrame(frame);
|
|
150
396
|
const axis = source?.axis;
|
|
397
|
+
/**
|
|
398
|
+
* Drive one cap.
|
|
399
|
+
*
|
|
400
|
+
* The rider's own thumb ALWAYS wins: a drawing that refused to follow a real stick because a hint
|
|
401
|
+
* was standing would be lying about the hardware. The hint takes over only once the stick is back
|
|
402
|
+
* inside its deadzone, which is also exactly when it becomes readable again.
|
|
403
|
+
*/
|
|
404
|
+
function driveStick(side, x, y) {
|
|
405
|
+
if (Math.hypot(x, y) > STICK_LIT_DEADZONE || !highlight.sticks.has(side)) {
|
|
406
|
+
driver.setStick(side, x, y, "auto");
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
const [hx, hy] = hintStickAt(highlight.sticks.get(side), now);
|
|
410
|
+
driver.setStick(side, hx, hy, "hint");
|
|
411
|
+
}
|
|
412
|
+
const lx = axis ? axis("LX") : 0;
|
|
413
|
+
const ly = axis ? axis("LY") : 0;
|
|
414
|
+
driveStick("l", lx, ly);
|
|
415
|
+
driveStick("r", axis ? axis("RX") : 0, axis ? axis("RY") : 0);
|
|
151
416
|
if (!axis)
|
|
152
417
|
return;
|
|
153
|
-
const lx = axis("LX");
|
|
154
|
-
const ly = axis("LY");
|
|
155
|
-
driver.setStick("l", lx, ly);
|
|
156
|
-
driver.setStick("r", axis("RX"), axis("RY"));
|
|
157
418
|
// The suppression rule: light a d-pad arm only if it's held AND the left stick isn't already
|
|
158
419
|
// showing that direction (projection of the stick vector onto the direction, past the deadzone).
|
|
420
|
+
//
|
|
421
|
+
// Read off the REAL axes, not the drawn ones: a hinted cap sweeping a circle is the pad talking,
|
|
422
|
+
// not the rider, and letting it explain away a d-pad press would blank a button they are holding.
|
|
159
423
|
for (const name of DPAD_NAMES) {
|
|
160
424
|
const [vx, vy] = DPAD_DIRECTIONS[name];
|
|
161
425
|
const explained = lx * vx + ly * vy > STICK_LIT_DEADZONE;
|
|
162
426
|
const part = litPartOfButton(name);
|
|
163
427
|
if (part)
|
|
164
|
-
driver.
|
|
428
|
+
driver.setPartState(part, held.has(name) && !explained ? "on" : restStateOf(part));
|
|
165
429
|
}
|
|
166
430
|
}
|
|
431
|
+
/** Is there anything to animate? Real axes to poll, or a stick the pad is asking the rider to move. */
|
|
432
|
+
function needsFrames() {
|
|
433
|
+
return hasAxis || highlight.sticks.size > 0;
|
|
434
|
+
}
|
|
167
435
|
function startFrames() {
|
|
168
|
-
if (
|
|
436
|
+
if (needsFrames() && !raf)
|
|
169
437
|
raf = requestAnimationFrame(frame);
|
|
170
438
|
}
|
|
171
439
|
function stopFrames() {
|
|
@@ -179,10 +447,11 @@ export function mountControllerPad(host, opts = {}) {
|
|
|
179
447
|
else
|
|
180
448
|
startFrames();
|
|
181
449
|
};
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
450
|
+
// Listened to unconditionally: `setHighlight` can introduce a hinted stick long after mount, and a
|
|
451
|
+
// listener attached only when the pad happened to start with axes would leave that loop running on a
|
|
452
|
+
// hidden tab.
|
|
453
|
+
document.addEventListener("visibilitychange", onVisibility);
|
|
454
|
+
startFrames();
|
|
186
455
|
// ── re-lettering, and re-drawing ────────────────────────────────────────────────────────────────
|
|
187
456
|
// Only for the parts the caller did NOT pin: an explicit `glyphSet`/`brand` is a deliberate preview.
|
|
188
457
|
// Both are watched here rather than in two subscriptions, because they come from ONE snapshot and a
|
|
@@ -197,6 +466,10 @@ export function mountControllerPad(host, opts = {}) {
|
|
|
197
466
|
glyphSet = nextGlyphs;
|
|
198
467
|
brand = nextBrand;
|
|
199
468
|
build();
|
|
469
|
+
applyHighlight();
|
|
470
|
+
// The new drawing may be a different renderer kind (flat vs 3D), which the captions style
|
|
471
|
+
// themselves on, and the parts it draws may differ — so they are rebuilt, not just re-placed.
|
|
472
|
+
buildCaptions();
|
|
200
473
|
applyAllHeld();
|
|
201
474
|
for (const cb of rebuildCbs)
|
|
202
475
|
cb();
|
|
@@ -236,6 +509,61 @@ export function mountControllerPad(host, opts = {}) {
|
|
|
236
509
|
setVisible(on) {
|
|
237
510
|
root.style.display = on ? "" : "none";
|
|
238
511
|
},
|
|
512
|
+
setWidth(px) {
|
|
513
|
+
applyWidth(px);
|
|
514
|
+
// The flat drawing scales through its viewBox; a canvas has to be told its box changed.
|
|
515
|
+
renderer?.resize();
|
|
516
|
+
placeCaptions();
|
|
517
|
+
},
|
|
518
|
+
setCaptions(on) {
|
|
519
|
+
captionsOn = on;
|
|
520
|
+
buildCaptions();
|
|
521
|
+
},
|
|
522
|
+
setPlacement(next) {
|
|
523
|
+
placement = { ...next };
|
|
524
|
+
root.classList.add("rydr-pad--placed");
|
|
525
|
+
anchorHudHost(host, placement);
|
|
526
|
+
applyHudPlacement(root, placement);
|
|
527
|
+
placeCaptions();
|
|
528
|
+
},
|
|
529
|
+
setHighlight(next) {
|
|
530
|
+
const previous = highlight;
|
|
531
|
+
hint = highlightTokens(next);
|
|
532
|
+
highlight = resolveHighlight(hint.tokens);
|
|
533
|
+
buildCaptions();
|
|
534
|
+
// Introducing a shell-owned control needs a drawing that is allowed to light one, and that is
|
|
535
|
+
// fixed at build time — so this is the one highlight change that costs a rebuild.
|
|
536
|
+
if (highlight.needsShellOwned && !previous.needsShellOwned && !opts.allowShellOwned) {
|
|
537
|
+
build();
|
|
538
|
+
applyHighlight();
|
|
539
|
+
buildCaptions();
|
|
540
|
+
applyAllHeld();
|
|
541
|
+
for (const cb of rebuildCbs)
|
|
542
|
+
cb();
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
// Clear what dropped out of the list before painting what came in, or a part that was hinted and
|
|
546
|
+
// no longer is would keep its throb forever.
|
|
547
|
+
//
|
|
548
|
+
// A part the rider is HOLDING is skipped rather than cleared-and-relit. Darkening it for an
|
|
549
|
+
// instant would be an `on → off → on` round trip, and the 3D renderer marks a press on the EDGE
|
|
550
|
+
// into a pressed state — so it would fire a second press pulse on a key nobody pressed again.
|
|
551
|
+
// The press stays the truth on screen, and `restStateOf` lands it correctly on release.
|
|
552
|
+
const down = heldParts();
|
|
553
|
+
for (const part of previous.parts) {
|
|
554
|
+
if (!highlight.parts.has(part) && !down.has(part))
|
|
555
|
+
driver.setPartState(part, "off");
|
|
556
|
+
}
|
|
557
|
+
for (const side of previous.sticks.keys()) {
|
|
558
|
+
if (!highlight.sticks.has(side))
|
|
559
|
+
driver.setStick(side, 0, 0, "off");
|
|
560
|
+
}
|
|
561
|
+
applyHighlight();
|
|
562
|
+
applyAllHeld();
|
|
563
|
+
// A highlight that no longer names a stick has nothing left to animate — let the loop stop.
|
|
564
|
+
if (!needsFrames())
|
|
565
|
+
stopFrames();
|
|
566
|
+
},
|
|
239
567
|
dispose() {
|
|
240
568
|
offButton?.();
|
|
241
569
|
offHardware?.();
|
|
@@ -245,6 +573,9 @@ export function mountControllerPad(host, opts = {}) {
|
|
|
245
573
|
// behind if the caller re-parents or re-mounts the node. The renderer's own dispose also frees
|
|
246
574
|
// whatever it holds beyond the DOM (a three.js one: geometries, materials, the WebGL context).
|
|
247
575
|
driver.clearAll();
|
|
576
|
+
captionRo.disconnect();
|
|
577
|
+
if (placeRaf)
|
|
578
|
+
cancelAnimationFrame(placeRaf);
|
|
248
579
|
renderer?.dispose();
|
|
249
580
|
renderer = undefined;
|
|
250
581
|
rebuildCbs.clear();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller-pad.js","sourceRoot":"","sources":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I,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;oBAAE,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YACtF,CAAC;YACD,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;gBAC1C,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;oBAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;YACtE,CAAC;YACD,cAAc,EAAE,CAAC;YACjB,YAAY,EAAE,CAAC;YACf,4FAA4F;YAC5F,IAAI,CAAC,WAAW,EAAE;gBAAE,UAAU,EAAE,CAAC;QACnC,CAAC;QACD,OAAO;YACL,SAAS,EAAE,EAAE,CAAC;YACd,WAAW,EAAE,EAAE,CAAC;YAChB,UAAU,EAAE,CAAC;YACb,QAAQ,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;YAC/D,4FAA4F;YAC5F,+FAA+F;YAC/F,+FAA+F;YAC/F,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,SAAS,CAAC,UAAU,EAAE,CAAC;YACvB,IAAI,QAAQ;gBAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC;YAC7C,QAAQ,EAAE,OAAO,EAAE,CAAC;YACpB,QAAQ,GAAG,SAAS,CAAC;YACrB,UAAU,CAAC,KAAK,EAAE,CAAC;YACnB,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -99,6 +99,19 @@ export interface PadRendererOptions extends PadDriverOptions {
|
|
|
99
99
|
labels?: boolean;
|
|
100
100
|
/** Accent colour for pressed parts. The flat renderer takes it from CSS; three.js needs it directly. */
|
|
101
101
|
accent?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Colour of the `hint` state — "press this". Default: the kit's near-white.
|
|
104
|
+
*
|
|
105
|
+
* Themable for the same reason {@link accent} is: a pad pinned into a game's HUD sits inside that
|
|
106
|
+
* game's palette, not this kit's. Same division of labour, too — the flat renderer reads it off the
|
|
107
|
+
* `--pad-hint` CSS variable the component sets, three.js needs the value itself.
|
|
108
|
+
*
|
|
109
|
+
* ⚠️ **Do not set it to {@link accent}.** White-vs-accent is how the drawing separates *do this*
|
|
110
|
+
* from *you are doing it*; collapse the two and a hinted key and a held key become the same picture,
|
|
111
|
+
* which is precisely the confusion the state grammar exists to prevent. The pulse still distinguishes
|
|
112
|
+
* them on the flat pad, and on the 3D pad only a difference in glow would be left.
|
|
113
|
+
*/
|
|
114
|
+
hintColor?: string;
|
|
102
115
|
}
|
|
103
116
|
/**
|
|
104
117
|
* Builds a renderer for one layout. `mountControllerPad` calls this on every (re-)draw, so a factory
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../../src/ui/controller/renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAgC,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEnF,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAEtE;;;;;;;;GAQG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,0DAA0D;AAC1D,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAA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G;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,kBAAkB,KAAK,WAAW,CAAC;AAE9F;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,GAAE,kBAAuB,GAAG,WAAW,CA6DlG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../../src/ui/controller/renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAyB,MAAM,cAAc,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAgC,MAAM,YAAY,CAAC;AAoBtE,0DAA0D;AAC1D,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,GAAW,EAAE,KAAa,EAAE,MAAc;IACjF,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,GAAG,MAAM,EAAE,CAAC;AACjF,CAAC;
|
|
1
|
+
{"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../../src/ui/controller/renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAyB,MAAM,cAAc,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAgC,MAAM,YAAY,CAAC;AAoBtE,0DAA0D;AAC1D,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,GAAW,EAAE,KAAa,EAAE,MAAc;IACjF,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,GAAG,KAAK,E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EAAE,CAAC;YAClB,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;QACnB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -34,6 +34,9 @@ export function injectPadCss() {
|
|
|
34
34
|
const CSS = `
|
|
35
35
|
/* ══════════════════════════════ THE PAD DRAWING ══════════════════════════════ */
|
|
36
36
|
.rydr-pad {
|
|
37
|
+
/* Anchors the hint-caption layer, which is absolutely positioned over the drawing. Harmless
|
|
38
|
+
otherwise: a positioned block lays out exactly like a static one. */
|
|
39
|
+
position: relative;
|
|
37
40
|
--pad-body: rgba(255, 255, 255, 0.10);
|
|
38
41
|
--pad-body-stroke: rgba(255, 255, 255, 0.40);
|
|
39
42
|
--pad-fill: rgba(255, 255, 255, 0.22);
|
|
@@ -41,6 +44,11 @@ const CSS = `
|
|
|
41
44
|
--pad-glyph: rgba(255, 255, 255, 0.88);
|
|
42
45
|
--pad-accent: #38bdf8;
|
|
43
46
|
--pad-glow: rgba(56, 189, 248, 0.45);
|
|
47
|
+
/* "Press this". Near-white by default, and deliberately NOT the accent: white-vs-accent is how the
|
|
48
|
+
drawing separates an instruction from a press. Themed through the hintColor option, never by
|
|
49
|
+
overriding this from outside. */
|
|
50
|
+
--pad-hint: rgba(255, 255, 255, 0.92);
|
|
51
|
+
--pad-hint-stroke: #ffffff;
|
|
44
52
|
display: block;
|
|
45
53
|
width: 100%;
|
|
46
54
|
}
|
|
@@ -49,6 +57,47 @@ const CSS = `
|
|
|
49
57
|
.rydr-pad.lg { max-width: 460px; }
|
|
50
58
|
/* ghost = static art with no live subscription; used as a placeholder or a backdrop. */
|
|
51
59
|
.rydr-pad.ghost { opacity: 0.25; }
|
|
60
|
+
/* Pinned into a corner of the game's screen by the place option — see ui/hud-placement.ts. Click-through in
|
|
61
|
+
full: it is a picture the game draws over itself, and a HUD piece that ate a click on what is
|
|
62
|
+
underneath is a bug in every game that mounts one. The position, the offsets and the transform are
|
|
63
|
+
written inline by applyHudPlacement — only what is true of EVERY placement lives here. max-width is
|
|
64
|
+
dropped with it: a placed pad is sized by its own width, and inheriting the size preset's max-width
|
|
65
|
+
would shrink it below what the game asked for. */
|
|
66
|
+
.rydr-pad--placed { pointer-events: none; max-width: none; }
|
|
67
|
+
|
|
68
|
+
/* ── the hint captions (the highlight's labels) ──────────────────────────────────────────────────
|
|
69
|
+
DOM over the drawing, positioned from the renderer's projection — so one implementation is correct
|
|
70
|
+
on the flat pad and on the 3D one, and follows the latter as it rolls to show a trigger.
|
|
71
|
+
The layer is inert: it names controls, it is not one. */
|
|
72
|
+
.rydr-pad-hints { position: absolute; inset: 0; pointer-events: none; }
|
|
73
|
+
.rydr-pad-hint {
|
|
74
|
+
position: absolute;
|
|
75
|
+
transform: translate(-50%, -100%);
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
font: 700 15px system-ui, -apple-system, sans-serif;
|
|
78
|
+
letter-spacing: 0.01em;
|
|
79
|
+
color: #0b0f17;
|
|
80
|
+
background: #ffffff;
|
|
81
|
+
padding: 3px 9px;
|
|
82
|
+
border-radius: 999px;
|
|
83
|
+
/* A host may shadow its type so it survives what passes underneath; that shadow behind dark text on
|
|
84
|
+
a light chip reads as smudged. Refuse it once here rather than in every host. */
|
|
85
|
+
text-shadow: none;
|
|
86
|
+
}
|
|
87
|
+
.rydr-pad-hint.below { transform: translate(-50%, 0); }
|
|
88
|
+
|
|
89
|
+
/* Over a pad drawn IN VOLUME the chip is wrong: it lands on a lit, shaded shell whose local brightness
|
|
90
|
+
it cannot predict, so it reads as a sticker — and it covers the very control it names. Bare type
|
|
91
|
+
instead, carrying its own shadow. Same reasoning as the spotlight's .on-3d rule below. */
|
|
92
|
+
.rydr-pad-hints.on-3d .rydr-pad-hint {
|
|
93
|
+
background: transparent;
|
|
94
|
+
color: #ffffff;
|
|
95
|
+
padding: 0;
|
|
96
|
+
border-radius: 0;
|
|
97
|
+
/* TWO layers: the tight one keeps the letterforms legible where they cross a pale shell, the wide
|
|
98
|
+
diffuse one lifts the word off whatever is behind it. One layer can do either, not both. */
|
|
99
|
+
text-shadow: 0 1px 2px rgba(0,0,0,0.9), 0 4px 14px rgba(0,0,0,0.65);
|
|
100
|
+
}
|
|
52
101
|
.rydr-pad > svg { display: block; width: 100%; height: auto; overflow: visible; }
|
|
53
102
|
|
|
54
103
|
.rydr-pad-body { fill: var(--pad-body); stroke: var(--pad-body-stroke); stroke-width: 1.2; }
|
|
@@ -143,7 +192,7 @@ const CSS = `
|
|
|
143
192
|
The pulse is what distinguishes the instruction from a press: colour alone would be ambiguous on a
|
|
144
193
|
pad whose pressed state is also a solid fill. */
|
|
145
194
|
.rydr-pad-part.hint .rydr-pad-shape {
|
|
146
|
-
fill: rgba(255,255,255,0.92); stroke: #ffffff; stroke-width: 1.4;
|
|
195
|
+
fill: var(--pad-hint, rgba(255,255,255,0.92)); stroke: var(--pad-hint-stroke, #ffffff); stroke-width: 1.4;
|
|
147
196
|
animation: rydr-pad-pulse 1.6s ease-in-out infinite;
|
|
148
197
|
}
|
|
149
198
|
.rydr-pad-part.hint .rydr-pad-glyph { fill: #0b0f17; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/ui/controller/styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAE9D,MAAM,QAAQ,GAAG,cAAc,CAAC;AAChC,IAAI,WAAW,GAAG,KAAK,CAAC;AAExB,wFAAwF;AACxF,MAAM,UAAU,YAAY;IAC1B,IAAI,WAAW,IAAI,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC;QACrD,WAAW,GAAG,IAAI,CAAC;QACnB,OAAO;IACT,CAAC;IACD,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,KAAK,CAAC,EAAE,GAAG,QAAQ,CAAC;IACpB,KA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