From 954c36868b12884a1e28b5ecfa3e52a9aafc9d53 Mon Sep 17 00:00:00 2001 From: Entkenntnis Date: Tue, 17 May 2022 16:16:11 +0200 Subject: [PATCH] finish integrating demo --- components/App.tsx | 19 ++++-- components/Research.tsx | 111 +++++++++++++++++++++++++++++-- lib/commands/world.ts | 3 + lib/state/types.ts | 1 + public/demo/allesinvertieren.png | Bin 0 -> 15014 bytes public/demo/bf.png | Bin 0 -> 21867 bytes "public/demo/f\303\274llen.png" | Bin 0 -> 19251 bytes public/demo/gol.png | Bin 0 -> 12708 bytes public/demo/konverter.png | Bin 0 -> 40042 bytes public/demo/labyrinth.png | Bin 0 -> 29107 bytes public/demo/raum_verlassen.png | Bin 0 -> 18031 bytes public/demo/schachbrett.png | Bin 0 -> 7906 bytes public/demo/schwimmbad.png | Bin 0 -> 13084 bytes public/demo/sortieren.png | Bin 0 -> 11822 bytes public/demo/stapeln.png | Bin 0 -> 22639 bytes 15 files changed, 123 insertions(+), 11 deletions(-) create mode 100644 public/demo/allesinvertieren.png create mode 100644 public/demo/bf.png create mode 100644 "public/demo/f\303\274llen.png" create mode 100644 public/demo/gol.png create mode 100644 public/demo/konverter.png create mode 100644 public/demo/labyrinth.png create mode 100644 public/demo/raum_verlassen.png create mode 100644 public/demo/schachbrett.png create mode 100644 public/demo/schwimmbad.png create mode 100644 public/demo/sortieren.png create mode 100644 public/demo/stapeln.png diff --git a/components/App.tsx b/components/App.tsx index 27397ff6..c4182714 100644 --- a/components/App.tsx +++ b/components/App.tsx @@ -35,16 +35,17 @@ export function App() { ;(async () => { const res = await fetch(file) const text = await res.text() - const wsClone: WorkspaceState = JSON.parse(JSON.stringify(core.ws)) const title = file.match(/\/([^\/]+\.json)/) if (title) { - wsClone.title = title[1] + //wsClone.title = title[1] + core.mutateCore((core) => { + core.projectTitle = title[1] + }) } - core.mutateCore((state) => { - state.workspaces.splice(1, 0, wsClone) - state.currentWorkspace = 1 - }) deserialize(core, text) + core.mutateWs((ws) => { + if (ws.type == 'free') ws.ui.showPreview = false + }) })() } catch (e) {} } @@ -53,7 +54,11 @@ export function App() { return ( <> - Robot Karol Web + {core.state.projectTitle ? ( + {core.state.projectTitle} - Robot Karol Web + ) : ( + Robot Karol Web + )}