reorganisational draft

This commit is contained in:
Jon Eugster
2023-05-22 20:30:58 +02:00
parent 60876b4a77
commit fbf0f55968
6 changed files with 262 additions and 146 deletions
+4 -1
View File
@@ -13,6 +13,7 @@ export function Inventory({levelInfo, setInventoryDoc } :
setInventoryDoc: (inventoryDoc: {name: string, type: string}) => void,
}) {
// TODO: This seems like a useless wrapper to me
function openDoc(name, type) {
setInventoryDoc({name, type})
}
@@ -103,6 +104,8 @@ export function Documentation({name, type}) {
return <>
<h2 className="doc">{doc.data?.displayName}</h2>
<Markdown>{doc.data?.text}</Markdown>
<p><code>{doc.data?.statement}</code></p>
{/* <code>docstring: {doc.data?.docstring}</code> */}
<Markdown>{doc.data?.content}</Markdown>
</>
}
+1
View File
@@ -171,6 +171,7 @@ function PlayableLevel({worldId, levelId}) {
}
}, [editor, commandLineMode])
// if this is set to a pair `(name, type)` then the according doc will be open.
const [inventoryDoc, setInventoryDoc] = useState<{name: string, type: string}>(null)
const levelTitle = <>{levelId && `Level ${levelId}`}{level?.data?.title && `: ${level?.data?.title}`}</>
+4 -1
View File
@@ -36,7 +36,10 @@ export interface LevelInfo {
interface Doc {
name: string,
displayName: string,
text: string
content: string,
statement: string,
type: string, // TODO: can I remove these?
category: string,
}