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