**Download Link**: [monogatari-v2.9.0.zip](https://storage.monogatari.io/releases/monogatari-v2.9.0.zip)

`v2.9.0` is the biggest fix release Monogatari 2 has had. While rewriting [the documentation](https://monogatari.io/v2), every page was checked against the engine itself, and that turned up problems in every corner of it, from games that froze after a typo to music that didn't play when a game was opened from its file. This release fixes them, each one with a test that fails without the fix.

Your script, your settings, your styles and your players' saves keep working: nothing was renamed or removed, and for most games upgrading means replacing one folder.

![Yui and Mio in front of the Palacio de Bellas Artes, in four moments of the Start Here tutorial|The new Start Here tutorial, "After the Bell", with art by Queen BeeBee](https://cdn.restlessdreams.cloud/5090cad0-63fe-47f7-b44d-2a6558691938.webp)

### 💜 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

#### 🌟 Highlights

**🛟 A mistake no longer freezes your game**

In 2.8, any statement that failed, like a jump to a label that doesn't exist, left the game stuck on that line. In 2.9.0 the statement shows its error dialog, the next click goes on with the statement after it, and **Back** steps over it:

```javascript
'y Come on, the lamps are about to come on!',
'jump Lamps', // There's no label called Lamps
'm Looks like that label isn\'t written yet...',
```

![On the left, an error dialog titled The label "Lamps" does not exist over the game; on the right, Mio's next line with Yui and Mio in front of the palace|The dialog names the missing label and the ones you may have meant. One click later, the story goes on.](https://cdn.restlessdreams.cloud/f2099fcd-527c-4008-8847-8d46bbe56dd8.webp)

Problems that used to be silent open a dialog while you develop, too: an object statement no action knows (a misspelled `Choice`), a label that runs out of statements without an `end` or a `jump`, a jump to an empty label, an endless loop of jumps, and a `wait` whose time isn't a number. A typo in any of your `.js` files opens one dialog that names the file and the line, where 2.8 left a blank page. [Diagnosing Errors](https://monogatari.io/v2/help/diagnosing-errors) lists every dialog by its title.

**⏪ Back undoes exactly what happened**

Going back now undoes exactly what each statement did, for choices, music, sounds, videos, particles, the gallery, the text box, images, backgrounds, canvases and NVL pages. In 2.8, some of these brought back things that were never there, or removed more than they should. **Back** from the line an option showed returns to the choice menu and runs its `onRevert`.

**💾 Saves you can count on**

- Saves made with 2.8 load in 2.9.0, and going back from them works.
- A new game starts from what `js/storage.js` declares, instead of carrying over variables from the last game or an older save.
- Loading a missing slot, or a save made at a label your script no longer has, leaves the game as it was (2.8 emptied the screen).
- `monogatari.upgrade()` works with IndexedDB, the starter game's storage.
- Lowering your `Version` or changing your `Store` no longer hides your players' saves. The game keeps using them, and a dialog tells you what to change back.
- Every save made in one visit to the save screen keeps its picture, and autosaves fill empty slots first, then the oldest.

**⏩ Skip and auto-play**

The quick menu's **Skip** button and the <kbd>S</kbd> key turn skipping on and off whenever the `Skip` setting is above `0`; in 2.8 they did nothing. Auto-play stops the moment the player turns it off, and a double click moves the game forward once.

**🔊 Audio that plays**

- A game opened from its file, with no server, plays its music, sounds and voices. Audio effects still need the game to be served.
- A missing or misspelled audio file no longer stops the game: a dialog names it while you develop, and the game goes on without it.
- The `delay`, `chorus`, `phaser`, `ringmod` and `autowah` effects change the sound. In 2.8 they did nothing, so a game that used them will now hear them.

**✍️ A typing cursor, and effects on every line**

The new `TypingCursor` setting shows a blinking cursor after the last typed letter:

```javascript
// js/options.js
'TypingCursor': true,
```

Style it with `--cursor-blinker`, `--cursor-speed` and `--cursor-easing` (see [Type Writer](https://monogatari.io/v2/components/type-writer#show-a-typing-cursor)). Text effects also show on lines that appear at once, and the effects that reveal letters start as each letter is typed.

**🌐 Translations and right to left**

- `monogatari.translations(object)` adds strings to a language instead of replacing all of them.
- A string a language lacks shows in English, and a missing language opens one dialog instead of one per string.
- `<html lang>` and `<html dir>` follow the game's language, so a game in Arabic is laid out right to left.

**🎨 Interface**

![The gallery screen with one unlocked picture of the palace and one locked card, next to the credits screen with Story and Thanks sections|Gallery pictures show again, and the credits screen is laid out as a centered column.](https://cdn.restlessdreams.cloud/ceb82a6f-c4ae-4da1-bedb-cb33fe138708.webp)

- **Gallery pictures show.** In 2.8 their cards had no width, so unlocked pictures were invisible.
- **The credits screen is laid out** as a centered column, roles on the left and names on the right.
- **The loading bar fills** as the files load.
- **Messages, alerts and the name prompt are narrower** on wide screens, and the quick menu's icons are 24 pixels (they were 16).
- **Fifteen new CSS variables** reach colors that used to need a selector of their own. Nothing changes until you set them:

```css
/* style/main.css */
:root {
  --text-box-text-color: #fff7e6;
  --choice-text-color: #fff7e6;
  --modal-background-color: #fdf6ec;
  --loading-bar-color: #c28cf0;
}
```

The full list is on [CSS Variables](https://monogatari.io/v2/style-and-design/css-variables).

**♿ Accessibility**

Screen readers read every new line with its speaker, sprites by name and expression, and the name of every button and slider. The starter game allows pinch zoom on phones ([Accessibility](https://monogatari.io/v2/guides/accessibility) shows the one-line change for your own `index.html`), and the message asking players to rotate their phone has an **OK** button.

**🖥️ Desktop apps**

- `FileSystem` storage works in both the Electron and the Electrobun apps: saves are files in the app's data folder.
- Links to websites open in the player's browser. In 2.8, Electron asked whether to quit the game.
- The Electrobun app shows your game's name as its title, and lists window sizes in the settings.
- The starter's `package.json` runs without Yarn, builds the Linux app and makes a smaller Electron app. [Releasing for Desktop](https://monogatari.io/v2/guides/releasing/desktop) lists the lines to copy into yours.

**🌍 Offline play on the web**

With the new `service-worker.js`, a game in a sub-folder of a website (itch.io, GitHub Pages) plays offline, players get the scripts and stylesheets you change on their next visit, and two games on one website keep their offline copies apart.

**🔄 Live reload while you work**

Serve your game with `bun run serve` and the page reloads by itself each time you save a file, showing the change, a replaced picture or sound included. In 2.8 it never did: the starter's own security policy blocked the reload. [Open Your Game](https://monogatari.io/v2/start-here/open-your-game#serve-your-game) shows how to start the server.

**📚 New documentation, and art you can use**

The docs at [monogatari.io/v2](https://monogatari.io/v2) were rewritten and checked against the engine, from a [Start Here](https://monogatari.io/v2/start-here) tutorial that goes from the downloaded zip to a story shared online, using only a browser and a text editor, to a reference for every action, component, setting and engine method, and a path for people who want to work on Monogatari itself.

The tutorial and the docs use art by [Queen BeeBee](https://queenbeebee.carrd.co/): the Palacio de Bellas Artes at four times of day, and Yui and Mio, remade from their original files. Two downloads bring them to your own projects:

- [`monogatari-tutorial-assets-v2.9.0.zip`](https://storage.monogatari.io/releases/monogatari-tutorial-assets-v2.9.0.zip): the tutorial's scenes, characters, music and sound.
- [`monogatari-characters-v2.9.0.zip`](https://storage.monogatari.io/releases/monogatari-characters-v2.9.0.zip): Yui and Mio facing both ways, with every layer, 16 expressions in each of their two poses, side images, and declarations ready to paste for whole and [layered sprites](https://monogatari.io/v2/script-actions/character-layers).

![Mio and Yui as layered sprites in front of the palace; in the second picture, Yui grins|Layered sprites from the character download: one statement, show character y:mouth grinning, changes Yui's mouth and nothing else.](https://cdn.restlessdreams.cloud/a62ea435-d585-4dbd-8465-b6944e5c0a40.webp)

> [!IMPORTANT]
> The art isn't covered by Monogatari's MIT license. It comes with its own terms, in `TERMS.txt` in both downloads: use it to learn and in games you give away for free, always credit Queen BeeBee with a link to her page, and never use it with AI or in anything that makes money. The [FAQ](https://monogatari.io/v2/help/faq#can-i-use-yui-mio-and-the-tutorials-backgrounds-in-my-game) has the details.

#### ⚠️ Changes You Might Notice

None of these need a change in your game, but they can make it look or behave a little differently:

- **A variable's value shows as text.** If a player types `<b>Kim</b>` as their name, the line shows the tags instead of a bold name, so nothing a player types can change your page. If your own variables hold HTML on purpose, turn it back on:

```javascript
// js/options.js
'AllowHTMLInVariables': true,
```

- **A `{{variable}}` that doesn't exist shows in the line as written.** 2.8 emptied the whole line.
- **Variables the game never declared are removed** when a game ends or a save loads. Declare every variable in `js/storage.js`.
- **The Text Speed slider is faster to the right.** Players' saved speeds don't change.
- **The wave effects lift the letters.** If you set a negative `--effect-wave-amplitude` to make them rise, use a positive value now.
- **Centered lines have a box**, with white text on the main color. For the 2.8 look, add `centered-dialog { background-color: transparent; color: var(--text-color); }` to `style/main.css`.
- **Your game shows more error dialogs while you develop**, one for each problem 2.8 kept quiet about. Each one points at something to fix in your script.

#### 🧩 For Extension Authors

- `monogatari.configuration({ part: { … } })` changes the configuration, and a menu on screen redraws when its configuration changes. Menu methods like `addButton()` work anywhere in your files, not only after `init()`.
- `onSave()` on actions and components runs after every save.
- A `didApply()` that returns nothing waits for the player instead of throwing.
- Preloading fires a new `assetFailed` event for each file that fails, and `didPreloadAssets` always fires.
- `Component.get(id)` and `instance(id)` find elements by `data-instance`, and a component registered for a tag that's already in use keeps the first one.
- The engine no longer writes into your script's statement objects.
- TypeScript projects can import the engine's types from `@monogatari/core` (TypeScript 5.0 or later).

#### 📦 Misc

- The console no longer shows "Lit is in dev mode": the engine bundles Pandora 0.5.1, built for production, and is about 8 KB smaller.
- Without the debug file, a released game's console only shows errors and warnings.
- The error dialogs' help links point at the docs and GitHub instead of the old community forums.
- The engine's code follows one formatting style, checked on every build, and the continuous integration checks that the committed bundles match the source.
- The [npm package](https://www.npmjs.com/package/@monogatari/core) has been updated to `2.9.0`.

<!-- fixes:start -->

#### 🧾 Every Fix

Here is everything 2.9.0 fixes, area by area, the highlights above included. Open an area to read it.

<p class="fixes-controls"><button class="fixes-toggle" type="button" hidden>Open every area</button></p>

<details class="fixes">
<summary class="fixes__summary"><span class="fixes__icon" aria-hidden="true">▶️</span><span class="fixes__heading"><span class="fixes__title">The game keeps going</span><span class="fixes__gist">Mistakes in a script, clicks and controls</span></span></summary>
<ul class="fixes__list">
<li>A statement that fails, like a jump to a missing label, a missing character or sprite, or hiding something that isn't shown, opens its error dialog, and the next click goes on with the statement after it. In 2.8 the game stopped there, and only <strong>Quit</strong> still worked.</li>
<li>A function statement that throws no longer holds the game.</li>
<li>A <code>didApply()</code> that returns nothing waits for the player instead of throwing.</li>
<li>Two clicks in the same instant advance one statement instead of two, and two Backs go back one.</li>
<li>A label that runs out of statements, with no <code>end</code> or <code>jump</code>, shows an error at its end.</li>
<li>A jump to an empty label shows an error, and an endless loop of jumps stops with one instead of freezing the page.</li>
<li><strong>Skip</strong> works: the quick menu's button and the <kbd>S</kbd> key turn it on and off when the <code>Skip</code> setting is above <code>0</code>.</li>
<li>Stopping auto-play stops it at once. In 2.8, one more statement went by.</li>
<li>Clicking a button with a <code>data-action</code> inside the game screen no longer advances the game too.</li>
<li>Moving the Text Speed slider while a line was typing no longer freezes the game.</li>
<li><code>wait</code> reads its time after extra spaces (<code>'wait  500'</code>), and a time that isn't a number shows an error instead of waiting for a click.</li>
<li><code>vibrate</code> in a browser that can't vibrate, and <code>show notification</code> in one without notifications, go on instead of holding the game, and a notification no longer waits for the player to answer the permission prompt.</li>
</ul>
</details>

<details class="fixes">
<summary class="fixes__summary"><span class="fixes__icon" aria-hidden="true">⏪</span><span class="fixes__heading"><span class="fixes__title">Going back</span><span class="fixes__gist">Back undoes exactly what each statement did</span></span></summary>
<ul class="fixes__list">
<li>Going back past the first <code>show scene</code> or <code>show background</code> clears it, and its <code>duration</code> too.</li>
<li>Going back past one copy of an image removes that copy only, and going back over <code>hide image</code> brings back every copy it hid.</li>
<li>Going back over <code>show textbox</code> hides the text box only if it was hidden before, and going back over a <code>hide textbox</code> that found it hidden keeps it hidden.</li>
<li>Going back over <code>gallery unlock</code> only locks a picture that statement unlocked.</li>
<li>Going back over <code>hide particles</code> or <code>hide video</code> only brings back what was showing, and videos no longer appear twice.</li>
<li>Going back past a second <code>particles</code> restores the first system instead of removing every particle.</li>
<li>Going back while a modal or immersive canvas waits removes it, going back past a canvas its own code hid works, and going back over <code>hide canvas</code> shows the canvas again in its own mode.</li>
<li>Going back over <code>show canvas</code> removes and forgets only the most recent canvas with that name and mode.</li>
<li>Music: going back past a plain <code>play</code> resume no longer pauses tracks that were never paused, going back past a second <code>play</code> of a playing track no longer stops it, and going back past a <code>stop</code> no longer brings a paused track back playing.</li>
<li>A video shown with its mode left out is forgotten when going back.</li>
<li>Going back from a statement that waits after an NVL line keeps that line on the page. The dialog log stays in step on NVL pages, and a load followed by Back no longer empties the NVL box.</li>
<li>Going back from the first line of a label that a function statement jumped to stays on that line, without running the function again.</li>
<li>A function statement's <code>Reverse</code> works after a load.</li>
</ul>
</details>

<details class="fixes">
<summary class="fixes__summary"><span class="fixes__icon" aria-hidden="true">🔀</span><span class="fixes__heading"><span class="fixes__title">Choices, conditions and inputs</span><span class="fixes__gist">Picks you can take back, and fields that behave</span></span></summary>
<ul class="fixes__list">
<li>A choice whose options are all hidden is passed over, instead of showing an empty menu that never goes away.</li>
<li>A choice option whose <code>Do</code> is an object, or is missing, no longer leaves the game waiting.</li>
<li>A choice with two or more options that have their own <code>Condition</code> no longer locks the game after the pick.</li>
<li>Back from the line an option's <code>Do</code> showed returns to the menu, runs <code>onRevert</code> and forgets the pick, so picking again runs <code>onChosen</code> once.</li>
<li>An option whose <code>onChosen</code> has no <code>onRevert</code> can't be gone back past, every time. In 2.8, Back showed the menu again with the first pick's changes still in place.</li>
<li>Back from an option whose <code>Do</code> failed shows the menu again, with <code>onRevert</code> run.</li>
<li>A save made on the line an option's <code>Do</code> showed loads on that line, instead of on the menu with the pick kept.</li>
<li>Going back to a menu that was on an NVL page keeps the page's lines.</li>
<li>Disabled options look disabled.</li>
<li>A <code>Conditional</code> with no branch for the result goes on to the next statement, and an error in the branch it ran no longer runs the other branch too.</li>
<li>An input whose <code>Validation</code> returns neither <code>true</code> nor <code>false</code> shows an error, instead of leaving the player stuck.</li>
<li>Date, time, range and telephone inputs start on their <code>Default</code>.</li>
</ul>
</details>

<details class="fixes">
<summary class="fixes__summary"><span class="fixes__icon" aria-hidden="true">💾</span><span class="fixes__heading"><span class="fixes__title">Saves and storage</span><span class="fixes__gist">Saves you can count on</span></span></summary>
<ul class="fixes__list">
<li>A new game, and every save you load, start from what <code>js/storage.js</code> declares: variables the game added without declaring them no longer carry over.</li>
<li>Loading a missing slot, or a save made at a label your script no longer has, leaves the game as it was, with an error dialog while you develop. 2.8 emptied the screen and left the wait cursor on.</li>
<li><code>monogatari.upgrade()</code> works with IndexedDB, the starter's storage, and from any of your files, after <code>preferences()</code> too. In 2.8 it left a blank page, or never ran.</li>
<li>An upgrade in one tab no longer waits for the game's other tabs to close: they let go of the storage and ask the player to reload.</li>
<li>A <code>Version</code> set lower than before, a <code>Version</code> of <code>0.0.0</code>, or a changed <code>Store</code> no longer hides your players' saves. The game goes on with the data they have, and a dialog says what to change back.</li>
<li>A <code>Name</code> with no Latin letters or digits, like <code>物語</code>, gets a storage name of its own, so saves work. LocalStorage saves a 2.8 game made without a name prefix are copied over once.</li>
<li>Every save made in one visit to the save screen keeps its picture, and an autosave no longer takes a manual save's picture.</li>
<li>Autosaves fill empty slots first, then the oldest, across visits. They only save while the game is being played, and get a readable name.</li>
<li>Slots show their date as players read it, and saves from v1.4.1 no longer say "Invalid DateTime".</li>
<li>When the storage can't open, one dialog says why, without a second one from the save list.</li>
<li><code>FileSystem</code> storage runs its upgrade functions, and in a browser its dialog says it needs a desktop app.</li>
<li>The <code>Screenshots</code> setting no longer claims it needs IndexedDB: save pictures work with every storage.</li>
</ul>
</details>

<details class="fixes">
<summary class="fixes__summary"><span class="fixes__icon" aria-hidden="true">🔊</span><span class="fixes__heading"><span class="fixes__title">Music, sound and video</span><span class="fixes__gist">Audio that plays, and videos that let go</span></span></summary>
<ul class="fixes__list">
<li>A game opened from its file plays its music, sounds and voices. Their audio effects apply when the game is served.</li>
<li>Opened from a file, preloading skips audio instead of logging a failure for every track, and Chrome no longer logs worklet errors.</li>
<li>A missing or misspelled audio file, or one that can't be decoded, names itself in a dialog while you develop, and the game goes on without it.</li>
<li>The <code>delay</code>, <code>chorus</code>, <code>phaser</code>, <code>ringmod</code> and <code>autowah</code> effects change the sound. In 2.8 they did nothing.</li>
<li>Resuming paused music with a fade fades it in.</li>
<li><code>play music</code> for a track that's already playing keeps its <code>loop</code>, and a save restores the track once, even a 2.8 save that held it twice.</li>
<li>A load restores a paused track paused, without playing it first.</li>
<li><code>play music with …</code> and <code>stop music with fade …</code> without a track name no longer store a track called "with", so saves and Back treat them right, and stopping several tracks fades them out together.</li>
<li>A misspelled kind (<code>play musik theme</code>, <code>stop musik</code>, <code>pause musik</code>) shows an error instead of crashing, and a named <code>pause</code> of a track that isn't playing no longer fails.</li>
<li>A name in a preload block that was never declared with <code>monogatari.assets()</code> is reported instead of skipped.</li>
<li>Videos: the mode can be left out (<code>show video intro with close</code>), a modal video with <code>close</code> no longer skips the line behind it, and immersive and fullscreen videos without <code>close</code> let the player move on once they end.</li>
<li><code>hide video</code> on a modal, immersive or fullscreen video lets the game go on, and <code>hide video rain fadeOut</code> plays <code>fadeOut</code>.</li>
<li>A video that fails to load, from an undeclared name or a missing file, no longer holds the game.</li>
<li>Removing a media player no longer makes the browser request the page itself as media.</li>
</ul>
</details>

<details class="fixes">
<summary class="fixes__summary"><span class="fixes__icon" aria-hidden="true">🎭</span><span class="fixes__heading"><span class="fixes__title">Scenes, characters and images</span><span class="fixes__gist">Colors, sprites and their animations</span></span></summary>
<ul class="fixes__list">
<li>A color with an animation (<code>show scene black with fadeIn</code>, <code>show background red with fadeIn</code>) shows the color, and <code>with</code> no longer ends up as a class.</li>
<li><code>hide character</code> and <code>hide image</code> with a class that isn't an animation remove the sprite at once, instead of leaving it on screen.</li>
<li><code>end-</code> animations keep their whole name (<code>end-shake-hard</code>), and work for images too.</li>
<li>An image whose name ends in "at" followed by more words gets the right position.</li>
<li>A character with no <code>sprites</code>, or <code>show character</code> with no name, shows an error dialog instead of a TypeError.</li>
<li>A character whose id is also an action's word gets an error dialog while you develop.</li>
<li>A <code>default_expression</code> without <code>expressions</code> is used as the side image's file, and the line shows. Preloading no longer asks for it as a file for every character.</li>
<li>Layered sprites (experimental) are no longer cut in half, and keep their size and place when a layer changes.</li>
<li>Layer exit animations and <code>end-</code> classes play, and a layer you removed stays gone.</li>
<li>A layer missing from <code>layer_assets</code>, or listed there but not in <code>layers</code>, shows an error instead of throwing or never being drawn.</li>
</ul>
</details>

<details class="fixes">
<summary class="fixes__summary"><span class="fixes__icon" aria-hidden="true">✨</span><span class="fixes__heading"><span class="fixes__title">Canvas, particles and effects</span><span class="fixes__gist">Effects that come and go cleanly</span></span></summary>
<ul class="fixes__list">
<li>A text box hidden with <code>hide textbox</code> shows again in the next game.</li>
<li><code>gallery unlock</code> of a picture already unlocked no longer adds it twice.</li>
<li><code>show canvas stars with fadeIn</code> works without a mode, and each show gets its own copy of the canvas's nested <code>state</code>.</li>
<li>A modal canvas can be clicked: the particles layer no longer covers it.</li>
<li><code>hide canvas</code> stops, removes and forgets one canvas when an object was shown twice, takes classes written without <code>with</code>, and removes the canvas at once when its class animates nothing.</li>
</ul>
</details>

<details class="fixes">
<summary class="fixes__summary"><span class="fixes__icon" aria-hidden="true">✍️</span><span class="fixes__heading"><span class="fixes__title">Text and typing</span><span class="fixes__gist">Effects, markers and variables in your lines</span></span></summary>
<ul class="fixes__list">
<li>Text effects show on lines that appear at once, with typing off, and when the player clicks to finish a line.</li>
<li>Effects that reveal letters (fade, blur, scale, slide, glitch-hard, invisible ink, handwriting, strike, flicker, static…) start as each letter is typed, instead of showing the text early.</li>
<li>The wave effects lift the letters, and <code>--effect-reveal-duration</code> sets how long the reveal effects take.</li>
<li>Icons in a line show while it types.</li>
<li>A marker after an HTML tag runs where it is in the line, and two markers side by side run once each.</li>
<li><code>didStartTyping</code> fires once per line.</li>
<li>A <code>TextSpeed</code> set from code keeps working after the first line, and the Text Speed slider no longer drops a <code>showCursor</code> set in the type writer's configuration.</li>
<li>The Text Speed slider is faster to the right. Players' saved speeds don't change.</li>
<li>The new <code>TypingCursor</code> setting shows a blinking cursor after the last typed letter, and <code>--cursor-color</code> follows the text color.</li>
<li>Centered lines have a box, with white text on the main color.</li>
<li>The dialog log's narrator style applies.</li>
<li>A <code>{{variable}}</code> that doesn't exist shows in the line as written. 2.8 emptied the whole line.</li>
<li>A variable's value shows as text, so nothing a player types can change the page; <code>'AllowHTMLInVariables': true</code> brings back values as HTML. A value that refers back to itself stops with an error instead of overflowing the stack.</li>
</ul>
</details>

<details class="fixes">
<summary class="fixes__summary"><span class="fixes__icon" aria-hidden="true">🌐</span><span class="fixes__heading"><span class="fixes__title">Translations and right to left</span><span class="fixes__gist">Every language, both directions</span></span></summary>
<ul class="fixes__list">
<li><code>monogatari.translations(object)</code> adds strings to each language, instead of replacing the language's whole table.</li>
<li>A string a language lacks shows in English, and a missing interface language opens one dialog instead of one per string.</li>
<li><code>_(Key)</code> markers work side by side and inside parentheses.</li>
<li>A message's <code>actionString</code> works and survives a language change, and so do the quick menu's swapped labels.</li>
<li>The settings screen's language list follows the language selection screen.</li>
<li>Removing a language no longer leaves the players who picked it with a blank page: they get the game's <code>Language</code>.</li>
<li>The save-name placeholder is translated, with the new <code>SaveSlotName</code> string.</li>
<li>Deutsch, Nederlands, 日本語 and 简体中文 have the strings that were still in English, and so does Español's <code>AllowPlayback</code>.</li>
<li><code>&lt;html lang&gt;</code> and <code>&lt;html dir&gt;</code> follow the game's language, so a right-to-left game is laid out right to left.</li>
<li>With <code>rtl</code>, the text box's line is right-aligned, the side image is no longer mirrored twice, and the screens' back button sits at the top right.</li>
<li>The <code>side-image--non-independent</code> and <code>side-image--unconstrained</code> classes do what they say.</li>
</ul>
</details>

<details class="fixes">
<summary class="fixes__summary"><span class="fixes__icon" aria-hidden="true">🎨</span><span class="fixes__heading"><span class="fixes__title">Interface and style</span><span class="fixes__gist">Screens, menus and the stylesheet</span></span></summary>
<ul class="fixes__list">
<li>Gallery pictures show. In 2.8 their cards had no width.</li>
<li>The credits screen is laid out as a centered column, and a section written as text keeps its heading and its variables, shown as text.</li>
<li>The loading bar fills, counts each file once, and sits in the middle of the screen.</li>
<li>The help screen no longer lists an <kbd>A</kbd> key, and leaves out Skip and Back when your game turns them off.</li>
<li>Main-menu buttons without an icon no longer get <code>icon="undefined"</code>, and menu labels can be plain text as well as translation keys.</li>
<li>Menu changes (<code>addButton()</code> and the others) work anywhere in your files, and <code>configuration('main-menu', …)</code> or <code>component('main-menu').configuration('buttons', …)</code> changes the menu on screen.</li>
<li>The settings screen shows preferences the game changed after it started, sets itself up when it's added later, and keeps its volume sliders in step.</li>
<li>A screen's button for a screen that isn't in <code>index.html</code> shows an error instead of an empty page.</li>
<li>The labels of alerts, messages and the name prompt can be plain text as well as translation keys.</li>
<li><code>monogatari.alert()</code> works before <code>init()</code>, and dismissing one alert leaves the others open.</li>
<li>Messages, alerts and the name prompt are narrower on wide screens, and error dialogs show above them.</li>
<li>The quick menu's icons are 24 pixels (they were 16).</li>
<li>Fifteen new CSS variables reach colors that used to need a selector of their own, the bars at the top of the game included.</li>
<li>On a phone held the wrong way for your <code>Orientation</code>, the rotate message has an <strong>OK</strong> button.</li>
<li>Kayros's <code>.margin</code> class has its unit.</li>
<li>The rules in the starter's <code>style/main.css</code> match what the engine draws.</li>
</ul>
</details>

<details class="fixes">
<summary class="fixes__summary"><span class="fixes__icon" aria-hidden="true">♿</span><span class="fixes__heading"><span class="fixes__title">Accessibility</span><span class="fixes__gist">For players with screen readers, keyboards and small screens</span></span></summary>
<ul class="fixes__list">
<li>Screen readers read every new line with its speaker.</li>
<li>Sprites are described by name and expression.</li>
<li>Every button, slider and list has a name, the screens' back buttons and the quick menu included.</li>
<li>The gallery's back button works from the keyboard.</li>
<li>The starter's <code>index.html</code> allows pinch zoom.</li>
</ul>
</details>

<details class="fixes">
<summary class="fixes__summary"><span class="fixes__icon" aria-hidden="true">🐞</span><span class="fixes__heading"><span class="fixes__title">Error dialogs and the console</span><span class="fixes__gist">One clear dialog per mistake</span></span></summary>
<ul class="fixes__list">
<li>The debug file turns the dialogs on by itself, so they show even when <code>js/main.js</code> never sets a debug level.</li>
<li>A typo in one of your <code>.js</code> files opens one dialog that names the file. A typo in <code>js/main.js</code> no longer leaves a blank page, and one in <code>js/script.js</code> no longer adds a second dialog about the Start label.</li>
<li>Errors that happen together all show, wherever the game is hosted, not only on your own computer.</li>
<li>"An Unknown Error Occurred" also covers errors after the page loaded.</li>
<li>Dialogs that opened before their texts loaded show their real title and message.</li>
<li>Details read well: elements show as markup, lists, functions and classes by name, and text from your script as written, never run as HTML.</li>
<li>An error a statement finds while it's being prepared names the statement instead of "undefined", and Back doesn't show it again.</li>
<li>The statements in the dialogs are highlighted, and their texts are corrected ("does not exist", "occurred", an apply error that says "apply").</li>
<li>Without the debug file, a released game's console only shows errors and warnings, even at debug level 5.</li>
<li>Help links point at the docs, Discord and GitHub instead of the old forums and Twitter, and the starter's help message links the v2 docs.</li>
<li>The console no longer shows "Lit is in dev mode": the engine bundles Pandora 0.5.1, built for production, and is about 8 KB smaller.</li>
<li>When offline play is off, the console says why (opened from its file, or plain <code>http</code>) instead of pointing at a Chrome app that no longer exists.</li>
</ul>
</details>

<details class="fixes">
<summary class="fixes__summary"><span class="fixes__icon" aria-hidden="true">🖥️</span><span class="fixes__heading"><span class="fixes__title">Desktop apps</span><span class="fixes__gist">Electron and Electrobun</span></span></summary>
<ul class="fixes__list">
<li><code>FileSystem</code> storage works in both apps: saves are files in the app's data folder. In 2.8 it hung the game at boot.</li>
<li>Links to websites open in the player's browser. In 2.8, Electron asked whether to quit the game.</li>
<li>The Electrobun app talks to its window: it shows your game's name as its title and lists window sizes in the settings.</li>
<li>The engine's default <code>Resolution</code> is <code>'1280x720'</code>, so a window with <code>ForceAspectRatio</code> set to <code>'Global'</code> opens at 16:9.</li>
<li>The starter's <code>package.json</code> runs without Yarn, builds the Linux app, keeps Electrobun out of the Electron app (which makes it much smaller), and makes a release build of the Electrobun app.</li>
<li>Notarizing on a Mac passes the <code>teamId</code> it needs.</li>
<li>A second Electron window, on macOS after closing the first, no longer adds a second set of handlers.</li>
<li>electron-builder no longer warns about <code>desktopName</code>, so Linux matches the window to its app.</li>
</ul>
</details>

<details class="fixes">
<summary class="fixes__summary"><span class="fixes__icon" aria-hidden="true">🌍</span><span class="fixes__heading"><span class="fixes__title">The web and the dev server</span><span class="fixes__gist">Offline play, updates and live reload</span></span></summary>
<ul class="fixes__list">
<li>A game in a sub-folder of a website (itch.io, GitHub Pages) installs its service worker and plays offline.</li>
<li>Players get the scripts and stylesheets you change on their next visit, and pictures or sounds you replace under the same name by their second.</li>
<li>Two games on one website keep their offline copies apart.</li>
<li>The offline page says the player is offline, instead of "under maintenance".</li>
<li><code>bun run serve</code> reloads the page each time you save a file, and serves file names with spaces.</li>
<li>Firefox no longer warns about the starter's Content-Security-Policy.</li>
</ul>
</details>

<details class="fixes">
<summary class="fixes__summary"><span class="fixes__icon" aria-hidden="true">🧩</span><span class="fixes__heading"><span class="fixes__title">For extension authors</span><span class="fixes__gist">Your own actions, components and code</span></span></summary>
<ul class="fixes__list">
<li><code>monogatari.configuration({ part: { … } })</code> changes the configuration. In 2.8 it changed nothing.</li>
<li><code>onSave()</code> runs after every save, and <code>fn(name)</code> reads without overwriting what was stored. <code>interrupt()</code>, the static <code>match()</code>, <code>_priority</code> and <code>_events</code>, which the engine never used, are marked deprecated.</li>
<li><code>Component.get(id)</code> and <code>instance(id)</code> find elements by <code>data-instance</code>, and <code>Component.configuration('key', value)</code> sets one key on any component.</li>
<li>Registering a component for a tag already in use keeps the first one instead of adding a second.</li>
<li><code>unregisterComponent()</code> before setup keeps the experimental components.</li>
<li>Built-in components and actions have their <code>engine</code> from the start, so their helpers work before <code>init()</code>.</li>
<li><code>setup()</code> gets its selector, <code>loadingOrder</code> sorts as numbers, and a menu's <code>template()</code> survives a configuration update.</li>
<li>Preloading fires a new <code>assetFailed</code> event for each file that fails, and <code>didPreloadAssets</code> always fires.</li>
<li>The engine no longer writes into your script's statement objects.</li>
<li>TypeScript: the engine's types are exported from <code>@monogatari/core</code>, <code>registerAction()</code> takes a subclass of <code>Action</code> in strict mode, and the doc comments of <code>preferences()</code> and <code>registerAction()</code> are corrected.</li>
</ul>
</details>

<details class="fixes">
<summary class="fixes__summary"><span class="fixes__icon" aria-hidden="true">🛠️</span><span class="fixes__heading"><span class="fixes__title">Building, testing and the package</span><span class="fixes__gist">For people working on Monogatari itself</span></span></summary>
<ul class="fixes__list">
<li>The npm package ships only the starter game's files, not a leftover zip or desktop build.</li>
<li>The build uses the project's own TypeScript, and the watch build rebuilds the right file and watches the CSS.</li>
<li><code>bun run test</code> runs the Cypress specs in Chrome or Chromium.</li>
<li>The specs that failed on a clean checkout pass, and the save screenshots spec really tests LocalStorage.</li>
<li>CI checks that the committed bundles match the source.</li>
<li>The code follows one formatting style, two-space indentation included, checked on every build.</li>
<li>Comments in the type writer describe the marker syntax it reads today.</li>
</ul>
</details>

<!-- fixes:end -->

### How To Upgrade

#### If you're on `v2.8.0` or `v2.8.1`

1. **Keep a copy of your game folder**, so you can go back to it.
2. **Download [the starter game](https://storage.monogatari.io/releases/monogatari-v2.9.0.zip)** and replace your game's `engine/core/` and `engine/debug/` folders with its own.
3. **If your game is on the web**, copy the starter's `service-worker.js` into your game too. At its top, set `NAME` to your game's name again, and add back any file you had added to the `FILES` list.
4. **If you serve your game with `bun run serve`**, copy the starter's `serve.ts` into your game too, for the automatic reload.
5. **If you release desktop apps**, also copy the starter's `engine/desktop/`, `engine/electron/` and `engine/electrobun/` folders.
6. **Play your game from the start** with the debug file loaded: a dialog that's new to you points at something to fix in your script.

Using npm? Run `npm install @monogatari/core@2.9.0`.

The [Upgrading from 2.8](https://monogatari.io/v2/upgrading/from-v2-8) page lists every change a game could notice, area by area.

#### If you're on an older `v2.x.x` version

Follow the steps above, and read the [2.8.0 release notes](https://hyuchia.com/monogatari-v2.8.0) first: 2.8.0 changed how text effects close, and how custom actions block the game.

#### If you're on `v1.4.1` (stable) or below

If you're upgrading from a game built on `v1.4.1`, we recommend reading the [Upgrade Guide](https://monogatari.io/v2/upgrading/from-v1-4-1) first: the jump to v2 is a big one.

**Code changes**: [v2.8.1...v2.9.0](https://github.com/Monogatari/Monogatari/compare/v2.8.1...v2.9.0)
