From d7e49fd71f0e436506249e882a57430cfb07b508 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Tue, 16 May 2023 12:04:25 -0600 Subject: [PATCH] custom dialog hide when next dialog shows --- src/hollywoo/Movie.kiss | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/hollywoo/Movie.kiss b/src/hollywoo/Movie.kiss index 6d49327..b8c9058 100644 --- a/src/hollywoo/Movie.kiss +++ b/src/hollywoo/Movie.kiss @@ -54,11 +54,16 @@ (setScene sceneForActor cc) (return)))) (cc)) + + (prop &mut :Void->Void _hideCustomDialog null) (method :Void showDialog [actorName dialogType wryly text cc] + // Hide custom dialog when the next dialog appears unless HIDECUSTOMDIALOG is called manually: + (when _hideCustomDialog + (_hideCustomDialog) + (set _hideCustomDialog null)) (processIntercut actorName (makeCC - (let [&mut :Continuation hideCustomDialog (makeCC null) - cc ->:Void {(hideCustomDialog)(director.hideDialog) (cc)} + (let [cc ->:Void {(director.hideDialog) (cc)} &mut skipCC cc] // When an actorName is given, check for a voiced line to play. // Otherwise, assume it is un-voiced super text @@ -99,7 +104,7 @@ ((Custom type character args) (ifLet [handler (dictGet customDialogTypeHandlers type)] (let [cleanupFunc (handler actorName character wryly args text skipCC)] - (set hideCustomDialog cleanupFunc)) + (set _hideCustomDialog cleanupFunc)) (throw "No handler for custom dialog type $type"))) (otherwise (director.showDialog actorName dialogType wryly text skipCC))))))) @@ -312,6 +317,11 @@ (#unless subclass (method ,nameAndType ,argList ,@body)) })) +(hollywooMethod :Void hideCustomDialog true [:Continuation cc] + (when _hideCustomDialog + (_hideCustomDialog) + (set _hideCustomDialog null))) + (hollywooMethod :Void delay true [:Dynamic length :Continuation cc] (let [sec (typeCase [length] ([:Float sec] sec)