Skip to content

Fix late line complete callback in line with markup #329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Runtime/Views/LinePresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,12 @@ public override async YarnTask RunLineAsync(LocalizedLine line, LineCancellation
{
milliSecondsPerLetter = (int)(1000f / typewriterEffectSpeed);
}


// Get the count of visible characters from TextMesh to exclude markup characters
var visibleCharacterCount = lineText.GetTextInfo(text.Text).characterCount;

// going through each character of the line and letting the processors know about it
for (int i = 0; i < text.Text.Length; i++)
for (int i = 0; i < visibleCharacterCount; i++)
{
// telling every processor that it is time to process the current character
foreach (var processor in temporalProcessors)
Expand All @@ -360,7 +363,7 @@ public override async YarnTask RunLineAsync(LocalizedLine line, LineCancellation
}
}

lineText.maxVisibleCharacters = text.Text.Length;
lineText.maxVisibleCharacters = visibleCharacterCount;

// letting each temporal processor know the line has finished displaying
foreach (var processor in temporalProcessors)
Expand Down