Skip to content

Commit

Permalink
v2.4.0
Browse files Browse the repository at this point in the history
- download utility
- update pronoun templates
- update dialog api macros
- add articles macros
- update docs
- other improvements
  • Loading branch information
ChapelR committed Jul 16, 2019
1 parent 929ed1b commit 21130a3
Show file tree
Hide file tree
Showing 15 changed files with 155 additions and 95 deletions.
15 changes: 11 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## Chapel's Custom Macro Collection

[Try the demo!](https://macros.twinelab.net/demo)
- [Try the demo!](https://macros.twinelab.net/demo)
- [Downloads](./download ':ignore')
- [Changelog](./changelog.md)
- [Release Notes](https://twinelab.net/blog/tags/macros/)

### Documentation
- **Gameplay Systems and Mechanics**
Expand Down Expand Up @@ -32,12 +35,14 @@

### Installation Guide

To install these macros, all you need is the code. It is highly recommended that you install the minified version (found in the `scripts/minified/` directory of the repo), as these versions will have improved performance. You will only need the non-minified versions if you plan to edit the code in some way. Links to both the minified and pretty scripts are available on the individual documentation pages for each macro / system.
To install these macros, all you need is the code. You can get the code by copy and pasting from the [repo](https://github.com/ChapelR/custom-macros-for-sugarcube-2/tree/master/scripts), or by generating a custom download using the [download utility](./download ':ignore'). If you use the downloader, select the scripts you want and click the `Create Download` button. Extract the files from the downloaded zip file and install the `bundle.js` and `bundle.css` files (see below).

If you opt to get the files from GitHub, It is highly recommended that you install the minified versions (found in the `scripts/minified/` [directory of the repo](https://github.com/ChapelR/custom-macros-for-sugarcube-2/tree/master/scripts/minified)), as these versions will have improved performance. You will only need the non-minified versions if you plan to edit the code in some way. Links to both the minified and pretty scripts are available on the individual documentation pages for each macro / system.

> [!WARNING]
> To install these macros, you will need to be using the most recent version of SugarCube 2 in most cases, and this is almost never the version that comes with Twine 2. See [SugarCube's website](http://www.motoslave.net/sugarcube/2/#downloads) for updating / installation instructions.
- For **Twine 2** users: copy and paste the required JavaScript code from this repo into your [story JavaScript area](https://twinery.org/wiki/twine2:adding_custom_javascript_and_css). Some macros may also require CSS code, which goes in your story stylehseet.
- For **Twine 2** users: copy and paste the JavaScript code into your [story JavaScript area](https://twinery.org/wiki/twine2:adding_custom_javascript_and_css). Some macros may also require CSS code, which goes in your story stylehseet.

- For **Twine 1**, you'll need to copy and paste the JavaSCript portions into a script-tagged passage, and the CSS portions (if any) into a stylesheet-tagged passage. You can create new passages and add the tags yourself, or right-click on a blank spot in the editor and select new script here and new stylesheet here to generate each passage.

Expand All @@ -49,7 +54,9 @@ To install these macros, all you need is the code. It is highly recommended tha

If you're having issues, please try some of these solutions.

- Before copying the script you want from GitHub, you can find a button above the code on the right called `raw`. Try using this code instead, as it takes you to a page with only the code allowing you to copy it and paste it much more easily, and preventing potential encoding issues.
- If you're getting the code from GitHub, before copying the script you want from GitHub, you can find a button above the code on the right called `raw`. Try using this code instead, as it takes you to a page with only the code allowing you to copy it and paste it much more easily, and preventing potential encoding issues.

- If you downloaded the files with the download utility, make sure to open the files and copy them with a text editor, **not** a word processor.

- Make sure you're using the latest version of SugarCube 2 and of your preferred compiler.

Expand Down
1 change: 1 addition & 0 deletions docs/_navbar.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* [Downloads](./download ':ignore')
* [Changelog](./changelog)
* [DEMO](./demo ':ignore')
4 changes: 2 additions & 2 deletions docs/articles.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This macro attempts to take the following text and prepend it with the appropria

**Examples**:
```
<<set _adjective to either('steel', 'adamantium', 'stone', 'iron', 'bronze', 'uridium');
<<set _adjective to either('steel', 'adamantium', 'stone', 'iron', 'bronze', 'iridium');
You found <<a _adjective>> sword!
Expand All @@ -47,7 +47,7 @@ This macro adds an *override* to the `<<a>>`-style macros, allowing you to assig
**Arguments**:
- `article` the string `'a'` or the string `'an'`&mdash;the article to set the provided text to use.
- `text` a string of text, can be a word or a bunch or words, to assign an article.
- `caseSensitive` if a third argument is provided and truthy, the text will only be overridden if it matches the exact case of the override.
- `caseSensitive` if a third argument is provided and truth-y, the text will only be overridden if it matches the exact case of the override.

**Examples**:
```
Expand Down
4 changes: 3 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
> [!NOTE]
> I'm going to start keeping a changelog for these macros because keeping track of them is becoming a nightmare. The overall version numbers are not really helpful for tracking what's happening on a macro-by-macro basis, but I'm trying to stick to major version bumps meaning breaking changes in any macro, or complete refactors of the whole collection, like what v2.0.0 was. Minor version updates indicate new macros have been added. Patch version updates means individual macro updates and bug fixes, or documentation, website, or demo updates.
### Jul 0, 2019 (v2.4.0)
### Jul 16, 2019 (v2.4.0)

- **[Update]** The `<<dialog>>` macro now accepts an `<<onopen>>` and `<<onclose>>` macro tag to set up handlers. These tags set up single-use event handlers for the dialog open and close events.
- **[Update]** The `<<notify>>` macro now accepts CSS time in its `delay` argument and is paired with a function, `setup.notify()` for usage in JS, plus some additional cleanup.
- **[New]** Added the articles (a/an) macro set.
- **[Docs]** Removed the note about retirement from the `<<mouseover>>` macro.
- **[Docs]** Reorganized / grouped macros in the main readme.
- **[Demo]** Added new macros / updates to demo file.
- **[Meta]** Created a [downloading utility](./download ':ignore') that creates custom bundles and generates downloads for them.

### Jun 28, 2019 (v2.3.0)

Expand Down
Loading

0 comments on commit 21130a3

Please sign in to comment.