| 27 | } |
| 28 | |
| 29 | static override async onLoad(): Promise<void> { |
| 30 | const characterLayers = this.engine.state('characterLayers') as string[]; |
| 31 | const promises: Promise<void>[] = []; |
| 32 | |
| 33 | for (const item of characterLayers) { |
| 34 | const action = this.engine.prepareAction(item, { cycle: 'Application' }) as ActionInstance | null; |
| 35 | if (action !== null) { |
| 36 | const promise = (async () => { |
| 37 | await action.willApply(); |
| 38 | await action.apply(); |
| 39 | await action.didApply({ updateHistory: false, updateState: false }); |
| 40 | })(); |
| 41 | |
| 42 | promises.push(promise); |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | if (promises.length > 0) { |
| 47 | await Promise.all(promises); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | static override matchString([show, type, identifier]: string[]): boolean { |
| 52 | return show === 'show' && type === 'character' && identifier.indexOf(':') > -1; |