bring back emojis!
This commit is contained in:
parent
be6d7c7151
commit
4d520a5994
@ -37,7 +37,7 @@ export abstract class Character extends Container {
|
||||
//private teleportation: Sprite;
|
||||
private invisible: boolean;
|
||||
public companion?: Companion;
|
||||
private emote: Phaser.GameObjects.DOMElement | null = null;
|
||||
private emote: Phaser.GameObjects.Text | null = null;
|
||||
private emoteTween: Phaser.Tweens.Tween | null = null;
|
||||
scene: GameScene;
|
||||
private readonly _pictureStore: Writable<string | undefined>;
|
||||
@ -336,10 +336,7 @@ export abstract class Character extends Container {
|
||||
playEmote(emote: string) {
|
||||
this.cancelPreviousEmote();
|
||||
const emoteY = -45;
|
||||
const image = new Image(16, 16);
|
||||
image.src = emote;
|
||||
this.emote = new DOMElement(this.scene, -1, 0, image, "z-index:10;");
|
||||
this.emote.setAlpha(0);
|
||||
this.emote = new Text(this.scene, -10, 0, emote, { fontFamily: "Twemoji Mozilla", fontSize: "20px" });
|
||||
this.add(this.emote);
|
||||
this.createStartTransition(emoteY);
|
||||
}
|
||||
|
@ -653,8 +653,8 @@ export class GameScene extends DirtyScene {
|
||||
|
||||
this.emoteUnsubscribe = emoteStore.subscribe((emote) => {
|
||||
if (emote) {
|
||||
this.CurrentPlayer?.playEmote(emote.url);
|
||||
this.connection?.emitEmoteEvent(emote.url);
|
||||
this.CurrentPlayer?.playEmote(emote.unicode);
|
||||
this.connection?.emitEmoteEvent(emote.unicode);
|
||||
emoteStore.set(null);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user