Control Continue button

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
mgregoirelds
Posts: 106
Joined: Wed Aug 23, 2017 4:10 pm
Location: Canada

Control Continue button

Post by mgregoirelds »

Hello,

Is there any way to disable being able to hit Continue before a certain event is received by Dialogue System?

I created my own custom sequence command that I use with my dialogues. This custom command is run at every dialogue entry. This command is in fact a IEnumator function that does different stuff based on the dialogue entry (add an item to the inventory, enable hud element, play sound, fade in/out screen...). However, there is nothing in place right now that control the fact that a player can mash all he wants on the controller to use the continue button while the IEnumator state is not completed. What I thought of is to be able, at the end of the IEnumerator coroutine, tell Dialogue System that yes, all elements in the state is run and continue is "reenabled" so the player can move to the next dialogue entry.

Any idea on how I could do that? Thanks!
Unity 2022.3.17f1
Dialogue System 2.2.44.1
OpenAI Addon 1.0.12
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Control Continue button

Post by Tony Li »

Hello Maxime,

You can use the SetContinueMode() sequencer command. For example:

Code: Select all

SetContinueMode(false);
YourCustomCommand()->Message(Done);
required SetContinueMode(original)@Message(Done)
The sequence above:
  • Disables the continue button at 0:00.
  • Starts YourCustomCommand() at 0:00.
  • When YourCustomCommand() finishes, sends the sequencer message "Done". (This is an arbitrary string. It can be anything.)
  • When the sequencer message "Done" is sent, resets the continue button back to its original state. The "required" keyword ensures that it resets the continue button no matter what.
If you don't want to use sequencer commands, you can control it in a script:

Code: Select all

// Hide continue button:
DialogueManager.DisplaySettings.subtitleSettings.continueButton = DisplaySettings.SubtitleSettings.ContinueButtonMode.Never;
DialogueManager.ConversationView.SetupContinueButton();
...
// Show continue button:
DialogueManager.DisplaySettings.subtitleSettings.continueButton = DisplaySettings.SubtitleSettings.ContinueButtonMode.Always;
DialogueManager.ConversationView.SetupContinueButton();
mgregoirelds
Posts: 106
Joined: Wed Aug 23, 2017 4:10 pm
Location: Canada

Re: Control Continue button

Post by mgregoirelds »

Yet again, thanks a lot for the help! This is working great.
Unity 2022.3.17f1
Dialogue System 2.2.44.1
OpenAI Addon 1.0.12
Post Reply