I have a question about the continue button.

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
fbthd1234
Posts: 10
Joined: Wed Jun 28, 2023 6:16 am

I have a question about the continue button.

Post by fbthd1234 »

Hi.

I want to control the text of this button.

When you press this button, if the conversation continues, if the conversation ends with continue, it's like displaying quit. Like Disco Elysium.

I made my custom script for the continuation button. In addition, the existing FastForward function was tracked and the call method was reviewed.

However, it is not known how to know whether the current active continue button role is a continuation or termination of the conversation.

I need help with this. Can you give me a guide?

Best regards.
Tony Li.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: I have a question about the continue button.

Post by Tony Li »

Hi,

You can add a script to the continue button that sets the text in its OnEnable() method, such as:

Code: Select all

using UnityEngine;
using PixelCushers.DialogueSystem;
public class SetContinueButtonText : MonoBehaviour
{
    public UITextField buttonText; //<-- ASSIGN IN INSPECTOR.
    
    void OnEnable()
    {
        if (!DialogueManager.isConversationActive) return;
        var text = DialogueManager.currentConversationState.hasAnyResponses ? "Continue" : "End";
        buttonText.text = DialogueManager.GetLocalizedText(text);
    }
}
fbthd1234
Posts: 10
Joined: Wed Jun 28, 2023 6:16 am

Re: I have a question about the continue button.

Post by fbthd1234 »

Thank you.
Have a good day.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: I have a question about the continue button.

Post by Tony Li »

Glad to help!
Post Reply