Skip to content

Commit

Permalink
FREEZE.unindexed
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Jan 2, 2021
1 parent 0432afb commit 7190eed
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cubing/puzzles/implementations/3x3x3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 8 additions & 2 deletions src/cubing/twisty/dom/TwistyPlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -493,17 +494,22 @@ export class TwistyPlayer extends ManagedCustomElement {
}
switch (this.visualization) {
case "2D":
case "experimental-2D-LL":
{
const options: Twisty2DSVGOptions = {};
if (this.experimentalStickering) {
options.experimentalStickering = this.experimentalStickering;
}

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) {
Expand Down
1 change: 1 addition & 0 deletions src/cubing/twisty/dom/TwistyPlayerConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/demo/twisty/cube3d-stickering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7190eed

Please sign in to comment.