allow Agent.speak() to override a previous call to speak()

This commit is contained in:
Lily Tsuru 2024-07-10 07:28:14 -04:00
parent 396ef67c78
commit d089018082

View file

@ -265,12 +265,14 @@ export class Agent {
}
speak(text: string) {
if (this.wordballoonState == null) {
if (this.wordballoonState != null) {
this.stopSpeaking();
}
this.wordballoonState = new AgentWordBalloonState(this, text);
this.wordballoonState.positionUpdated();
this.wordballoonState.show();
}
}
stopSpeaking() {
if (this.wordballoonState !== null) {