Page 1 of 1

Dynamic formatting response menu entries

Posted: Tue Feb 02, 2016 7:11 am
by irve
I'm trying to do automatic re-colouring and numbering of response entries using OnConversationResponseMenu, which sometimes causes some specific responses to be parsed twice, which in turn results in numbering being there twice (I think it's Articy condition nodes which transform into {group} nodes ).

The current hack is that I'm detecting the formatted one, but I started to wonder, if there was a more straightforward solution. I suppose I could do numbering in response buttons panel to guarantee that they stay correct, but I think I still need to include imminent skillcheck information dynamically.

(feel free to answer after releasing the new version: not in a hurry ;))

Re: Dynamic formatting response menu entries

Posted: Tue Feb 02, 2016 11:39 am
by Tony Li
Hi,

The Unity UI Dialogue UI has built-in auto-numbering. Just tick Response Menu > Autonumber.

If you need to manipulate and reparse the response text, you could do something like this:

Code: Select all

foreach (var response in responses) {
    var myManipulatedText = ManipulateText(response.destinationEntry.MenuText);
    response.formattedText = FormattedText.Parse(myManipulatedText, DialogueManager.MasterDatabase.emphasisSettings);
} 
If I missed the point of what you're trying to do, please provide some more details or an example. Or feel free to send an example to tony (at) pixelcrushers.com. I'll be happy to take a look!

Re: Dynamic formatting response menu entries

Posted: Thu Feb 04, 2016 9:04 am
by irve
Thanks. Getting them from the source does it for us, but auto-numbers were also a helpful hint since they already have hotkeys set up.

Re: Dynamic formatting response menu entries

Posted: Thu Feb 04, 2016 9:11 am
by Tony Li
Great! Glad I could help!