chat bubble above game tiles (#2129)

Co-authored-by: Piotr 'pwh' Hanusiak <p.hanusiak@workadventu.re>
This commit is contained in:
Piotr Hanusiak 2022-05-05 11:46:15 +02:00 committed by GitHub
parent 76bf7b9c74
commit f46d7d57f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -4,5 +4,6 @@ export const DEPTH_TILE_INDEX = 0;
//Note: Player characters use their y coordinate as their depth to simulate a perspective. //Note: Player characters use their y coordinate as their depth to simulate a perspective.
//See the Character class. //See the Character class.
export const DEPTH_OVERLAY_INDEX = 10000; export const DEPTH_OVERLAY_INDEX = 10000;
export const DEPTH_BUBBLE_CHAT_SPRITE = 99999;
export const DEPTH_INGAME_TEXT_INDEX = 100000; export const DEPTH_INGAME_TEXT_INDEX = 100000;
export const DEPTH_UI_INDEX = 1000000; export const DEPTH_UI_INDEX = 1000000;

View File

@ -101,6 +101,7 @@ import type { CoWebsite } from "../../WebRtc/CoWebsite/CoWesbite";
import CancelablePromise from "cancelable-promise"; import CancelablePromise from "cancelable-promise";
import { Deferred } from "ts-deferred"; import { Deferred } from "ts-deferred";
import { SuperLoaderPlugin } from "../Services/SuperLoaderPlugin"; import { SuperLoaderPlugin } from "../Services/SuperLoaderPlugin";
import { DEPTH_BUBBLE_CHAT_SPRITE } from "./DepthIndexes";
import { ErrorScreenMessage, PlayerDetailsUpdatedMessage } from "../../Messages/ts-proto-generated/protos/messages"; import { ErrorScreenMessage, PlayerDetailsUpdatedMessage } from "../../Messages/ts-proto-generated/protos/messages";
import { uiWebsiteManager } from "./UI/UIWebsiteManager"; import { uiWebsiteManager } from "./UI/UIWebsiteManager";
export interface GameSceneInitInterface { export interface GameSceneInitInterface {
@ -1216,7 +1217,7 @@ ${escapedMessage}
this.CurrentPlayer.y, this.CurrentPlayer.y,
"circleSprite-white" "circleSprite-white"
); );
scriptedBubbleSprite.setDisplayOrigin(48, 48); scriptedBubbleSprite.setDisplayOrigin(48, 48).setDepth(DEPTH_BUBBLE_CHAT_SPRITE);
this.add.existing(scriptedBubbleSprite); this.add.existing(scriptedBubbleSprite);
}) })
); );
@ -2079,7 +2080,7 @@ ${escapedMessage}
? "circleSprite-red" ? "circleSprite-red"
: "circleSprite-white" : "circleSprite-white"
); );
sprite.setDisplayOrigin(48, 48); sprite.setDisplayOrigin(48, 48).setDepth(DEPTH_BUBBLE_CHAT_SPRITE);
this.add.existing(sprite); this.add.existing(sprite);
this.groups.set(groupPositionMessage.groupId, sprite); this.groups.set(groupPositionMessage.groupId, sprite);
if (this.currentPlayerGroupId === groupPositionMessage.groupId) { if (this.currentPlayerGroupId === groupPositionMessage.groupId) {