From e54f37b540c60e3509dcb62761687f3e2d8b677e Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 25 Sep 2024 17:15:28 -0500 Subject: [PATCH] more cludge on the cludge pile to fix getProp/ActorName --- src/hollywoo/Director.hx | 3 +++ src/hollywoo/Movie.kiss | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/hollywoo/Director.hx b/src/hollywoo/Director.hx index 79c4d7c..0dda9fc 100644 --- a/src/hollywoo/Director.hx +++ b/src/hollywoo/Director.hx @@ -64,6 +64,9 @@ interface Director, appearance:Appearance, camera:Camera, cc:Continuation):Void; function hideCharacter(character:Character, camera:Camera, cc:Continuation):Void; + function propEquals(propA:Prop, propB:Prop):Bool; + function actorEquals(propA:Actor, propB:Actor):Bool; + function loadSound(path:String):Sound; function playSound(sound:Sound, volumeMod:Float, ?cc:Continuation):Void; function getSoundLength(sound:Sound):Float; diff --git a/src/hollywoo/Movie.kiss b/src/hollywoo/Movie.kiss index c7d087a..a41f204 100644 --- a/src/hollywoo/Movie.kiss +++ b/src/hollywoo/Movie.kiss @@ -299,7 +299,9 @@ (prop :Array> propNames []) (method :String getPropName [:Prop prop] (doFor [_prop name] propNames - (when (= prop _prop) (return name))) + (unless (.exists .props (_currentScene) name) + (continue)) + (when (director.propEquals prop _prop) (return name))) (throw "Couldn't get name of prop $prop in $propNames")) (method _addProp [name :Prop prop] @@ -329,7 +331,9 @@ (prop :Array> actorNames []) (method :String getActorName [:Actor actor] (doFor [_actor name] actorNames - (when (= actor _actor) (return name))) + (unless (.exists .characters (_currentScene) name) + (continue)) + (when (director.actorEquals actor _actor) (return name))) (throw "Couldn't get name of actor $actor in $actorNames")) (method _addActor [name :Actor actor]