Page 1 of 1

SetDialoguePanel isn't working correctly?

Posted: Mon Aug 03, 2020 7:00 pm
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 347 times
and the subtitle dialogue therefore remained broken and stuck
Broken Subtitles.PNG
Broken Subtitles.PNG (4.03 KiB) Viewed 347 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!

Re: SetDialoguePanel isn't working correctly?

Posted: Mon Aug 03, 2020 8:26 pm
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)

Re: SetDialoguePanel isn't working correctly?

Posted: Tue Aug 04, 2020 12:13 am
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!

Re: SetDialoguePanel isn't working correctly?

Posted: Tue Aug 04, 2020 11:22 am
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.

Re: SetDialoguePanel isn't working correctly?

Posted: Tue Aug 04, 2020 11:41 am
by AlvaroGode
Nice! Thank you so much Tony!

Re: SetDialoguePanel isn't working correctly?

Posted: Tue Aug 04, 2020 11:51 am
by Tony Li
Happy to help!