Formatting Text in Response Menu

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
digiwombat
Posts: 50
Joined: Sun Jun 16, 2019 4:59 am

Formatting Text in Response Menu

Post by digiwombat »

BIG TONE! I've got a tactical question.

I'm currently using a gendered dialogue tag for pronouns and various other things (ex: [g=He/She]).

The OnConversationLine function doesn't apply to response choices, so is there a way to format text in the dialogue options than using OnConversationResponseMenu and iterating through the choices or is that the preferred way?

That's it. Just wanted to make sure I wasn't missing a method I should be using.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Formatting Text in Response Menu

Post by Tony Li »

Hi,

OnConversationResponseMenu is the usual way. Alternatively, you can make a subclass of StandardUIResponseButton and override the SetFormattedText() method. Then use that subclass on your response buttons. Example:

Code: Select all

public class CustomResponseButton : StandardUIResponseButton
{
    public override void SetFormattedText(FormattedText formattedText)
    {
        formattedText.text = formattedText.text.Replace("[g=He/she]", GetPronoun());
        base.SetFormattedText(formattedText);
    }
}
Post Reply