- 20 May, 2022 1 commit
-
-
Leon Arnott authored
Worked out a new compromise for (line-style:) and line selection that can handle multi-line hooks more intuitively. The big problem I'd been wrestling with is getting (line-style:) to "make sense" when wrapping a line that A) begins a hook halfway through, and B) where said hook spans multiple lines. Since it's not possible to jQuery wrap only the text nodes in the first half of the hook along with the text nodes in the same line outside of the hook without displacing some of the text nodes, I'd been forced to think of various solutions. In the end, I decided to compromise like so: the halves of a multi-line hook are now always treated as (and wrapped as) a separate line from the rest of the line. Even though that makes (text-indent:) not work quite right, other changers like (text-colour:) work correctly with this. It's not ideal, but I can't afford to keep fretting over this. Also: * Fixed up more documentation lines. * 2.4 toolbar buttons now have more descriptive labels that TwineJS should use as tooltips. * Added an alternative error message for unmatched text tokens appearing in macro calls, in cases where it seems like a position name (like '1st') that was incorrectly used. * Code inside HTML comments is no longer syntax-highlighted.
-
- 12 May, 2022 1 commit
-
-
Leon Arnott authored
Also decided to use the new aliases of (datanames:), (datavalues:) and (dataentries:) as their main names, to be fully consistent with (dm-altered:).
-
- 11 May, 2022 1 commit
-
-
Leon Arnott authored
Added (dm-altered:), a macro which serves as a combination of (altered:) and (dataentries:) while also returning an altered datamap. Closes #97. I still want to add a (dm-from-entries:) macro which lets (dataentries:)'s array be turned back into a datamap, but I have to decide I like that name first... Also: * (datanames:), (datavalues:) and (dataentries:) now have the aliases (dm-names:), (dm-values:) and (dm-entries:), to better convey that these operate exclusively on datamaps. * (altered:) now accepts a lambda with a 'where' clause in addition to a 'via' clause. If the 'where' clause produces false, the value for that loop is not altered. * Improved lambda frames of debug replays further, adding separate "where result" and "via result" columns and fixing some bugs.
-
- 10 May, 2022 1 commit
-
-
Leon Arnott authored
Each loop's variables and results are presented in a table as a special replay frame, and the sub-Replay of those loops can be inspected further. This all came together pretty well, fortunately for everyone.
-
- 08 May, 2022 1 commit
-
-
Leon Arnott authored
Now, instead of simply wrapping all of the text nodes in a line with a <tw-pseudo-hook>, which excluded <tw-expression>s that weren't rendered yet, it now wraps every element in a line, except where that element contains a <br> (whereupon only some of its contents are wrapped). Note that enchanting lines still has ongoing issues involving inline elements that contain <br>s, which I want to fix backwards-incompatibly in 4.0. Closes #249.
-
- 07 May, 2022 1 commit
-
-
Leon Arnott authored
This wasn't added previously because I was still thinking about how it would actually read, how it would be described in the documentation, and whether it would make sense alongside (p-not:) and so forth. I've convinced myself now that it's fine, though. After this, the only patterns really missing are (p-start:) and (p-end:), which weren't needed until the arrival of (str-replaced:). Also added some tests for the previous commit's changes. Closes #254.
-
- 06 May, 2022 1 commit
-
-
Leon Arnott authored
* Fixed a bug where legacy octal escape syntax inside strings produced a Javascript strict mode error. * Fixed a crash during generation of belongingProperty Debug Replay frames. * Fixed a bug where (sorted:) producing the wrong error message when given non-string non-numbers. * Also added a special-case error message to (sorted:) when a single array is given to it. * Corrected the collapsing whitespace documentation article. Closes #238. * Added to the String documentation a section about escapes. * Fixed various other documentation lines.
-
- 03 May, 2022 1 commit
-
-
Leon Arnott authored
Fixed a bug where (output:)-attached hooks nested inside multiple other hooks wouldn't have access to temp variables inside the custom macro's code hook. Also improved the performance of (history:). Closes #255.
-
- 28 Apr, 2022 2 commits
-
-
Leon Arnott authored
-
Leon Arnott authored
I've long wanted to give a better explanation for how <script> tags actually make sense within Harlowe, and this helps solve most of that. Also, I'm glad that Harlowe's long-standing alignment of its variable names with Javascript variables has finally borne fruit, justifying the slightly dubious choice of the _ glyph for temp variables. In order to make this work, the run time of <script> elements has been changed to line up with Harlowe macros. Also, <script> elements now force an early reattachment of <tw-story> to the DOM, to allow jQuery queries to target the incoming passage. Also fixed a bug where the Toolbar's find/replace functionality didn't work right in multi-editor. Closes #253.
-
- 22 Apr, 2022 2 commits
-
-
Leon Arnott authored
One small problem with this, though, is that their settings no longer persist across editors. While this is fine for multi-editor, it does mean that you can't turn off tooltips and have subsequent opened editors respect this decision. This will have to be worked on, I think.
-
Leon Arnott authored
Also fixed some toolbar bugs for 2.3 in previous commits.
-
- 20 Apr, 2022 1 commit
-
-
Leon Arnott authored
* Fixed a bug where highlighting didn't work right when editing the first line. * Fixed a bug where "harlowe3" CodeMirror event handler function names weren't being preserved by UglifyJS. * Tooltips now work multi-editor (the tooltip is attached to the correct editor).
-
- 19 Apr, 2022 1 commit
-
-
Leon Arnott authored
* Added a few CodeMirror built-in keyboard shortcuts (for just Bold, Italic, Strikethrough and Find). * The Toolbar's module has been split into a ToolbarPanel module containing the basic implementation of each panel, leaving the actual panel definitions in the original module. * Made a Utils module for any functions that both of the above modules need, which also subsumes the ShortDefs "module". * The toolbar now uses foregroundColor to set the icon colour, instead of appTheme plus hardcoded colours. (Not that this makes much difference...) * Fixed a tooltip layering issue in 2.4.
-
- 16 Apr, 2022 1 commit
-
-
Leon Arnott authored
* Multi-editor syntax highlighting is finally supported! * Cursor marking of tokens inside verbatim markup is now suppressed. * The gradient editor's colour stops panels are now correctly positioned in 2.4. * The 2.4 toolbar now has the basic text styles + the "Styles…" button condensed into a dropdown menu.
-
- 15 Apr, 2022 1 commit
-
-
Leon Arnott authored
Also fixed a bug in the previous commit. Also tweaked the Harlowe Toolbar for 2.4 some more: * Removed "Resulting code" as it's getting too much of a struggle to make it look good or make sense. * Fixed a bug in the tooltip dismissal code. * Now, various elements use the 2.4 --grid-size variable for padding, adding consistency with 2.4's UI. * Started moving a few buttons into dropdown menus to save space.
-
- 13 Apr, 2022 1 commit
-
-
Leon Arnott authored
Now, Debug Replays for errors can be clicked without entering Debug View (as long as the story is a debug build). This is in keeping with the idea that Debug View provides a look behind the scenes of normal story functionality, and errors are always abnormal. Also added an additional explanation for Debug Replay frames of property "'s" and belonging "of" tokens.
-
- 12 Apr, 2022 1 commit
-
-
Leon Arnott authored
This macro was a specific request for controlling memory usage, but I managed to think of some scenarios to justify "normal" semantic use, justifying this macro's inclusion. Both of these macros together provide a little bit of control over all the non-variable game state data that Harlowe saves. I still need to test (erase-visits:) with repeated saves and loads, though. Also, I might rename both of these to (forget-undos:) and (forget-visits:), to better convey what they actually do (remove old/past data only). Also: * Fixed some VarRef-related error messages. * Fixed the TwineScript_ObjectName of spreaders. * Fixed a Debug Replay issue with chained "'s" property syntax.
-
- 03 Apr, 2022 1 commit
-
-
Leon Arnott authored
* "Replace One" now advances the highlighted match correctly. * Now works correctly with multiple selections created with ctrl-clicking. * Clicking "Done" now removes the search highlight overlay. I've decided to leave the "Replace One"/"In Selection" behaviour because, based on a survey of a few other text editors, it doesn't really matter. Also added a HTML Comments button to The Harlowe Toolbar, and changed the default text for various instant-markup-insertion buttons in the toolbar.
-
- 02 Apr, 2022 1 commit
-
-
Leon Arnott authored
Various other panels also had a once-over. There's still a few layout issues, though. Also: * Adjusted the find/replace highlight colour. * Added a special hint to the tooltips, pointing out the toolbar button to disable them. The hint only shows up for the first few tooltips after startup. * Adjusted some other tooltip messages. * Added "tall" and "flat" style options to (text-style:). * Fixed the documentation article for (text-style:) interacting poorly with dark mode.
-
- 01 Apr, 2022 1 commit
-
-
Leon Arnott authored
This panel supports multi-line find/replace, and has case-sensitivity, Only Code, Only Prose, and Only Selection search options. Known bugs for next commit: * "Replace One" doesn't advance the highlighted match correctly when replacement string contains search string. * "Replace One" with "Only in Selection" doesn't preserve the selection correctly. * Doesn't look good in TwineJS 2.4. * Needs keyboard shortcuts, as well as proper tabbing order for the Find and Replace textareas. * "Done" doesn't remove the overlay. In order to make this happen, I also did this: * Fixed the CodeMirror mode() function such that it only installs event handlers if functions with the same names aren't already in that CodeMirror object's _handlers array. * Made various toolbar panel <select> elements look better in TwineJS 2.4.
-
- 29 Mar, 2022 1 commit
-
-
Leon Arnott authored
* Now, panels are floating cards (reusing 2.4's card CSS classes) above the editor, and their contents wrapped in a scroll container such that the confirm buttons' row is usually always visible. * Toolbar links now use the correct colour. * Tooltips now use the correct font. Also: * The format.js file now has a valid semver key.
-
- 26 Mar, 2022 1 commit
-
-
Leon Arnott authored
Removed the green "attached changer line" from the syntax highlighter, on the basis that the newly relaxed rules for changer attachment (allowing non-changers to appear in attachment position) make this misleading. Also: * Added an appendix to the documentation describing Harlowe's order of operations, and providing potted summaries of every operator. * Commented out the SugarCube 1 comparison appendix, pending a rewrite for SugarCube 2. * Added missing notes to the documentation regarding using - with strings. * Tweaked several more documentation lines.
-
- 23 Mar, 2022 1 commit
-
-
Leon Arnott authored
The "any" data name of arrays and strings has been renamed to "some", to avoid confusion with the "any" datatype and for naming consistency with (some-pass:). "any" remains as a deprecated alias for compatibility, but is likely to be removed in Harlowe 4. Also: * Checkboxes created by (checkbox:) and related macros are better vertically aligned to their text labels. * Fixed a duplicate error message issue in lambdas. * Added tests for datasets' start and end datanames. * Macro aliases in the documentation now have anchor <a> elements, allowing them to be linked to. * Fixed a bug in the previous commit. * Removed DokuWiki compilation from the Makefile.
-
- 22 Mar, 2022 1 commit
-
-
Leon Arnott authored
As usual, I changed the name from (num-format:) just before committing, to be consistent with the type system terminology of digit=string and num=number. But, I'm satisfied with this macro as-is.
-
- 20 Mar, 2022 1 commit
-
-
Leon Arnott authored
There's still one last thing that bugs me about this… the frames these create should have different right-side messages that don't involve toSource(). Also: * Fixed a few bugs in the previous commit. * Rewrote the It identifier's documentation article a bit more. * Fixed the docs's Debug Mode z-index interfering with the Debug Replay dialog.
-
- 19 Mar, 2022 1 commit
-
-
Leon Arnott authored
* I realised it was easier to simply have each token skip its own eval replay frame if it was a literal, rather than have these frames skipped later by makeEvalReplayFrame(). Hence, all string literal, number literal, and other literals' steps are now skipped, cleaning up the replays a whole lot. * Replay frames that feature the it identifier's value changing now include a message mentioning it. * Certain unusual replay frame steps (such as inferred 'it') now have special explanations included in their replay frames. Also added some explanations for previously undocumented Harlowe behaviour into the docs.
-
- 18 Mar, 2022 1 commit
-
-
Leon Arnott authored
This is heavily based off of CSS's color-mix(), but it uses a similar argument order to (gradient:). As for naming: I wanted to use (blend:) but came to realise that "blend" now only refers to blend modes, so I switched to (mix:). I was also contemplating having this explicitly be named (lch-mix:) but decided I didn't want to include the (hsl-mix:) that would be implied by such naming. By the way, in Harlowe 4, I might switch the LCH-using macros to use the newer OKLCH instead. Also: * Fixed a bug where (lch:) and all lch-related colour conversions were slightly wrong, due to the conversion algorithm assuming linear-light sRGB instead of gamut sRGB. * Fixed a bug where colours created via (lch:) could sometimes have r, g or b datavalues higher than 255 or lower than 0. * Fixed a bug where (background:) didn't work when given a Harlowe colour with fractional r, g, or b datavalues. * Now, instead of the docs removing the animated (text-style:) examples when Chrome is detected, they no longer animate in any browser unless the mouse is over their containing table. * Now, (bg:) is the main name for (background:), and the documentation refers to it mainly by that.
-
- 15 Mar, 2022 1 commit
-
-
Leon Arnott authored
Added "Skip 10" buttons to the Debug Replay dialogs that let the replay advance by 10 steps at once. Also improved/standardised several datatypes' objectNames (specifically TypedVars, HookNames and VarRefs), as well as fixed some bugs thereof.
-
- 13 Mar, 2022 1 commit
-
-
Leon Arnott authored
Deprecated (mouseover:), (mouseout:), and all other macros beginning with "mouse", and added the (action:) link changer to replace them. Ever since I added the optional second value to the (click:) macros, it's become clear that creating another changer for these interaction types is by far the preferable solution compared to having dozens of (mouseover:) variants in the macro namespace. Plus, being able to make the mouseover and mouseout interactions available to all kinds of links is a big win. There is one big discomfort in how I implemented this, however: CSS/DOM structure compatibility with Harlowe 3.2 forced me to make this much more convoluted than I'd like, with multiple selectors and the "enchantment-" CSS class prefix. I'll fix all of this up in Harlowe 4.0, however. Assuming I live long enough to make it… While I recognise that (click:?A,(action:'mouseover')) kind of reads awkwardly (is it a click or a mouseover?), this seems to be to be a flaw in the naming of (click:). In Harlowe 4.0, I might rename it to (enlink:). I also recognise that this might be confused with SugarCube's <<actions>> macro... but I still think this is the best name for this macro. Not just because names like (link-style:) and (event:) have already been taken. Also: * Now, instead of (enchant:) checking changers' ability to be enchanted using their summary(), a canEnchant boolean is (internally) attached to them. * Added a string variable serialisation optimisation: if the string is an appended or prepended version of an earlier turn's string, it is serialised as a {via} valueRef accordingly. * Fixed the z-index layering of the preview panel, debug panel and preview code area in the docs, again.
-
- 08 Mar, 2022 1 commit
-
-
Leon Arnott authored
* Fixed a bug where using (append:?Link) (or one of its relatives) to append text to a hook enchanted with (click:) wouldn't work correctly (the text would be placed next to the link instead of inside). * Fixed a bug where (enchant:), (click:), and other enchantment macros could enchant empty hooks such as |A>[] (wrapping them with <tw-enchantment> elements), even though Harlowe usually considers empty hooks to be nonexistent, and hides them with its default CSS. For awhile I thought that second one might be a compatibility anchor, requiring this fix to be punted to 4.0... but thinking about it, the circumstances are a bit too esoteric (involving all of ?Link, (click:), and empty named hooks) to reasonably worry about. Nevertheless, a note about this is in the Readme.
-
- 06 Mar, 2022 1 commit
-
-
Leon Arnott authored
Added (click-rerun:), a variant of (click:) which can be clicked multiple times to re-run the attached hook. This one doesn't have a (click-replace:) style variant, where the enchanted hook behaves like a (link-rerun:) link, because I feel like that use-case is unlikely to be that popular. Also, there aren't (mouseover:) or (mouseout:) variants of this because I'm reconsidering whether those should have separate macros at all, instead of being special changers one could give to existing (click:) and (link:) macros to change their fundamental behaviour. Also: * Fixed some documentation CSS bugs, as well as the bug where the story preview's Harlowe embed would scroll to page top on initial load. * Added an alias for (link-reveal:), which is (link-append:).
-
- 04 Mar, 2022 1 commit
-
-
Leon Arnott authored
Also, added a vertical resizer to Debug Mode panels which lets the max-height of the panels be changed. This is also saved in localStorage as a Debug Mode config option.
-
- 03 Mar, 2022 1 commit
-
-
Leon Arnott authored
* "via" ValueRefs shouldn't be kept on flattened moments. * Fixed a bug where (erase-past:-1) combined with (save-game:) would lose the values of variables set in the immediate previous turn. * Fixed a bug where (erase-past:-1) combined with (save-game:) could cause Startup passages to be re-run erroneously.
-
- 02 Mar, 2022 3 commits
-
-
Leon Arnott authored
* Fixed a bug where (metadata:) macro calls would be referred to as (storylet:) macro calls. * Corrected the use of whitespace around replacements in each replay frame. Also: * Added a "Clear this panel" button to the Errors panel, which, when clicked, removes all of the recorded errors. * Made toSource() very slightly more efficient when serialising datamaps and arrays.
-
Leon Arnott authored
Also made it so that (rerun:?passage) does what one would expect it to.
-
Leon Arnott authored
Fixed a long-standing bug where hook transitions would often result in only the <tw-hook> element's contents being transitioned, not the element itself. This bug is very embarasssing and I shall speak no more of it. Also, (replace-with:), (append-with:) and (prepend-with) have been altered to permit code hooks in place of the message string value.
-
- 01 Mar, 2022 2 commits
-
-
Leon Arnott authored
Also: * Added a Debug Mode option to toggle the recording of Debug Replays (for possible performance reasons). The default is on. * The Storylets panel is now sorted (by Open) by default. * Fixed some more ValueRef related bugs.
-
Leon Arnott authored
Devised a new kind of ValueRef for serialisation of large arrays and datamaps altered over many turns. I'm rather proud of reusing the "it" syntax in this way, as well as the "via" lambda's terminology in naming these kinds of valueRefs. That being said, I still have to make datasets work with this... Also: * Fixed an important bug where invalid {from,to} ValueRefs were being created for VarRefs that were property mutations. * Fixed a bug where errors weren't being displayed in Debug Replay correctly.
-
- 27 Feb, 2022 1 commit
-
-
Leon Arnott authored
* The toolbar's buttons are the correct shade now. * Tooltip stems should be in the correct spot. * The modal toolbar buttons now correctly light up when clicked. * Toolbar buttons now use iconOnly where necessary. * Tweaked some tooltip messages as well.
-