1. 05 Jul, 2022 2 commits
  2. 23 Jun, 2022 1 commit
  3. 17 Jun, 2022 1 commit
    • Leon Arnott's avatar
      Fixed two background-related bugs. · b5a0518338b7
      Leon Arnott authored
      * Fixed a long-standing bug where enchanting ?Page with (background:) would, if the current passage was taller than the browser window, cause the background to only cover the length of the browser window.
      * Fixed a bug where enchanting ?Page with (background:) using (gradient:) or (stripes:) would, upon leaving the passage with that enchantment, cause the page background to become transparent (i.e. whatever the browser's default is) instead of the default black (unless the story stylesheet changed it).
      
      Closes #237. Closes #259.
      b5a0518338b7
  4. 15 Jun, 2022 1 commit
    • Leon Arnott's avatar
      Several Harlowe Toolbar fixes and revisions. · b3221d767d18
      Leon Arnott authored
       * Fixed the Find panel's "Only in" functionality.
       * The Find panel now populates itself with the current text selection when opened.
       * Added keyboard shortcut hints to various toolbar labels.
       * Moved the toolbar's "wizards" buttons into a separate "Macro" dropdown in 2.4.
       * Added Ctrl+G and Ctrl+H keyboard shortcuts for the Find dialog. One small problem is that these only work when the CodeMirror panel has focus, though...
       * Applied a fix to the colouring of dropdowns in panels.
       * Added a "past versions" section to the documentation.
      b3221d767d18
  5. 11 Jun, 2022 1 commit
  6. 10 Jun, 2022 1 commit
    • Leon Arnott's avatar
      Strings that match the name of an existing passage are now coloured... · 35e810f9d270
      Leon Arnott authored
      Strings that match the name of an existing passage are now coloured differently and have an additional thin underline.
      
      Additionally, strings that match an existing passage tag now have a dotted underline.
      
      Also, data structure values more than 4 levels deep no longer get separate rows in Debug Mode's Variables panel.
      35e810f9d270
  7. 09 Jun, 2022 1 commit
    • Leon Arnott's avatar
      Fixed two bugs. · fe72feccee0e
      Leon Arnott authored
       * Fixed a bug where Debug Mode's variables panel listings of data structures' contents would have the wrong names ("$A's 1st" becoming just "1st") after changing passages.
       * Fixed a bug where the truncated names of data structures (used in Debug Mode and error messages) sometimes missing the "X other items" text.
      
      Also tweaked the Input panel of the Harlowe Toolbar to fit certain things on one line in 2.4.
      fe72feccee0e
  8. 08 Jun, 2022 2 commits
    • Leon Arnott's avatar
      Tweaked the Find/Replace panel's 'Done' button position, plus a few other layout things. · 52b4ecfe6d2b
      Leon Arnott authored
      Also tweaked some tests relating to the previous commit.
      52b4ecfe6d2b
    • Leon Arnott's avatar
      Fixed or ameliorated a few bugs relating to transitions and (t8n-delay:). · a2fc223a6bd6
      Leon Arnott authored
      Now, (t8n-delay:) uses animation-play-state to force animations to not run at all until the delay expires, rather than using just animation-delay by itself. This mostly works, but there still isn't a strong guarantee that the animation animates at the required duration, meaning that they can judder at the very end of the animation.
      
      In addition, the expediting of child animations in unwrapped parent elements has been slightly improved (they now expedite at the rate at which THEY have been animating, not the parent), but still isn't perfect.
      
      A full rewrite of the animation system - NOT using CSS-based animation - in 4.0 is really what's called for...
      
      Also:
       * Fixed (again) Debug Replay frames being created where the right-side code is the same as the left-side code.
       * Fixed a bug where "pos" used in lambdas given to (char-style:) would, for each character, be a number relative to the entire passage, not the attached hook.
       * Fixed an error message in comparisonOp() involving determiners.
       * Fixed a few more documentation lines.
      
      Closes #247.
      a2fc223a6bd6
  9. 07 Jun, 2022 1 commit
    • Leon Arnott's avatar
      (input:), (force-input:) and (button:) now take a sizing string. · 2a07e5ade026
      Leon Arnott authored
      I decided this provided the most consistency for macros which create block-level elements. Resizing them is a highly desirable operation, so it might as well be built-in to the call.
      
      Also:
       * Removed the 'placeholder' string, as it was making the type signature too complicated and it seemed too niche a feature.
       * The sizing strings for (input-box:) and (force-input-box:) are now optional, given that they can already be disambiguated (more or less) from the default text string.
      2a07e5ade026
  10. 06 Jun, 2022 1 commit
    • Leon Arnott's avatar
      Added (input:) and (force-input:), variations of (input-box:) and... · 08b06ffc44d1
      Leon Arnott authored
      Added (input:) and (force-input:), variations of (input-box:) and (force-input-box:) which produce single-line <input> elements instead of <textarea> elements.
      
      I was a little skeptical of making these separate from (input-box:), but the way that <input> interacts with newlines by itself makes it distinct enough to merit separate names, I think. Even a 1-row (input-box:) is ultimately quite different.
      
      I don't quite like how it ended up that (input:) has nothing much to do with (output:), but that seems to be the corner I've been pushed in ever since adding (input-box:). Giving (input:) a name like (input-line:) doesn't seem additionally necessary or informative, either.
      
      Closes #202.
      08b06ffc44d1
  11. 04 Jun, 2022 1 commit
    • Leon Arnott's avatar
      Fixed some bugs relating to input macros. · c25a113d0601
      Leon Arnott authored
       * (icon-counter:) no longer uses the pointing hand cursor when the mouse hovers over it.
       * (meter:) now produces an error if given a bound variable using 2bind instead of bind (for consistency with (dialog:)).
       * (checkbox:), (input-box:) and (force-input-box:) now set the bound variable as soon as the element appears in the passage (For consistency with (cycling-link:)).
       * <input type=checkbox> now has vertical-align:middle.
      c25a113d0601
  12. 03 Jun, 2022 1 commit
  13. 02 Jun, 2022 1 commit
    • Leon Arnott's avatar
      Custom commands can now be saved in save files. · afaefdfbd9b0
      Leon Arnott authored
      This follows from the previous commit's work. I had to somewhat awkwardly special-case custom commands in State, but it seems to be a fairly minimal kludge.
      
      Also:
       * Fixed a bug where erroneous VarRefs from (set:) macro calls inside evaluated strings were being created.
       * Fixed a bug where metadata macros wouldn't work at all if their macro names weren't entirely in lowercase. Closes #258.
       * Made the (loadgame:) tests slightly more robust.
      afaefdfbd9b0
  14. 25 May, 2022 1 commit
    • Leon Arnott's avatar
      Custom commands can now be serialised with (source:) and (v6m-source:), and... · f398bb8ccc4d
      Leon Arnott authored
      Custom commands can now be serialised with (source:) and (v6m-source:), and are represented correctly in debug replays.
      
      This representation is not guaranteed to be accurate throughout the story, for obvious reasons which are now laid out in the (source:) macro's article.
      
      This also contains some refactoring needed to allow custom commands to be saved in save files, thus allowing every Harlowe value to be serialisable. More work on this will be in the next commit.
      f398bb8ccc4d
  15. 20 May, 2022 1 commit
    • Leon Arnott's avatar
      Worked out a new compromise for (line-style:) and line selection that can... · 7241808e110e
      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.
      7241808e110e
  16. 12 May, 2022 1 commit
  17. 11 May, 2022 1 commit
    • Leon Arnott's avatar
      Added (dm-altered:), a macro which serves as a combination of (altered:) and... · 9426cec7afaa
      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.
      9426cec7afaa
  18. 10 May, 2022 1 commit
  19. 08 May, 2022 1 commit
    • Leon Arnott's avatar
      Improved the behaviour of enchanting a hook's lines when those lines contain macros or links. · feb864f01bb0
      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.
      feb864f01bb0
  20. 07 May, 2022 1 commit
    • Leon Arnott's avatar
      Added (p-not-before:). · 62a19d6ac0aa
      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.
      62a19d6ac0aa
  21. 06 May, 2022 1 commit
    • Leon Arnott's avatar
      Fixed a few bugs and documentation issues. · 431bc02a5d19
      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.
      431bc02a5d19
  22. 03 May, 2022 1 commit
  23. 28 Apr, 2022 2 commits
    • Leon Arnott's avatar
    • Leon Arnott's avatar
      HTML <script> elements inside passages can now access Harlowe variables and temp variables. · c6dbe8c76ab3
      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.
      c6dbe8c76ab3
  24. 22 Apr, 2022 2 commits
  25. 20 Apr, 2022 1 commit
    • Leon Arnott's avatar
      More Harlowe Toolbar fixes. · 3111f32e4327
      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).
      3111f32e4327
  26. 19 Apr, 2022 1 commit
    • Leon Arnott's avatar
      More important work on the Harlowe Toolbar. · de1d0a30ece4
      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.
      de1d0a30ece4
  27. 16 Apr, 2022 1 commit
    • Leon Arnott's avatar
      More important TwineJS 2.4 syntax highlighter fixes. · 4ac85be1ecc3
      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.
      4ac85be1ecc3
  28. 15 Apr, 2022 1 commit
    • Leon Arnott's avatar
      Added tests and fixes for (erase-visits:)'s interaction with saved and loaded games. · d6256de06801
      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.
      d6256de06801
  29. 13 Apr, 2022 1 commit
    • Leon Arnott's avatar
      Now, Debug Replays for errors can be clicked without entering Debug View (as... · 2a5355e65bf5
      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.
      2a5355e65bf5
  30. 12 Apr, 2022 1 commit
    • Leon Arnott's avatar
      Added the (erase-visits:) macro, and renamed (erase-past:) to (erase-undos:). · 6f7fbe18c100
      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.
      6f7fbe18c100
  31. 03 Apr, 2022 1 commit
    • Leon Arnott's avatar
      Fixed some Find/Replace bugs. · fbc01674c1e8
      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.
      fbc01674c1e8
  32. 02 Apr, 2022 1 commit
    • Leon Arnott's avatar
      Made the Find/Replace panel look slightly better in TwineJS 2.4. · 00f18f8e8f3f
      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.
      00f18f8e8f3f
  33. 01 Apr, 2022 1 commit
    • Leon Arnott's avatar
      Added a Find/Replace panel to The Harlowe Toolbar. · 1fcb2185e0cb
      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.
      1fcb2185e0cb
  34. 29 Mar, 2022 1 commit
    • Leon Arnott's avatar
      More work on the TwineJS 2.4 version of the CodeMirror mode. · 8724be55ad9e
      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.
      8724be55ad9e
  35. 26 Mar, 2022 1 commit
    • Leon Arnott's avatar
      Removed the green "attached changer line" from the syntax highlighter, on the... · 7bcf04b59fae
      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.
      7bcf04b59fae
  36. 23 Mar, 2022 1 commit
    • Leon Arnott's avatar
      The "any" data name of arrays and strings has been renamed to "some", to avoid... · 1fe9259c5f91
      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.
      1fe9259c5f91