From 3bdc0d3887e0dfaffb94550e3847eeb6825c028d Mon Sep 17 00:00:00 2001 From: Jennifer Taylor Date: Sat, 22 May 2021 01:31:17 +0000 Subject: [PATCH] Add more specific warning for missing bytecode. --- bemani/format/afp/render.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bemani/format/afp/render.py b/bemani/format/afp/render.py index f3bea41..a58cd1c 100644 --- a/bemani/format/afp/render.py +++ b/bemani/format/afp/render.py @@ -306,9 +306,6 @@ class AFPRenderer(VerboseOutput): if tag.source_tag_id is None: raise Exception("Cannot place a tag with no source ID and no update flags!") - # TODO: Handle ON_LOAD triggers for this object. Many of these are just calls into - # the game to set the current frame that we're on, but sometimes its important. - if tag.source_tag_id in self.__registered_objects: self.vprint(f"{prefix} Placing Object {tag.source_tag_id} with Object ID {tag.object_id} onto Depth {tag.depth}") @@ -330,6 +327,14 @@ class AFPRenderer(VerboseOutput): # Didn't place a new clip, changed the parent clip. return None, True elif isinstance(newobj, RegisteredClip): + # TODO: Handle ON_LOAD triggers for this object. Many of these are just calls into + # the game to set the current frame that we're on, but sometimes its important. + for flags, code in tag.triggers.items(): + for bytecode in code: + print("WARNING: Unhandled PLACE_OBJECT trigger!") + if self.verbose: + print(bytecode.decompile()) + placed_clip = PlacedClip( tag.object_id, tag.depth,