Resolve review

This commit is contained in:
GRL 2021-06-22 16:12:53 +02:00
parent 0728d462a5
commit 67d4c6e271
6 changed files with 21 additions and 21 deletions

View File

@ -21,7 +21,7 @@
import AudioPlaying from "./UI/AudioPlaying.svelte"; import AudioPlaying from "./UI/AudioPlaying.svelte";
import {soundPlayingStore} from "../Stores/SoundPlayingStore"; import {soundPlayingStore} from "../Stores/SoundPlayingStore";
import ErrorDialog from "./UI/ErrorDialog.svelte"; import ErrorDialog from "./UI/ErrorDialog.svelte";
import {ConsoleGlobalMessageManagerVisibleStore} from "../Stores/ConsoleGlobalMessageManagerStore"; import {consoleGlobalMessageManagerVisibleStore} from "../Stores/ConsoleGlobalMessageManagerStore";
import ConsoleGlobalMessageManager from "./ConsoleGlobalMessageManager/ConsoleGlobalMessageManager.svelte"; import ConsoleGlobalMessageManager from "./ConsoleGlobalMessageManager/ConsoleGlobalMessageManager.svelte";
export let game: Game; export let game: Game;
@ -72,7 +72,7 @@
<CameraControls></CameraControls> <CameraControls></CameraControls>
</div> </div>
{/if} {/if}
{#if $ConsoleGlobalMessageManagerVisibleStore} {#if $consoleGlobalMessageManagerVisibleStore}
<div> <div>
<ConsoleGlobalMessageManager game={game}></ConsoleGlobalMessageManager> <ConsoleGlobalMessageManager game={game}></ConsoleGlobalMessageManager>
</div> </div>

View File

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import {ConsoleGlobalMessageManagerFocusStore, ConsoleGlobalMessageManagerVisibleStore } from "../../Stores/ConsoleGlobalMessageManagerStore"; import {consoleGlobalMessageManagerFocusStore, consoleGlobalMessageManagerVisibleStore } from "../../Stores/ConsoleGlobalMessageManagerStore";
import {onMount} from "svelte"; import {onMount} from "svelte";
import type {Game} from "../../Phaser/Game/Game"; import type {Game} from "../../Phaser/Game/Game";
import type {GameManager} from "../../Phaser/Game/GameManager"; import type {GameManager} from "../../Phaser/Game/GameManager";
@ -56,15 +56,15 @@
quill.on('selection-change', function (range, oldRange) { quill.on('selection-change', function (range, oldRange) {
if (range === null && oldRange !== null) { if (range === null && oldRange !== null) {
ConsoleGlobalMessageManagerFocusStore.set(false); consoleGlobalMessageManagerFocusStore.set(false);
} else if (range !== null && oldRange === null) } else if (range !== null && oldRange === null)
ConsoleGlobalMessageManagerFocusStore.set(true); consoleGlobalMessageManagerFocusStore.set(true);
}); });
}); });
function disableConsole() { function disableConsole() {
ConsoleGlobalMessageManagerVisibleStore.set(false); consoleGlobalMessageManagerVisibleStore.set(false);
ConsoleGlobalMessageManagerFocusStore.set(false); consoleGlobalMessageManagerFocusStore.set(false);
} }
function SendTextMessage() { function SendTextMessage() {

View File

@ -2,7 +2,7 @@
import {HtmlUtils} from "../../WebRtc/HtmlUtils"; import {HtmlUtils} from "../../WebRtc/HtmlUtils";
import type {Game} from "../../Phaser/Game/Game"; import type {Game} from "../../Phaser/Game/Game";
import type {GameManager} from "../../Phaser/Game/GameManager"; import type {GameManager} from "../../Phaser/Game/GameManager";
import {ConsoleGlobalMessageManagerFocusStore, ConsoleGlobalMessageManagerVisibleStore} from "../../Stores/ConsoleGlobalMessageManagerStore"; import {consoleGlobalMessageManagerFocusStore, consoleGlobalMessageManagerVisibleStore} from "../../Stores/ConsoleGlobalMessageManagerStore";
import {AdminMessageEventTypes} from "../../Connexion/AdminMessagesService"; import {AdminMessageEventTypes} from "../../Connexion/AdminMessagesService";
import type {PlayGlobalMessageInterface} from "../../Connexion/ConnexionModels"; import type {PlayGlobalMessageInterface} from "../../Connexion/ConnexionModels";
import uploadFile from "../images/music-file.svg"; import uploadFile from "../images/music-file.svg";
@ -78,8 +78,8 @@
} }
function disableConsole() { function disableConsole() {
ConsoleGlobalMessageManagerVisibleStore.set(false); consoleGlobalMessageManagerVisibleStore.set(false);
ConsoleGlobalMessageManagerFocusStore.set(false); consoleGlobalMessageManagerFocusStore.set(false);
} }
</script> </script>

View File

@ -11,7 +11,7 @@ import {WarningContainer, warningContainerHtml, warningContainerKey} from "../Co
import {worldFullWarningStream} from "../../Connexion/WorldFullWarningStream"; import {worldFullWarningStream} from "../../Connexion/WorldFullWarningStream";
import {menuIconVisible} from "../../Stores/MenuStore"; import {menuIconVisible} from "../../Stores/MenuStore";
import {videoConstraintStore} from "../../Stores/MediaStore"; import {videoConstraintStore} from "../../Stores/MediaStore";
import {ConsoleGlobalMessageManagerVisibleStore} from "../../Stores/ConsoleGlobalMessageManagerStore"; import {consoleGlobalMessageManagerVisibleStore} from "../../Stores/ConsoleGlobalMessageManagerStore";
import {get} from "svelte/store"; import {get} from "svelte/store";
export const MenuSceneName = 'MenuScene'; export const MenuSceneName = 'MenuScene';
@ -161,7 +161,7 @@ export class MenuScene extends Phaser.Scene {
this.sideMenuOpened = false; this.sideMenuOpened = false;
this.closeAll(); this.closeAll();
this.menuButton.getChildByID('openMenuButton').innerHTML = `<img src="/static/images/menu.svg">`; this.menuButton.getChildByID('openMenuButton').innerHTML = `<img src="/static/images/menu.svg">`;
ConsoleGlobalMessageManagerVisibleStore.set(false); consoleGlobalMessageManagerVisibleStore.set(false);
this.tweens.add({ this.tweens.add({
targets: this.menuElement, targets: this.menuElement,
x: closedSideMenuX, x: closedSideMenuX,
@ -306,10 +306,10 @@ export class MenuScene extends Phaser.Scene {
this.toggleFullscreen(); this.toggleFullscreen();
break; break;
case 'adminConsoleButton': case 'adminConsoleButton':
if (get(ConsoleGlobalMessageManagerVisibleStore)) { if (get(consoleGlobalMessageManagerVisibleStore)) {
ConsoleGlobalMessageManagerVisibleStore.set(false); consoleGlobalMessageManagerVisibleStore.set(false);
} else { } else {
ConsoleGlobalMessageManagerVisibleStore.set(true); consoleGlobalMessageManagerVisibleStore.set(true);
} }
break; break;
} }

View File

@ -1,5 +1,5 @@
import { writable } from "svelte/store"; import { writable } from "svelte/store";
export const ConsoleGlobalMessageManagerVisibleStore = writable(false); export const consoleGlobalMessageManagerVisibleStore = writable(false);
export const ConsoleGlobalMessageManagerFocusStore = writable(false); export const consoleGlobalMessageManagerFocusStore = writable(false);

View File

@ -1,10 +1,10 @@
import {derived} from "svelte/store"; import {derived} from "svelte/store";
import {ConsoleGlobalMessageManagerFocusStore,} from "./ConsoleGlobalMessageManagerStore"; import {consoleGlobalMessageManagerFocusStore} from "./ConsoleGlobalMessageManagerStore";
//derived from the focus on Menu, ConsoleGlobal, Chat and ... //derived from the focus on Menu, ConsoleGlobal, Chat and ...
export const enableUserInputsStore = derived( export const enableUserInputsStore = derived(
ConsoleGlobalMessageManagerFocusStore, consoleGlobalMessageManagerFocusStore,
($ConsoleGlobalMessageManagerFocusStore) => { ($consoleGlobalMessageManagerFocusStore) => {
return !$ConsoleGlobalMessageManagerFocusStore; return !$consoleGlobalMessageManagerFocusStore;
} }
); );