Displaying Variables in Custom UI

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Displaying Variables in Custom UI

Post by nathanj »

Hi Tony

I'm trying to get variables to display in my custom but I can't remember how to do this and can not remember what I should be looking for.

Basically, in my Quest Description I have
Gathered [var=Macadamia]/3 Macadamia Nuts for Aunty
And when I use

Code: Select all

_description = QuestLog.GetQuestDescription(questName);
my UI panel shows the text as it is written in the description and doesn't who the variable amount.

Is there a way to achieve this?

I'm pretty sure you have already explain this so if so you mind telling me what to search for to do this?

Thanks in advance and happy (late) New Year!

Nathan
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Displaying Variables in Custom UI

Post by Tony Li »

Hi Nathan!

Run it through FormattedText.ParseCode:

Code: Select all

_description = FormattedText.ParseCode(QuestLog.GetQuestDescription(questName));
This parses [var] and [lua] markup tags.
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Displaying Variables in Custom UI

Post by nathanj »

Beautiful

Thanks Tony, you are the best!
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Displaying Variables in Custom UI

Post by Tony Li »

Happy to help!
Post Reply