From 010611ab6acf1db32612b4a58490160c59df1655 Mon Sep 17 00:00:00 2001 From: Tim Nugent Date: Fri, 19 Jan 2024 13:33:34 +1100 Subject: [PATCH] Lineview now cancels any in-flight lines when dialogue is stopped. Previously when you had auto-advance lines set and then stopped all dialogue the coroutine that would auto-advance was still running. Now the coroutines are aborted before wrapping up the line, preventing this. Fixes #262 --- CHANGELOG.md | 1 + Runtime/Views/LineView.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e813bb22..403930d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - this is now handled at the codegen side so we can better log it - `ActionsGenerator` will now generate C# warnings for non-private methods that are attributed as `YarnFunction` or `YarnCommand`. - `ActionsGenerator` still logs to a temporary location, but now into a `dev.yarnspinner.logs` folder inside the temporary location. +- Auto-advancing `LineView`s will no longer attempt to advance dialogue that has been stopped. ### Removed diff --git a/Runtime/Views/LineView.cs b/Runtime/Views/LineView.cs index ac5374fc..3f5e3bca 100644 --- a/Runtime/Views/LineView.cs +++ b/Runtime/Views/LineView.cs @@ -540,6 +540,7 @@ public override void DialogueComplete() if (currentLine != null) { currentLine = null; + StopAllCoroutines(); StartCoroutine(DismissLineInternal(null)); } }