private Yarn.Markup.MarkupParseResult TryParseCharacter(LocalizedLine dialogueLine) { Yarn.Markup.MarkupParseResult markupResult = dialogueLine.Text; if (markupResult.TryGetAttributeWithName("character", out var attribute)) { TextAttributeHandler.HandleAttribute(attribute, this); return(markupResult.DeleteRange(attribute)); } return(markupResult); }
private string TryParseMarkup(Yarn.Markup.MarkupParseResult markupResult) { // Delete attributes foreach (KeyValuePair <string, bool> pair in TextAttributeHandler.attributes) { // If attribute is present, remove its text if (markupResult.TryGetAttributeWithName(pair.Key, out var attribute)) { if (pair.Value == true) { markupResult = markupResult.DeleteRange(attribute); } TextAttributeHandler.HandleAttribute(attribute, this); } } return(markupResult.Text); }