From d156a8fb8e87f3607cb3819aa7815a4cc6e2e98a Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 23 Feb 2022 01:26:48 +0000 Subject: [PATCH] chore(release): 20.1.0 [skip ci] # [20.1.0](https://github.com/seleb/bitsy-hacks/compare/v20.0.0...v20.1.0) (2022-02-23) ### Features * **javascript dialog:** evaluated javascript value returned to bitsy ([7fa4524](https://github.com/seleb/bitsy-hacks/commit/7fa45241900261d87d2d21ca3e28fb581a012cc5)) * dialog tag returned values are returned to bitsy too ([3c701c4](https://github.com/seleb/bitsy-hacks/commit/3c701c4d4da0def8d6ad2c8a8aa5b22752e0b068)) --- CHANGELOG.md | 8 +++++++ dist/avatar-by-room.js | 6 ++--- dist/backdrops.js | 8 +++---- dist/basic-sfx.js | 6 ++--- dist/bitsymuse.js | 10 ++++---- dist/canvas-replacement.js | 6 +++-- dist/character-portraits-animated.js | 6 ++--- dist/character-portraits.js | 4 ++-- dist/close-on-ending.js | 4 ++-- dist/corrupt.js | 8 +++---- dist/custom-exit-effects.js | 4 ++-- dist/custom-keyhandlers.js | 4 ++-- dist/custom-text-effect.js | 4 ++-- dist/dialog-audio-vocal-synth.js | 8 +++---- dist/dialog-audio.js | 4 ++-- dist/dialog-box-transition.js | 4 ++-- dist/dialog-choices.js | 12 +++++----- dist/dialog-jump.js | 8 +++---- dist/dialog-pause.js | 4 ++-- dist/dialog-prompt.js | 6 ++--- dist/direction-in-dialog.js | 4 ++-- dist/directional-avatar.js | 8 +++---- dist/dynamic-background.js | 6 ++--- dist/edit-dialog-from-dialog.js | 6 ++--- dist/edit-image-from-dialog.js | 12 +++++----- dist/edit-player-from-dialog.js | 10 ++++---- dist/edit-room-from-dialog.js | 10 ++++---- dist/end-from-dialog.js | 8 +++---- dist/exit-from-dialog.js | 10 ++++---- dist/external-game-data.js | 4 ++-- dist/favicon-from-sprite.js | 6 ++--- dist/follower.js | 10 ++++---- dist/gamepad-input.js | 4 ++-- dist/gravity.js | 12 +++++----- dist/itsy-bitsy.js | 4 ++-- dist/javascript-dialog.js | 25 ++++++++++++++++---- dist/logic-operators-extended.js | 4 ++-- dist/long-dialog.js | 10 ++++---- dist/multi-sprite-avatar.js | 6 ++--- dist/noclip.js | 6 ++--- dist/online.js | 35 ++++++++++++++++++++-------- dist/opaque-tiles.js | 4 ++-- dist/paragraph-break.js | 4 ++-- dist/permanent-items.js | 4 ++-- dist/push-sprites.js | 8 +++---- dist/replace-drawing.js | 4 ++-- dist/save.js | 10 ++++---- dist/smooth-moves.js | 4 ++-- dist/solid-items.js | 4 ++-- dist/sprite-effects.js | 10 ++++---- dist/stopwatch.js | 10 ++++---- dist/text-to-speech.js | 8 +++---- dist/tracery-processing.js | 4 ++-- dist/transitions.js | 8 ++++--- dist/transparent-background.js | 6 ++--- dist/transparent-dialog.js | 4 ++-- dist/transparent-sprites.js | 4 ++-- dist/twine-bitsy-comms.js | 8 +++---- dist/unique-items.js | 4 ++-- package-lock.json | 2 +- package.json | 2 +- 61 files changed, 239 insertions(+), 197 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86679ebe..10fd3383 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# [20.1.0](https://github.com/seleb/bitsy-hacks/compare/v20.0.0...v20.1.0) (2022-02-23) + + +### Features + +* **javascript dialog:** evaluated javascript value returned to bitsy ([7fa4524](https://github.com/seleb/bitsy-hacks/commit/7fa45241900261d87d2d21ca3e28fb581a012cc5)) +* dialog tag returned values are returned to bitsy too ([3c701c4](https://github.com/seleb/bitsy-hacks/commit/3c701c4d4da0def8d6ad2c8a8aa5b22752e0b068)) + # [20.0.0](https://github.com/seleb/bitsy-hacks/compare/v19.2.7...v20.0.0) (2022-01-29) diff --git a/dist/avatar-by-room.js b/dist/avatar-by-room.js index 83201330..6297c750 100644 --- a/dist/avatar-by-room.js +++ b/dist/avatar-by-room.js @@ -4,7 +4,7 @@ @summary change the avatar in certain rooms @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -174,7 +174,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -241,7 +241,7 @@ var after = kitsy.after; @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/backdrops.js b/dist/backdrops.js index 5cb53ec7..b259cc53 100644 --- a/dist/backdrops.js +++ b/dist/backdrops.js @@ -4,7 +4,7 @@ @summary makes the game have a backdrop @license MIT @author Cephalopodunk & Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -181,7 +181,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -250,7 +250,7 @@ var after = kitsy.after; @summary makes all sprites have transparent backgrounds @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -302,7 +302,7 @@ after('renderPixelInstruction', function (bufferId, buffer, paletteIndex, x, y) @summary makes the game have a transparent background @license MIT @author Cephalopodunk & Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 diff --git a/dist/basic-sfx.js b/dist/basic-sfx.js index 0805e3ec..71c2498c 100644 --- a/dist/basic-sfx.js +++ b/dist/basic-sfx.js @@ -4,7 +4,7 @@ @summary "walk" and "talk" sound effect support @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -172,7 +172,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -239,7 +239,7 @@ var after = kitsy.after; @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/bitsymuse.js b/dist/bitsymuse.js index 127659a4..c612a6a2 100644 --- a/dist/bitsymuse.js +++ b/dist/bitsymuse.js @@ -4,7 +4,7 @@ @summary A variety of Bitsy sound and music handlers @license MIT @author David Mowatt -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -206,7 +206,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -361,8 +361,8 @@ function addDeferredDialogTag(tag, fn) { */ function addDualDialogTag(tag, fn) { addDialogTag(tag + 'Now', function (environment, parameters, onReturn) { - fn(environment, parameters); - onReturn(null); + var result = fn(environment, parameters); + onReturn(result === undefined ? null : result); }); addDeferredDialogTag(tag, fn); } @@ -371,7 +371,7 @@ function addDualDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/canvas-replacement.js b/dist/canvas-replacement.js index b7ddf424..951fe9e5 100644 --- a/dist/canvas-replacement.js +++ b/dist/canvas-replacement.js @@ -4,7 +4,7 @@ @summary WebGLazy bitsy integration (this one's mostly just for me) @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -39,6 +39,8 @@ void main(){ `, }, }; + +See https://github.com/seleb/WebGLazy#configuration for more options */ this.hacks = this.hacks || {}; (function (exports, bitsy) { @@ -201,7 +203,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/character-portraits-animated.js b/dist/character-portraits-animated.js index df938ddd..7673e555 100644 --- a/dist/character-portraits-animated.js +++ b/dist/character-portraits-animated.js @@ -4,7 +4,7 @@ @summary high quality anime gifs @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -971,7 +971,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -1088,7 +1088,7 @@ function addDialogTag(tag, fn) { @summary high quality anime jpegs (or pngs i guess) @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 diff --git a/dist/character-portraits.js b/dist/character-portraits.js index 6faf5298..aff3d0fd 100644 --- a/dist/character-portraits.js +++ b/dist/character-portraits.js @@ -4,7 +4,7 @@ @summary high quality anime jpegs (or pngs i guess) @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -200,7 +200,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/close-on-ending.js b/dist/close-on-ending.js index 727037d3..8384f1c1 100644 --- a/dist/close-on-ending.js +++ b/dist/close-on-ending.js @@ -4,7 +4,7 @@ @summary Prevents from playing past an ending @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -163,7 +163,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/corrupt.js b/dist/corrupt.js index 2c442b1e..7249c330 100644 --- a/dist/corrupt.js +++ b/dist/corrupt.js @@ -4,7 +4,7 @@ @summary corrupts gamedata at runtime @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -60,7 +60,7 @@ bitsy = bitsy || /*#__PURE__*/_interopDefaultLegacy(bitsy); @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -122,7 +122,7 @@ function getImage(name, map) { @file edit image at runtime @summary API for updating image data at runtime. @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @description @@ -340,7 +340,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/custom-exit-effects.js b/dist/custom-exit-effects.js index a7a8f0f6..8d870a43 100644 --- a/dist/custom-exit-effects.js +++ b/dist/custom-exit-effects.js @@ -4,7 +4,7 @@ @summary make custom exit transition effects @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -199,7 +199,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/custom-keyhandlers.js b/dist/custom-keyhandlers.js index 80003f91..b349bbea 100644 --- a/dist/custom-keyhandlers.js +++ b/dist/custom-keyhandlers.js @@ -4,7 +4,7 @@ @summary run custom code on key inputs @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -188,7 +188,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/custom-text-effect.js b/dist/custom-text-effect.js index 77bee642..bf172610 100644 --- a/dist/custom-text-effect.js +++ b/dist/custom-text-effect.js @@ -4,7 +4,7 @@ @summary make {custom}text effects{custom} @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -351,7 +351,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/dialog-audio-vocal-synth.js b/dist/dialog-audio-vocal-synth.js index de882231..0ad2ae9b 100644 --- a/dist/dialog-audio-vocal-synth.js +++ b/dist/dialog-audio-vocal-synth.js @@ -4,7 +4,7 @@ @summary animal crossing-style audio powered by the pink trombone vocal synth @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -884,7 +884,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -1001,7 +1001,7 @@ function addDialogTag(tag, fn) { @summary animal crossing-style audio @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -1058,7 +1058,7 @@ before('dialogBuffer.DoNextChar', function () { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/dialog-audio.js b/dist/dialog-audio.js index b4fa6448..e4ddd4b9 100644 --- a/dist/dialog-audio.js +++ b/dist/dialog-audio.js @@ -4,7 +4,7 @@ @summary animal crossing-style audio @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -190,7 +190,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/dialog-box-transition.js b/dist/dialog-box-transition.js index 9d1cc140..cadf11a3 100644 --- a/dist/dialog-box-transition.js +++ b/dist/dialog-box-transition.js @@ -4,7 +4,7 @@ @summary adds an easing transition animation to display the dialog box text @license MIT @author Delacannon -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -160,7 +160,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/dialog-choices.js b/dist/dialog-choices.js index 2b89c929..19af8756 100644 --- a/dist/dialog-choices.js +++ b/dist/dialog-choices.js @@ -4,7 +4,7 @@ @summary dialog choices @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -241,7 +241,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -396,8 +396,8 @@ function addDeferredDialogTag(tag, fn) { */ function addDualDialogTag(tag, fn) { addDialogTag(tag + 'Now', function (environment, parameters, onReturn) { - fn(environment, parameters); - onReturn(null); + var result = fn(environment, parameters); + onReturn(result === undefined ? null : result); }); addDeferredDialogTag(tag, fn); } @@ -415,7 +415,7 @@ inject(/(this\.AddLinebreak = )/, 'this.AddParagraphBreak = function() { buffer. @summary Adds paragraph breaks to the dialogue parser @license WTFPL (do WTF you want) @author Sean S. LeBlanc, David Mowatt -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -459,7 +459,7 @@ addDialogTag('p', function (environment, parameters, onReturn) { @summary put more words onscreen @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 diff --git a/dist/dialog-jump.js b/dist/dialog-jump.js index 68b664d4..59e92144 100644 --- a/dist/dialog-jump.js +++ b/dist/dialog-jump.js @@ -4,7 +4,7 @@ @summary jump from one dialog entry to another @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -174,7 +174,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -329,8 +329,8 @@ function addDeferredDialogTag(tag, fn) { */ function addDualDialogTag(tag, fn) { addDialogTag(tag + 'Now', function (environment, parameters, onReturn) { - fn(environment, parameters); - onReturn(null); + var result = fn(environment, parameters); + onReturn(result === undefined ? null : result); }); addDeferredDialogTag(tag, fn); } diff --git a/dist/dialog-pause.js b/dist/dialog-pause.js index adfaf1e5..65efb3e5 100644 --- a/dist/dialog-pause.js +++ b/dist/dialog-pause.js @@ -4,7 +4,7 @@ @summary add pauses in between printing text @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -160,7 +160,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/dialog-prompt.js b/dist/dialog-prompt.js index c21388f8..9066b884 100644 --- a/dist/dialog-prompt.js +++ b/dist/dialog-prompt.js @@ -4,7 +4,7 @@ @summary prompt the user for text input in dialog @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -197,7 +197,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -321,7 +321,7 @@ inject(/(this\.AddLinebreak = )/, 'this.AddParagraphBreak = function() { buffer. @summary Adds paragraph breaks to the dialogue parser @license WTFPL (do WTF you want) @author Sean S. LeBlanc, David Mowatt -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 diff --git a/dist/direction-in-dialog.js b/dist/direction-in-dialog.js index 2d2cda94..63b62d55 100644 --- a/dist/direction-in-dialog.js +++ b/dist/direction-in-dialog.js @@ -4,7 +4,7 @@ @summary provides a variable with player direction @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -166,7 +166,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/directional-avatar.js b/dist/directional-avatar.js index 16c68e0e..b618999d 100644 --- a/dist/directional-avatar.js +++ b/dist/directional-avatar.js @@ -4,7 +4,7 @@ @summary flips the player's sprite based on directional movement @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -41,7 +41,7 @@ bitsy = bitsy || /*#__PURE__*/_interopDefaultLegacy(bitsy); @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -103,7 +103,7 @@ function getImage(name, map) { @file edit image at runtime @summary API for updating image data at runtime. @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @description @@ -305,7 +305,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/dynamic-background.js b/dist/dynamic-background.js index 9a45efc8..39d74439 100644 --- a/dist/dynamic-background.js +++ b/dist/dynamic-background.js @@ -4,7 +4,7 @@ @summary HTML background matching bitsy background @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -170,7 +170,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -237,7 +237,7 @@ var after = kitsy.after; @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/edit-dialog-from-dialog.js b/dist/edit-dialog-from-dialog.js index f53fd4e4..d56ae1ba 100644 --- a/dist/edit-dialog-from-dialog.js +++ b/dist/edit-dialog-from-dialog.js @@ -4,7 +4,7 @@ @summary edit dialog from dialog (yes really) @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -169,7 +169,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -296,7 +296,7 @@ function addDeferredDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/edit-image-from-dialog.js b/dist/edit-image-from-dialog.js index ca7dc0b1..8813ee03 100644 --- a/dist/edit-image-from-dialog.js +++ b/dist/edit-image-from-dialog.js @@ -4,7 +4,7 @@ @summary edit sprites, items, and tiles from dialog @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -67,7 +67,7 @@ bitsy = bitsy || /*#__PURE__*/_interopDefaultLegacy(bitsy); @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -129,7 +129,7 @@ function getImage(name, map) { @file edit image at runtime @summary API for updating image data at runtime. @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @description @@ -323,7 +323,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -478,8 +478,8 @@ function addDeferredDialogTag(tag, fn) { */ function addDualDialogTag(tag, fn) { addDialogTag(tag + 'Now', function (environment, parameters, onReturn) { - fn(environment, parameters); - onReturn(null); + var result = fn(environment, parameters); + onReturn(result === undefined ? null : result); }); addDeferredDialogTag(tag, fn); } diff --git a/dist/edit-player-from-dialog.js b/dist/edit-player-from-dialog.js index bdc7b893..b13fac05 100644 --- a/dist/edit-player-from-dialog.js +++ b/dist/edit-player-from-dialog.js @@ -4,7 +4,7 @@ @summary change which sprite is controlled by the player @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -171,7 +171,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -326,8 +326,8 @@ function addDeferredDialogTag(tag, fn) { */ function addDualDialogTag(tag, fn) { addDialogTag(tag + 'Now', function (environment, parameters, onReturn) { - fn(environment, parameters); - onReturn(null); + var result = fn(environment, parameters); + onReturn(result === undefined ? null : result); }); addDeferredDialogTag(tag, fn); } @@ -336,7 +336,7 @@ function addDualDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/edit-room-from-dialog.js b/dist/edit-room-from-dialog.js index df486a46..5b5f7625 100644 --- a/dist/edit-room-from-dialog.js +++ b/dist/edit-room-from-dialog.js @@ -4,7 +4,7 @@ @summary modify the content of a room from dialog @license MIT @author Dana Holdampf -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -290,7 +290,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -445,8 +445,8 @@ function addDeferredDialogTag(tag, fn) { */ function addDualDialogTag(tag, fn) { addDialogTag(tag + 'Now', function (environment, parameters, onReturn) { - fn(environment, parameters); - onReturn(null); + var result = fn(environment, parameters); + onReturn(result === undefined ? null : result); }); addDeferredDialogTag(tag, fn); } @@ -455,7 +455,7 @@ function addDualDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/end-from-dialog.js b/dist/end-from-dialog.js index be03c497..508d9136 100644 --- a/dist/end-from-dialog.js +++ b/dist/end-from-dialog.js @@ -4,7 +4,7 @@ @summary trigger an ending from dialog, including narration text @license WTFPL (do WTF you want) @author @mildmojo -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -194,7 +194,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -349,8 +349,8 @@ function addDeferredDialogTag(tag, fn) { */ function addDualDialogTag(tag, fn) { addDialogTag(tag + 'Now', function (environment, parameters, onReturn) { - fn(environment, parameters); - onReturn(null); + var result = fn(environment, parameters); + onReturn(result === undefined ? null : result); }); addDeferredDialogTag(tag, fn); } diff --git a/dist/exit-from-dialog.js b/dist/exit-from-dialog.js index 17831b84..5af13981 100644 --- a/dist/exit-from-dialog.js +++ b/dist/exit-from-dialog.js @@ -4,7 +4,7 @@ @summary exit to another room from dialog, including conditionals @license WTFPL (do WTF you want) @author @mildmojo -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -194,7 +194,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -349,8 +349,8 @@ function addDeferredDialogTag(tag, fn) { */ function addDualDialogTag(tag, fn) { addDialogTag(tag + 'Now', function (environment, parameters, onReturn) { - fn(environment, parameters); - onReturn(null); + var result = fn(environment, parameters); + onReturn(result === undefined ? null : result); }); addDeferredDialogTag(tag, fn); } @@ -359,7 +359,7 @@ function addDualDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/external-game-data.js b/dist/external-game-data.js index 6461ccc8..988d6e89 100644 --- a/dist/external-game-data.js +++ b/dist/external-game-data.js @@ -4,7 +4,7 @@ @summary separate Bitsy game data from your (modded) HTML for easier development @license WTFPL (do WTF you want) @author @mildmojo -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -182,7 +182,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/favicon-from-sprite.js b/dist/favicon-from-sprite.js index c6193410..4bdf64b0 100644 --- a/dist/favicon-from-sprite.js +++ b/dist/favicon-from-sprite.js @@ -4,7 +4,7 @@ @summary generate a browser favicon (tab icon) from a Bitsy sprite, including animation! @license WTFPL (do WTF you want) @author @mildmojo -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -170,7 +170,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -237,7 +237,7 @@ var after = kitsy.after; @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/follower.js b/dist/follower.js index 2120c85e..fee00c3c 100644 --- a/dist/follower.js +++ b/dist/follower.js @@ -4,7 +4,7 @@ @summary make sprites follow the player @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -193,7 +193,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -348,8 +348,8 @@ function addDeferredDialogTag(tag, fn) { */ function addDualDialogTag(tag, fn) { addDialogTag(tag + 'Now', function (environment, parameters, onReturn) { - fn(environment, parameters); - onReturn(null); + var result = fn(environment, parameters); + onReturn(result === undefined ? null : result); }); addDeferredDialogTag(tag, fn); } @@ -358,7 +358,7 @@ function addDualDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/gamepad-input.js b/dist/gamepad-input.js index c59c7fc5..1a250c1e 100644 --- a/dist/gamepad-input.js +++ b/dist/gamepad-input.js @@ -4,7 +4,7 @@ @summary HTML5 gamepad support @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -489,7 +489,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/gravity.js b/dist/gravity.js index 13e6ddb0..da717519 100644 --- a/dist/gravity.js +++ b/dist/gravity.js @@ -4,7 +4,7 @@ @summary Pseudo-platforming/gravity/physics @license MIT @author Cole Sea -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -122,7 +122,7 @@ bitsy = bitsy || /*#__PURE__*/_interopDefaultLegacy(bitsy); @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -184,7 +184,7 @@ function getImage(name, map) { @file edit image at runtime @summary API for updating image data at runtime. @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @description @@ -386,7 +386,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -541,8 +541,8 @@ function addDeferredDialogTag(tag, fn) { */ function addDualDialogTag(tag, fn) { addDialogTag(tag + 'Now', function (environment, parameters, onReturn) { - fn(environment, parameters); - onReturn(null); + var result = fn(environment, parameters); + onReturn(result === undefined ? null : result); }); addDeferredDialogTag(tag, fn); } diff --git a/dist/itsy-bitsy.js b/dist/itsy-bitsy.js index ee38ccc8..9e41befc 100644 --- a/dist/itsy-bitsy.js +++ b/dist/itsy-bitsy.js @@ -4,7 +4,7 @@ @summary for when bitsy's not small enough @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -171,7 +171,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/javascript-dialog.js b/dist/javascript-dialog.js index 801b0bf7..ab3239f0 100644 --- a/dist/javascript-dialog.js +++ b/dist/javascript-dialog.js @@ -4,7 +4,7 @@ @summary execute arbitrary javascript from dialog @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -20,13 +20,28 @@ Usage: Examples: move a sprite: (js "sprite['a'].x = 10;") + edit palette colour: (js "getPal(curPal())[0] = [255,0,0];renderer.ClearCache();") + place an item next to player: (js "room[curRoom].items.push({id:'0',x:player().x+1,y:player().y});") + verbose facsimile of exit-from-dialog: (js "var _onExitDialog=onExitDialog;onExitDialog=function(){player().room=curRoom='3';_onExitDialog.apply(this,arguments);onExitDialog=_onExitDialog;};") + reading a bitsy variable + (js "console.log(scriptInterpreter.GetVariable('variable_name'))") + + writing a bitsy variable + (js "scriptInterpreter.SetVariable('variable_name', 'variable_value')") + +When using the "jsNow" version, the result of the evaluated JS will be returned to the Bitsy script. +This allows it to be used as part of larger expressions, e.g. + + {x = 10 * (jsNow "Math.random()")} + + HOW TO USE: 1. Copy-paste into a script tag after the bitsy source 2. Add (js "") to your dialog as needed @@ -181,7 +196,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -336,8 +351,8 @@ function addDeferredDialogTag(tag, fn) { */ function addDualDialogTag(tag, fn) { addDialogTag(tag + 'Now', function (environment, parameters, onReturn) { - fn(environment, parameters); - onReturn(null); + var result = fn(environment, parameters); + onReturn(result === undefined ? null : result); }); addDeferredDialogTag(tag, fn); } @@ -348,7 +363,7 @@ function addDualDialogTag(tag, fn) { var indirectEval = eval; function executeJs(environment, parameters) { - indirectEval(parameters[0]); + return indirectEval(parameters[0]); } addDualDialogTag('js', executeJs); diff --git a/dist/logic-operators-extended.js b/dist/logic-operators-extended.js index ca504316..f08c4a51 100644 --- a/dist/logic-operators-extended.js +++ b/dist/logic-operators-extended.js @@ -3,7 +3,7 @@ @file logic-operators-extended @summary adds conditional logic operators @author @mildmojo -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -168,7 +168,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/long-dialog.js b/dist/long-dialog.js index cfbaa667..3d9ef9de 100644 --- a/dist/long-dialog.js +++ b/dist/long-dialog.js @@ -4,7 +4,7 @@ @summary put more words onscreen @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -184,7 +184,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -339,8 +339,8 @@ function addDeferredDialogTag(tag, fn) { */ function addDualDialogTag(tag, fn) { addDialogTag(tag + 'Now', function (environment, parameters, onReturn) { - fn(environment, parameters); - onReturn(null); + var result = fn(environment, parameters); + onReturn(result === undefined ? null : result); }); addDeferredDialogTag(tag, fn); } @@ -358,7 +358,7 @@ inject(/(this\.AddLinebreak = )/, 'this.AddParagraphBreak = function() { buffer. @summary Adds paragraph breaks to the dialogue parser @license WTFPL (do WTF you want) @author Sean S. LeBlanc, David Mowatt -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 diff --git a/dist/multi-sprite-avatar.js b/dist/multi-sprite-avatar.js index 677c6f88..1a87146c 100644 --- a/dist/multi-sprite-avatar.js +++ b/dist/multi-sprite-avatar.js @@ -4,7 +4,7 @@ @summary make the player big @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -193,7 +193,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -260,7 +260,7 @@ var after = kitsy.after; @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/noclip.js b/dist/noclip.js index 918ef56a..e0590254 100644 --- a/dist/noclip.js +++ b/dist/noclip.js @@ -4,7 +4,7 @@ @summary walk through wall tiles, sprites, items, exits, and endings @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -182,7 +182,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -251,7 +251,7 @@ var after = kitsy.after; @summary run custom code on key inputs @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 diff --git a/dist/online.js b/dist/online.js index 4b5afef5..8e446412 100644 --- a/dist/online.js +++ b/dist/online.js @@ -4,7 +4,7 @@ @summary multiplayer bitsy @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @description @@ -182,7 +182,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -337,8 +337,8 @@ function addDeferredDialogTag(tag, fn) { */ function addDualDialogTag(tag, fn) { addDialogTag(tag + 'Now', function (environment, parameters, onReturn) { - fn(environment, parameters); - onReturn(null); + var result = fn(environment, parameters); + onReturn(result === undefined ? null : result); }); addDeferredDialogTag(tag, fn); } @@ -347,7 +347,7 @@ function addDualDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -411,7 +411,7 @@ function getImage(name, map) { @summary edit dialog from dialog (yes really) @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -478,7 +478,7 @@ addDeferredDialogTag('dialog', editDialog); @file edit image at runtime @summary API for updating image data at runtime. @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @description @@ -547,7 +547,7 @@ function setSpriteData(id, frame, newData) { @summary edit sprites, items, and tiles from dialog @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -692,7 +692,7 @@ addDualDialogTag('imagePal', editPalette); @summary execute arbitrary javascript from dialog @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -708,13 +708,28 @@ Usage: Examples: move a sprite: (js "sprite['a'].x = 10;") + edit palette colour: (js "getPal(curPal())[0] = [255,0,0];renderer.ClearCache();") + place an item next to player: (js "room[curRoom].items.push({id:'0',x:player().x+1,y:player().y});") + verbose facsimile of exit-from-dialog: (js "var _onExitDialog=onExitDialog;onExitDialog=function(){player().room=curRoom='3';_onExitDialog.apply(this,arguments);onExitDialog=_onExitDialog;};") + reading a bitsy variable + (js "console.log(scriptInterpreter.GetVariable('variable_name'))") + + writing a bitsy variable + (js "scriptInterpreter.SetVariable('variable_name', 'variable_value')") + +When using the "jsNow" version, the result of the evaluated JS will be returned to the Bitsy script. +This allows it to be used as part of larger expressions, e.g. + + {x = 10 * (jsNow "Math.random()")} + + HOW TO USE: 1. Copy-paste into a script tag after the bitsy source 2. Add (js "") to your dialog as needed @@ -732,7 +747,7 @@ NOTE: This uses parentheses "()" instead of curly braces "{}" around function var indirectEval = eval; function executeJs(environment, parameters) { - indirectEval(parameters[0]); + return indirectEval(parameters[0]); } addDualDialogTag('js', executeJs); diff --git a/dist/opaque-tiles.js b/dist/opaque-tiles.js index eb6c622d..cf8a249c 100644 --- a/dist/opaque-tiles.js +++ b/dist/opaque-tiles.js @@ -4,7 +4,7 @@ @summary tiles which hide the player @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -169,7 +169,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/paragraph-break.js b/dist/paragraph-break.js index 91fad880..083d38fb 100644 --- a/dist/paragraph-break.js +++ b/dist/paragraph-break.js @@ -4,7 +4,7 @@ @summary Adds paragraph breaks to the dialogue parser @license WTFPL (do WTF you want) @author Sean S. LeBlanc, David Mowatt -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -176,7 +176,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/permanent-items.js b/dist/permanent-items.js index 62544ffb..897f1003 100644 --- a/dist/permanent-items.js +++ b/dist/permanent-items.js @@ -4,7 +4,7 @@ @summary prevent some items from being picked up @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -166,7 +166,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/push-sprites.js b/dist/push-sprites.js index da77c376..8dd77102 100644 --- a/dist/push-sprites.js +++ b/dist/push-sprites.js @@ -4,7 +4,7 @@ @summary sokoban-style sprite pushing @license MIT @author jan0sc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -198,7 +198,7 @@ bitsy = bitsy || /*#__PURE__*/_interopDefaultLegacy(bitsy); @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -260,7 +260,7 @@ function getImage(name, map) { @file edit image at runtime @summary API for updating image data at runtime. @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @description @@ -462,7 +462,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/replace-drawing.js b/dist/replace-drawing.js index 20dd6060..d3b3afc9 100644 --- a/dist/replace-drawing.js +++ b/dist/replace-drawing.js @@ -4,7 +4,7 @@ @summary add name-tags to replace drawings when the game is loading @license MIT @author Elkie Nova -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -177,7 +177,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/save.js b/dist/save.js index e0334cbf..6d66f548 100644 --- a/dist/save.js +++ b/dist/save.js @@ -4,7 +4,7 @@ @summary save/load your game @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -195,7 +195,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -350,8 +350,8 @@ function addDeferredDialogTag(tag, fn) { */ function addDualDialogTag(tag, fn) { addDialogTag(tag + 'Now', function (environment, parameters, onReturn) { - fn(environment, parameters); - onReturn(null); + var result = fn(environment, parameters); + onReturn(result === undefined ? null : result); }); addDeferredDialogTag(tag, fn); } @@ -360,7 +360,7 @@ function addDualDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/smooth-moves.js b/dist/smooth-moves.js index 928a2c71..502018b3 100644 --- a/dist/smooth-moves.js +++ b/dist/smooth-moves.js @@ -4,7 +4,7 @@ @summary ease the player's movement @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -170,7 +170,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/solid-items.js b/dist/solid-items.js index fd50e249..c786959c 100644 --- a/dist/solid-items.js +++ b/dist/solid-items.js @@ -4,7 +4,7 @@ @summary treat some items like sprites that can be placed multiple times @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -167,7 +167,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/sprite-effects.js b/dist/sprite-effects.js index eaa615da..0e2af1e1 100644 --- a/dist/sprite-effects.js +++ b/dist/sprite-effects.js @@ -4,7 +4,7 @@ @summary like text effects, but for sprites @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -215,7 +215,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -370,8 +370,8 @@ function addDeferredDialogTag(tag, fn) { */ function addDualDialogTag(tag, fn) { addDialogTag(tag + 'Now', function (environment, parameters, onReturn) { - fn(environment, parameters); - onReturn(null); + var result = fn(environment, parameters); + onReturn(result === undefined ? null : result); }); addDeferredDialogTag(tag, fn); } @@ -380,7 +380,7 @@ function addDualDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/stopwatch.js b/dist/stopwatch.js index a2964a7d..ff51e2cd 100644 --- a/dist/stopwatch.js +++ b/dist/stopwatch.js @@ -4,7 +4,7 @@ @summary time player actions @license MIT @author Lenny Magner -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -202,7 +202,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -357,8 +357,8 @@ function addDeferredDialogTag(tag, fn) { */ function addDualDialogTag(tag, fn) { addDialogTag(tag + 'Now', function (environment, parameters, onReturn) { - fn(environment, parameters); - onReturn(null); + var result = fn(environment, parameters); + onReturn(result === undefined ? null : result); }); addDeferredDialogTag(tag, fn); } @@ -367,7 +367,7 @@ function addDualDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/text-to-speech.js b/dist/text-to-speech.js index 85188df8..4f8e0361 100644 --- a/dist/text-to-speech.js +++ b/dist/text-to-speech.js @@ -4,7 +4,7 @@ @summary text-to-speech for bitsy dialog @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -192,7 +192,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -347,8 +347,8 @@ function addDeferredDialogTag(tag, fn) { */ function addDualDialogTag(tag, fn) { addDialogTag(tag + 'Now', function (environment, parameters, onReturn) { - fn(environment, parameters); - onReturn(null); + var result = fn(environment, parameters); + onReturn(result === undefined ? null : result); }); addDeferredDialogTag(tag, fn); } diff --git a/dist/tracery-processing.js b/dist/tracery-processing.js index 9f10368a..2c7d05e5 100644 --- a/dist/tracery-processing.js +++ b/dist/tracery-processing.js @@ -4,7 +4,7 @@ @summary process all dialog text with a tracery grammar @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -1036,7 +1036,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/transitions.js b/dist/transitions.js index e99eb3ef..e5ef7797 100644 --- a/dist/transitions.js +++ b/dist/transitions.js @@ -4,7 +4,7 @@ @summary customizable WebGL transitions @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -223,7 +223,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -292,7 +292,7 @@ var after = kitsy.after; @summary WebGLazy bitsy integration (this one's mostly just for me) @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -327,6 +327,8 @@ void main(){ `, }, }; + +See https://github.com/seleb/WebGLazy#configuration for more options */ var hackOptions$1 = { diff --git a/dist/transparent-background.js b/dist/transparent-background.js index 22ce6ea3..4029d87f 100644 --- a/dist/transparent-background.js +++ b/dist/transparent-background.js @@ -4,7 +4,7 @@ @summary makes the game have a transparent background @license MIT @author Cephalopodunk & Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -171,7 +171,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -240,7 +240,7 @@ var after = kitsy.after; @summary makes all sprites have transparent backgrounds @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 diff --git a/dist/transparent-dialog.js b/dist/transparent-dialog.js index 9fb807fd..1fc7cde0 100644 --- a/dist/transparent-dialog.js +++ b/dist/transparent-dialog.js @@ -4,7 +4,7 @@ @summary makes the dialog box have a transparent background @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -156,7 +156,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/transparent-sprites.js b/dist/transparent-sprites.js index 8522cfbd..7cc169d3 100644 --- a/dist/transparent-sprites.js +++ b/dist/transparent-sprites.js @@ -4,7 +4,7 @@ @summary makes all sprites have transparent backgrounds @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -167,7 +167,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/dist/twine-bitsy-comms.js b/dist/twine-bitsy-comms.js index cf9dd536..594ae3d1 100644 --- a/dist/twine-bitsy-comms.js +++ b/dist/twine-bitsy-comms.js @@ -4,7 +4,7 @@ @summary interprocess communication for twine and bitsy @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -238,7 +238,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ @@ -393,8 +393,8 @@ function addDeferredDialogTag(tag, fn) { */ function addDualDialogTag(tag, fn) { addDialogTag(tag + 'Now', function (environment, parameters, onReturn) { - fn(environment, parameters); - onReturn(null); + var result = fn(environment, parameters); + onReturn(result === undefined ? null : result); }); addDeferredDialogTag(tag, fn); } diff --git a/dist/unique-items.js b/dist/unique-items.js index 0633aba9..3607fd0e 100644 --- a/dist/unique-items.js +++ b/dist/unique-items.js @@ -4,7 +4,7 @@ @summary items which, when picked up, remove all other instances of that item from the game @license MIT @author Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 @@ -167,7 +167,7 @@ function applyHook(root, functionName) { @summary Monkey-patching toolkit to make it easier and cleaner to run code before and after functions or to inject new code into script tags @license WTFPL (do WTF you want) @author Original by mildmojo; modified by Sean S. LeBlanc -@version 20.0.0 +@version 20.1.0 @requires Bitsy 7.12 */ diff --git a/package-lock.json b/package-lock.json index 2a2c564b..18a1e5de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@bitsy/hecks", - "version": "20.0.0", + "version": "20.1.0", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 79027cdd..16646b29 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "hacks" ], "main": "index.mjs", - "version": "20.0.0", + "version": "20.1.0", "bitsyVersion": "7.12", "scripts": { "build": "rollup -c",