FIX: fixes for the emnote menu

This commit is contained in:
Kharhamel 2021-10-04 11:23:30 +02:00
parent 7bb0175648
commit 02108ce977
6 changed files with 5 additions and 19 deletions

View File

@ -1,7 +1,7 @@
<script lang="typescript"> <script lang="typescript">
import MenuIcon from "./Menu/MenuIcon.svelte"; import MenuIcon from "./Menu/MenuIcon.svelte";
import {menuIconVisiblilityStore, menuVisiblilityStore} from "../Stores/MenuStore"; import {menuIconVisiblilityStore, menuVisiblilityStore} from "../Stores/MenuStore";
import {emoteMenuVisiblilityStore} from "../Stores/EmoteStore"; import {emoteMenuStore} from "../Stores/EmoteStore";
import {enableCameraSceneVisibilityStore} from "../Stores/MediaStore"; import {enableCameraSceneVisibilityStore} from "../Stores/MediaStore";
import CameraControls from "./CameraControls.svelte"; import CameraControls from "./CameraControls.svelte";
import MyCamera from "./MyCamera.svelte"; import MyCamera from "./MyCamera.svelte";
@ -113,7 +113,7 @@
<Menu></Menu> <Menu></Menu>
</div> </div>
{/if} {/if}
{#if $emoteMenuVisiblilityStore} {#if $emoteMenuStore}
<div> <div>
<EmoteMenu></EmoteMenu> <EmoteMenu></EmoteMenu>
</div> </div>

View File

@ -20,6 +20,8 @@
emojisPerRow: isMobile() ? 6 : 8, emojisPerRow: isMobile() ? 6 : 8,
autoFocusSearch: false autoFocusSearch: false
}); });
//the timeout is here to prevent the menu from flashing
setTimeout(() => picker.showPicker(emojiContainer), 100);
picker.on("emoji", (selection) => { picker.on("emoji", (selection) => {
emoteStore.set(selection.emoji); emoteStore.set(selection.emoji);
@ -29,13 +31,6 @@
emoteMenuStore.closeEmoteMenu(); emoteMenuStore.closeEmoteMenu();
}); });
unsubscriber = emoteMenuStore.subscribe((isEmoteMenuVisible) => {
if (isEmoteMenuVisible && !picker.isPickerVisible()) {
picker.showPicker(emojiContainer);
} else {
picker.hidePicker();
}
})
}) })
function onKeyDown(e:KeyboardEvent) { function onKeyDown(e:KeyboardEvent) {

View File

@ -301,7 +301,7 @@ export abstract class Character extends Container {
this.cancelPreviousEmote(); this.cancelPreviousEmote();
const emoteY = -45; const emoteY = -45;
this.playerName.setVisible(false); this.playerName.setVisible(false);
this.emote = new Text(this.scene, -10, 0, emote, { fontFamily: '"Twemoji Mozilla"', fontSize: "20px" }); this.emote = new Text(this.scene, -10, 0, emote, { fontSize: "20px" });
this.emote.setAlpha(0); this.emote.setAlpha(0);
this.add(this.emote); this.add(this.emote);
this.createStartTransition(emoteY); this.createStartTransition(emoteY);

View File

@ -9,7 +9,6 @@ import { get } from "svelte/store";
import { requestedCameraState, requestedMicrophoneState } from "../../Stores/MediaStore"; import { requestedCameraState, requestedMicrophoneState } from "../../Stores/MediaStore";
import { helpCameraSettingsVisibleStore } from "../../Stores/HelpCameraSettingsStore"; import { helpCameraSettingsVisibleStore } from "../../Stores/HelpCameraSettingsStore";
import { menuIconVisiblilityStore } from "../../Stores/MenuStore"; import { menuIconVisiblilityStore } from "../../Stores/MenuStore";
import { emoteMenuVisiblilityStore } from "../../Stores/EmoteStore";
/** /**
* This class should be responsible for any scene starting/stopping * This class should be responsible for any scene starting/stopping
@ -112,7 +111,6 @@ export class GameManager {
public gameSceneIsCreated(scene: GameScene) { public gameSceneIsCreated(scene: GameScene) {
this.currentGameSceneName = scene.scene.key; this.currentGameSceneName = scene.scene.key;
menuIconVisiblilityStore.set(true); menuIconVisiblilityStore.set(true);
emoteMenuVisiblilityStore.set(true);
} }
/** /**
@ -125,7 +123,6 @@ export class GameManager {
gameScene.cleanupClosingScene(); gameScene.cleanupClosingScene();
gameScene.createSuccessorGameScene(false, false); gameScene.createSuccessorGameScene(false, false);
menuIconVisiblilityStore.set(false); menuIconVisiblilityStore.set(false);
emoteMenuVisiblilityStore.set(false);
if (!this.scenePlugin.get(targetSceneName)) { if (!this.scenePlugin.get(targetSceneName)) {
this.scenePlugin.add(targetSceneName, sceneClass, false); this.scenePlugin.add(targetSceneName, sceneClass, false);
} }
@ -139,7 +136,6 @@ export class GameManager {
if (this.currentGameSceneName) { if (this.currentGameSceneName) {
this.scenePlugin.start(this.currentGameSceneName); this.scenePlugin.start(this.currentGameSceneName);
menuIconVisiblilityStore.set(true); menuIconVisiblilityStore.set(true);
emoteMenuVisiblilityStore.set(true);
} else { } else {
this.scenePlugin.run(fallbackSceneName); this.scenePlugin.run(fallbackSceneName);
} }

View File

@ -14,6 +14,5 @@ function createEmoteMenuStore() {
}; };
} }
export const emoteMenuVisiblilityStore = writable(false);
export const emoteStore = writable<string | null>(null); export const emoteStore = writable<string | null>(null);
export const emoteMenuStore = createEmoteMenuStore(); export const emoteMenuStore = createEmoteMenuStore();

View File

@ -1103,10 +1103,6 @@ div.is-silent.hide {
right: 15px; right: 15px;
} }
.emote-menu .emoji-picker .emoji-picker__emoji {
font-family: "Twemoji Mozilla" !important;
}
div.emoji-picker { div.emoji-picker {
background-color: #333; background-color: #333;
border-radius: 1em; border-radius: 1em;