partey_workadventure/front/src/Components/App.svelte

154 lines
5.4 KiB
Svelte
Raw Normal View History

2021-05-11 17:37:21 +02:00
<script lang="typescript">
import MenuIcon from "./Menu/MenuIcon.svelte";
2021-12-06 16:12:37 +01:00
import { menuIconVisiblilityStore, menuVisiblilityStore } from "../Stores/MenuStore";
import { emoteMenuStore } from "../Stores/EmoteStore";
import { enableCameraSceneVisibilityStore } from "../Stores/MediaStore";
import CameraControls from "./CameraControls.svelte";
2021-05-28 15:48:58 +02:00
import MyCamera from "./MyCamera.svelte";
2021-05-31 12:06:11 +02:00
import SelectCompanionScene from "./SelectCompanion/SelectCompanionScene.svelte";
2021-12-06 16:12:37 +01:00
import { selectCompanionSceneVisibleStore } from "../Stores/SelectCompanionStore";
import { selectCharacterSceneVisibleStore } from "../Stores/SelectCharacterStore";
import SelectCharacterScene from "./selectCharacter/SelectCharacterScene.svelte";
2021-12-06 16:12:37 +01:00
import { customCharacterSceneVisibleStore } from "../Stores/CustomCharacterStore";
import { errorStore } from "../Stores/ErrorStore";
import CustomCharacterScene from "./CustomCharacterScene/CustomCharacterScene.svelte";
2021-05-31 17:03:29 +02:00
import LoginScene from "./Login/LoginScene.svelte";
import Chat from "./Chat/Chat.svelte";
2021-12-06 16:12:37 +01:00
import { loginSceneVisibleStore } from "../Stores/LoginSceneStore";
import EnableCameraScene from "./EnableCamera/EnableCameraScene.svelte";
import VisitCard from "./VisitCard/VisitCard.svelte";
2021-12-06 16:12:37 +01:00
import { requestVisitCardsStore } from "../Stores/GameStore";
2021-12-06 16:12:37 +01:00
import type { Game } from "../Phaser/Game/Game";
import { chatVisibilityStore } from "../Stores/ChatStore";
import { helpCameraSettingsVisibleStore } from "../Stores/HelpCameraSettingsStore";
import HelpCameraSettingsPopup from "./HelpCameraSettings/HelpCameraSettingsPopup.svelte";
2021-06-02 16:46:28 +02:00
import AudioPlaying from "./UI/AudioPlaying.svelte";
2021-12-06 16:12:37 +01:00
import { soundPlayingStore } from "../Stores/SoundPlayingStore";
import ErrorDialog from "./UI/ErrorDialog.svelte";
import Menu from "./Menu/Menu.svelte";
2021-09-10 16:57:21 +02:00
import EmoteMenu from "./EmoteMenu/EmoteMenu.svelte";
import VideoOverlay from "./Video/VideoOverlay.svelte";
2021-12-06 16:12:37 +01:00
import { gameOverlayVisibilityStore } from "../Stores/GameOverlayStoreVisibility";
import AdminMessage from "./TypeMessage/BanMessage.svelte";
import TextMessage from "./TypeMessage/TextMessage.svelte";
2021-12-06 16:12:37 +01:00
import { banMessageVisibleStore } from "../Stores/TypeMessageStore/BanMessageStore";
import { textMessageVisibleStore } from "../Stores/TypeMessageStore/TextMessageStore";
import { warningContainerStore } from "../Stores/MenuStore";
import WarningContainer from "./WarningContainer/WarningContainer.svelte";
2021-12-06 16:12:37 +01:00
import { layoutManagerVisibilityStore } from "../Stores/LayoutManagerStore";
2021-08-03 11:13:08 +02:00
import LayoutManager from "./LayoutManager/LayoutManager.svelte";
2021-12-06 16:12:37 +01:00
import { audioManagerVisibilityStore } from "../Stores/AudioManagerStore";
import AudioManager from "./AudioManager/AudioManager.svelte";
import { showReportScreenStore, userReportEmpty } from "../Stores/ShowReportScreenStore";
import ReportMenu from "./ReportMenu/ReportMenu.svelte";
import { followStateStore, followStates } from "../Stores/InteractStore";
import InteractMenu from "./InteractMenu/InteractMenu.svelte";
2021-05-31 12:06:11 +02:00
export let game: Game;
2021-05-11 17:37:21 +02:00
</script>
2021-06-02 09:09:23 +02:00
<div>
2021-05-31 17:03:29 +02:00
{#if $loginSceneVisibleStore}
<div class="scrollable">
2021-12-06 16:12:37 +01:00
<LoginScene {game} />
</div>
2021-05-31 17:03:29 +02:00
{/if}
{#if $selectCharacterSceneVisibleStore}
<div>
2021-12-06 16:12:37 +01:00
<SelectCharacterScene {game} />
</div>
{/if}
{#if $customCharacterSceneVisibleStore}
<div>
2021-12-06 16:12:37 +01:00
<CustomCharacterScene {game} />
</div>
{/if}
2021-05-31 12:06:11 +02:00
{#if $selectCompanionSceneVisibleStore}
<div>
2021-12-06 16:12:37 +01:00
<SelectCompanionScene {game} />
</div>
2021-05-31 12:06:11 +02:00
{/if}
{#if $enableCameraSceneVisibilityStore}
<div class="scrollable">
2021-12-06 16:12:37 +01:00
<EnableCameraScene {game} />
</div>
{/if}
{#if $banMessageVisibleStore}
<div>
2021-12-06 16:12:37 +01:00
<AdminMessage />
</div>
{/if}
{#if $textMessageVisibleStore}
<div>
2021-12-06 16:12:37 +01:00
<TextMessage />
</div>
{/if}
2021-06-02 16:46:28 +02:00
{#if $soundPlayingStore}
2021-12-06 16:12:37 +01:00
<div>
<AudioPlaying url={$soundPlayingStore} />
</div>
2021-06-02 16:46:28 +02:00
{/if}
{#if $audioManagerVisibilityStore}
2021-12-06 16:12:37 +01:00
<div>
<AudioManager />
</div>
{/if}
2021-08-03 11:13:08 +02:00
{#if $layoutManagerVisibilityStore}
<div>
2021-12-06 16:12:37 +01:00
<LayoutManager />
2021-08-03 11:13:08 +02:00
</div>
{/if}
{#if $showReportScreenStore !== userReportEmpty}
<div>
2021-12-06 16:12:37 +01:00
<ReportMenu />
</div>
{/if}
{#if $followStateStore !== followStates.off}
<div>
<InteractMenu />
</div>
{/if}
{#if $menuIconVisiblilityStore}
<div>
2021-12-06 16:12:37 +01:00
<MenuIcon />
</div>
{/if}
{#if $menuVisiblilityStore}
<div>
2021-12-06 16:12:37 +01:00
<Menu />
</div>
{/if}
2021-10-04 11:23:30 +02:00
{#if $emoteMenuStore}
2021-09-10 16:57:21 +02:00
<div>
2021-12-06 16:12:37 +01:00
<EmoteMenu />
2021-09-10 16:57:21 +02:00
</div>
{/if}
{#if $gameOverlayVisibilityStore}
<div>
2021-12-06 16:12:37 +01:00
<VideoOverlay />
<MyCamera />
<CameraControls />
</div>
{/if}
{#if $helpCameraSettingsVisibleStore}
<div>
2021-12-06 16:12:37 +01:00
<HelpCameraSettingsPopup />
</div>
{/if}
{#if $requestVisitCardsStore}
2021-12-06 16:12:37 +01:00
<VisitCard visitCardUrl={$requestVisitCardsStore} />
{/if}
{#if $errorStore.length > 0}
2021-12-06 16:12:37 +01:00
<div>
<ErrorDialog />
</div>
{/if}
{#if $chatVisibilityStore}
2021-12-06 16:12:37 +01:00
<Chat />
{/if}
{#if $warningContainerStore}
2021-12-06 16:12:37 +01:00
<WarningContainer />
{/if}
2021-05-11 17:37:21 +02:00
</div>