From 1ce68fe7fe2d404ed3e6763fb0d4278f2fb2970e Mon Sep 17 00:00:00 2001 From: Jon Eugster Date: Sat, 29 Jul 2023 15:01:46 +0200 Subject: [PATCH] fix end-of-level-buttons for mobile --- client/src/components/infoview/main.tsx | 12 ++++++------ client/src/components/level.tsx | 4 ++-- client/src/components/world_selection_menu.tsx | 6 ++++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/client/src/components/infoview/main.tsx b/client/src/components/infoview/main.tsx index 0680fa9..a230f45 100644 --- a/client/src/components/infoview/main.tsx +++ b/client/src/components/infoview/main.tsx @@ -39,7 +39,7 @@ import { Hints } from '../hints'; /** Wrapper for the two editors. It is important that the `div` with `codeViewRef` is * always present, or the monaco editor cannot start. */ -export function DualEditor({ level, codeviewRef, levelId, worldId, lastLevel = false }) { +export function DualEditor({ level, codeviewRef, levelId, worldId, worldSize }) { const ec = React.useContext(EditorContext) const { commandLineMode } = React.useContext(InputModeContext) return <> @@ -48,7 +48,7 @@ export function DualEditor({ level, codeviewRef, levelId, worldId, lastLevel = f
{ec ? - : + : // TODO: Style this if relevant. <>

Editor is starting up...

@@ -59,7 +59,7 @@ export function DualEditor({ level, codeviewRef, levelId, worldId, lastLevel = f } /** The part of the two editors that needs the editor connection first */ -function DualEditorMain({ worldId, levelId, level, lastLevel }: { worldId: string, levelId: number, level: LevelInfo, lastLevel: boolean }) { +function DualEditorMain({ worldId, levelId, level, worldSize }: { worldId: string, levelId: number, level: LevelInfo, worldSize: number }) { const ec = React.useContext(EditorContext) const gameId = React.useContext(GameIdContext) const { commandLineMode } = React.useContext(InputModeContext) @@ -109,7 +109,7 @@ function DualEditorMain({ worldId, levelId, level, lastLevel }: { worldId: strin {commandLineMode ? - + :
} @@ -282,7 +282,7 @@ function GoalsTab({ proofStep }: { proofStep: ProofStep }) { } /** The interface in command line mode */ -export function CommandLineInterface(props: { world: string, level: number, data: LevelInfo, lastLevel: boolean }) { +export function CommandLineInterface(props: { world: string, level: number, data: LevelInfo, worldSize: number }) { const ec = React.useContext(EditorContext) const editor = React.useContext(MonacoEditorContext) @@ -456,7 +456,7 @@ export function CommandLineInterface(props: { world: string, level: number, data )} {completed && i == proof.length - 1 &&
- {props.lastLevel ? + {props.level >= props.worldSize ? diff --git a/client/src/components/level.tsx b/client/src/components/level.tsx index 82b72e1..86170a8 100644 --- a/client/src/components/level.tsx +++ b/client/src/components/level.tsx @@ -318,7 +318,7 @@ function PlayableLevel({worldId, levelId}) {
- +
@@ -388,7 +388,7 @@ function PlayableLevel({worldId, levelId}) {
- +
diff --git a/client/src/components/world_selection_menu.tsx b/client/src/components/world_selection_menu.tsx index c1b115c..7d71090 100644 --- a/client/src/components/world_selection_menu.tsx +++ b/client/src/components/world_selection_menu.tsx @@ -148,8 +148,10 @@ export function WorldSelectionMenu() {

Delete Progress?

Do you want to delete your saved progress irreversibly?

-

(This only affects your saved proofs, no levels are ever locked. - Saves from other games are not deleted.)

+

+ (This deletes your proofs and your collected inventory. + Saves from other games are not deleted.) +