Skip to content

Commit

Permalink
Set dialogue program when SetProject is called
Browse files Browse the repository at this point in the history
  • Loading branch information
desplesda committed Feb 7, 2025
1 parent 9804b5d commit 0ee0345
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- `AsyncOptionsView` now supports configuring its fade duration.
- `MarkupPalette` and the associated `PaletteMarkerProcessor` now support custom TMP rich text tags beyond what the more basic markers allow.
- `LineMetadata` now has public API methods for constructing and manually adding elements.
- `DialogueRunner.SetProject` now sets the `Program` of its internal `Dialogue` object. Previously, this didn't happen until `StartDialogue()`.

### Changed

Expand Down
9 changes: 9 additions & 0 deletions Runtime/DialogueRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,15 @@ public void SetProject(YarnProject project)
throw new InvalidOperationException("Can't set project, because dialogue is currently running.");
}
this.yarnProject = project;

if (project != null)
{
Dialogue.SetProgram(project.Program);
}
else
{
Dialogue.SetProgram(null);
}
}

/// <summary>
Expand Down

0 comments on commit 0ee0345

Please sign in to comment.