Movie.rollCredits()

This commit is contained in:
2021-12-31 18:25:31 -07:00
parent f2442ad618
commit b26665749a
5 changed files with 86 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
package hollywoo;
import hollywoo.Scene;
import hollywoo.Movie;
enum Appearance {
FirstAppearance;
@@ -29,5 +30,7 @@ interface Director<Set, StagePosition, StageFacing, ScreenPosition, Actor, Sound
// TODO showPropOnStage
function hideProp(prop:Prop, cc:Continuation):Void;
function rollCredits(credits:Array<CreditsLine>, cc:Continuation):Void;
function cleanup():Void;
}

View File

@@ -4,6 +4,7 @@ import haxe.Constraints.Function;
import haxe.Timer;
import kiss.AsyncEmbeddedScript;
import kiss.Prelude;
import kiss.Stream;
import kiss.FuzzyMap;
import hollywoo.Scene;
import hollywoo.Director;
@@ -24,6 +25,13 @@ typedef VoiceLine = {
end:Float
};
enum CreditsLine {
OneColumn(s:String);
TwoColumn(left:String, right:String);
ThreeColumn(left:String, center:String, right:String);
Break;
}
/**
* Model/controller of a Hollywoo film, and main execution script
*/

View File

@@ -258,4 +258,21 @@
(hollywooMethod onPhoneSpeech true [actorName wryly text :Continuation cc]
(showDialog actorName (ifLet [charOnScreen (dictGet .characters (_currentScene) actorName)]
(OnScreen charOnScreen)
(FromPhone (dictGet actors actorName))) wryly text cc))
(FromPhone (dictGet actors actorName))) wryly text cc))
// TODO themedRollCredits
(hollywooMethod rollCredits true [:String creditsTSV :Continuation cc]
(director.rollCredits
(for line (.split .content (Stream.fromString creditsTSV) "\n")
(case (line.split "\t")
((unless line [_])
Break)
([col1]
(OneColumn col1))
([col1 col2]
(TwoColumn col1 col2))
([col1 col2 col3]
(ThreeColumn col1 col2 col3))
(otherwise
(throw "unsupported credits line $line"))))
cc))