+}
+
+
function ErasePopup ({handleClose}) {
const gameId = React.useContext(GameIdContext)
const gameProgress = useSelector(selectProgress(gameId))
@@ -155,6 +168,11 @@ function Welcome() {
function closeImpressum() {setImpressum(false)}
function toggleImpressum() {setImpressum(!impressum)}
+ const [info, setInfo] = React.useState(false)
+ function closeInfo() {setInfo(false)}
+ function toggleInfo() {setInfo(!impressum)}
+
+
/* state variables to toggle the pop-up menus */
const [eraseMenu, setEraseMenu] = React.useState(false);
const openEraseMenu = () => setEraseMenu(true);
@@ -177,12 +195,12 @@ function Welcome() {
: <>
+ openUploadMenu={openUploadMenu} toggleInfo={toggleInfo} />
{ mobile ?
{(pageNumber == 0 ?
-
+
: pageNumber == 1 ?
:
@@ -200,6 +218,7 @@ function Welcome() {
{impressum ? : null}
{eraseMenu? : null}
{uploadMenu? : null}
+ {info ? : null}
>
}
diff --git a/client/src/components/world_tree.tsx b/client/src/components/world_tree.tsx
index 2a794b8..3e54ed8 100644
--- a/client/src/components/world_tree.tsx
+++ b/client/src/components/world_tree.tsx
@@ -23,7 +23,7 @@ import './world_tree.css'
cytoscape.use( klay )
const r = 16 // radius of a level
-const s = 12 // global scale
+const s = 10 // global scale
const lineWidth = 10 //
const ds = .75 // scale the resulting svg image
diff --git a/client/src/state/api.ts b/client/src/state/api.ts
index 89c83da..6b45915 100644
--- a/client/src/state/api.ts
+++ b/client/src/state/api.ts
@@ -7,6 +7,7 @@ import { Connection } from '../connection'
export interface GameInfo {
title: null|string,
introduction: null|string,
+ info: null|string,
worlds: null|{nodes: {[id:string]: {id: string, title: string, introduction: string}}, edges: string[][]},
worldSize: null|{[key: string]: number},
authors: null|string[],
diff --git a/server/GameServer/Commands.lean b/server/GameServer/Commands.lean
index a7f0647..9cdfc67 100644
--- a/server/GameServer/Commands.lean
+++ b/server/GameServer/Commands.lean
@@ -47,6 +47,14 @@ elab "Introduction" t:str : command => do
| .World => modifyCurWorld fun world => pure {world with introduction := t.getString}
| .Game => modifyCurGame fun game => pure {game with introduction := t.getString}
+/-- Define the info of the current game. Used for e.g. credits -/
+elab "Info" t:str : command => do
+ match ← getCurLayer with
+ | .Level => pure ()
+ | .World => pure ()
+ | .Game => modifyCurGame fun game => pure {game with info := t.getString}
+
+
/-- Define the conclusion of the current game or current level if some
building a level. -/
elab "Conclusion" t:str : command => do
diff --git a/server/GameServer/EnvExtensions.lean b/server/GameServer/EnvExtensions.lean
index dab153d..0569845 100644
--- a/server/GameServer/EnvExtensions.lean
+++ b/server/GameServer/EnvExtensions.lean
@@ -285,6 +285,8 @@ structure Game where
title : String := default
/-- Text displayed on the main landing page of the game. -/
introduction : String := default
+ /-- Text displayed on the main landing page of the game. -/
+ info : String := default
/-- TODO: currently unused. -/
conclusion : String := default
/-- TODO: currently unused. -/