bring back emojis!

This commit is contained in:
_Bastler 2022-01-03 13:42:13 +01:00
parent be6d7c7151
commit 4d520a5994
2 changed files with 4 additions and 7 deletions

View File

@ -37,7 +37,7 @@ export abstract class Character extends Container {
//private teleportation: Sprite; //private teleportation: Sprite;
private invisible: boolean; private invisible: boolean;
public companion?: Companion; public companion?: Companion;
private emote: Phaser.GameObjects.DOMElement | null = null; private emote: Phaser.GameObjects.Text | null = null;
private emoteTween: Phaser.Tweens.Tween | null = null; private emoteTween: Phaser.Tweens.Tween | null = null;
scene: GameScene; scene: GameScene;
private readonly _pictureStore: Writable<string | undefined>; private readonly _pictureStore: Writable<string | undefined>;
@ -336,10 +336,7 @@ export abstract class Character extends Container {
playEmote(emote: string) { playEmote(emote: string) {
this.cancelPreviousEmote(); this.cancelPreviousEmote();
const emoteY = -45; const emoteY = -45;
const image = new Image(16, 16); this.emote = new Text(this.scene, -10, 0, emote, { fontFamily: "Twemoji Mozilla", fontSize: "20px" });
image.src = emote;
this.emote = new DOMElement(this.scene, -1, 0, image, "z-index:10;");
this.emote.setAlpha(0);
this.add(this.emote); this.add(this.emote);
this.createStartTransition(emoteY); this.createStartTransition(emoteY);
} }

View File

@ -653,8 +653,8 @@ export class GameScene extends DirtyScene {
this.emoteUnsubscribe = emoteStore.subscribe((emote) => { this.emoteUnsubscribe = emoteStore.subscribe((emote) => {
if (emote) { if (emote) {
this.CurrentPlayer?.playEmote(emote.url); this.CurrentPlayer?.playEmote(emote.unicode);
this.connection?.emitEmoteEvent(emote.url); this.connection?.emitEmoteEvent(emote.unicode);
emoteStore.set(null); emoteStore.set(null);
} }
}); });