diff --git a/CHANGELOG.md b/CHANGELOG.md index b229702a..3da889cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [21.4.0](https://github.com/seleb/bitsy-hacks/compare/v21.3.0...v21.4.0) (2023-07-07) + + +### Features + +* update bitsy version to 8.6 ([e1ed1f7](https://github.com/seleb/bitsy-hacks/commit/e1ed1f75bc3bb6d0c82e316f6bb3a258224f4c79)) + # [21.3.0](https://github.com/seleb/bitsy-hacks/compare/v21.2.1...v21.3.0) (2023-01-21) diff --git a/README.md b/README.md index 40b4b611..80d57d44 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ npm i @bitsy/hecks A collection of re-usable scripts for [Adam Le Doux](https://twitter.com/adamledoux)'s [Bitsy Game Maker](https://ledoux.itch.io/bitsy). See [Ayolland's Borksy](https://ayolland.itch.io/borksy) for a GUI that allows you to use these hacks with less copy-pasting. -Last tested against Bitsy 8.4 +Last tested against Bitsy 8.6 - [Contents](#contents) - [How to use](#how-to-use) diff --git a/dist/avatar-by-room.js b/dist/avatar-by-room.js index c7257836..4887156f 100644 --- a/dist/avatar-by-room.js +++ b/dist/avatar-by-room.js @@ -4,8 +4,8 @@ @summary change the avatar in certain rooms @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -173,8 +173,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -236,11 +236,12 @@ var after = kitsy.after; @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /* Helper for getting image by name or id diff --git a/dist/backdrops.js b/dist/backdrops.js index 1f7688e7..435df77b 100644 --- a/dist/backdrops.js +++ b/dist/backdrops.js @@ -4,8 +4,8 @@ @summary makes the game have a backdrop @license MIT @author Cephalopodunk & Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -177,8 +177,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -242,8 +242,8 @@ var after = kitsy.after; @summary makes all sprites have transparent backgrounds (deprecated) @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -288,8 +288,8 @@ before('renderer.SetDrawings', function () { @summary makes the game have a transparent background @license MIT @author Cephalopodunk & Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description diff --git a/dist/basic-sfx.js b/dist/basic-sfx.js index 20c6797c..fc307918 100644 --- a/dist/basic-sfx.js +++ b/dist/basic-sfx.js @@ -4,8 +4,8 @@ @summary "walk" and "talk" sound effect support @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -168,8 +168,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -231,11 +231,12 @@ var after = kitsy.after; @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /** * @param {number} value number to clamp * @param {number} min minimum diff --git a/dist/bitsymuse.js b/dist/bitsymuse.js index 89bb7c35..301cc454 100644 --- a/dist/bitsymuse.js +++ b/dist/bitsymuse.js @@ -4,8 +4,8 @@ @summary A variety of Bitsy sound and music handlers @license MIT @author David Mowatt -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -202,8 +202,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -224,6 +224,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -261,17 +272,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -363,11 +363,12 @@ function addDualDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /** * Helper for getting room by name or id * @param {string} name id or name of room to return @@ -405,6 +406,7 @@ function createAudio(id, options) { + var audioElementsById = {}; var currentMusic; var roomMusicFlag = null; diff --git a/dist/canvas-replacement.js b/dist/canvas-replacement.js index 153d2e11..7b61e4e7 100644 --- a/dist/canvas-replacement.js +++ b/dist/canvas-replacement.js @@ -4,8 +4,8 @@ @summary WebGLazy bitsy integration (this one's mostly just for me) @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -199,8 +199,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { diff --git a/dist/character-portraits-animated.js b/dist/character-portraits-animated.js index 1cfb2f31..6a42e783 100644 --- a/dist/character-portraits-animated.js +++ b/dist/character-portraits-animated.js @@ -4,8 +4,8 @@ @summary high quality anime gifs @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -967,8 +967,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -989,6 +989,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -1026,17 +1037,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -1080,8 +1080,8 @@ function addDialogTag(tag, fn) { @summary high quality anime jpegs (or pngs i guess) @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description diff --git a/dist/character-portraits.js b/dist/character-portraits.js index 59d884d8..02cf6c45 100644 --- a/dist/character-portraits.js +++ b/dist/character-portraits.js @@ -4,8 +4,8 @@ @summary high quality anime jpegs (or pngs i guess) @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -196,8 +196,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -218,6 +218,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -255,17 +266,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { diff --git a/dist/close-on-ending.js b/dist/close-on-ending.js index 3ac3e9ce..9bcf9fc7 100644 --- a/dist/close-on-ending.js +++ b/dist/close-on-ending.js @@ -4,8 +4,8 @@ @summary Prevents from playing past an ending @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -159,8 +159,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { diff --git a/dist/corrupt.js b/dist/corrupt.js index b21bfcaf..ee6fcf09 100644 --- a/dist/corrupt.js +++ b/dist/corrupt.js @@ -4,8 +4,8 @@ @summary corrupts gamedata at runtime @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -56,11 +56,12 @@ var hackOptions = { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /* Helper for getting image by name or id @@ -83,8 +84,8 @@ function getImage(name, map) { @file edit image at runtime @summary API for updating image data at runtime. @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description Adds API for updating sprite, tile, and item data at runtime. @@ -291,8 +292,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { diff --git a/dist/custom-exit-effects.js b/dist/custom-exit-effects.js index 43843d6c..1a767e9e 100644 --- a/dist/custom-exit-effects.js +++ b/dist/custom-exit-effects.js @@ -4,8 +4,8 @@ @summary make custom exit transition effects @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -195,8 +195,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { diff --git a/dist/custom-text-effect.js b/dist/custom-text-effect.js index 1de44cad..2f09c138 100644 --- a/dist/custom-text-effect.js +++ b/dist/custom-text-effect.js @@ -4,8 +4,8 @@ @summary make {custom}text effects{custom} @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -349,8 +349,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { diff --git a/dist/dialog-audio-vocal-synth.js b/dist/dialog-audio-vocal-synth.js index dc98ed5f..c2385dc8 100644 --- a/dist/dialog-audio-vocal-synth.js +++ b/dist/dialog-audio-vocal-synth.js @@ -4,8 +4,8 @@ @summary animal crossing-style audio powered by the pink trombone vocal synth @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -880,8 +880,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -902,6 +902,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -939,17 +950,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -993,8 +993,8 @@ function addDialogTag(tag, fn) { @summary animal crossing-style audio @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -1050,11 +1050,12 @@ before('dialogBuffer.DoNextChar', function () { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /** * @param {number} value number to clamp * @param {number} min minimum diff --git a/dist/dialog-audio.js b/dist/dialog-audio.js index bbaa42b7..169eed76 100644 --- a/dist/dialog-audio.js +++ b/dist/dialog-audio.js @@ -4,8 +4,8 @@ @summary animal crossing-style audio @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -186,8 +186,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { diff --git a/dist/dialog-box-transition.js b/dist/dialog-box-transition.js index bb3614df..dc954eb1 100644 --- a/dist/dialog-box-transition.js +++ b/dist/dialog-box-transition.js @@ -4,8 +4,8 @@ @summary adds an easing transition animation to display the dialog box text @license MIT @author Delacannon -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -168,8 +168,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -231,6 +231,7 @@ var after = kitsy.after; + function lerp(from, to, by) { return from + (to - from) * by; } diff --git a/dist/dialog-choices.js b/dist/dialog-choices.js index 0e189f41..d34a8219 100644 --- a/dist/dialog-choices.js +++ b/dist/dialog-choices.js @@ -4,8 +4,8 @@ @summary dialog choices @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -236,8 +236,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -258,6 +258,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -295,17 +306,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -406,8 +406,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -437,6 +437,7 @@ NOTE: This uses parentheses "()" instead of curly braces "{}" around function code at the end of the editor's `bitsy.js` file. Untested. */ + // Adds the actual dialogue tag. No deferred version is required. addDialogTag('p', function (environment, parameters, onReturn) { environment.GetDialogBuffer().AddParagraphBreak(); @@ -450,8 +451,8 @@ addDialogTag('p', function (environment, parameters, onReturn) { @summary put more words onscreen @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description diff --git a/dist/dialog-jump.js b/dist/dialog-jump.js index cf4e6794..b2c764e1 100644 --- a/dist/dialog-jump.js +++ b/dist/dialog-jump.js @@ -4,8 +4,8 @@ @summary jump from one dialog entry to another @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -170,8 +170,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -192,6 +192,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -229,17 +240,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -329,6 +329,7 @@ function addDualDialogTag(tag, fn) { + // jump function function jump(targetDialog) { if (!targetDialog) { diff --git a/dist/dialog-pause.js b/dist/dialog-pause.js index bf647b8d..0d5373f1 100644 --- a/dist/dialog-pause.js +++ b/dist/dialog-pause.js @@ -4,8 +4,8 @@ @summary add pauses in between printing text @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -156,8 +156,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -178,6 +178,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -215,17 +226,6 @@ var before = kitsy.before; /** @see kitsy.after */ kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { diff --git a/dist/dialog-prompt.js b/dist/dialog-prompt.js index 6c79e8a7..bea96134 100644 --- a/dist/dialog-prompt.js +++ b/dist/dialog-prompt.js @@ -4,8 +4,8 @@ @summary prompt the user for text input in dialog @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -193,8 +193,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -215,6 +215,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -252,17 +263,6 @@ var before = kitsy.before; /** @see kitsy.after */ kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -313,8 +313,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -344,6 +344,7 @@ NOTE: This uses parentheses "()" instead of curly braces "{}" around function code at the end of the editor's `bitsy.js` file. Untested. */ + // Adds the actual dialogue tag. No deferred version is required. addDialogTag('p', function (environment, parameters, onReturn) { environment.GetDialogBuffer().AddParagraphBreak(); @@ -355,6 +356,7 @@ addDialogTag('p', function (environment, parameters, onReturn) { + var cachedBuffer; var prompted = false; diff --git a/dist/direction-in-dialog.js b/dist/direction-in-dialog.js index 93345c9e..5b703fcb 100644 --- a/dist/direction-in-dialog.js +++ b/dist/direction-in-dialog.js @@ -4,8 +4,8 @@ @summary provides a variable with player direction @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -162,8 +162,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { diff --git a/dist/directional-avatar.js b/dist/directional-avatar.js index c2f44ede..85a4367b 100644 --- a/dist/directional-avatar.js +++ b/dist/directional-avatar.js @@ -4,8 +4,8 @@ @summary flips the player's sprite based on directional movement @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -37,11 +37,12 @@ var hackOptions = { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /* Helper for getting image by name or id @@ -64,8 +65,8 @@ function getImage(name, map) { @file edit image at runtime @summary API for updating image data at runtime. @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description Adds API for updating sprite, tile, and item data at runtime. @@ -256,8 +257,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { diff --git a/dist/dynamic-background.js b/dist/dynamic-background.js index 493124c1..897a6d4d 100644 --- a/dist/dynamic-background.js +++ b/dist/dynamic-background.js @@ -4,8 +4,8 @@ @summary HTML background matching bitsy background @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -166,8 +166,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -229,11 +229,12 @@ var after = kitsy.after; @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /** * Helper for getting room by name or id * @param {string} name id or name of room to return diff --git a/dist/edit-dialog-from-dialog.js b/dist/edit-dialog-from-dialog.js index 3992dc1a..a582ffa3 100644 --- a/dist/edit-dialog-from-dialog.js +++ b/dist/edit-dialog-from-dialog.js @@ -4,8 +4,8 @@ @summary edit dialog from dialog (yes really) @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -165,8 +165,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -187,6 +187,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -224,17 +235,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -288,11 +288,12 @@ function addDeferredDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /* Helper for getting image by name or id diff --git a/dist/edit-image-from-dialog.js b/dist/edit-image-from-dialog.js index e34f804e..7cf910dc 100644 --- a/dist/edit-image-from-dialog.js +++ b/dist/edit-image-from-dialog.js @@ -4,8 +4,8 @@ @summary edit sprites, items, and tiles from dialog @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -63,11 +63,12 @@ NOTE: This uses parentheses "()" instead of curly braces "{}" around function @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /* Helper for getting image by name or id @@ -90,8 +91,8 @@ function getImage(name, map) { @file edit image at runtime @summary API for updating image data at runtime. @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description Adds API for updating sprite, tile, and item data at runtime. @@ -274,8 +275,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -296,6 +297,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -333,17 +345,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { diff --git a/dist/edit-player-from-dialog.js b/dist/edit-player-from-dialog.js index 23b2036d..5a3562c7 100644 --- a/dist/edit-player-from-dialog.js +++ b/dist/edit-player-from-dialog.js @@ -4,8 +4,8 @@ @summary change which sprite is controlled by the player @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -169,8 +169,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -191,6 +191,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -228,17 +239,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -330,11 +330,12 @@ function addDualDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /* Helper for getting image by name or id diff --git a/dist/edit-room-from-dialog.js b/dist/edit-room-from-dialog.js index df67decb..5940fe01 100644 --- a/dist/edit-room-from-dialog.js +++ b/dist/edit-room-from-dialog.js @@ -4,8 +4,8 @@ @summary modify the content of a room from dialog @license MIT @author Dana Holdampf -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -286,8 +286,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -308,6 +308,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -345,17 +356,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -447,11 +447,12 @@ function addDualDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /** * Helper for parsing parameters that may be relative to another value * e.g. @@ -484,6 +485,7 @@ function clamp(value, min, max) { + // Draws an Item, Sprite, or Tile at a location in a room // {draw "mapId, sourceId, xPos, yPos, roomID"} // {drawNow "mapId, sourceId, xPos, yPos, roomID"} diff --git a/dist/end-from-dialog.js b/dist/end-from-dialog.js index e69839f4..428afad8 100644 --- a/dist/end-from-dialog.js +++ b/dist/end-from-dialog.js @@ -4,8 +4,8 @@ @summary trigger an ending from dialog, including narration text (deprecated) @license WTFPL (do WTF you want) @author @mildmojo -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -190,8 +190,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -212,6 +212,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -249,17 +260,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -349,6 +349,7 @@ function addDualDialogTag(tag, fn) { + addDualDialogTag('end', function (environment, parameters) { // cleanup current dialog bitsy.dialogBuffer.EndDialog(); diff --git a/dist/exit-from-dialog.js b/dist/exit-from-dialog.js index e53f9a68..5790f752 100644 --- a/dist/exit-from-dialog.js +++ b/dist/exit-from-dialog.js @@ -4,8 +4,8 @@ @summary exit to another room from dialog, including conditionals @license WTFPL (do WTF you want) @author @mildmojo -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -190,8 +190,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -212,6 +212,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -249,17 +260,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -351,11 +351,12 @@ function addDualDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /** * Helper for getting room by name or id * @param {string} name id or name of room to return diff --git a/dist/external-game-data.js b/dist/external-game-data.js index 5d4992f1..ad21416f 100644 --- a/dist/external-game-data.js +++ b/dist/external-game-data.js @@ -4,8 +4,8 @@ @summary separate Bitsy game data from your (modded) HTML for easier development @license WTFPL (do WTF you want) @author @mildmojo -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -178,8 +178,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -239,6 +239,7 @@ kitsy.after; + var ERR_MISSING_IMPORT = 1; before('startExportedGame', function (done) { diff --git a/dist/favicon-from-sprite.js b/dist/favicon-from-sprite.js index 0ca745ee..c7f82d6e 100644 --- a/dist/favicon-from-sprite.js +++ b/dist/favicon-from-sprite.js @@ -4,8 +4,8 @@ @summary generate a browser favicon (tab icon) from a Bitsy sprite, including animation! @license WTFPL (do WTF you want) @author @mildmojo -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -166,8 +166,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -229,11 +229,12 @@ var after = kitsy.after; @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /* Helper for getting image by name or id @@ -254,6 +255,7 @@ function getImage(name, map) { + // CONFIGURATION FOR FAVICON // END CONFIG diff --git a/dist/follower.js b/dist/follower.js index 56557f9e..3a3560d7 100644 --- a/dist/follower.js +++ b/dist/follower.js @@ -4,8 +4,8 @@ @summary make sprites follow the player @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -189,8 +189,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -211,6 +211,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -248,17 +259,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -350,11 +350,12 @@ function addDualDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /* Helper for getting image by name or id diff --git a/dist/gamepad-input.js b/dist/gamepad-input.js index 9d8941b1..448b6033 100644 --- a/dist/gamepad-input.js +++ b/dist/gamepad-input.js @@ -4,8 +4,8 @@ @summary HTML5 gamepad support @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -485,8 +485,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { diff --git a/dist/gravity.js b/dist/gravity.js index 2d69632f..8fe4d785 100644 --- a/dist/gravity.js +++ b/dist/gravity.js @@ -4,8 +4,8 @@ @summary Pseudo-platforming/gravity/physics @license MIT @author Cole Sea -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -118,11 +118,12 @@ var hackOptions = { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /* Helper for getting image by name or id @@ -145,8 +146,8 @@ function getImage(name, map) { @file edit image at runtime @summary API for updating image data at runtime. @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description Adds API for updating sprite, tile, and item data at runtime. @@ -337,8 +338,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -359,6 +360,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -396,17 +408,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { diff --git a/dist/itsy-bitsy.js b/dist/itsy-bitsy.js index 8be9a273..9c93418f 100644 --- a/dist/itsy-bitsy.js +++ b/dist/itsy-bitsy.js @@ -4,8 +4,8 @@ @summary for when bitsy's not small enough @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -167,8 +167,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { diff --git a/dist/javascript-dialog.js b/dist/javascript-dialog.js index 7b00216e..d84c4597 100644 --- a/dist/javascript-dialog.js +++ b/dist/javascript-dialog.js @@ -4,8 +4,8 @@ @summary execute arbitrary javascript from dialog @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -192,8 +192,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -214,6 +214,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -251,17 +262,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -351,6 +351,7 @@ function addDualDialogTag(tag, fn) { + // eslint-disable-next-line no-eval var indirectEval = eval; diff --git a/dist/logic-operators-extended.js b/dist/logic-operators-extended.js index 23895016..3169f5e7 100644 --- a/dist/logic-operators-extended.js +++ b/dist/logic-operators-extended.js @@ -3,8 +3,8 @@ @file logic-operators-extended @summary adds conditional logic operators @author @mildmojo -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -164,8 +164,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -225,6 +225,7 @@ kitsy.after; + var operators = ['!==', '&&', '||', '%']; function expression(operator) { diff --git a/dist/long-dialog.js b/dist/long-dialog.js index 8538485a..24f10f55 100644 --- a/dist/long-dialog.js +++ b/dist/long-dialog.js @@ -4,8 +4,8 @@ @summary put more words onscreen @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -180,8 +180,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -202,6 +202,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -239,17 +250,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -350,8 +350,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -381,6 +381,7 @@ NOTE: This uses parentheses "()" instead of curly braces "{}" around function code at the end of the editor's `bitsy.js` file. Untested. */ + // Adds the actual dialogue tag. No deferred version is required. addDialogTag('p', function (environment, parameters, onReturn) { environment.GetDialogBuffer().AddParagraphBreak(); diff --git a/dist/multi-sprite-avatar.js b/dist/multi-sprite-avatar.js index 6cddc092..a03322b8 100644 --- a/dist/multi-sprite-avatar.js +++ b/dist/multi-sprite-avatar.js @@ -4,8 +4,8 @@ @summary make the player big @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -197,8 +197,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -219,6 +219,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -256,17 +267,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -358,11 +358,12 @@ function addDualDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /* Helper for getting image by name or id diff --git a/dist/online.js b/dist/online.js index ad663be1..c5f85386 100644 --- a/dist/online.js +++ b/dist/online.js @@ -4,8 +4,8 @@ @summary multiplayer bitsy @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description Provides the groundwork for running a small online multiplayer bitsy game. @@ -178,8 +178,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -200,6 +200,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -237,17 +248,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -339,11 +339,12 @@ function addDualDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /* Helper for getting image by name or id @@ -368,8 +369,8 @@ function getImage(name, map) { @summary edit dialog from dialog (yes really) @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -435,8 +436,8 @@ addDeferredDialogTag('dialog', editDialog); @file edit image at runtime @summary API for updating image data at runtime. @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description Adds API for updating sprite, tile, and item data at runtime. @@ -494,8 +495,8 @@ function setSpriteData(id, frame, newData) { @summary edit sprites, items, and tiles from dialog @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -641,8 +642,8 @@ addDualDialogTag('imagePal', editPalette); @summary execute arbitrary javascript from dialog @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -692,6 +693,7 @@ NOTE: This uses parentheses "()" instead of curly braces "{}" around function code at the end of the editor's `bitsy.js` file. Untested. */ + // eslint-disable-next-line no-eval var indirectEval = eval; diff --git a/dist/opaque-tiles.js b/dist/opaque-tiles.js index 16419493..e2d9db96 100644 --- a/dist/opaque-tiles.js +++ b/dist/opaque-tiles.js @@ -4,8 +4,8 @@ @summary tiles which hide the player @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -165,8 +165,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { diff --git a/dist/paragraph-break.js b/dist/paragraph-break.js index f120f766..d3f14336 100644 --- a/dist/paragraph-break.js +++ b/dist/paragraph-break.js @@ -4,8 +4,8 @@ @summary Adds paragraph breaks to the dialogue parser @license WTFPL (do WTF you want) @author Sean S. LeBlanc, David Mowatt -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -172,8 +172,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -194,6 +194,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -231,17 +242,6 @@ var before = kitsy.before; /** @see kitsy.after */ kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -288,6 +288,7 @@ inject(/(this\.AddLinebreak = )/, 'this.AddParagraphBreak = function() { buffer. + // Adds the actual dialogue tag. No deferred version is required. addDialogTag('p', function (environment, parameters, onReturn) { environment.GetDialogBuffer().AddParagraphBreak(); diff --git a/dist/permanent-items.js b/dist/permanent-items.js index f4856711..0507c710 100644 --- a/dist/permanent-items.js +++ b/dist/permanent-items.js @@ -4,8 +4,8 @@ @summary prevent some items from being picked up @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -162,8 +162,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { diff --git a/dist/push-sprites.js b/dist/push-sprites.js index 9d9d5340..82eb1554 100644 --- a/dist/push-sprites.js +++ b/dist/push-sprites.js @@ -1,37 +1,4 @@ -/** -➡ -@file push sprites -@summary sokoban-style sprite pushing -@license MIT -@author jan0sc -@version 21.3.0 -@requires Bitsy 8.4 - - -@description -Hack to make sprites pushable. - -HOW TO USE: -1. Copy-paste into a script tag after the bitsy source -2. Edit hackOptions below to specify the push logic, exit handling, target states and whether to flip drawings - -PUSH LOGIC: -functions to determine: - 1. the sprites that the player can push - 2. the sprites that a pushed sprite can push - 3. the items that stop a sprite from moving - 4. the tiles that stop a sprite from moving - -EXIT HANDLING: -function to determine whether a sprite will be allowed to transit an exit - -TARGET STATES: -object specifying which dialogs to trigger and under what conditions - -SPRITE FLIPPING: -allow or disallow drawing flips when a sprite is pushed - -*/ +/* eslint-disable no-restricted-syntax */ this.hacks = this.hacks || {}; (function (exports, bitsy) { 'use strict'; @@ -194,11 +161,12 @@ var hackOptions = { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /* Helper for getting image by name or id @@ -221,8 +189,8 @@ function getImage(name, map) { @file edit image at runtime @summary API for updating image data at runtime. @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description Adds API for updating sprite, tile, and item data at runtime. @@ -413,8 +381,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -527,6 +495,40 @@ function transformSpriteData(spriteData, v, h, rot) { return s; } +/** +➡ +@file push sprites +@summary sokoban-style sprite pushing +@license MIT +@author jan0sc +@version 21.4.0 +@requires Bitsy 8.6 + + +@description +Hack to make sprites pushable. + +HOW TO USE: +1. Copy-paste into a script tag after the bitsy source +2. Edit hackOptions below to specify the push logic, exit handling, target states and whether to flip drawings + +PUSH LOGIC: +functions to determine: + 1. the sprites that the player can push + 2. the sprites that a pushed sprite can push + 3. the items that stop a sprite from moving + 4. the tiles that stop a sprite from moving + +EXIT HANDLING: +function to determine whether a sprite will be allowed to transit an exit + +TARGET STATES: +object specifying which dialogs to trigger and under what conditions + +SPRITE FLIPPING: +allow or disallow drawing flips when a sprite is pushed + +*/ diff --git a/dist/replace-drawing.js b/dist/replace-drawing.js index f8db36d4..e5bd5f15 100644 --- a/dist/replace-drawing.js +++ b/dist/replace-drawing.js @@ -4,8 +4,8 @@ @summary add name-tags to replace drawings when the game is loading @license MIT @author Elkie Nova -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -173,8 +173,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { diff --git a/dist/save.js b/dist/save.js index 933c0a55..00e7f0e3 100644 --- a/dist/save.js +++ b/dist/save.js @@ -4,8 +4,8 @@ @summary save/load your game @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -191,8 +191,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -213,6 +213,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -250,17 +261,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -352,11 +352,12 @@ function addDualDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /* Helper used to replace code in a script tag based on a search regex To inject code without erasing original string, using capturing groups; e.g. diff --git a/dist/solid-items.js b/dist/solid-items.js index 2162825d..6e8551b3 100644 --- a/dist/solid-items.js +++ b/dist/solid-items.js @@ -4,8 +4,8 @@ @summary treat some items like sprites that can be placed multiple times @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -163,8 +163,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { diff --git a/dist/stopwatch.js b/dist/stopwatch.js index 3feab5ae..eaa886b7 100644 --- a/dist/stopwatch.js +++ b/dist/stopwatch.js @@ -4,8 +4,8 @@ @summary time player actions @license MIT @author Lenny Magner -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -200,8 +200,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -222,6 +222,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -259,17 +270,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -361,11 +361,12 @@ function addDualDialogTag(tag, fn) { @file utils @summary miscellaneous bitsy utilities @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ + /** * Helper for printing dialog inside of a dialog function. * Intended to be called using the environment + onReturn parameters of the original function; @@ -387,6 +388,7 @@ function printDialog(environment, text, onReturn) { + function getTimeDifferenceInMs(timer) { return (timer.end || Date.now()) - timer.start; } diff --git a/dist/text-to-speech.js b/dist/text-to-speech.js index 7fc5fc0b..c728ca59 100644 --- a/dist/text-to-speech.js +++ b/dist/text-to-speech.js @@ -4,8 +4,8 @@ @summary text-to-speech for bitsy dialog @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -188,8 +188,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -210,6 +210,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -247,17 +258,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { @@ -349,6 +349,7 @@ function addDualDialogTag(tag, fn) { + var speaking = false; var toSpeak = []; var latestUtterance; // we need to maintain a reference to this, or a bug in the GC will prevent events from firing diff --git a/dist/tracery-processing.js b/dist/tracery-processing.js index e8a1e370..a2058231 100644 --- a/dist/tracery-processing.js +++ b/dist/tracery-processing.js @@ -4,8 +4,8 @@ @summary process all dialog text with a tracery grammar @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -1032,8 +1032,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { diff --git a/dist/transitions.js b/dist/transitions.js index 8facc3e4..962ef9b0 100644 --- a/dist/transitions.js +++ b/dist/transitions.js @@ -4,8 +4,8 @@ @summary customizable WebGL transitions @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -219,8 +219,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -284,8 +284,8 @@ var after = kitsy.after; @summary WebGLazy bitsy integration (this one's mostly just for me) @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description diff --git a/dist/transparent-background.js b/dist/transparent-background.js index 65a34f56..cf2c6dce 100644 --- a/dist/transparent-background.js +++ b/dist/transparent-background.js @@ -4,8 +4,8 @@ @summary makes the game have a transparent background @license MIT @author Cephalopodunk & Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -167,8 +167,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -232,8 +232,8 @@ var after = kitsy.after; @summary makes all sprites have transparent backgrounds (deprecated) @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description diff --git a/dist/transparent-dialog.js b/dist/transparent-dialog.js index 35c24dbb..3085d3f4 100644 --- a/dist/transparent-dialog.js +++ b/dist/transparent-dialog.js @@ -4,8 +4,8 @@ @summary makes the dialog box have a transparent background @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -152,8 +152,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { diff --git a/dist/transparent-sprites.js b/dist/transparent-sprites.js index f7d80b7c..5266bbbe 100644 --- a/dist/transparent-sprites.js +++ b/dist/transparent-sprites.js @@ -4,8 +4,8 @@ @summary makes all sprites have transparent backgrounds (deprecated) @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -170,8 +170,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { diff --git a/dist/twine-bitsy-comms.js b/dist/twine-bitsy-comms.js index 206c68f0..e997a95b 100644 --- a/dist/twine-bitsy-comms.js +++ b/dist/twine-bitsy-comms.js @@ -4,8 +4,8 @@ @summary interprocess communication for twine and bitsy @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -234,8 +234,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { @@ -256,6 +256,17 @@ var kitsy = (window.kitsy = window.kitsy || { applyHooks, }); +// Rewrite custom functions' parentheses to curly braces for Bitsy's +// interpreter. Unescape escaped parentheticals, too. +function convertDialogTags(input, tag) { + return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { + if (match.substr(0, 1) === '\\') { + return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) + } + return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} + }); +} + var hooked = kitsy.hooked; if (!hooked) { kitsy.hooked = true; @@ -293,17 +304,6 @@ var before = kitsy.before; /** @see kitsy.after */ var after = kitsy.after; -// Rewrite custom functions' parentheses to curly braces for Bitsy's -// interpreter. Unescape escaped parentheticals, too. -function convertDialogTags(input, tag) { - return input.replace(new RegExp('\\\\?\\((' + tag + '(\\s+(".*?"|.+?))?)\\\\?\\)', 'g'), function (match, group) { - if (match.substr(0, 1) === '\\') { - return '(' + group + ')'; // Rewrite \(tag "..."|...\) to (tag "..."|...) - } - return '{' + group + '}'; // Rewrite (tag "..."|...) to {tag "..."|...} - }); -} - function addDialogFunction(tag, fn) { kitsy.dialogFunctions = kitsy.dialogFunctions || {}; if (kitsy.dialogFunctions[tag]) { diff --git a/dist/unique-items.js b/dist/unique-items.js index 2abb2d9c..ba3b817c 100644 --- a/dist/unique-items.js +++ b/dist/unique-items.js @@ -4,8 +4,8 @@ @summary items which, when picked up, remove all other instances of that item from the game @license MIT @author Sean S. LeBlanc -@version 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 @description @@ -163,8 +163,8 @@ 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 21.3.0 -@requires Bitsy 8.4 +@version 21.4.0 +@requires Bitsy 8.6 */ var kitsy = (window.kitsy = window.kitsy || { diff --git a/package-lock.json b/package-lock.json index 505b78ee..279a2928 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@bitsy/hecks", - "version": "21.3.0", + "version": "21.4.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@bitsy/hecks", - "version": "21.3.0", + "version": "21.4.0", "license": "MIT (individual hacks have their own license specified)", "dependencies": { "@seansleblanc/pink-trombone": "^1.0.1", diff --git a/package.json b/package.json index 0d42508f..ef3ed349 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "hacks" ], "main": "index.mjs", - "version": "21.3.0", + "version": "21.4.0", "bitsyVersion": "8.6", "scripts": { "build": "rollup -c --bundleConfigAsCjs",