|
|
|
@ -5,7 +5,7 @@ import * as React from 'react'
|
|
|
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
|
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
|
|
import { faDownload, faUpload, faEraser, faBook, faBookOpen, faGlobe, faHome,
|
|
|
|
import { faDownload, faUpload, faEraser, faBook, faBookOpen, faGlobe, faHome,
|
|
|
|
faArrowRight, faArrowLeft, faXmark, faBars, faCode,
|
|
|
|
faArrowRight, faArrowLeft, faXmark, faBars, faCode,
|
|
|
|
faCircleInfo, faTerminal, faMobileScreenButton, faDesktop } from '@fortawesome/free-solid-svg-icons'
|
|
|
|
faCircleInfo, faTerminal, faMobileScreenButton, faDesktop, faGear } from '@fortawesome/free-solid-svg-icons'
|
|
|
|
import { GameIdContext } from "../app"
|
|
|
|
import { GameIdContext } from "../app"
|
|
|
|
import { InputModeContext, MobileContext, WorldLevelIdContext } from "./infoview/context"
|
|
|
|
import { InputModeContext, MobileContext, WorldLevelIdContext } from "./infoview/context"
|
|
|
|
import { GameInfo, useGetGameInfoQuery } from '../state/api'
|
|
|
|
import { GameInfo, useGetGameInfoQuery } from '../state/api'
|
|
|
|
@ -150,14 +150,15 @@ function InventoryButton({pageNumber, setPageNumber}) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** the navigation bar on the welcome page */
|
|
|
|
/** the navigation bar on the welcome page */
|
|
|
|
export function WelcomeAppBar({pageNumber, setPageNumber, gameInfo, toggleImpressum, toggleEraseMenu, toggleUploadMenu, toggleInfo} : {
|
|
|
|
export function WelcomeAppBar({pageNumber, setPageNumber, gameInfo, toggleImpressum, toggleEraseMenu, toggleUploadMenu, toggleInfo, togglePreferencesPopup} : {
|
|
|
|
pageNumber: number,
|
|
|
|
pageNumber: number,
|
|
|
|
setPageNumber: any,
|
|
|
|
setPageNumber: any,
|
|
|
|
gameInfo: GameInfo,
|
|
|
|
gameInfo: GameInfo,
|
|
|
|
toggleImpressum: any,
|
|
|
|
toggleImpressum: any,
|
|
|
|
toggleEraseMenu: any,
|
|
|
|
toggleEraseMenu: any,
|
|
|
|
toggleUploadMenu: any,
|
|
|
|
toggleUploadMenu: any,
|
|
|
|
toggleInfo: any
|
|
|
|
toggleInfo: any,
|
|
|
|
|
|
|
|
togglePreferencesPopup: () => void;
|
|
|
|
}) {
|
|
|
|
}) {
|
|
|
|
const gameId = React.useContext(GameIdContext)
|
|
|
|
const gameId = React.useContext(GameIdContext)
|
|
|
|
const gameProgress = useAppSelector(selectProgress(gameId))
|
|
|
|
const gameProgress = useAppSelector(selectProgress(gameId))
|
|
|
|
@ -182,12 +183,6 @@ export function WelcomeAppBar({pageNumber, setPageNumber, gameInfo, toggleImpres
|
|
|
|
<Button title="Game Info & Credits" inverted="true" to="" onClick={() => {toggleInfo(); setNavOpen(false)}}>
|
|
|
|
<Button title="Game Info & Credits" inverted="true" to="" onClick={() => {toggleInfo(); setNavOpen(false)}}>
|
|
|
|
<FontAwesomeIcon icon={faCircleInfo} /> Game Info
|
|
|
|
<FontAwesomeIcon icon={faCircleInfo} /> Game Info
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
{mobile ? <Button title="Mobile" inverted="true" to="" onClick={() => {setMobile(false)}}>
|
|
|
|
|
|
|
|
<FontAwesomeIcon icon={faDesktop} /> Desktop
|
|
|
|
|
|
|
|
</Button>:
|
|
|
|
|
|
|
|
<Button title="Mobile" inverted="true" to="" onClick={() => {setMobile(true)}}>
|
|
|
|
|
|
|
|
<FontAwesomeIcon icon={faMobileScreenButton} /> Mobile
|
|
|
|
|
|
|
|
</Button>}
|
|
|
|
|
|
|
|
<Button title="Clear Progress" inverted="true" to="" onClick={() => {toggleEraseMenu(); setNavOpen(false)}}>
|
|
|
|
<Button title="Clear Progress" inverted="true" to="" onClick={() => {toggleEraseMenu(); setNavOpen(false)}}>
|
|
|
|
<FontAwesomeIcon icon={faEraser} /> Erase
|
|
|
|
<FontAwesomeIcon icon={faEraser} /> Erase
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
@ -200,6 +195,9 @@ export function WelcomeAppBar({pageNumber, setPageNumber, gameInfo, toggleImpres
|
|
|
|
<Button title="Impressum, privacy policy" inverted="true" to="" onClick={() => {toggleImpressum(); setNavOpen(false)}}>
|
|
|
|
<Button title="Impressum, privacy policy" inverted="true" to="" onClick={() => {toggleImpressum(); setNavOpen(false)}}>
|
|
|
|
<FontAwesomeIcon icon={faCircleInfo} /> Impressum
|
|
|
|
<FontAwesomeIcon icon={faCircleInfo} /> Impressum
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<Button title="Preferences" inverted="true" to="" onClick={() => {togglePreferencesPopup(); setNavOpen(false)}}>
|
|
|
|
|
|
|
|
<FontAwesomeIcon icon={faGear} /> Preferences
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -214,7 +212,7 @@ export function LevelAppBar({isLoading, levelTitle, toggleImpressum, pageNumber=
|
|
|
|
}) {
|
|
|
|
}) {
|
|
|
|
const gameId = React.useContext(GameIdContext)
|
|
|
|
const gameId = React.useContext(GameIdContext)
|
|
|
|
const {worldId, levelId} = React.useContext(WorldLevelIdContext)
|
|
|
|
const {worldId, levelId} = React.useContext(WorldLevelIdContext)
|
|
|
|
const {mobile, setMobile} = React.useContext(MobileContext)
|
|
|
|
const {mobile} = React.useContext(MobileContext)
|
|
|
|
const [navOpen, setNavOpen] = React.useState(false)
|
|
|
|
const [navOpen, setNavOpen] = React.useState(false)
|
|
|
|
const gameInfo = useGetGameInfoQuery({game: gameId})
|
|
|
|
const gameInfo = useGetGameInfoQuery({game: gameId})
|
|
|
|
const completed = useAppSelector(selectCompleted(gameId, worldId, levelId))
|
|
|
|
const completed = useAppSelector(selectCompleted(gameId, worldId, levelId))
|
|
|
|
@ -237,9 +235,6 @@ export function LevelAppBar({isLoading, levelTitle, toggleImpressum, pageNumber=
|
|
|
|
<NextButton worldSize={gameInfo.data?.worldSize[worldId]} difficulty={difficulty} completed={completed} setNavOpen={setNavOpen} />
|
|
|
|
<NextButton worldSize={gameInfo.data?.worldSize[worldId]} difficulty={difficulty} completed={completed} setNavOpen={setNavOpen} />
|
|
|
|
<PreviousButton setNavOpen={setNavOpen} />
|
|
|
|
<PreviousButton setNavOpen={setNavOpen} />
|
|
|
|
<HomeButton isDropdown={true} />
|
|
|
|
<HomeButton isDropdown={true} />
|
|
|
|
<Button title="Mobile" inverted="true" to="" onClick={()=>setMobile(false)}>
|
|
|
|
|
|
|
|
<FontAwesomeIcon icon={faDesktop} /> Desktop
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<InputModeButton setNavOpen={setNavOpen} isDropdown={true}/>
|
|
|
|
<InputModeButton setNavOpen={setNavOpen} isDropdown={true}/>
|
|
|
|
<ImpressumButton setNavOpen={setNavOpen} toggleImpressum={toggleImpressum} isDropdown={true} />
|
|
|
|
<ImpressumButton setNavOpen={setNavOpen} toggleImpressum={toggleImpressum} isDropdown={true} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@ -257,9 +252,6 @@ export function LevelAppBar({isLoading, levelTitle, toggleImpressum, pageNumber=
|
|
|
|
<PreviousButton setNavOpen={setNavOpen} />
|
|
|
|
<PreviousButton setNavOpen={setNavOpen} />
|
|
|
|
<NextButton worldSize={gameInfo.data?.worldSize[worldId]} difficulty={difficulty} completed={completed} setNavOpen={setNavOpen} />
|
|
|
|
<NextButton worldSize={gameInfo.data?.worldSize[worldId]} difficulty={difficulty} completed={completed} setNavOpen={setNavOpen} />
|
|
|
|
<InputModeButton setNavOpen={setNavOpen} isDropdown={false}/>
|
|
|
|
<InputModeButton setNavOpen={setNavOpen} isDropdown={false}/>
|
|
|
|
<Button title="Mobile" inverted="true" to="" onClick={() => setMobile(true)}>
|
|
|
|
|
|
|
|
<FontAwesomeIcon icon={faMobileScreenButton} />
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<ImpressumButton setNavOpen={setNavOpen} toggleImpressum={toggleImpressum} isDropdown={false} />
|
|
|
|
<ImpressumButton setNavOpen={setNavOpen} toggleImpressum={toggleImpressum} isDropdown={false} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
|