Adding a button to the dialogue panel

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
chud575
Posts: 50
Joined: Thu May 11, 2017 10:57 am

Adding a button to the dialogue panel

Post by chud575 »

Howdy,

So, I want to add a special case button to the main Dialogue Panel, that I can enable/disable in the sequencer, and when you click on it, you get a context sensitive menu (in the dialogue panel), and then can return to the original conversation from there. Is this possible?
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Adding a button to the dialogue panel

Post by Tony Li »

The dialogue UI scripts were designed to support UIs that are as light or as heavy as you want, even really heavy UIs like those seen in the early Fallout games:

Image

Here's a similar example, without any textures though so it doesn't look as fancy as the Fallout UI above:

ExtraButtonInUI_2017-05-27.unitypackage

To set it up, I just added a button and a panel to the dialogue UI's Dialogue Panel. I also enabled the Dialogue Panel's Image, which could be a frame like the Fallout image above. The panel starts inactive. The button activates the panel. Another button on the panel deactivates the panel. You could configure your button to call a script method instead. If you want to pause the conversation, you can call DialogueTime.Pause(). (Remember to call DialogueTime.Unpause() when you close the menu.)

To enable or disable the button with a sequencer command, use the SetActive() sequencer command, specifying the button's name.

I hope that answers your question. If I totally missed your point, please let me know and I'll try again. :-)
Post Reply