Skip to content

Line markup causes a delay in triggering OnLineDisplayComplete on an ActionMarkupHandler #328

Open
@Abban

Description

@Abban

What is the current behavior?
When a line has markup it causes a delay in calling OnLineDisplayComplete in an ActionMarkupHandler. This is because this for loop in the LinePresenter includes the markup characters.

Please provide the steps to reproduce, and if possible a minimal demo of the problem:

  • Create a basic ActionMarkupHandler and attach it to the LinePresenter.
  • Add a Debug.Log to the OnLineDisplayComplete method.
  • Visually compare a line with markup ending in the editor and the delay in the Debug.Log firing.
  • You can also see the markup characters in the OnCharacterWillAppear method if you add Debug.Log(line.Text[currentCharacterIndex]) inside.

What is the expected behavior?
OnLineDisplayComplete is triggered when the text is finished displaying.

Please tell us about your environment:

  • Yarn Spinner Version: 3.0.1
  • Unity Version: 6000.0.44f1

Other information
I tried using a copy of the LinePresenter and looping the attributes and calling DeleteRange on the MarkupParseResult before the text loop but this resulted in no change. Eg:

foreach (var markupAttribute in text.Attributes)
{
    text = text.DeleteRange(markupAttribute);
}

// going through each character of the line and letting the processors know about it
for (int i = 0; i < text.Text.Length; i++) {
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions