How to activate continue button without subtitle panel

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Swing Wren
Posts: 31
Joined: Fri Apr 10, 2020 2:30 am

How to activate continue button without subtitle panel

Post by Swing Wren »

Hello!

Right now I have a continue button logic that works even if the subtitle panel is closed as I want. My main issue is that if the first dialogue played doesn't have text, the panel is not set as focused and the continue button doesn't show.

//this never happens

Code: Select all

 // Focus the panel and show the subtitle:
m_focusedPanel = panel;

Code: Select all

 public override void ShowContinueButton()
 {
       if (m_focusedPanel != null) m_focusedPanel.ShowContinueButton();
 }
What would be the recommended way to proceed?

thanks
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to activate continue button without subtitle panel

Post by Tony Li »

Hi,

What if you just manually activate the continue button in the first node's Sequence? Give the continue button a unique name. Assuming the name is "Continue Button", the first node's Sequence could include this command:

Code: Select all

SetActive(ContinueButton)@0.1
We wait 0.1 seconds to allow the subtitle panels to set themselves up (unfocused) first.
Swing Wren
Posts: 31
Joined: Fri Apr 10, 2020 2:30 am

Re: How to activate continue button without subtitle panel

Post by Swing Wren »

If that's the solution we prefer to solve this by changing the source code of the dialogue system for now. How stable is the core part od the dialogue system? If we replace all the UI code using the interfaces will it likely break with updates?
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to activate continue button without subtitle panel

Post by Tony Li »

Hi,

There's no need to change the source code. Just make a subclass of StandardDialogueUI and override the ShowContinueButton() method.

Or, if you don't want to inherit the functionality of StandardDialogueUI, it's perfectly fine to write your own implementation of IDialogueUI. There's even a starter template (TemplateDialogueUI.cs) in Plugins / Pixel Crushers / Dialogue System / Templates / Scripts.

We understand that, while a UI implementation such as StandardDialogueUI can do a lot, it can't cover every single use case for everyone. That's why its methods are virtual and there's a C# interface if you want to write all the UI code from the ground up.
Swing Wren
Posts: 31
Joined: Fri Apr 10, 2020 2:30 am

Re: How to activate continue button without subtitle panel

Post by Swing Wren »

Yep that was what I was talking about, sorry I was not clear enough. As we don't need the majority of the functionality of the dialogue system UI code our target is to replace it with a simple version for us. That's why I asked of the stability of the interfaces.

thanks
Swing Wren
Posts: 31
Joined: Fri Apr 10, 2020 2:30 am

Re: How to activate continue button without subtitle panel

Post by Swing Wren »

I have everything setup with the IDialogueUI now. My last question is that right now the SetContinue mode only works if you inherit from AbstractDialogueUI

Code: Select all

var abstractDialogueUI = ui as AbstractDialogueUI;
if (abstractDialogueUI != null)
   {
    if (showContinueButton)
    {
       abstractDialogueUI.ShowContinueButton(subtitle);
    }
    else
     {
       abstractDialogueUI.HideContinueButton(subtitle);
     }
 }
 
I have to create my own SetContinueMode command now or there is another way?
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to activate continue button without subtitle panel

Post by Tony Li »

Hi,

Yes, since continue buttons aren't part of the IDialogueUI interface (which is stable, btw -- it hasn't changed since 2013), you can either inherit from AbstractDialogueUI or implement your own continue buttons however you like.
Post Reply