How to prevent alert from hiding on continue button?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
fringilla
Posts: 12
Joined: Tue Jan 31, 2017 12:37 pm

How to prevent alert from hiding on continue button?

Post by fringilla »

Hey, I am using DialogueManager.ShowAlert(message, duration) from code and when I'm using it during conversation, alert hides when I click continue button (continue conversation button, alert continue button is null). How do I force alert to stay?
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to prevent alert from hiding on continue button?

Post by Tony Li »

Hi,

I'll post a short script here later today to change the behavior so the conversation's continue button doesn't close the alert. What GUI system are you using? Unity UI Dialogue UI?
fringilla
Posts: 12
Joined: Tue Jan 31, 2017 12:37 pm

Re: How to prevent alert from hiding on continue button?

Post by fringilla »

Yes, Unity UI Dialogue UI. Thanks!
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to prevent alert from hiding on continue button?

Post by Tony Li »

Great! Please import this package: ContinueButtonOptions_2017-02-09.unitypackage

If you're using the Unity UI Continue Button Fast Forward component on your continue button, add the UnityUIContinueButtonFastForwardConversation script to your continue button. Configure it the same as the existing Unity UI Continue Button Fast Forward component, then delete the original Unity UI Continue Button Fast Forward component. Finally, point the OnClick() event to UnityUIContinueButtonFastForwardConversation.OnFastForward:

Image

If you're not using the Unity UI Continue Button Fast Forward component on your continue button, add the ConversationContinueButton script, and point the OnClick() event to ConversationContinueButton.ContinueConversation:

Image

You may find that the alert's continue button also continues the conversation. To change that behavior, inspect your alert's Continue Button, and point the OnClick() event to UnityUIDialogueUI.HideAlert:

Image
fringilla
Posts: 12
Joined: Tue Jan 31, 2017 12:37 pm

Re: How to prevent alert from hiding on continue button?

Post by fringilla »

Thanks! That works like a charm :)

Also, how to make current alert hide before showing the next queued one?
Post Reply