DRY special dialogue tags + voiceover
This commit is contained in:
@@ -3,27 +3,35 @@
|
|||||||
(function isUpperCase [s]
|
(function isUpperCase [s]
|
||||||
(= s (s.toUpperCase)))
|
(= s (s.toUpperCase)))
|
||||||
|
|
||||||
(registerConversion
|
(var :Array<String> specialSpeechTags [])
|
||||||
(new ktxt2.StreamConversion "On Phone Speech" "fountain" "hollywoo"
|
|
||||||
->stream
|
(function specialSpeech [name parenTag hmethod]
|
||||||
?(whenLet [(Some name) (stream.takeUntilAndDrop " (O.P.")]
|
(specialSpeechTags.push parenTag)
|
||||||
(and (isUpperCase name) {(stream.dropWhitespace) !(stream.isEmpty)}))
|
(registerConversion
|
||||||
->stream
|
(new ktxt2.StreamConversion name "fountain" "hollywoo"
|
||||||
(let [name (whenLet [(Some name) (stream.takeUntilAndDrop " (O.P.")] name)
|
->stream
|
||||||
&mut output ""]
|
?(whenLet [(Some name) (stream.takeUntilAndDrop " (${parenTag}")]
|
||||||
(stream.takeLine)
|
(and (isUpperCase name) {(stream.dropWhitespace) !(stream.isEmpty)}))
|
||||||
(loop
|
->stream
|
||||||
(let [wryly (ifLet [(Some w) (stream.takeBetween "(" ")\n")] w "")
|
(let [name (whenLet [(Some name) (stream.takeUntilAndDrop " (${parenTag}")] name)
|
||||||
line (ifLet [(Some l) (stream.takeLine)] (l.trim) (break))]
|
&mut output ""]
|
||||||
(when line
|
(stream.takeLine)
|
||||||
(+= output "ONPHONESPEECH \"${name}\" \"${wryly}\" ##\"${line}\"##\n"))))
|
(loop
|
||||||
output)))
|
(let [wryly (ifLet [(Some w) (stream.takeBetween "(" ")\n")] w "")
|
||||||
|
line (ifLet [(Some l) (stream.takeLine)] (l.trim) (break))]
|
||||||
|
(when line
|
||||||
|
(+= output "$hmethod \"${name}\" \"${wryly}\" ##\"${line}\"##\n"))))
|
||||||
|
output))))
|
||||||
|
|
||||||
|
(specialSpeech "On Phone Speech" "O.P." "ONPHONESPEECH")
|
||||||
|
(specialSpeech "VoiceOver Speech" "V.O." "VOICEOVER")
|
||||||
|
|
||||||
(registerConversion
|
(registerConversion
|
||||||
(new ktxt2.StreamConversion "Normal Speech" "fountain" "hollywoo"
|
(new ktxt2.StreamConversion "Normal Speech" "fountain" "hollywoo"
|
||||||
->stream ?(whenLet [(Some name) (stream.takeLine)
|
->stream ?(whenLet [(Some name) (stream.takeLine)]
|
||||||
None (indexOf name "(O.P.")
|
(doFor tag specialSpeechTags
|
||||||
None (indexOf name "(V.O.")] (and (isUpperCase name) {(stream.dropWhitespace) !(stream.isEmpty)}))
|
(whenLet [(Some _) (indexOf name "(${tag}")] (return false)))
|
||||||
|
(and (isUpperCase name) {(stream.dropWhitespace) !(stream.isEmpty)}))
|
||||||
->stream
|
->stream
|
||||||
(let [name (whenLet [(Some name) (stream.takeLine)] name)
|
(let [name (whenLet [(Some name) (stream.takeLine)] name)
|
||||||
&mut output ""]
|
&mut output ""]
|
||||||
|
@@ -207,6 +207,9 @@
|
|||||||
(hollywooMethod normalSpeech [actorName wryly text :Continuation cc]
|
(hollywooMethod normalSpeech [actorName wryly text :Continuation cc]
|
||||||
(showDialog actorName (OnScreen (dictGet .characters (_currentScene) actorName)) wryly text cc))
|
(showDialog actorName (OnScreen (dictGet .characters (_currentScene) actorName)) wryly text cc))
|
||||||
|
|
||||||
|
(hollywooMethod voiceOver [actorName wryly text :Continuation cc]
|
||||||
|
(showDialog actorName (VoiceOver (dictGet actors actorName)) wryly text cc))
|
||||||
|
|
||||||
(hollywooMethod onPhoneSpeech [actorName wryly text :Continuation cc]
|
(hollywooMethod onPhoneSpeech [actorName wryly text :Continuation cc]
|
||||||
(showDialog actorName (ifLet [charOnScreen (dictGet .characters (_currentScene) actorName)]
|
(showDialog actorName (ifLet [charOnScreen (dictGet .characters (_currentScene) actorName)]
|
||||||
(OnScreen charOnScreen)
|
(OnScreen charOnScreen)
|
||||||
|
@@ -22,6 +22,7 @@ typedef Character<StagePosition, StageFacing, Actor> = {
|
|||||||
enum SpeechType<StagePosition, StageFacing, Actor> {
|
enum SpeechType<StagePosition, StageFacing, Actor> {
|
||||||
Super;
|
Super;
|
||||||
OffScreen(actor:Actor);
|
OffScreen(actor:Actor);
|
||||||
|
VoiceOver(actor:Actor);
|
||||||
TextMessage(actor:Actor);
|
TextMessage(actor:Actor);
|
||||||
FromPhone(actor:Actor);
|
FromPhone(actor:Actor);
|
||||||
OnScreen(character:Character<StagePosition, StageFacing, Actor>);
|
OnScreen(character:Character<StagePosition, StageFacing, Actor>);
|
||||||
|
Reference in New Issue
Block a user