From 4095189e8fe926bf5d16ae2bb927bb7cda8793a3 Mon Sep 17 00:00:00 2001 From: Marius Unsel Date: Tue, 24 Feb 2026 03:55:15 +0100 Subject: [PATCH] add levels button to editor --- src/components/Editor.tsx | 10 +++++++++- src/index.css | 8 ++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/components/Editor.tsx b/src/components/Editor.tsx index 7317578..33ebddb 100644 --- a/src/components/Editor.tsx +++ b/src/components/Editor.tsx @@ -1,11 +1,12 @@ import * as React from "react"; -import { Play, Bug, StepForward, RotateCcw, Square, ChevronUp, ChevronDown } from "lucide-react"; +import { Play, Bug, StepForward, RotateCcw, Square, ChevronUp, ChevronDown, LayoutGrid } from "lucide-react"; import { CodeBlockContainer, INIT_CODEBLOCKS, CodeBlock, INSERT_CODEBLOCK, REMOVE_CODEBLOCK, SET_DROPZONE_Z_INDEX } from "../store/codeBlocks/types"; import { LevelInitializer, IPlayerData } from "../game/levels"; import { initCodeBlocks, insertCodeBlock, removeCodeBlock } from "../store/codeBlocks/actions"; import { AppState } from "../store"; import game from "../game/game" import { connect } from "react-redux"; +import { Link } from "react-router-dom"; import { START_EXECUTING, STEP_EXECUTION, TOGGLE_AUTOSTEP, TOGGLE_SPEED } from "../store/executionState/types"; @@ -171,6 +172,12 @@ const RuntimeControls = ({ start, fast, step, running, level, code, autostep, to run ) + let LevelsButton = () => ( + + + levels + + ) let ResetButton = () => (
game.reset()}> @@ -217,6 +224,7 @@ const RuntimeControls = ({ start, fast, step, running, level, code, autostep, to
) } return (
+
) diff --git a/src/index.css b/src/index.css index 91138c0..2e9b238 100644 --- a/src/index.css +++ b/src/index.css @@ -244,6 +244,14 @@ h1 { background: #3b8; } +.controlbutton.levels { + background: #48b; +} + +.controlbutton.levels:hover { + background: #59c; +} + .controlbutton.debug { background: #eA5; color: #222;