diff --git a/client/src/game/gameManager.tsx b/client/src/game/gameManager.tsx index 358076234..90f545d32 100644 --- a/client/src/game/gameManager.tsx +++ b/client/src/game/gameManager.tsx @@ -35,9 +35,18 @@ export function createGameManager(): GameManager { Anchor.playAudioFile("/audio/01. Calm Before The Storm.mp3"); }, setGameState() { + let roomCode = null; + if(GAME_MANAGER.state.stateType === "lobby"){ + roomCode = GAME_MANAGER.state.roomCode; + } + + Anchor.stopAudio(); GAME_MANAGER.state = createGameState(); Anchor.setContent(GameScreen.createDefault()); + if(roomCode !== null){ + GAME_MANAGER.state.roomCode = roomCode; + } }, async setOutsideLobbyState() { Anchor.stopAudio(); diff --git a/client/src/menu/Settings.tsx b/client/src/menu/Settings.tsx index 6d57ff0b5..befab014e 100644 --- a/client/src/menu/Settings.tsx +++ b/client/src/menu/Settings.tsx @@ -38,20 +38,41 @@ export default class Settings extends React.Component{translate("menu.settings.title")}
-
-

{translate("menu.settings.volume")}

- { - console.log("Volume changed to " + e.target.value); - let volume = parseFloat(e.target.value); - this.props.onVolumeChange(volume); - } - }/> -
+

{translate("menu.settings.volume")}

+ { + console.log("Volume changed to " + e.target.value); + let volume = parseFloat(e.target.value); + this.props.onVolumeChange(volume); + } + }/> + { + GAME_MANAGER.state.stateType === "lobby" || GAME_MANAGER.state.stateType === "game" ? + (<> +

{translate("menu.play.field.roomCode")}

+ + ) : null + }
); } +} + +export function RoomCodeButton(props: {}): JSX.Element { + return } \ No newline at end of file diff --git a/client/src/menu/lobby/LobbyMenu.tsx b/client/src/menu/lobby/LobbyMenu.tsx index 46ee0813c..a43a5f851 100644 --- a/client/src/menu/lobby/LobbyMenu.tsx +++ b/client/src/menu/lobby/LobbyMenu.tsx @@ -9,6 +9,7 @@ import { StateListener } from "../../game/gameManager.d"; import LobbyExcludedRoles from "./lobbyExcludedRoles"; import Anchor from "../Anchor"; import WikiSearch from "../../components/WikiSearch"; +import { RoomCodeButton } from "../Settings"; type LobbyMenuProps = {} @@ -91,19 +92,3 @@ function LobbyMenuHeader(props: { host?: boolean }): JSX.Element { } -function RoomCodeButton(props: {}): JSX.Element { - return -} \ No newline at end of file