From 7190eed3d44f241615a566cec04486a921ef9a0a Mon Sep 17 00:00:00 2001 From: Lucas Garron Date: Sat, 2 Jan 2021 04:21:20 -0800 Subject: [PATCH] FREEZE.unindexed --- src/cubing/puzzles/implementations/3x3x3/index.ts | 2 +- src/cubing/twisty/dom/TwistyPlayer.ts | 10 ++++++++-- src/cubing/twisty/dom/TwistyPlayerConfig.ts | 1 + src/demo/twisty/cube3d-stickering.ts | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/cubing/puzzles/implementations/3x3x3/index.ts b/src/cubing/puzzles/implementations/3x3x3/index.ts index 3811109cd..bed3d52ad 100644 --- a/src/cubing/puzzles/implementations/3x3x3/index.ts +++ b/src/cubing/puzzles/implementations/3x3x3/index.ts @@ -14,7 +14,7 @@ export const cube3x3x3: PuzzleManager = { return kpuzzle3x3x3; }, svg: async () => { - return (await import("./3x3x3-ll.kpuzzle.svg")).default; + return (await import("./3x3x3.kpuzzle.svg")).default; }, llSVG: async () => { return (await import("./3x3x3-ll.kpuzzle.svg")).default; diff --git a/src/cubing/twisty/dom/TwistyPlayer.ts b/src/cubing/twisty/dom/TwistyPlayer.ts index 670d27cb0..922628fd2 100644 --- a/src/cubing/twisty/dom/TwistyPlayer.ts +++ b/src/cubing/twisty/dom/TwistyPlayer.ts @@ -338,7 +338,8 @@ export class TwistyPlayer extends ManagedCustomElement { // TODO: specify exactly when back views are possible. // TODO: Are there any SVGs where we'd want a separate back view? - const setBackView: boolean = this.backView && this.visualization !== "2D"; + const setBackView: boolean = + this.backView && is3DVisualization(this.visualization); const backView: BackViewLayout = setBackView ? (this.backView as BackViewLayout) : "none"; @@ -493,6 +494,7 @@ export class TwistyPlayer extends ManagedCustomElement { } switch (this.visualization) { case "2D": + case "experimental-2D-LL": { const options: Twisty2DSVGOptions = {}; if (this.experimentalStickering) { @@ -500,10 +502,14 @@ export class TwistyPlayer extends ManagedCustomElement { } this.setRenderMode2D(); + const svgPromiseFn = + this.visualization === "2D" + ? puzzleManager.svg + : puzzleManager.llSVG ?? puzzleManager.svg; const mainViewer = new Twisty2DSVG( cursor, def, - await puzzleManager.svg(), + await svgPromiseFn(), options, ); if (!pendingPuzzleUpdate.cancelled) { diff --git a/src/cubing/twisty/dom/TwistyPlayerConfig.ts b/src/cubing/twisty/dom/TwistyPlayerConfig.ts index ccf0822d7..dbe786438 100644 --- a/src/cubing/twisty/dom/TwistyPlayerConfig.ts +++ b/src/cubing/twisty/dom/TwistyPlayerConfig.ts @@ -25,6 +25,7 @@ export const cubeCameraPosition = new Vector3(3, 4, 5); export const visualizationFormats = { "3D": true, // default "2D": true, + "experimental-2D-LL": true, // TODO "PG3D": true, }; export type VisualizationFormat = keyof typeof visualizationFormats; diff --git a/src/demo/twisty/cube3d-stickering.ts b/src/demo/twisty/cube3d-stickering.ts index 9a9a0a121..81faf93cc 100644 --- a/src/demo/twisty/cube3d-stickering.ts +++ b/src/demo/twisty/cube3d-stickering.ts @@ -16,7 +16,7 @@ function addAlg(stickering: ExperimentalStickering, s: string): Cube3D { const twistyPlayer = new TwistyPlayer({ experimentalStartSetup: invert(parseAlg(s)), alg: parseAlg(s), - // visualization: "2D", + visualization: "experimental-2D-LL", experimentalStickering: stickering, }); div.appendChild(document.createElement("h1")).textContent = stickering;