Skip to content

Commit

Permalink
Update ViewBox.svelte
Browse files Browse the repository at this point in the history
  • Loading branch information
NybyDK committed May 14, 2024
1 parent 32ea3bb commit f9a81b5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/lib/components/ViewBox.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,27 @@
network.clearPackets();
break;
case "Digit1":
$editorState.placing = "CE";
buttonPreviewRouter("CE");
break;
case "Digit2":
$editorState.placing = "LER";
buttonPreviewRouter("LER");
break;
case "Digit3":
$editorState.placing = "LSR";
buttonPreviewRouter("LSR");
break;
case "Space":
event.preventDefault();
$config.running = !$config.running;
}
}
function buttonPreviewRouter(type: "CE" | "LSR" | "LER") {
for (const dialog of document.querySelectorAll("dialog")) {
if (dialog.hasAttribute("open")) return;
}
$editorState.placing = type;
}
function handlePointerDown(event: PointerEvent) {
if (!(event.target instanceof Element)) return;
Expand Down

0 comments on commit f9a81b5

Please sign in to comment.