| 234 | } |
| 235 | |
| 236 | _setCharacter(id: string, expression: string | undefined): void { |
| 237 | this.character = this.engine.character(id); |
| 238 | |
| 239 | this.id = id; |
| 240 | |
| 241 | if (typeof this.character.nvl !== 'undefined') { |
| 242 | this.nvl = this.character.nvl; |
| 243 | } |
| 244 | |
| 245 | if (typeof expression !== 'undefined') { |
| 246 | if (typeof this.character.expressions !== 'undefined') { |
| 247 | this.image = this.character.expressions[expression]; |
| 248 | this.expression = expression; |
| 249 | } |
| 250 | |
| 251 | } else if (typeof this.character.default_expression !== 'undefined') { |
| 252 | if (typeof this.character.expressions[this.character.default_expression] !== 'undefined') { |
| 253 | this.image = this.character.expressions[this.character.default_expression]; |
| 254 | } else { |
| 255 | this.image = this.character.default_expression; |
| 256 | } |
| 257 | this.expression = 'default'; |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | async displayCenteredDialog(dialog: string, clearDialog: string, character: string, animation: boolean): Promise<void> { |
| 262 | const element = document.createElement('centered-dialog') as any; |