1. 08 Jul, 2018 1 commit
  2. 06 Jul, 2018 1 commit
    • Leon Arnott's avatar
      Finished implementing (cycling-link:) and VarBind. · b22700969a1c
      Leon Arnott authored
      I'm still not 100% confident on the "bind" keyword, but I guess this is what I'm sticking with.
      
      You may notice that a VarBind stores a VarRef, which contains a variable name and property chain, but afterward one can then alter the variable from under it, so that a property chain for a datamap is now applied to an array. canSet() in varref.js has some provisions to make these not much of a hassle, but I changed it so that internally, VarRefs' property chains now store array indexes as numbers instead of strings, so that they might be distinguished from datamap names. This isn't ideal at all, but for now it produces user-facing errors when it should.
      
      Working on this implementation leaves me with a few additional questions:
      
       * Whether (cycling-link:) rejecting an empty link text should be universalised to the other link macros.
      
       * Whether (t8n:) attached to a (cycling-link:) causing it to transition in on passage start is a problem. (Should it follow how (link:) interacts with t8n?)
      b22700969a1c
  3. 27 Jun, 2018 1 commit
  4. 26 Jun, 2018 1 commit
  5. 23 Jun, 2018 1 commit
  6. 21 Jun, 2018 1 commit
  7. 20 Jun, 2018 1 commit
    • Leon Arnott's avatar
      Implemented (transition-depart:) and (transition-arrive:) as a means to change... · 26cc772ce58b
      Leon Arnott authored
      Implemented (transition-depart:) and (transition-arrive:) as a means to change the passage transitions used by links.
      
      (t8n-depart:) and (t8n-arrive:) only have an effect when affixed to (link-goto:) and (link-undo:) (as well as when (enchant:?Link) targets those entities) and alter the between-passage transitions of those links. Fortunately, the existing transitions' code didn't need to be adjusted to work with passages. The terms "depart" and "arrive" may be a little long, but I like how unambiguously they convey the idea of travel between passages.
      
      Also added "instant" as a valid transition name.
      26cc772ce58b
  8. 10 Jun, 2018 1 commit
  9. 26 May, 2018 1 commit
    • Leon Arnott's avatar
      Implemented HookCommands, and converted a few macros to use their API. · 6bd997b33a40
      Leon Arnott authored
       * Commands now, contrary to previous plans, have a TwineScript_Run() that is separate from TwineScript_Print(). This is to clarify Harlowe's expression-printing logic and differentiate what exactly printing a data expression produces (currently, always a string of markup or a TwineError, with no side effects) vs. what running a command produces (either an earlyExit signal object or a ChangeDescriptor to permute the <tw-expression>, plus side effects). This forces one breaking change: (print:) no longer runs commands passed into it, instead merely printing a basic string representation.
      
       * (print:), (display:) and (link-goto:) are currently reimplemented as HookCommands, but they don't fully utilise their ChangeDescriptors yet.
      
       * Additionally, Macros now has addCommand(), which centralises the "command constructor" macro pattern. All other command macros' definitions (except for the (set:) bunch, whose commands need TwineScript_Unobservable) have been changed to use it.
      6bd997b33a40
  10. 18 May, 2018 1 commit
    • Leon Arnott's avatar
      Added infrastructure for "hook commands", a command which can have changers... · 04f96b39de1f
      Leon Arnott authored
      Added infrastructure for "hook commands", a command which can have changers attached, as well as the "bind" datatype.
      
       * "bind" is a new unary operator designed to pass variables by reference to certain upcoming input element macros, like (cycling-link:). This solves, with some brutality, the long-standing issue of not being able to pass in variables by reference to macros, which was always necessary to add these much-sought macros to Harlowe. Try as I might to think of some less blunt way to specify this syntactically, I must now in my increasing age defer to this solution.
      
       * "hook commands" will be ordinary commands (which have a TwineScript_Print() method) but also have a TwineScript_Attach() method that allows changers to mutate it in-place before it's finally printed. This will solve the long-standing issue of not being able to attach (t8n:) macros, and other valuable changers, to links and (goto:) macros.
      
       * Also fixed a few minor issues here and there.
      04f96b39de1f
  11. 11 May, 2018 1 commit
    • Leon Arnott's avatar
      Added (click-goto:), (mouseover-goto:) and (mouseout-goto:), as shorthands for... · 78e86df0b493
      Leon Arnott authored
      Added (click-goto:), (mouseover-goto:) and (mouseout-goto:), as shorthands for the (click:), (mouseover:) and (mouseout:) macros combined with (goto:).
      
      The primary incentive for doing this was to add a special form of the link syntax, with no link text, resembling [[->passage name]], as syntactic sugar for (click-goto: ?Page, "passage name") etc., so as to promote the use of full-page clicking in stories, as an alternative, in strictly linear stories, to single links of arbitrary words. But, the appeal of this shorthand, as an alternative way to create otherwise normal links, is also desirable.
      78e86df0b493
  12. 10 May, 2018 1 commit
    • Leon Arnott's avatar
      Implemented (link-reveal-goto:), which functions as a combination of (link-reveal:) and (goto:). · 4813e279b3a8
      Leon Arnott authored
      I'd previously been unwilling to implement the old Twine 1 [[Link|Passage][x = 1]] link syntax for a few reasons, most notably that using = for assignment, while technically supported in Harlowe, is nonetheless heavily frowned upon, and there's no comfortably way to incorporate "to" or "into" in it without "set" or "put". Additionally, I felt adding another feature to the link syntax which didn't naturally arise from other syntactic structures was adding unpleasant complexity. I'd toyed with adding this as the macro (link-set-goto:), but I was uncomfortably with the syntax of a lone VariableToValue "$a to 2" in the middle of unrelated params, and additionally disliked how this looked like an "emergent concatenation" of (link:), (set:) and (goto:) by themselves, comparable to (mouseover-replace:) and its ilk, and had no model for explaining how this would make sense.
      
      What changed? I decided that it does make sense for (link-reveal:) to be concatenated with (goto:) to make (link-reveal-goto:), because the (set:) could be included in the attached hook, rather than crudely incorporated into the call itself. Moreover, by using a hook, any other arbitrary instant-effect macro could be used with it, like (alert:), or a hypothetical audio macro. Since this is only the concatenation of two macros - (link-reveal:) and (goto:) - rather than three, it's in keeping with (mouseover-replace:)'s example.
      
      I intend to add link syntax sugar for this, but am currently debating its exact form. Certainly it won't just resemble the Twine 1 form.
      4813e279b3a8
  13. 09 May, 2018 1 commit
    • Leon Arnott's avatar
      Implemented the (event:) macro, an alternative to (live:), along with the "when" lambda clause. · 4a431f886235
      Leon Arnott authored
      (event:), unlike (live:), live-renders the hook only once, and only when the given lambda, which is run every 20ms, produces true. The new lambda clause, "when", is just a version of "where" typed to only be accepted by (event:). Moreover, it can't take any temp variables or refer to "it" - it must refer to globals or local temp variables outside of it. This contradicts the definition of a "lambda", but I needed a way to express deferred computation to make this macro work, and this seems smoothest from the coder's perspective.
      
      Also fixed a bug where debug view would write messages referring to global variables as if they were in a temp variable store.
      4a431f886235
  14. 16 Apr, 2018 1 commit
    • Leon Arnott's avatar
      Implemented basic functionality for the "matches" operator. · 53288f790075
      Leon Arnott authored
      This supports basic structural matching, using datatype names as the 'blanks'.
      
      Also:
      
       * Renamed typenames (the user-facing Harlowe construct) to datatypes, to avoid confusion with internals' use of "typename".
      
       * Removed some typenames whose utility seems low (lambda, hookset, typename, data) at present.
      
       * Added "or a" as an invalid operator, to preclude people writing "$a is a number or a string".
      53288f790075
  15. 15 Apr, 2018 1 commit
  16. 14 Apr, 2018 1 commit
  17. 13 Apr, 2018 1 commit
  18. 11 Apr, 2018 1 commit
    • Leon Arnott's avatar
      Added a string-specific shorthand of (repeated:) called (str-repeated:). · 412b30269ce6
      Leon Arnott authored
      This will be followed by a number of other str- macros in the coming days.
      
      Additionally, the (text:) macro now has another alias, (str:). This alias will now be the preferred name for this macro in the documentation, mainly due to the arrival of other string macros that begin with "str-", and additionally to avoid semantic conflict with the various "text-" changer macros like (text-style:).
      412b30269ce6
  19. 10 Apr, 2018 1 commit
  20. 25 Feb, 2018 1 commit
  21. 15 Jan, 2018 1 commit
  22. 07 Dec, 2017 1 commit
  23. 06 Dec, 2017 3 commits
  24. 20 Nov, 2017 2 commits
  25. 02 Aug, 2017 1 commit
  26. 16 Jun, 2017 1 commit
  27. 25 May, 2017 1 commit
    • Leon Arnott's avatar
      Changed (link-repeat:)'s documentation to match current behaviour. · 476a743d3003
      Leon Arnott authored
      The current implementation erroneously appends each iteration of (link-repeat:) instead of replacing - but in the interests of backwards-compatibility, I can't change this until another major release.
      
      Also fixes a few places where old version numbers were recorded.
      
      Closes #92.
      476a743d3003
  28. 30 Apr, 2017 1 commit
  29. 26 Apr, 2017 1 commit
  30. 08 Mar, 2017 1 commit
    • Leon Arnott's avatar
      Fixed (enchant: ?Page) not being able to override default CSS (or other CSS) on <tw-story>. · ff6e94bb72a5
      Leon Arnott authored
      This fix forcibly checks which CSS properties are being applied to the <tw-enchantment> by style changers, and adds matching "inherit" inline styles to the <tw-story> below. Yes, it's unfortunate that the <tw-story> has to be permuted for this… oh well.
      
      Also added CodeMirror mode CSS that keeps the line-break marker gutter at left:0, which, for reasons yet unknown, it sometimes isn't.
      
      Version changed to 2.0.1.
      
      Closes #85. Closes #83.
      ff6e94bb72a5
  31. 14 Feb, 2017 4 commits
  32. 31 Jan, 2017 1 commit
  33. 25 Jan, 2017 1 commit
  34. 23 Jan, 2017 1 commit