Page 1 of 1

Adding a button to the dialogue panel

Posted: Sat May 27, 2017 4:51 pm
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?

Re: Adding a button to the dialogue panel

Posted: Sat May 27, 2017 7:17 pm
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. :-)