Skip to content

Update TypeWriter Enclosed Action Format#187

Merged
Hyuchia merged 5 commits intoMonogatari:developfrom
MidZM:engine-typescript
Jan 13, 2026
Merged

Update TypeWriter Enclosed Action Format#187
Hyuchia merged 5 commits intoMonogatari:developfrom
MidZM:engine-typescript

Conversation

@MidZM
Copy link
Contributor

@MidZM MidZM commented Dec 26, 2025

Update the TypeWriter component to improve the parsing and handling of enclosed actions and their options.

Action Parsing and Error Handling:

  • Updated the parsing logic for enclosed actions to use opening ({action}) and closing ({/action}) tags, and added error handling for mismatched or improperly closed actions.
  • Modified the regular expressions and caches to correctly match both opening and closing forms of enclosed actions.

Updated Options Parsing:

  • Changed the ParsedAction.options type to accept either an object or an array of strings, allowing the use of "empty options" ({size large}Large Text{/size}).
  • Updated the _parseOptions method to return either an object or an array, depending on the input format, and to split options by whitespace if no key-value pattern is detected.

Regex Correction:

  • Fixed the QUOTED_VALUE_PATTERN regex to correctly capture quoted values.

Replaces now invalid {/effect} opening tags with correct {effect} syntax in dialog.spec.js.
New:
- Exported "tsParticles" for legacy support.

Fixes:
- Text speed can now be set from the settings slider.
- Text speed will now update text-box "typeSpeed" configuration. (Prior, even if you changed the text speed, it wouldn't update until refresh)
- "Message" actions will no longer soft lock the screen.
- Fixed a bug that caused the "AutoPlaySpeed" to change every time the player modified it and refreshed the game. (Upon refresh, it would always be the opposite of what they chose)
New:
- Added a "minTextSpeed" global variable to keep track of the minimum variable speed for later use.
- Added the ability to allow semi-instant skipping when the dev has chosen to keep "InstantText" off. (Setting the "min" value on the "text-speed" slider below 0 enables it)
- Added a comment to the "stopTyping" function to internally understand what the main differences are when "InstantText" is active and not.

Changes:
- Changed how text speed was being applied, to keep consistency when reloading the page.

Fixes:
 - Text speed slider bar was occasionally incorrect when refreshing the page.
- Fixed an issue where "selector" wasn't being passed to the "init" functions in actions and components.
Fixed a bug that was causing the page to not center correctly when aspect ratio was being enforced.
@Hyuchia Hyuchia merged commit 4dd271c into Monogatari:develop Jan 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants