Page 1 of 1

Formatting Text in Response Menu

Posted: Mon Dec 28, 2020 12:31 pm
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.

Re: Formatting Text in Response Menu

Posted: Mon Dec 28, 2020 3:12 pm
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);
    }
}