Page 1 of 1
How to activate continue button without subtitle panel
Posted: Mon Jan 03, 2022 12:50 pm
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
Re: How to activate continue button without subtitle panel
Posted: Mon Jan 03, 2022 2:37 pm
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:
We wait 0.1 seconds to allow the subtitle panels to set themselves up (unfocused) first.
Re: How to activate continue button without subtitle panel
Posted: Mon Jan 03, 2022 4:28 pm
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?
Re: How to activate continue button without subtitle panel
Posted: Mon Jan 03, 2022 4:37 pm
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.
Re: How to activate continue button without subtitle panel
Posted: Tue Jan 04, 2022 3:37 am
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
Re: How to activate continue button without subtitle panel
Posted: Tue Jan 04, 2022 7:48 am
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?
Re: How to activate continue button without subtitle panel
Posted: Tue Jan 04, 2022 8:13 am
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.