Page 1 of 1

Displaying Variables in Custom UI

Posted: Wed Jan 20, 2021 6:56 pm
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

Re: Displaying Variables in Custom UI

Posted: Wed Jan 20, 2021 8:44 pm
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.

Re: Displaying Variables in Custom UI

Posted: Wed Jan 20, 2021 8:49 pm
by nathanj
Beautiful

Thanks Tony, you are the best!

Re: Displaying Variables in Custom UI

Posted: Wed Jan 20, 2021 9:11 pm
by Tony Li
Happy to help!