| 126 | } |
| 127 | |
| 128 | static override async reset({ keepNVL = false, saveNVL = false }: { keepNVL?: boolean; saveNVL?: boolean } = {}): Promise<void> { |
| 129 | const textBox = this.engine.element().find('[data-component="text-box"]').get(0) as any; |
| 130 | |
| 131 | if (!textBox) { |
| 132 | return; |
| 133 | } |
| 134 | |
| 135 | if (saveNVL === true && textBox.props.mode === 'nvl') { |
| 136 | this.engine.history('nvl').push(textBox.content('dialog').html()); |
| 137 | } |
| 138 | |
| 139 | if (keepNVL !== true) { |
| 140 | textBox.setProps({ mode: 'adv' }); |
| 141 | } |
| 142 | |
| 143 | |
| 144 | this.engine.element().find('[data-component="text-box"]').data('speaking', ''); |
| 145 | |
| 146 | this.engine.element().find('[data-ui="who"]').style('color', ''); |
| 147 | |
| 148 | this.engine.element().find('[data-ui="who"]').html(''); |
| 149 | this.engine.element().find('[data-ui="say"]').html(''); |
| 150 | |
| 151 | this.engine.element().find('[data-ui="face"]').attribute('src', ''); |
| 152 | this.engine.element().find('[data-ui="face"]').hide(); |
| 153 | |
| 154 | // Remove all classes from the text-box |
| 155 | Array.from(textBox.classList).forEach((c: any) => textBox.classList.remove(c)); |
| 156 | |
| 157 | // Remove all classes from the centered-dialog |
| 158 | const centeredDialog = this.engine.element().find('[data-component="centered-dialog"]').get(0); |
| 159 | |
| 160 | if (centeredDialog) { |
| 161 | Array.from(centeredDialog.classList).forEach((c: any) => centeredDialog.classList.remove(c)); |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | static override matchString(): boolean { |
| 166 | return true; |