(dialog: string, clearDialog: string, character: string, animation: boolean)
| 259 | } |
| 260 | |
| 261 | async displayCenteredDialog(dialog: string, clearDialog: string, character: string, animation: boolean): Promise<void> { |
| 262 | const element = document.createElement('centered-dialog') as any; |
| 263 | const gameScreen = this.engine.element().find('[data-screen="game"]'); |
| 264 | const textBox = this.engine.element().find('[data-component="text-box"]'); |
| 265 | const writer = textBox.find('type-writer').get(0) as TypeWriter | undefined; |
| 266 | |
| 267 | this._handleCustomClasses(element); |
| 268 | |
| 269 | // If the text-box's typewriter exists, set it to ignore |
| 270 | // (in NVL mode, there might not be a type-writer element) |
| 271 | if (writer) { |
| 272 | writer.setState({ ignore: true, strings: [] }); |
| 273 | } |
| 274 | |
| 275 | textBox.hide(); |
| 276 | gameScreen.append(element); |
| 277 | |
| 278 | element.ready(() => { |
| 279 | const wrapper = element.content('wrapper'); |
| 280 | const wrapperElement = wrapper?.get(0) as TypeWriter | undefined; |
| 281 | |
| 282 | if (wrapperElement) { |
| 283 | wrapperElement.setContent(dialog, animation); |
| 284 | } |
| 285 | }); |
| 286 | } |
| 287 | |
| 288 | displayNvlDialog(dialog: string, clearDialog: string, character: string, animation: boolean): void { |
| 289 | const textBox = this.engine.element().find('[data-component="text-box"]').get(0) as any; |
no test coverage detected