Skip to content

Commit 6d45d4f

Browse files
committed
Update CHANGELOG
1 parent 4e9a5af commit 6d45d4f

File tree

1 file changed

+81
-28
lines changed

1 file changed

+81
-28
lines changed

CHANGELOG.md

Lines changed: 81 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,61 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77
## [Unreleased]
88

9+
### Overview
10+
11+
Yarn Spinner for Unity 3.1 contains a number of improvements and useful changes.
12+
13+
#### Dialogue Runner Is Now More Async
14+
15+
The dialogue runner's `StartDialogue` and `Stop` methods are now `async`, and return a task. When you call `StartDialogue`, you'll receive a task (either a `System.Threading.Tasks` task, a `UnityEngine.Awaitable`, or a `UniTask`) that will complete after every dialogue presenter has finished running its `OnDialogueStartedAsync` method. Likewise, the `Stop` method will finish after every dialogue presenter has finished running its `OnDialogueCompleteAsync` method. This is really useful for making sure that you don't accidentally make a change to your scene in the middle of your dialogue presenters getting ready.
16+
17+
### Dialogue Option Fallthrough
18+
19+
In Yarn Spinner, you can add a condition to the end of an option. If the condition evaluates to `false`, Yarn Spinner will mark the option as "unavailable". It's up to your game to decide what that means - you might want to make the option visible but unselectable, or you might want to hide the option from the player entirely. However, if _every_ option is unavailable, the player has no option they could select. Previously, this could cause your game to have to soft-lock the player, since they weren't able to proceed.
20+
21+
In Yarn Spinner 3.1, dialogue presenters are now allowed to tell the Dialogue Runner that no option was selected at all. When this happens, Yarn Spinner will skip the options and move on to the next part of the script:
22+
23+
```
24+
Guard: Who goes there?
25+
26+
// If the player is a thief, a royal visitor, or a merchant, then
27+
// go run the appropriate conversation for that. The player might be
28+
// some combination of the three, so let them choose.
29+
-> A thief! <<if $player_is_thief>>
30+
<<jump Guard_Thief_Conversation>>
31+
-> A royal visitor! <<if $player_is_royal_visitor>>
32+
<<jump Guard_RoyalVisitor_Conversation>>
33+
-> A merchant! <<if $player_is_merchant>>
34+
<<jump Guard_Merchant_Conversation>>
35+
36+
// But if the player is NONE of those, then none of the options would have
37+
// been available. We'll fall through to here.
38+
39+
Player: I'm nobody!
40+
<<jump Guard_Nobody_Conversation>>
41+
```
42+
43+
> [!NOTE]
44+
> You can turn off this behaviour by setting the `allowOptionFallthrough` property on your `DialogueRunner` to `false`.
45+
46+
### Lines Know Where They Came From
47+
48+
When Yarn Spinner sends a line to your game, it wraps up the line in an object called a [`LocalizedLine`](https://docs.yarnspinner.dev/api/csharp/yarn.unity/yarn.unity.localizedline). Previously, if your game has multiple Dialogue Runners that are running at the same time, it wasn't possible to know which runner the line came from. In Yarn Spinner 3.1, the `LocalizedLine` now has a [`Source`](https://docs.yarnspinner.dev/3.1/api/csharp/yarn.unity/yarn.unity.localizedline/yarn.unity.localizedline.source) property that tells you where it came from.
49+
50+
### Options Can Now Be Hurried Up And Cancelled
51+
52+
Just like how lines have a separate 'hurry up' and 'next' cancellation tokens that act as a signal to move things along, options now have the same 'hurry up' and 'next' tokens. (Previously, they only had a single cancellation token that signalled that option selection was no longer necessary.) This allows your game to signal that you want to hurry up the presentation of your dialogue's options.
53+
54+
### New Typewriter System
55+
56+
We've updated the way that typewriters are used in the built-in Line Presenter system, to make it easier to customise. This is useful for when you want to take full control over how the line appears over time, and for when you want to have in-game events occur (like sound effects) as the line appears.
57+
58+
To create a custom typewriter, create a class that implements [`IAsyncTypewriter`](https://docs.yarnspinner.dev/3.1/api/csharp/yarn.unity/yarn.unity.iasynctypewriter). You can find an example of how to write a custom typewriter in the source code for the [`LetterTypewriter`](https://github.com/YarnSpinnerTool/YarnSpinner-Unity/blob/main/Runtime/Views/Typewriter/LetterTypewriter.cs) class.
59+
60+
### Removed Legacy `DialogueView` Classes
61+
62+
Yarn Spinner 3.0 introduced a new programming model for presenting dialogue, called [Dialogue Presenters](https://docs.yarnspinner.dev/3.1/components/dialogue-view). As part of the rollout of this new API, we made the old `DialogueView` class act as a compatibility layer, and marked it as deprecated. Yarn Spinner 3.1 removes this deprecated code. If you have code that started life as a Yarn Spinner 2.0 project, you will need to [migrate your legacy dialogue presentation UI code to use Dialogue Presenters](https://docs.yarnspinner.dev/3.1/changelog/upgrading-from-yarn-spinner-2#dialogueviewbase-is-now-dialoguepresenter).
63+
964
### Added
1065

1166
- `DialogueRunner` will now log warnings if a dialogue presenter throws an `OperationCanceledException` - these usually indicate that a task they were themselves waiting on was cancelled, and that the presenter didn't clean up.
@@ -15,10 +70,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1570
- By Word
1671
- By Letter
1772
- Instantly
18-
- A virtual `IAsyncTypewriter` field `Typewriter` onto `DialoguePresenterBase`
19-
- Virtual `OnNodeEnter` and `OnNodeExit` calls onto `DialoguePresenterBase`
20-
- A static `FindRunner` call onto `DialogueRunner` which first tries to find it on the game object itself and then anywhere in the scene
21-
- A `Source` field to the `LocalizedLine`, this can be of any type but by default will be the `DialogueRunner` that caused the line to be created
73+
- Added a virtual `IAsyncTypewriter` field `Typewriter` onto `DialoguePresenterBase`
74+
- Added new virtual `OnNodeEnter` and `OnNodeExit` calls onto `DialoguePresenterBase`.
75+
- Added a static `FindRunner` call onto `DialogueRunner`, which first tries to find it on the game object itself, followed by anywhere in the scene.
76+
- Added a `Source` field to the `LocalizedLine`, this can be of any type but by default will be the `DialogueRunner` that caused the line to be created
2277
- Options can now be hurried up, the same as lines
2378
- added `RunOptionsAsync(DialogueOption[], LineCancellationToken)` to `DialoguePresenterBase`.
2479
- this method is virtual and is now the recommended way to respond to options
@@ -29,7 +84,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
2984
- added hurry up option inputs to `LineAdvancer`
3085
- `LineAdvancer` now better handles situations where you want to use the same input for hurrying up and skipping lines.
3186
- This behaviour is controllable via the `separateHurryUpAndAdvanceControls` field
32-
- `InterfaceContainer` is a wrapper class to clean up some interface serialisation pains
87+
- Added a new container type `InterfaceContainer`, a wrapper class to clean up some interface serialisation pains
3388

3489
### Changed
3590

@@ -44,36 +99,34 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4499
- `DialogueRunner.Stop` is now asynchronous and waits for all presenters to finish their `OnDialogueCompleteAsync` calls before exiting
45100
- Fixed a bug where the continue button on the `LinePresenter` could become non interactive.
46101
- `PaletteMarkerProcessor` and `StyleMarkerProcessor` now look less aggressively for their Dialogue Runner.
47-
- `LocalizedLine.TextWithoutCharacterName` still does not contain the text of the character but does contain the Markup attribute of the character
48-
- this allows other pieces that might need to know who said a line still use the `TextWithoutCharacterName` property
49-
- `ReplacementMarkuphandler` now returns a `ReplacementMarkerResult` instead of a list of diagnostics
50-
- this is to match the behaviour change in core to fix a markup offset bug
102+
- `LocalizedLine.TextWithoutCharacterName` still does not contain the text of the character, but does contain the Markup attribute of the character.
103+
- This allows other parts of your dialogue UI that might need to know who said a line still use the `TextWithoutCharacterName` property.
104+
- `ReplacementMarkuphandler` now returns a `ReplacementMarkerResult` instead of a list of diagnostics.
105+
- This is to match the behaviour change in core to fix a markup offset bug
51106
- `OptionsPresenter` now returns null if there are no options that can be selected due to their availability.
52-
- Now if there are no available options Dialogue Runner will now fallthrough to the next piece of content
53-
- this behaviour can be disabled in the `allowOptionFallthrough` field on the runner
107+
- If there are no available options, Dialogue Runner will now fallthrough to the next piece of content
108+
- This behaviour can be disabled in the `allowOptionFallthrough` field on the runner.
54109
- Fixed an issue where Builtin localisation would always use the base localisation when fetching a localised asset ([#344](https://github.com/YarnSpinnerTool/YarnSpinner-Unity/issues/344))
55110
- The UPM samples installer now installs from a specific tag, rather than the head of the repo.
56-
- Options can now be hurried up, the same as lines, this necessitated several obsolences
57-
- `RunOptionsAsync(DialogueOption[], CancellationToken)` is now obsolete
58-
- `IsNextLineRequested` is now obsolete
59-
- `NextLineToken` is now obsolete
60-
- `RunOptionsAsync(DialogueOption[], CancellationToken)` is now virtual
111+
- Options can now be hurried up, the same as lines. This necessitated several obsolences:
112+
- `RunOptionsAsync(DialogueOption[], CancellationToken)` is now obsolete.
113+
- `IsNextLineRequested` is now obsolete.
114+
- `NextLineToken` is now obsolete.
115+
- `RunOptionsAsync(DialogueOption[], CancellationToken)` is now virtual.
61116
- the default implementation selects nothing and instantly returns.
62-
- Dialogue Presenter template file now has the newer form of `RunOptionsAsync`.
63-
- Built in presenters now use the newer form of `RunOptionsAsync`
64-
- `InputSystemAvailability` static class has been made public
65-
- `LineAdvancer` will ignore hurry up if it comes in the same frame as line was requested to be shown
66-
- This fixes a bug where the same key was used to start conversation as well hurry up dialoge
67-
- Fixed an issue on `EnsureInputModuleAvailable` where if there was an input system in the scene but it was of the wrong type the console would fill up with errors
117+
- The Dialogue Presenter template file now has the newer form of `RunOptionsAsync`.
118+
- Built in presenters now use the newer form of `RunOptionsAsync`.
119+
- The `InputSystemAvailability` static class has been made public.
120+
- `LineAdvancer` will now ignore the signal to 'hurry up' if it comes in the same frame as line was requested to be shown.
121+
- This fixes a bug where the same key was used to start conversation as well hurry up dialogue.
122+
- Fixed an issue on `EnsureInputModuleAvailable` where, if there was an input system in the scene but it was of the wrong type, the console would fill up with errors.
68123

69124
### Removed
70125

71-
- `ActionMarkupHandlers` list from `DialoguePresenterBase` as this was only used by the default line presenter
72-
- this is now handled by typewriters which is more representative of what Action Markup Handling entailed anyways
73-
- Legacy Dialogue Views, Typewriter, and Effects
74-
- `ReplacementMarkupHandler.NoDiagnostics` as this no longer matches any need due to core changes around replacement markup
75-
- `RunOptionsAsync(DialogueOption[], CancellationToken)` from `LinePresenter`
76-
- this method is virtual and the default implementation does what we needed here.
126+
- Removed `ActionMarkupHandlers` list from `DialoguePresenterBase`. This was only used by the default line presenter, and is now handled by the typewriter system. This which is more representative of what Action Markup Handling already entailed.
127+
- Removed the legacy Dialo Dialogue Views, Typewriter, and Effects
128+
- Removed the `ReplacementMarkupHandler.NoDiagnostics` static property, as this no longer matches any need due to core changes around replacement markup.
129+
- Removed `RunOptionsAsync(DialogueOption[], CancellationToken)` from `LinePresenter`. This method is now virtual, and the default implementation does what we needed here.
77130

78131
## [3.0.3] 2025-06-21
79132

0 commit comments

Comments
 (0)