Movies support skippable timed delays

This commit is contained in:
2021-11-02 19:36:17 -04:00
parent 613e3cf4d2
commit c6275716a1
2 changed files with 11 additions and 12 deletions

View File

@@ -7,6 +7,7 @@ import flixel.FlxSprite;
import flixel.input.actions.FlxAction; import flixel.input.actions.FlxAction;
import flixel.input.actions.FlxActionManager; import flixel.input.actions.FlxActionManager;
import flixel.input.mouse.FlxMouseButton; import flixel.input.mouse.FlxMouseButton;
import hollywoo.Movie;
import hollywoo.Scene; import hollywoo.Scene;
import hollywoo.Director; import hollywoo.Director;
import hollywoo_flixel.FlxMovie; import hollywoo_flixel.FlxMovie;

View File

@@ -1,5 +1,6 @@
(prop :FlxActionDigital continueAction) (prop :FlxActionDigital continueAction)
(prop actionManager (new FlxActionManager)) (prop actionManager (new FlxActionManager))
(prop &mut :Movie<String,FlxStagePosition,FlxStageFacing,FlxScreenPosition,ActorFlxSprite,FlxSound,String> movie)
(defNew [] (defNew []
(set continueAction (new FlxActionDigital "Continue" onContinue)) (set continueAction (new FlxActionDigital "Continue" onContinue))
@@ -44,15 +45,11 @@
(set nextCC null) (set nextCC null)
(cc))) (cc)))
(method :Void waitForInputOrDelay [:Float delaySeconds :Continuation cc] (method :Void startWaitForInput [:Continuation cc]
// TODO allow user to choose between automatic delays and continue checks (set nextCC cc))
(if true
//{ (method :Void stopWaitForInput []
(set nextCC cc) (set nextCC null))
// TODO show an indicator that input is needed
//}
)
)
(var DIALOG_X 300) (var DIALOG_X 300)
(var DIALOG_WIDTH (- 1280 ACTOR_WIDTH ACTOR_WIDTH)) (var DIALOG_WIDTH (- 1280 ACTOR_WIDTH ACTOR_WIDTH))
@@ -95,9 +92,10 @@
(set dialogText.y DIALOG_Y)) (set dialogText.y DIALOG_Y))
(dialogText.revive) (dialogText.revive)
// wait for input // wait for input or delay
// TODO customize the delay to the dialog length or voice-over length // TODO customize the delay in a more sophisticated way to the dialog length or voice-over length,
(waitForInputOrDelay 5 // or rely on FlxTypeText to add breathing room
(movie.delay .length (text.split " ")
->{ ->{
(dialogText.kill) (dialogText.kill)
(speakerNameText.kill) (speakerNameText.kill)