**Download Link**: [Monogatari-v2.0.0.beta.7.zip](https://datadyne.perfectdark.space/monogatari/releases/Monogatari-v2.0.0.beta.7.zip)

> **Remember this is a _Beta_ release meant for testing and bugs are expected, everything is also prone to change a lot. If you're using it to release a game, you should warn your players as chances are it will eventually break.**

### 💜 Support Monogatari

Monogatari is free, open source, and built in the open — releases like this one are powered by the people who chip in to keep it going. If the engine helps you bring your stories to life, please consider sponsoring its development:

- ❤️ [GitHub Sponsors](https://github.com/sponsors/Hyuchia)
- 🧡 [Patreon](https://www.patreon.com/Hyuchia)
- ☕ [Ko-fi](https://ko-fi.com/hyuchia)

### 📰 Release Change Log

#### 🌟 New Features
- Actions have four new hooks `beforeRun`, `afterRun`, `beforeRevert` and `afterRevert`, however this are mostly for internal use and users should use the `willProceed`, `didProceed` and `willRollback`, `didRollback` ones
- Monogatari now exports the [`random-js` library](https://github.com/ckknight/random-js) to perform random numbers related functionalities
- New `monogatari.random (min, max)` function was added that returns a cryptographyc random number
- Added files required for Apple's app notarization process so the electron version of a game gets notarized automatically
- New `timer-display` component was added to enable timed actions
- Choices now allow a `Timer` property, the following example will randomly pick a choice if none was picked in 5 seconds:

```javascript
{
    'Choice': {
        'Dialog': 'y Have you already read some documentation?',
        'Timer': {
	    // Time in milliseconds 
            time: 5000,
            // The function to run when the time is over
            callback: () => {
		// Get all choices being shown and that are not disabled
                const choices = monogatari.element ().find ('[data-choice]:not([disabled])');
                
                // Pick one of those options randomly
                const random = choices.get (monogatari.random (0, choices.length - 1));
                
                // Fake a click on it
                random.click ();
                
		// Promise friendly!
                return Promise.resolve ();
            }
        },
        'Yes': {
            'Text': 'Yes',
            'Do': 'jump Yes'
        },
        'No': {
            'Text': 'No',
            'Do': 'jump No'
        }
    }
}
```

Want to change the color of the `timer-display`? That's simple!

```css
timer-display > div {
	background: '<some CSS Color>';
}
```

#### 🐛 Bug Fixes
- Main menu music would stop playing if entering any other menu
- Position classes (left, right, center) where being overridden and the images would always be shown centered
- In some cases the wrong character would be shown when rolling back a `show character` statement
- Under some conditions (mainly on node), electron-only functions could be triggered and cause an error
- When rolling back to the beginning of a label, the game could enter an invalid state where the current `step` was a negative number
- Using `url()` or any `gradient()` CSS properties in the `show background` or `show scene` statements would not work
- Reversible functions would still require the user to click to advance even if the function returned `true` 

### 📦 Misc
- The [npm package](https://www.npmjs.com/package/@monogatari/core) has been updated to this latest version
- [Cypress](https://www.cypress.io/) is now being used to perform e2e testing
- Conditionals implementation has been changed and should be more reliable when rolling back
- Choices implementation was simplified

### How To Upgrade

If you were already using a previous release from `v2.x.x`, then upgrading is as simple as replacing the files in your engine directory with the new ones.

If you are planning to upgrade from a game made with the `v1.4.1` release, we recommend you reading the [Upgrade Guide](https://developers.monogatari.io/documentation/v/develop/upgrading-from-v1.4.1)