| 15 | classes: string[]; |
| 16 | |
| 17 | constructor([hide, type, asset, ...classes]: string[]) { |
| 18 | super(); |
| 19 | this.asset = asset; |
| 20 | |
| 21 | if (typeof this.engine.character(this.asset) !== 'undefined') { |
| 22 | this.element = this.engine.element().find(`[data-character="${this.asset}"]`).last(); |
| 23 | } else { |
| 24 | FancyError.show('action:hide_character:character_not_found', { |
| 25 | asset: this.asset, |
| 26 | availableCharacters: Object.keys(this.engine.characters()), |
| 27 | statement: `<code class='language=javascript'>"${this._statement}"</code>`, |
| 28 | label: this.engine.state('label'), |
| 29 | step: this.engine.state('step') |
| 30 | }); |
| 31 | } |
| 32 | |
| 33 | if (typeof classes !== 'undefined') { |
| 34 | this.classes = classes; |
| 35 | } else { |
| 36 | this.classes = []; |
| 37 | } |
| 38 | this.classes = this.classes.filter((c) => (c !== 'at' && c !== 'with')); |
| 39 | } |
| 40 | |
| 41 | override async willApply(): Promise<void> { |
| 42 | |