Use AsyncEmbeddedScript2 for full skip control
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# @install: lix --silent download "gh://github.com/kiss-lang/hollywoo#6d5e1392a62ad174f4dd437f976dff907fee0bec" into hollywoo/0.0.0/github/6d5e1392a62ad174f4dd437f976dff907fee0bec
|
||||
# @run: haxelib run-dir hollywoo "${HAXE_LIBCACHE}/hollywoo/0.0.0/github/6d5e1392a62ad174f4dd437f976dff907fee0bec"
|
||||
# @install: lix --silent download "gh://github.com/kiss-lang/hollywoo#007cab4595935d196449ab0a49fbcd039674284f" into hollywoo/0.0.0/github/007cab4595935d196449ab0a49fbcd039674284f
|
||||
# @run: haxelib run-dir hollywoo "${HAXE_LIBCACHE}/hollywoo/0.0.0/github/007cab4595935d196449ab0a49fbcd039674284f"
|
||||
-lib kiss
|
||||
-lib kiss-tools
|
||||
-cp ${HAXE_LIBCACHE}/hollywoo/0.0.0/github/6d5e1392a62ad174f4dd437f976dff907fee0bec/src/
|
||||
-cp ${HAXE_LIBCACHE}/hollywoo/0.0.0/github/007cab4595935d196449ab0a49fbcd039674284f/src/
|
||||
-D hollywoo=0.0.0
|
@@ -1,4 +1,4 @@
|
||||
# @install: lix --silent download "gh://github.com/kiss-lang/kiss-flixel#61e71a1f2b7128f837af3f6d6f4af3dc7c03d008" into kiss-flixel/0.0.0/github/61e71a1f2b7128f837af3f6d6f4af3dc7c03d008
|
||||
# @install: lix --silent download "gh://github.com/kiss-lang/kiss-flixel#511113e93ddd2da3f3b320cfe0eb51f751a1566d" into kiss-flixel/0.0.0/github/511113e93ddd2da3f3b320cfe0eb51f751a1566d
|
||||
-lib flixel
|
||||
-lib flixel-addons
|
||||
-lib flixel-ui
|
||||
@@ -6,5 +6,5 @@
|
||||
-lib kiss-tools
|
||||
-lib lime
|
||||
-lib openfl
|
||||
-cp ${HAXE_LIBCACHE}/kiss-flixel/0.0.0/github/61e71a1f2b7128f837af3f6d6f4af3dc7c03d008/src/
|
||||
-cp ${HAXE_LIBCACHE}/kiss-flixel/0.0.0/github/511113e93ddd2da3f3b320cfe0eb51f751a1566d/src/
|
||||
-D kiss-flixel=0.0.0
|
@@ -1,4 +1,4 @@
|
||||
# @install: lix --silent download "gh://github.com/kiss-lang/kiss-tools#7418d158fefe2e145006468f35c9fa0fed8c224c" into kiss-tools/0.0.0/github/7418d158fefe2e145006468f35c9fa0fed8c224c
|
||||
# @install: lix --silent download "gh://github.com/kiss-lang/kiss-tools#4dddcb1b43e7f27f5caae0ce09d67fd93be76a3e" into kiss-tools/0.0.0/github/4dddcb1b43e7f27f5caae0ce09d67fd93be76a3e
|
||||
-lib kiss
|
||||
-cp ${HAXE_LIBCACHE}/kiss-tools/0.0.0/github/7418d158fefe2e145006468f35c9fa0fed8c224c/src/
|
||||
-cp ${HAXE_LIBCACHE}/kiss-tools/0.0.0/github/4dddcb1b43e7f27f5caae0ce09d67fd93be76a3e/src/
|
||||
-D kiss-tools=0.0.0
|
@@ -1,12 +1,12 @@
|
||||
# @install: lix --silent download "gh://github.com/kiss-lang/kiss#8bf61eb403081c929e6faf7a4564551fbe1f2bd2" into kiss/0.0.1/github/8bf61eb403081c929e6faf7a4564551fbe1f2bd2
|
||||
# @run: haxelib run-dir kiss "${HAXE_LIBCACHE}/kiss/0.0.1/github/8bf61eb403081c929e6faf7a4564551fbe1f2bd2"
|
||||
# @install: lix --silent download "gh://github.com/kiss-lang/kiss#63600c8d16ec7c227b54c2c5a33f3e9672fd4981" into kiss/0.0.1/github/63600c8d16ec7c227b54c2c5a33f3e9672fd4981
|
||||
# @run: haxelib run-dir kiss "${HAXE_LIBCACHE}/kiss/0.0.1/github/63600c8d16ec7c227b54c2c5a33f3e9672fd4981"
|
||||
-lib haxe-strings
|
||||
-lib hscript
|
||||
-lib tink_json
|
||||
-lib tink_macro
|
||||
-lib tink_syntaxhub
|
||||
-lib uuid
|
||||
-cp ${HAXE_LIBCACHE}/kiss/0.0.1/github/8bf61eb403081c929e6faf7a4564551fbe1f2bd2/src
|
||||
-cp ${HAXE_LIBCACHE}/kiss/0.0.1/github/63600c8d16ec7c227b54c2c5a33f3e9672fd4981/src
|
||||
-D kiss=0.0.1
|
||||
-w -WUnusedPattern
|
||||
--macro kiss.KissFrontend.use()
|
@@ -588,7 +588,7 @@
|
||||
(set track.onComplete ->{
|
||||
(currentVoiceTracks.remove track)
|
||||
(restoreOriginalVolume)
|
||||
(movie?.delay DELAY_BETWEEN_VOICE_TRACKS cc)
|
||||
(movie?.delay false DELAY_BETWEEN_VOICE_TRACKS cc)
|
||||
}))
|
||||
(currentVoiceTracks.push track)
|
||||
(track.play true (* 1000 start) (* 1000 end)))
|
||||
|
@@ -50,4 +50,10 @@ class FlxMovie extends Movie<FlxSprite, ActorFlxSprite, FlxSound, FlxSound, FlxS
|
||||
public var DIALOG_WIDTH:Int;
|
||||
public var DIALOG_HEIGHT:Int;
|
||||
public var presetPositions:Map<String,Bool> = [];
|
||||
|
||||
// HollywooFlixelDSL overrides this in subclasses
|
||||
public function update(elapsed:Float):Void {}
|
||||
|
||||
// Such a hack:
|
||||
private var skipMovie:FlxMovie = null;
|
||||
}
|
||||
|
@@ -43,34 +43,40 @@
|
||||
|
||||
|
||||
@:keep
|
||||
(method linearMotion [:FlxSprite sprite :Float destX :Float destY :Float speed &opt :Void->Void cc :String soundLoop :Float volumeMod :Array<FlxSprite> connectedSprites]
|
||||
(method linearMotion [:Bool skipping :FlxSprite sprite :Float destX :Float destY :Float speed &opt :Void->Void cc :String soundLoop :Float volumeMod :Array<FlxSprite> connectedSprites]
|
||||
(unless (tweenedPositionsOfSpritesInScenes.exists sceneKey)
|
||||
(dictSet tweenedPositionsOfSpritesInScenes sceneKey (new Map)))
|
||||
(dictSet (dictGet tweenedPositionsOfSpritesInScenes sceneKey) sprite (new FlxPoint destX destY))
|
||||
(when skipping
|
||||
(cc)
|
||||
(return))
|
||||
(when soundLoop
|
||||
(let [oldCC cc]
|
||||
(set cc
|
||||
(makeCC
|
||||
(stopSound soundLoop (makeCC null))
|
||||
(stopSound skipping soundLoop (makeCC null))
|
||||
(when oldCC
|
||||
(oldCC)))))
|
||||
(loopSound soundLoop (makeCC null) volumeMod))
|
||||
(loopSound skipping soundLoop (makeCC null) volumeMod))
|
||||
(tween
|
||||
(FlxTween.linearMotion sprite sprite.x sprite.y destX destY speed false (tweenOpts cc)))
|
||||
(when connectedSprites
|
||||
(doFor cSprite connectedSprites
|
||||
(let [xOffset (- cSprite.x sprite.x)
|
||||
yOffset (- cSprite.y sprite.y)]
|
||||
(linearMotion cSprite (+ destX xOffset) (+ destY yOffset) speed)))))
|
||||
(linearMotion skipping cSprite (+ destX xOffset) (+ destY yOffset) speed)))))
|
||||
|
||||
@:keep
|
||||
(method linearMotionTo [:FlxSprite sprite :String positionKey :Float speed &opt :Void->Void cc :String soundLoop :Float volumeMod :Array<FlxSprite> connectedSprites]
|
||||
(method linearMotionTo [:Bool skipping :FlxSprite sprite :String positionKey :Float speed &opt :Void->Void cc :String soundLoop :Float volumeMod :Array<FlxSprite> connectedSprites]
|
||||
(let [position (resolvePosition positionKey)]
|
||||
(linearMotion sprite position.x position.y speed cc soundLoop volumeMod connectedSprites)))
|
||||
(linearMotion skipping sprite position.x position.y speed cc soundLoop volumeMod connectedSprites)))
|
||||
|
||||
// Reusable effect: Scan a slightly transparent line side-to-side across a FlxSprite like a scanner
|
||||
@:keep
|
||||
(method scanLineEffect [:FlxSprite sprite :FlxColor lineColor :Int lineThickness :Float alpha :Bool vertical :Float speed &opt :Bool repeat :Void->Void cc :String soundLoop :Float volumeMod]
|
||||
(method :Void scanLineEffect [:Bool skipping :FlxSprite sprite :FlxColor lineColor :Int lineThickness :Float alpha :Bool vertical :Float speed &opt :Bool repeat :Void->Void cc :String soundLoop :Float volumeMod]
|
||||
(when skipping
|
||||
(cc)
|
||||
(return))
|
||||
(unless repeat (set repeat true))
|
||||
(let [lineSprite (new FlxSprite)
|
||||
width (if vertical lineThickness (Std.int sprite.width))
|
||||
@@ -94,23 +100,26 @@
|
||||
(set lineSprite.x lineStartX)
|
||||
(set lineSprite.y lineStartY)
|
||||
(FlxG.state.add lineSprite)
|
||||
(linearMotion lineSprite lineEndX lineEndY speed
|
||||
(linearMotion skipping lineSprite lineEndX lineEndY speed
|
||||
->:Void {
|
||||
(if repeat
|
||||
(linearMotion lineSprite lineStartX lineStartY speed finish soundLoop volumeMod)
|
||||
(linearMotion skipping lineSprite lineStartX lineStartY speed finish soundLoop volumeMod)
|
||||
(finish))
|
||||
}
|
||||
soundLoop volumeMod)))
|
||||
|
||||
(method rotateTo [:FlxSprite sprite :Float angle :Float duration &opt :Void->Void cc :String soundLoop :Float volumeMod]
|
||||
(method :Void rotateTo [:Bool skipping :FlxSprite sprite :Float angle :Float duration &opt :Void->Void cc :String soundLoop :Float volumeMod]
|
||||
(when skipping
|
||||
(cc)
|
||||
(return))
|
||||
(when soundLoop
|
||||
(let [oldCC cc]
|
||||
(set cc
|
||||
(makeCC
|
||||
(stopSound soundLoop (makeCC null))
|
||||
(stopSound skipping soundLoop (makeCC null))
|
||||
(when oldCC
|
||||
(oldCC)))))
|
||||
(loopSound soundLoop (makeCC null) volumeMod))
|
||||
(loopSound skipping soundLoop (makeCC null) volumeMod))
|
||||
(tween
|
||||
(FlxTween.angle sprite sprite.angle angle duration (tweenOpts cc))))
|
||||
|
||||
@@ -171,7 +180,11 @@
|
||||
|
||||
(defAlias &ident flxDirector (cast director FlxDirector))
|
||||
|
||||
(method :Void update [:Float elapsed]
|
||||
(method &override :Void update [:Float elapsed]
|
||||
(when skipMovie
|
||||
(skipMovie.update elapsed)
|
||||
(return))
|
||||
|
||||
(doFor action nextFrameActions
|
||||
(action))
|
||||
(set nextFrameActions [])
|
||||
@@ -202,7 +215,10 @@
|
||||
(let [[x y] (SpriteTools.positionOn s (canvas) rpos true)]
|
||||
(new StagePosition x y layer)))
|
||||
|
||||
(method namePlates [:Array<String> names :Dynamic delayLength :Bool delayWhileShown :Void->Void cc]
|
||||
(method namePlates [:Bool skipping :Array<String> names :Dynamic delayLength :Bool delayWhileShown :Void->Void cc]
|
||||
(when skipping
|
||||
(cc)
|
||||
(return))
|
||||
(let [plates
|
||||
(for name names
|
||||
(let [plate (SpriteTools.textPlate name FlxDirector.DIALOG_SIZE FlxDirector.SUPER_MARGIN)
|
||||
@@ -212,14 +228,14 @@
|
||||
(set plate.y (+ actor.y actor.height))
|
||||
(FlxG.state.add plate)
|
||||
plate))]
|
||||
(delay delayLength
|
||||
(delay skipping delayLength
|
||||
(makeCC
|
||||
(doFor plate plates (FlxG.state.remove plate true))
|
||||
(when delayWhileShown (cc)))))
|
||||
(unless delayWhileShown (cc)))
|
||||
|
||||
(method loopSound [name :Void->Void cc &opt :Float volumeMod]
|
||||
(playSound name (makeCC null) volumeMod false)
|
||||
(method loopSound [:Bool skipping name :Void->Void cc &opt :Float volumeMod]
|
||||
(playSound skipping name (makeCC null) volumeMod false)
|
||||
(let [cs flxDirector.currentSounds
|
||||
sound (nth cs (- cs.length 1))
|
||||
onComplete sound.onComplete]
|
||||
@@ -229,9 +245,9 @@
|
||||
(cc))
|
||||
|
||||
(method putPresetPosition [key x y z]
|
||||
(let [pos (new StagePosition (Std.int x) (Std.int y) (Std.int z))]
|
||||
(stagePositions.put key pos)
|
||||
(dictSet presetPositions (pos.stringify) true)))
|
||||
(let [pos (new StagePosition (Std.int x) (Std.int y) (Std.int z))]
|
||||
(stagePositions.put key pos)
|
||||
(dictSet presetPositions (pos.stringify) true)))
|
||||
|
||||
(preload
|
||||
(.enableGamepadInput
|
||||
@@ -356,8 +372,11 @@
|
||||
(prop &mut :FlxCamera inCamera)
|
||||
(prop &mut :FlxSprite outCameraPos)
|
||||
(prop &mut :FlxCamera outCamera)
|
||||
(method tweenScene [name :Float speed :Continuation cc &opt :Bool fromLeft :String soundLoop :Float volumeMod]
|
||||
(let [name (kiss.FuzzyMapTools.bestMatch scenes name)
|
||||
(method :Void tweenScene [:Bool skipping name :Float speed :Continuation cc &opt :Bool fromLeft :String soundLoop :Float volumeMod]
|
||||
(when skipping
|
||||
(setScene name cc)
|
||||
(return))
|
||||
(let [name (kiss.FuzzyMapTools.bestMatch scenes name)
|
||||
lastSceneKey sceneKey
|
||||
lastScene (dictGet scenes sceneKey)
|
||||
scene (dictGet scenes name)
|
||||
@@ -394,4 +413,32 @@
|
||||
(hollywoo.Movie.appearanceFlag shownScenes name)
|
||||
camera
|
||||
(makeCC
|
||||
(linearMotion inCameraPos 0 0 speed finish soundLoop volumeMod [outCameraPos])))))
|
||||
(linearMotion skipping inCameraPos 0 0 speed finish soundLoop volumeMod [outCameraPos])))))
|
||||
|
||||
(defMacro addSkips [flxMovieClass]
|
||||
`(#when debug
|
||||
(method prepareForSkip []
|
||||
(kiss_tools.TimerWithPause.stopAll)
|
||||
(flxDirector.pause)
|
||||
(.clear (director.shortcutHandler))
|
||||
(doCleanup)
|
||||
(set skipMovie (new Ep102 flxDirector)))
|
||||
|
||||
(preload
|
||||
(.registerItem (director.shortcutHandler) "[n]ext label"
|
||||
->cc {
|
||||
(prepareForSkip)
|
||||
(runFromNextLabel skipMovie)
|
||||
})
|
||||
|
||||
|
||||
(.registerItem (director.shortcutHandler) "skip to [l]abel"
|
||||
->cc
|
||||
(let [runners (labelRunners)]
|
||||
(director.chooseString
|
||||
"Skip to scene?"
|
||||
(sort (collect (runners.keys)))
|
||||
->label {
|
||||
(prepareForSkip)
|
||||
((dictGet runners label) skipMovie)
|
||||
}))))))
|
Reference in New Issue
Block a user