2021-07-07 18:07:58 +02:00
|
|
|
import { DEPTH_INGAME_TEXT_INDEX } from "../Game/DepthIndexes";
|
|
|
|
import { chatVisibilityStore } from "../../Stores/ChatStore";
|
2020-12-04 11:30:35 +01:00
|
|
|
|
2021-07-07 18:07:58 +02:00
|
|
|
export const openChatIconName = "openChatIcon";
|
2020-12-04 11:30:35 +01:00
|
|
|
export class OpenChatIcon extends Phaser.GameObjects.Image {
|
|
|
|
constructor(scene: Phaser.Scene, x: number, y: number) {
|
2021-02-03 23:11:33 +01:00
|
|
|
super(scene, x, y, openChatIconName, 3);
|
2020-12-04 11:30:35 +01:00
|
|
|
scene.add.existing(this);
|
|
|
|
this.setScrollFactor(0, 0);
|
|
|
|
this.setOrigin(0, 1);
|
|
|
|
this.setInteractive();
|
2021-07-07 18:07:58 +02:00
|
|
|
//this.setVisible(false);
|
2021-05-10 17:10:41 +02:00
|
|
|
this.setDepth(DEPTH_INGAME_TEXT_INDEX);
|
2020-12-04 11:30:35 +01:00
|
|
|
|
2021-07-07 18:07:58 +02:00
|
|
|
this.on("pointerup", () => chatVisibilityStore.set(true));
|
2020-12-04 11:30:35 +01:00
|
|
|
}
|
2021-07-07 18:07:58 +02:00
|
|
|
}
|