From 4916a6d24ec836f3e9c766b0771099aa278048d5 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 22 Sep 2025 16:21:27 -0500 Subject: [PATCH] always compile in withCancel --- src/hollywoo/Movie.hx | 882 ++++++++++++++++++++++++++++++---------- src/hollywoo/Movie.kiss | 8 +- 2 files changed, 673 insertions(+), 217 deletions(-) diff --git a/src/hollywoo/Movie.hx b/src/hollywoo/Movie.hx index 4b6d4a2..58059bf 100644 --- a/src/hollywoo/Movie.hx +++ b/src/hollywoo/Movie.hx @@ -75,14 +75,14 @@ class Movie = haxe.Json.parse(content); @@ -98,14 +98,14 @@ class Movie = haxe.Json.parse(content); @@ -128,14 +128,14 @@ class Movie = haxe.Json.parse(content); @@ -151,14 +151,14 @@ class Movie = haxe.Json.parse(content); @@ -294,12 +294,12 @@ class Movie = haxe.Json.parse(content); @@ -348,14 +348,14 @@ class Movie = haxe.Json.parse(content); @@ -399,10 +399,10 @@ class Movie>(), actorAndPropPositionKeys : new FuzzyMap(), propOrder : new kiss.List([]), props : new FuzzyMap>(), camera : camera, time : time, perspective : perspective }; @@ -782,9 +784,9 @@ class Movie> = new Map(); public function resolvePosition(position:Dynamic, holder:String):StagePosition return { { - final _uNpFsfLBhkkDQncjT1t5p3:Dynamic = position; + final _6vezd6n7hMxTup5umdJyJv:Dynamic = position; { - switch [_uNpFsfLBhkkDQncjT1t5p3] { + switch [_6vezd6n7hMxTup5umdJyJv] { case [positionKey] if (Prelude.truthy({ - final _g4UJXVXxtDXLKXr1BpouFe:Dynamic = Std.isOfType(positionKey, String); + final _23TNcH3FE5zh6XgBkkXXvc:Dynamic = Std.isOfType(positionKey, String); { - _g4UJXVXxtDXLKXr1BpouFe; + _23TNcH3FE5zh6XgBkkXXvc; }; })):{ { final positionKey:String = positionKey; { { - final _9DZfmAfQ1M1gnXjYTGfJVP = sceneKey; + final _v6XELEdBXdexJh5JYFwdTg = sceneKey; { - if (Prelude.truthy(_9DZfmAfQ1M1gnXjYTGfJVP)) _9DZfmAfQ1M1gnXjYTGfJVP else throw kiss.Prelude.runtimeInsertAssertionMessage("resolvePosition() should be called in the context of a scene", "/Users/nat/repos/hollywoo/src/hollywoo/Movie.kiss:495:17: Assertion failed: \nFrom:[(assert sceneKey \"resolvePosition() should be called in the context of a scene\")]", 4); + if (Prelude.truthy(_v6XELEdBXdexJh5JYFwdTg)) _v6XELEdBXdexJh5JYFwdTg else throw kiss.Prelude.runtimeInsertAssertionMessage("resolvePosition() should be called in the context of a scene", "/Users/nat/repos/hollywoo/src/hollywoo/Movie.kiss:495:17: Assertion failed: \nFrom:[(assert sceneKey \"resolvePosition() should be called in the context of a scene\")]", 4); }; }; { @@ -976,20 +978,20 @@ class Movie>)) { - final _bX683NJrsPyuMofRUDTaAz = _2YR1DeK67EEE8mugWecb7x; final ending = _bX683NJrsPyuMofRUDTaAz[0]; final extension = _bX683NJrsPyuMofRUDTaAz[1]; + for (_jXeZ2aQfBby9z6FewSAitA in (Prelude.intersect(overrideEndings, overrideExtensions) : Array>)) { + final _9WQG1vsGfQBFY2Z1CMC4XF = _jXeZ2aQfBby9z6FewSAitA; final ending = _9WQG1vsGfQBFY2Z1CMC4XF[0]; final extension = _9WQG1vsGfQBFY2Z1CMC4XF[1]; { { final possibleOverride = (Prelude.add("", Std.string({ @@ -1166,7 +1180,9 @@ class Movie [::... dir] failed"; }; }; - case _cWZtcKVnwjFVrxjnrHxuM6 if (Prelude.greaterThan(_cWZtcKVnwjFVrxjnrHxuM6.length, 1)):{ - final _ = _cWZtcKVnwjFVrxjnrHxuM6.slice(0, Prelude.subtract(_cWZtcKVnwjFVrxjnrHxuM6.length, 1)); final dir = _cWZtcKVnwjFVrxjnrHxuM6[Prelude.subtract(_cWZtcKVnwjFVrxjnrHxuM6.length, 1)]; + case _moixUtwA3pbmbHonMJjKkB if (Prelude.greaterThan(_moixUtwA3pbmbHonMJjKkB.length, 1)):{ + final _ = _moixUtwA3pbmbHonMJjKkB.slice(0, Prelude.subtract(_moixUtwA3pbmbHonMJjKkB.length, 1)); final dir = _moixUtwA3pbmbHonMJjKkB[Prelude.subtract(_moixUtwA3pbmbHonMJjKkB.length, 1)]; { { if (Prelude.truthy(!Prelude.truthy(assetPaths.existsExactly(dir)))) { @@ -1268,7 +1284,13 @@ class Movie; public final lightSources:JsonMap>; public final delayLengths:JsonMap; @@ -1406,7 +1432,437 @@ class Movie>)) { + final _aVmKNLBBUzBQvfcr7Fe5oP = _qzJ5vBGc8vyA2gsdb2oyGm; final key = _aVmKNLBBUzBQvfcr7Fe5oP[0]; final ls = _aVmKNLBBUzBQvfcr7Fe5oP[1]; + { + key => ls; + }; + }]; + { + director.chooseString("Remove which light source?", withCancel(stringArr), function(choice) return { + if (Prelude.truthy(Prelude.areEqual(choice, CANCEL_COMMAND))) cc() else { + final ls = stringMap[choice]; + { + arr.elements.remove(ls); + lightSources.put(sceneKey, arr); + _updateLighting(); + cc(); + }; + }; + }); + }; + }; + }; + shortcutHandler.registerItem("[r]emove [l]ight source", removeLightSource); + function connectLightSourceToProp(cc) return { + if (Prelude.truthy(doingSomething)) { + return; + } else null; + doingSomething = true; + lastCommand = connectLightSourceToProp; + { + final arr = lightSources.get(sceneKey); final stringArr = [for (ls in arr) { + ls.stringify(); + }]; final stringMap = [for (_4gJ7cqij5rMd94PMmB83jg in (Prelude.zipThrow(stringArr, arr) : Array>)) { + final _fF4Fe51kx1fWCMfnd4j6Go = _4gJ7cqij5rMd94PMmB83jg; final key = _fF4Fe51kx1fWCMfnd4j6Go[0]; final ls = _fF4Fe51kx1fWCMfnd4j6Go[1]; + { + key => ls; + }; + }]; + { + director.chooseString("Connect which light source?", withCancel(stringArr), function(choice) return { + if (Prelude.truthy(Prelude.areEqual(choice, CANCEL_COMMAND))) cc() else { + final ls = stringMap[choice]; final propsArr = [for (elem in _currentScene().props.keys()) { + elem; + }]; + { + director.chooseString("Connect to which prop?", withCancel(propsArr), function(propChoice) return { + if (Prelude.truthy(Prelude.areEqual(propChoice, CANCEL_COMMAND))) cc() else { + final prop = _currentScene().props[propChoice]; final relativeLS = director.offsetLightSource(ls, opposite(prop.position)); final propLightSources = lightSources.get(propChoice); + { + arr.elements.remove(ls); + lightSources.put(sceneKey, arr); + propLightSources.elements.push(relativeLS); + lightSources.put(propChoice, propLightSources); + _updateLighting(); + cc(); + }; + }; + }); + }; + }; + }); + }; + }; + }; + shortcutHandler.registerItem("[c]onnect [l]ight source to [p]rop", connectLightSourceToProp); + function connectLightSourceToActor(cc) return { + if (Prelude.truthy(doingSomething)) { + return; + } else null; + doingSomething = true; + lastCommand = connectLightSourceToActor; + { + final arr = lightSources.get(sceneKey); final stringArr = [for (ls in arr) { + ls.stringify(); + }]; final stringMap = [for (_gctfdsyJgSHjT9R1v2SzgU in (Prelude.zipThrow(stringArr, arr) : Array>)) { + final _xKYcWGW3U7XzKowTtvbHr = _gctfdsyJgSHjT9R1v2SzgU; final key = _xKYcWGW3U7XzKowTtvbHr[0]; final ls = _xKYcWGW3U7XzKowTtvbHr[1]; + { + key => ls; + }; + }]; + { + director.chooseString("Connect which light source?", withCancel(stringArr), function(choice) return { + if (Prelude.truthy(Prelude.areEqual(choice, CANCEL_COMMAND))) cc() else { + final ls = stringMap[choice]; final actorArr = [for (elem in _currentScene().characters.keys()) { + elem; + }]; + { + director.chooseString("Connect to which actor?", withCancel(actorArr), function(actorChoice) return { + if (Prelude.truthy(Prelude.areEqual(actorChoice, CANCEL_COMMAND))) cc() else { + final character = _currentScene().characters[actorChoice]; final relativeLS = director.offsetLightSource(ls, opposite(character.stagePosition)); final actorLightSources = lightSources.get(actorChoice); + { + arr.elements.remove(ls); + lightSources.put(sceneKey, arr); + actorLightSources.elements.push(relativeLS); + lightSources.put(actorChoice, actorLightSources); + _updateLighting(); + cc(); + }; + }; + }); + }; + }; + }); + }; + }; + }; + shortcutHandler.registerItem("[c]onnect [l]ight source to [a]ctor", connectLightSourceToActor); + }; }; }; } @@ -1448,30 +1904,30 @@ class Movie otherCharacter in _currentScene().characters) { if (Prelude.truthy({ - final _onwakoJfPMKR7wjuFJBvZn:Dynamic = Prelude.areEqual(position.x, otherCharacter.stagePosition.x); + final _cqV8FcE33ZueFFA7ZhrHuc:Dynamic = Prelude.areEqual(position.x, otherCharacter.stagePosition.x); { - if (Prelude.truthy(_onwakoJfPMKR7wjuFJBvZn)) { - final _hBabos65ovVtfroA4EHEL7:Dynamic = Prelude.areEqual(position.y, otherCharacter.stagePosition.y); + if (Prelude.truthy(_cqV8FcE33ZueFFA7ZhrHuc)) { + final _xeBfdvqGTYVYrKL8LzeLxu:Dynamic = Prelude.areEqual(position.y, otherCharacter.stagePosition.y); { - if (Prelude.truthy(_hBabos65ovVtfroA4EHEL7)) { - final _wEp9yxNgdyvNgHvJnMeWEY:Dynamic = Prelude.areEqual(position.z, otherCharacter.stagePosition.z); + if (Prelude.truthy(_xeBfdvqGTYVYrKL8LzeLxu)) { + final _t4HJGyMSdDixytdGM18ufB:Dynamic = Prelude.areEqual(position.z, otherCharacter.stagePosition.z); { - _wEp9yxNgdyvNgHvJnMeWEY; + _t4HJGyMSdDixytdGM18ufB; }; - } else _hBabos65ovVtfroA4EHEL7; + } else _xeBfdvqGTYVYrKL8LzeLxu; }; - } else _onwakoJfPMKR7wjuFJBvZn; + } else _cqV8FcE33ZueFFA7ZhrHuc; }; })) { moveCharacter(name, new StagePosition(position.x, position.y, Prelude.add(otherCharacter.stagePosition.z, zPerLayer)), otherCharacter.stageFacing, cc); @@ -2499,12 +2955,12 @@ class Movie(); final headingIndices = new Map(); final headingData = new Map>>(); { { - for (_pa3tL46QtbNV9zkLNXQxdf in Prelude.enumerate(creditsData)) { - final _3mVsa5reQhbJgzQ1yi9fWn = _pa3tL46QtbNV9zkLNXQxdf; final idx = _3mVsa5reQhbJgzQ1yi9fWn[0]; final data = _3mVsa5reQhbJgzQ1yi9fWn[1]; + for (_pBeJggeso7ZWGicsZfP5QJ in Prelude.enumerate(creditsData)) { + final _cw2j3gWohqrEdPLanUXnTC = _pBeJggeso7ZWGicsZfP5QJ; final idx = _cw2j3gWohqrEdPLanUXnTC[0]; final data = _cw2j3gWohqrEdPLanUXnTC[1]; { switch data { - case _baPMWxer7Gedp9wktUBQ9j if (Prelude.truthy(Prelude.isNull(_baPMWxer7Gedp9wktUBQ9j))):{ + case _uqsc8DuoavDkWMnPJxT2w6 if (Prelude.truthy(Prelude.isNull(_uqsc8DuoavDkWMnPJxT2w6))):{ { }; }; case [heading] | [heading, ""]:{ @@ -2590,22 +3046,22 @@ class Moviecc (unless doingSomething (set doingSomething true)