| 116 | } |
| 117 | |
| 118 | override async didApply({ updateHistory = true, updateState = true } = {}): Promise<ActionApplyResult> { |
| 119 | const show = this.engine.state('characterLayers').filter((item: string) => { |
| 120 | const [show, character, asset,] = item.split(' '); |
| 121 | const [id, layer] = asset.split(':'); |
| 122 | return id !== this.asset || layer !== this.layer; |
| 123 | }); |
| 124 | |
| 125 | this.engine.state({ characterLayers: show }); |
| 126 | return { advance: true }; |
| 127 | } |
| 128 | |
| 129 | override async willRevert(): Promise<void> { |
| 130 | if (this.engine.history('characterLayer').length <= 0) { |