New Scene and Return to Scene conversions

This commit is contained in:
2023-07-13 22:02:13 -06:00
parent 6a7ebf734f
commit 86b87a0073
4 changed files with 36 additions and 8 deletions

View File

@@ -1,12 +1,12 @@
# @install: lix --silent download "gh://github.com/kiss-lang/kiss#3aa41cbcc0e9e5f87004f56f8b29b6d793c9cdf3" into kiss/0.0.1/github/3aa41cbcc0e9e5f87004f56f8b29b6d793c9cdf3
# @run: haxelib run-dir kiss "${HAXE_LIBCACHE}/kiss/0.0.1/github/3aa41cbcc0e9e5f87004f56f8b29b6d793c9cdf3"
# @install: lix --silent download "gh://github.com/kiss-lang/kiss#bbb5dcf426a6834c2b16a1f2b5b9fa6014b8d4ba" into kiss/0.0.1/github/bbb5dcf426a6834c2b16a1f2b5b9fa6014b8d4ba
# @run: haxelib run-dir kiss "${HAXE_LIBCACHE}/kiss/0.0.1/github/bbb5dcf426a6834c2b16a1f2b5b9fa6014b8d4ba"
-lib haxe-strings
-lib hscript
-lib tink_json
-lib tink_macro
-lib tink_syntaxhub
-lib uuid
-cp ${HAXE_LIBCACHE}/kiss/0.0.1/github/3aa41cbcc0e9e5f87004f56f8b29b6d793c9cdf3/src
-cp ${HAXE_LIBCACHE}/kiss/0.0.1/github/bbb5dcf426a6834c2b16a1f2b5b9fa6014b8d4ba/src
-D kiss=0.0.1
-w -WUnusedPattern
--macro kiss.KissFrontend.use()

View File

@@ -1,12 +1,12 @@
# @install: lix --silent download "gh://github.com/kiss-lang/kiss#d46e386972dd893a690fd20427613bd9dca5a60d" into kiss/0.0.1/github/d46e386972dd893a690fd20427613bd9dca5a60d
# @run: haxelib run-dir kiss "${HAXE_LIBCACHE}/kiss/0.0.1/github/d46e386972dd893a690fd20427613bd9dca5a60d"
# @install: lix --silent download "gh://github.com/kiss-lang/kiss#bbb5dcf426a6834c2b16a1f2b5b9fa6014b8d4ba" into kiss/0.0.1/github/bbb5dcf426a6834c2b16a1f2b5b9fa6014b8d4ba
# @run: haxelib run-dir kiss "${HAXE_LIBCACHE}/kiss/0.0.1/github/bbb5dcf426a6834c2b16a1f2b5b9fa6014b8d4ba"
-lib haxe-strings
-lib hscript
-lib tink_json
-lib tink_macro
-lib tink_syntaxhub
-lib uuid
-cp ${HAXE_LIBCACHE}/kiss/0.0.1/github/d46e386972dd893a690fd20427613bd9dca5a60d/src
-cp ${HAXE_LIBCACHE}/kiss/0.0.1/github/bbb5dcf426a6834c2b16a1f2b5b9fa6014b8d4ba/src
-D kiss=0.0.1
-w -WUnusedPattern
--macro kiss.KissFrontend.use()

View File

@@ -108,3 +108,29 @@
(new tct.StreamConversion "Delay" "fountain" "hollywoo"
->stream (isScreenLine stream.content)
->stream "DELAY ##\"$(stream.content.trim)\"##\n"))
(function newSceneConversion [engine command setArgs newCamera]
(FileConversionProject.registerConversion
(new tct.StreamConversion "New scene (hollywoo-${engine})" "fountain" "hollywoo"
->stream (stream.startsWithOneOf ["INT." "EXT." "INT./EXT."])
->stream {
(let [fullHeading (stream.content.trim)
perspectiveAbbr (stream.expect "perspective" ->(stream.takeUntilAndDrop " "))
perspective (case perspectiveAbbr ("INT." "Interior") ("EXT." "Exterior") ("INT./EXT." "Mixed") (never otherwise))
location (.trim (stream.expect "location" ->(stream.takeUntilLastAndDrop "-")))
setKey "${perspectiveAbbr} ${location}"
time {(stream.dropWhitespace) stream.content}
timeEnumValue (case (time.trim) ("MORNING" "Morning") ("DAY" "Day") ("EVENING" "Evening") ("NIGHT" "Night") (otherwise "<Morning/Day/Evening/Night>"))]
"(preload
(${command} \"${setKey}\" ${setArgs})
(newSceneFromSet \"${fullHeading}\" \"${setKey}\" ${timeEnumValue} ${perspective} ${newCamera}))
SETSCENE \"${fullHeading}\""
)
})))
(FileConversionProject.registerConversion
(new tct.StreamConversion "Return to scene" "fountain" "hollywoo"
->stream (stream.startsWithOneOf ["INT." "EXT." "INT./EXT."])
->stream {
(let [fullHeading (stream.content.trim)]
"SETSCENE \"${fullHeading}\"")
}))

View File

@@ -13,3 +13,5 @@
(linearMotionTo $actorVar <position key> <speed> cc <soundLoop key> <volumeMod> <connectedSprites>))"))
"\n")
"\n")))
(newSceneConversion "flixel" "newFlxSet" #"(assetPath "images" <filename>)"# "(new FlxCamera)")