From a1d5647446aef88578ab375086cfc8055298743e Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 8 Mar 2023 09:47:52 -0700 Subject: [PATCH] stopWaitForInput needs to check for same cc --- .../hollywoo-flixel/src/hollywoo_flixel/FlxDirector.kiss | 5 +++-- projects/hollywoo/src/hollywoo/Director.hx | 2 +- projects/hollywoo/src/hollywoo/Movie.kiss | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/projects/hollywoo-flixel/src/hollywoo_flixel/FlxDirector.kiss b/projects/hollywoo-flixel/src/hollywoo_flixel/FlxDirector.kiss index e8ebba5a..23455adb 100644 --- a/projects/hollywoo-flixel/src/hollywoo_flixel/FlxDirector.kiss +++ b/projects/hollywoo-flixel/src/hollywoo_flixel/FlxDirector.kiss @@ -75,8 +75,9 @@ (method :Void startWaitForInput [:Continuation cc] (set nextCC cc)) -(method :Void stopWaitForInput [] - (set nextCC null)) +(method :Void stopWaitForInput [:Continuation cc] + (when (= nextCC cc) + (set nextCC null))) (var TITLE_Y 240) (var TITLE_SIZE 72) diff --git a/projects/hollywoo/src/hollywoo/Director.hx b/projects/hollywoo/src/hollywoo/Director.hx index bc930f22..7b0f3d3f 100644 --- a/projects/hollywoo/src/hollywoo/Director.hx +++ b/projects/hollywoo/src/hollywoo/Director.hx @@ -43,7 +43,7 @@ interface Director, ScreenPosition, Actor, Sound, Song, Prop, function playVoiceTrack(track:VoiceTrack, volumeMod:Float, start:Float, end:Float, cc:Continuation):Void; function stopVoiceTrack(track:VoiceTrack):Void; function startWaitForInput(cc:Continuation):Void; - function stopWaitForInput():Void; + function stopWaitForInput(cc:Continuation):Void; function showDialog(speakerName:String, type:SpeechType, wryly:String, dialog:String, cc:Continuation):Void; function hideDialog():Void; function showTitleCard(text:Array, cc:Continuation):Void; diff --git a/projects/hollywoo/src/hollywoo/Movie.kiss b/projects/hollywoo/src/hollywoo/Movie.kiss index a32a0f48..6ec5baa0 100644 --- a/projects/hollywoo/src/hollywoo/Movie.kiss +++ b/projects/hollywoo/src/hollywoo/Movie.kiss @@ -193,20 +193,20 @@ (let [autoDelay (Timer.delay ->{ - (director.stopWaitForInput) + (director.stopWaitForInput cc) (cc) } (* 1000 sec))] (director.startWaitForInput ->{ - (director.stopWaitForInput) + (director.stopWaitForInput cc) (autoDelay.stop) (cc) }))) (Manual (director.startWaitForInput ->{ - (director.stopWaitForInput) + (director.stopWaitForInput cc) (cc) })) (otherwise (throw "Unsupported delay type $delayHandling"))))