Yes and No buttons rather than continue?
Yes and No buttons rather than continue?
Hi,
Is it possible to change the continue button to two buttons, one of them yes and the other no?
and I am also trying to pass the result onto my code, whcih I am struggling to figure out how to do.
(I have tried var resp = DialogueLua.GetVariable("Response"); // with response setup as a variable.
Is it possible to change the continue button to two buttons, one of them yes and the other no?
and I am also trying to pass the result onto my code, whcih I am struggling to figure out how to do.
(I have tried var resp = DialogueLua.GetVariable("Response"); // with response setup as a variable.
- Attachments
-
- conversationoptions.png (21.18 KiB) Viewed 320 times
Re: Yes and No buttons rather than continue?
Figured out how to do the variable at least:
bool resp = DialogueLua.GetVariable("Response").asBool
Not sure how to get it at the correct time (after player has clicked appropriate button).
bool resp = DialogueLua.GetVariable("Response").asBool
Not sure how to get it at the correct time (after player has clicked appropriate button).
Re: Yes and No buttons rather than continue?
Hi,
Quick comment on the variable: You can also register a C# method with Lua and use that in the Script field. (video tutorial)
Yes, it's possible to add more buttons to the dialogue UI. I recommend adding the Yes and No buttons to your subtitle panel(s). If you want them to immediately continue the conversation, connect their OnClick() events to the dialogue UI's StandardDialogueUI.OnContinueConversation method. If you want the first click to fast-forward the typewriter and the second to continue, add a StandardUIContinueButtonFastForward component to both buttons and configure them like the continue button in the Basic Standard Dialogue UI prefab.
You can also add other items to your Yes / No buttons' OnClick() events, too. Otherwise there wouldn't be any difference between them.
Quick comment on the variable: You can also register a C# method with Lua and use that in the Script field. (video tutorial)
Yes, it's possible to add more buttons to the dialogue UI. I recommend adding the Yes and No buttons to your subtitle panel(s). If you want them to immediately continue the conversation, connect their OnClick() events to the dialogue UI's StandardDialogueUI.OnContinueConversation method. If you want the first click to fast-forward the typewriter and the second to continue, add a StandardUIContinueButtonFastForward component to both buttons and configure them like the continue button in the Basic Standard Dialogue UI prefab.
You can also add other items to your Yes / No buttons' OnClick() events, too. Otherwise there wouldn't be any difference between them.
Re: Yes and No buttons rather than continue?
Awesome tutorial, thanks.Tony Li wrote: ↑Thu Nov 26, 2020 10:08 pm Hi,
Quick comment on the variable: You can also register a C# method with Lua and use that in the Script field. (video tutorial)
Lost on this (which is what I really need), any chance you have a tutorial?Tony Li wrote: ↑Thu Nov 26, 2020 10:08 pm Yes, it's possible to add more buttons to the dialogue UI. I recommend adding the Yes and No buttons to your subtitle panel(s). If you want them to immediately continue the conversation, connect their OnClick() events to the dialogue UI's StandardDialogueUI.OnContinueConversation method. If you want the first click to fast-forward the typewriter and the second to continue, add a StandardUIContinueButtonFastForward component to both buttons and configure them like the continue button in the Basic Standard Dialogue UI prefab.
You can also add other items to your Yes / No buttons' OnClick() events, too. Otherwise there wouldn't be any difference between them.
EDIT: I think half of the issue on my side is that I don't know where certain things originate from. e.g. I have been changing the "continue" text on several UI's in order to determine which one I should change.) I couldn't find any of my changed text when I ran my scene. I then found out that I should have changed the continue in "Example Bubble Standard UI Subtitle Panel", however I don't even know why this UI was initiated.
Re: Yes and No buttons rather than continue?
Hi,
Would you please post a sketch or mock-up of what you want the UI to look like? I should be able to provide clearer, less-ambiguous info specific to your UI requirements.
Would you please post a sketch or mock-up of what you want the UI to look like? I should be able to provide clearer, less-ambiguous info specific to your UI requirements.
Re: Yes and No buttons rather than continue?
This is my npc character setup pre play. (The speech bubble npc)
This is my npc character setup during play. (The speech bubble npc)
In the third image, I am not sure how the "Example Bubble Standard UI Subtitle Panel" gets there....
Sorry, not sure what's going on with the images. (ok images fixed) Sorry, edited this post about 20 times.
Re: Yes and No buttons rather than continue?
You can just make those into response buttons. You don't have to do anything custom or unusual. Here's a version of the BubbleSubtitleExample package that's available on the Dialogue System Extras page:
DS_BubbleSubtitleExample_2020-11-27.unitypackage
I just added a new scene named "Bubble Subtitle Example Yes No Menu" that looks like this:
(You can restyle it however you want.) The NPC has a Dialogue Actor component that points to a bubble subtitle panel. The bubble subtitle panel is a child of the NPC, and it has a menu panel inside it.
DS_BubbleSubtitleExample_2020-11-27.unitypackage
I just added a new scene named "Bubble Subtitle Example Yes No Menu" that looks like this:
(You can restyle it however you want.) The NPC has a Dialogue Actor component that points to a bubble subtitle panel. The bubble subtitle panel is a child of the NPC, and it has a menu panel inside it.
Re: Yes and No buttons rather than continue?
Thanks, that helps a lot. I am just struggling with sizes and positioning (panel sizes), I will read some more posts/documentation to see if I can sort it out myself.
Thanks for the quick help.
Thanks for the quick help.
Re: Yes and No buttons rather than continue?
Glad to help. Working with Unity UI layouts is always a bit of a headache at first. I recommend Unity's official Unity UI tutorials, especially the ones on Rect Transforms and Layouts.