From db4245faf25ae047dba01e147fc3f2dafdf2ef4d Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 24 Sep 2025 18:07:39 -0500 Subject: [PATCH] update deps and add some macros --- haxe_libraries/hollywoo.hxml | 6 ++-- haxe_libraries/kiss-flixel.hxml | 4 +-- src/hollywoo_flixel/HollywooFlixelDSL.kiss | 39 ++++++++++++++++------ src/hollywoo_flixel/HollywooInterp.hx | 11 +++++- 4 files changed, 43 insertions(+), 17 deletions(-) diff --git a/haxe_libraries/hollywoo.hxml b/haxe_libraries/hollywoo.hxml index 16f4bb4..a06bed9 100644 --- a/haxe_libraries/hollywoo.hxml +++ b/haxe_libraries/hollywoo.hxml @@ -1,6 +1,6 @@ -# @install: lix --silent download "git:https://k7izh9.gitea.cloud/kiss-lang/hollywoo#5343d8128f8e6b44417274cedcf6ab2f6756be42" into hollywoo/0.0.0/git/5343d8128f8e6b44417274cedcf6ab2f6756be42 -# @run: haxelib run-dir hollywoo "${HAXE_LIBCACHE}/hollywoo/0.0.0/git/5343d8128f8e6b44417274cedcf6ab2f6756be42" +# @install: lix --silent download "git:https://k7izh9.gitea.cloud/kiss-lang/hollywoo#b0726f1495d156f778190b491e1a2906a6d709f5" into hollywoo/0.0.0/git/b0726f1495d156f778190b491e1a2906a6d709f5 +# @run: haxelib run-dir hollywoo "${HAXE_LIBCACHE}/hollywoo/0.0.0/git/b0726f1495d156f778190b491e1a2906a6d709f5" -lib kiss -lib kiss-tools --cp ${HAXE_LIBCACHE}/hollywoo/0.0.0/git/5343d8128f8e6b44417274cedcf6ab2f6756be42/src/ +-cp ${HAXE_LIBCACHE}/hollywoo/0.0.0/git/b0726f1495d156f778190b491e1a2906a6d709f5/src/ -D hollywoo=0.0.0 \ No newline at end of file diff --git a/haxe_libraries/kiss-flixel.hxml b/haxe_libraries/kiss-flixel.hxml index 1c394d0..3ed66d7 100644 --- a/haxe_libraries/kiss-flixel.hxml +++ b/haxe_libraries/kiss-flixel.hxml @@ -1,4 +1,4 @@ -# @install: lix --silent download "git:https://k7izh9.gitea.cloud/kiss-lang/kiss-flixel#81dd066ebe275c5a6aab49d0aef8ac63068322a7" into kiss-flixel/0.0.0/git/81dd066ebe275c5a6aab49d0aef8ac63068322a7 +# @install: lix --silent download "git:https://k7izh9.gitea.cloud/kiss-lang/kiss-flixel#101fe2613d72b92d4a31ad301a11c9403329a769" into kiss-flixel/0.0.0/git/101fe2613d72b92d4a31ad301a11c9403329a769 -lib flixel -lib flixel-addons -lib flixel-ui @@ -6,6 +6,6 @@ -lib kiss-tools -lib lime -lib openfl --cp ${HAXE_LIBCACHE}/kiss-flixel/0.0.0/git/81dd066ebe275c5a6aab49d0aef8ac63068322a7/src/ +-cp ${HAXE_LIBCACHE}/kiss-flixel/0.0.0/git/101fe2613d72b92d4a31ad301a11c9403329a769/src/ -D kiss-flixel=0.0.0 --macro kiss_flixel.ShaderFrontend.use() \ No newline at end of file diff --git a/src/hollywoo_flixel/HollywooFlixelDSL.kiss b/src/hollywoo_flixel/HollywooFlixelDSL.kiss index b9fad85..179d45c 100644 --- a/src/hollywoo_flixel/HollywooFlixelDSL.kiss +++ b/src/hollywoo_flixel/HollywooFlixelDSL.kiss @@ -171,6 +171,14 @@ (when (FlxG.cameras.list.contains camera) (FlxG.cameras.remove camera ?destroy)) (when cc (cc))) +(hollywooMethod setCameraZoom [:Float zoom cc] + (withSceneCamera c (set c.zoom zoom))) + +(hollywooMethod setCameraScroll [:String positionKey cc] + (let [p (resolvePosition positionKey "")] + (withSceneCamera c + (c.scroll.set p.x p.y)))) + @:keep (method linearMotion [:Bool skipping :FlxSprite sprite :Float destX :Float destY :Float speed &opt :Void->Void cc :String soundLoop :Float volumeMod :Array connectedSprites] (unless (tweenedPositionsOfSpritesInScenes.exists sceneKey) @@ -740,6 +748,7 @@ (bar.destroy) (set bar null))) +// TODO make this a hollywoomethod and interp reader macro (method overlayPropOnCurrentSet [propKey :Void->Void cc &opt z] (let [propKey (kiss.FuzzyMapTools.bestMatch props propKey)] (dictSet shownProps propKey true) // Don't scale when showing @@ -763,6 +772,7 @@ (prop &mut :FlxCamera inCamera) (prop &mut :FlxSprite outCameraPos) (prop &mut :FlxCamera outCamera) +// TODO make this a hollywoomethod and interp reader macro (method :Void tweenScene [:Bool skipping :String name :Float speed :Continuation cc &opt :Bool fromLeft :String soundLoop :Float volumeMod] (when skipping (setScene skipping name cc) @@ -962,16 +972,23 @@ (dictSet interp.globals "Read" hollywoo.Movie.PlayMode.Read) (dictSet interp.globals "Watch" hollywoo.Movie.PlayMode.Watch) + (localFunction :Void handleNext [exp] + (case exp.def + ((CallExp (object def (Symbol "commands")) commands) + (doFor c commands (handleNext c))) + ((CallExp (object def (Symbol "label")) [(object def (Symbol "null"))]) + 0) + ((CallExp (object def (Symbol "label")) [(object def (StrExp label))]) + (dictSet labels label idx)) + (otherwise + // TODO add more automatic labels + (instructions.insert idx++ ->[self skipping cc] { + (dictSet interp.globals "skipping" skipping) + (dictSet interp.globals "cc" cc) + (print (kiss.Reader.toString exp.def)) + (interp.evalCC exp ->_ {}) + })))) (until (stream.isEmpty) (let [exp (interp.read stream)] - (case exp.def - ((CallExp (object def (Symbol "label")) [(object def (StrExp label))]) - (dictSet labels label idx)) - (otherwise - // TODO add more automatic labels - (instructions.insert idx++ ->[self skipping cc] { - (dictSet interp.globals "skipping" skipping) - (dictSet interp.globals "cc" cc) - (print (kiss.Reader.toString exp.def)) - (interp.evalCC exp ->_ {}) - }))))))) \ No newline at end of file + ~(kiss.Reader.toString exp.def) + (handleNext exp))))) \ No newline at end of file diff --git a/src/hollywoo_flixel/HollywooInterp.hx b/src/hollywoo_flixel/HollywooInterp.hx index 29122c3..020aaf2 100644 --- a/src/hollywoo_flixel/HollywooInterp.hx +++ b/src/hollywoo_flixel/HollywooInterp.hx @@ -122,12 +122,21 @@ class HollywooInterp { readTable["ROLLCREDITS "] = quickReaderMacro("(movie.rollCredits skipping $$1 cc $$2)"); + readTable["TIMEDTITLECARDV2 "] = + quickReaderMacro("(commands + (movie.showTitleCard $$2 cc) + (label $$3) // This will be null, and be fine, if it's not provided + (movie.delay skipping $$1 cc) + (movie.hideTitleCard cc) + )"); // HollywooFlixel-specific: readTable["ADDTEMPCAMERA "] = quickReaderMacro("(movie.addTempCamera skipping $$1 $$2 $$3 cc)"); readTable["REMOVETEMPCAMERA "] = quickReaderMacro("(movie.removeTempCamera $$1 $$2 cc)"); - readTable["ACTORPLAYANIMATION"] = quickReaderMacro("(movie.actorPlayAnimation $$1 $$2 cc)"); + readTable["ACTORPLAYANIMATION "] = quickReaderMacro("(movie.actorPlayAnimation $$1 $$2 cc)"); + readTable["SETCAMERAZOOM "] = quickReaderMacro("(movie.setCameraZoom $$1 cc)"); + readTable["SETCAMERASCROLL "] = quickReaderMacro("(movie.setCameraScroll $$1 cc)"); } } \ No newline at end of file