From 02f4ec5e68758f409a084d57173975518475cbc1 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Thu, 25 May 2023 16:50:13 -0600 Subject: [PATCH] Store props' appearance/reappearance status and pass to director --- src/hollywoo/Director.hx | 2 +- src/hollywoo/Movie.kiss | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hollywoo/Director.hx b/src/hollywoo/Director.hx index af14a69..9968994 100644 --- a/src/hollywoo/Director.hx +++ b/src/hollywoo/Director.hx @@ -79,7 +79,7 @@ interface Director, Actor, Sound, Song, Prop, VoiceTrack, Cam function showBlackScreen():Void; function hideBlackScreen():Void; - function showProp(prop:Prop, position:StagePosition, cc:Continuation):Void; + function showProp(prop:Prop, position:StagePosition, appearance:Appearance, cc:Continuation):Void; function hideProp(prop:Prop, cc:Continuation):Void; function rollCredits(credits:Array, cc:Continuation):Void; diff --git a/src/hollywoo/Movie.kiss b/src/hollywoo/Movie.kiss index ae08469..e500054 100644 --- a/src/hollywoo/Movie.kiss +++ b/src/hollywoo/Movie.kiss @@ -29,6 +29,7 @@ (prop :FuzzyMap> scenes (new FuzzyMap>)) (prop :Map shownScenes (new Map)) + (prop :Map shownProps (new Map)) (prop :Map shownCharacters (new Map)) // This is set and unset by doPreload defined in HollywooDSL.kiss @@ -170,7 +171,7 @@ (_ccForEach scene.props ->[:StageProp p :Continuation cc] - (director.showProp p.prop p.position cc) + (director.showProp p.prop p.position ReAppearance cc) cc)))))) (prop &mut :Bool paused false) @@ -545,10 +546,11 @@ (dictSet props name prop)) (hollywooMethod addProp false [name :Dynamic position :Continuation cc] - (let [prop (dictGet props name) + (let [name (FuzzyMapTools.bestMatch props name) + prop (dictGet props name) position (resolvePosition position)] (dictSet .props (_currentScene) name (objectWith position prop)) - (director.showProp prop position cc))) + (director.showProp prop position (appearanceFlag shownProps name) cc))) (hollywooMethod removeProp false [name :Continuation cc] (.remove .props (_currentScene) name)