forcing close talkIcon indicator when leaving bubble conversation
This commit is contained in:
parent
0b0d3b5beb
commit
e590cee753
@ -20,15 +20,17 @@ export class TalkIcon extends Phaser.GameObjects.Image {
|
||||
this.scene.add.existing(this);
|
||||
}
|
||||
|
||||
public show(show: boolean = true): void {
|
||||
if (this.shown === show) {
|
||||
public show(show: boolean = true, forceClose: boolean = false): void {
|
||||
if (this.shown === show && !forceClose) {
|
||||
return;
|
||||
}
|
||||
this.showAnimation(show);
|
||||
this.showAnimation(show, forceClose);
|
||||
}
|
||||
|
||||
private showAnimation(show: boolean = true) {
|
||||
if (this.showAnimationTween?.isPlaying()) {
|
||||
private showAnimation(show: boolean = true, forceClose: boolean = false) {
|
||||
if (forceClose && !show) {
|
||||
this.showAnimationTween?.stop();
|
||||
} else if (this.showAnimationTween?.isPlaying()) {
|
||||
return;
|
||||
}
|
||||
this.shown = show;
|
||||
|
@ -213,8 +213,8 @@ export abstract class Character extends Container implements OutlineableInterfac
|
||||
});
|
||||
}
|
||||
|
||||
public showTalkIcon(show: boolean = true): void {
|
||||
this.talkIcon.show(show);
|
||||
public showTalkIcon(show: boolean = true, forceClose: boolean = false): void {
|
||||
this.talkIcon.show(show, forceClose);
|
||||
}
|
||||
|
||||
public addCompanion(name: string, texturePromise?: CancelablePromise<string>): void {
|
||||
|
@ -678,8 +678,8 @@ export class GameScene extends DirtyScene {
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.CurrentPlayer.showTalkIcon(false);
|
||||
this.MapPlayersByKey.forEach((remotePlayer) => remotePlayer.showTalkIcon(false));
|
||||
this.CurrentPlayer.showTalkIcon(false, true);
|
||||
this.MapPlayersByKey.forEach((remotePlayer) => remotePlayer.showTalkIcon(false, true));
|
||||
if (this.localVolumeStoreUnsubscriber) {
|
||||
this.localVolumeStoreUnsubscriber();
|
||||
this.localVolumeStoreUnsubscriber = undefined;
|
||||
|
Loading…
Reference in New Issue
Block a user