SetDialoguePanel isn't working correctly?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
AlvaroGode
Posts: 7
Joined: Mon Aug 03, 2020 6:32 pm

SetDialoguePanel isn't working correctly?

Post by AlvaroGode »

Well, after some tests I found a bug I think?
I've set my Dialogue Manager's continue button mode as 'Always', and everytime I used the sequence command 'SetDialoguePanel' (to turn off and back on again) some UI elements remained disabled
Disabled.PNG
Disabled.PNG (9.12 KiB) Viewed 341 times
and the subtitle dialogue therefore remained broken and stuck
Broken Subtitles.PNG
Broken Subtitles.PNG (4.03 KiB) Viewed 341 times
This was all resolved when the continue button mode was set as 'Never'

Is this intended? Is there a workaround for this?

Thanks in advance!
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: SetDialoguePanel isn't working correctly?

Post by Tony Li »

Hi,

SetDialoguePanel() clears everything when it closes the UI. It's intended to be used if you'll be showing the dialogue panel again with a new dialogue entry. If you want to resume showing the entry that was visible before hiding the UI, use SetEnabled() instead of disable and re-enable the Dialogue Manager's Canvas. For example, say the Canvas is named "Dialogue Canvas". Use a sequence like this:

Code: Select all

SetEnabled(Canvas, false, Dialogue Canvas);
AnimatorPlayWait(Dance)->Message(Done);
SetEnabled(Canvas, true, Dialogue Canvas)@Message(Done)
AlvaroGode
Posts: 7
Joined: Mon Aug 03, 2020 6:32 pm

Re: SetDialoguePanel isn't working correctly?

Post by AlvaroGode »

Thank you so much Tony! Now I better understand when and how to use SetDialoguePanel()
Say, if i wanted to hide the dialogue UI with that nice mecanim fade animations, do some waiting, and then show the dualogue UI like this:

Code: Select all

AnimatorTrigger(Hide,Dialogue Panel)@Message(Typed)->Message(Hidden);
Delay(2)@Message(Hidden)->Message(Delayed);
AnimatorTrigger(Show,Dialogue Panel)@Message(Delayed)
Would there be any problem? Or is there a better way to do this?

Thanks!
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: SetDialoguePanel isn't working correctly?

Post by Tony Li »

That's fine, as long as your dialogue UI's Hide animation fades out (as most of the included prefabs do). But you may want to change the Sequence to:

Code: Select all

AnimatorPlayWait(Hide,DialoguePanel)->Message(Hidden);
Delay(2)@Message(Hidden)->Message(Delayed);
AnimatorPlayWait(Show,DialoguePanel)@Message(Delayed)
AnimatorTrigger does not wait for the animation state to finish, but AnimatorPlayWait does.
AlvaroGode
Posts: 7
Joined: Mon Aug 03, 2020 6:32 pm

Re: SetDialoguePanel isn't working correctly?

Post by AlvaroGode »

Nice! Thank you so much Tony!
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: SetDialoguePanel isn't working correctly?

Post by Tony Li »

Happy to help!
Post Reply