diff --git a/src/Entry.ts b/src/Entry.ts index 95535b6..c72a0be 100644 --- a/src/Entry.ts +++ b/src/Entry.ts @@ -38,10 +38,7 @@ export class Entry { constructor(project: Project) { this.project = project - this.events = { - start: [], - scene_start: [], - } + this.events = {} this.scenes = Object.fromEntries( this.project.scenes.map( @@ -138,6 +135,9 @@ export class Entry { ) } on(eventName: string, f: () => void) { + if (!this.events[eventName]) { + this.events[eventName] = [] + } this.events[eventName].push(f) } start() {