Adding a Subtitle Panel to SMS Dialogue UI

Announcements, support questions, and discussion for the Dialogue System.
User avatar
bohemian pulp
Posts: 21
Joined: Wed Apr 21, 2021 7:01 am

Adding a Subtitle Panel to SMS Dialogue UI

Post by bohemian pulp »

Hello,

I'm trying to figure out a way to add additional Subtitle Panels to the SMS Dialogue UI. I understand that the Menu Panel Number option on the Dialogue Actor works only on the Standard Dialogue UI, but is there a way to make it work with SMS as well?

Thanks
Creator of "Let Bions be bygones"
https://linktr.ee/bohemianpulp
User avatar
Tony Li
Posts: 22131
Joined: Thu Jul 18, 2013 1:27 pm

Re: Adding a Subtitle Panel to SMS Dialogue UI

Post by Tony Li »

Hi,

You'll need to make a subclass of SMSDialogueUI.

If you want to show a message outside the context of text messages -- for example, in a separate pop-up window -- override the ShowSubtitle() method.

If you want to show a message as part of the text message thread but with a different subtitle panel template, override the GetTemplate() method. For example:

Code: Select all

public class MyDialogueUI : SMSDialogueUI
{
    protected override StandardUISubtitlePanel GetTemplate(Subtitle subtitle)
    {
        if (subtitle.speakerInfo.nameInDatabase == "Fred")
        {
            return specialSubtitlePanelForFred;
        }
        else
        {
            return base.GetTemplate(subtitle);
        }
    }
}
User avatar
bohemian pulp
Posts: 21
Joined: Wed Apr 21, 2021 7:01 am

Re: Adding a Subtitle Panel to SMS Dialogue UI

Post by bohemian pulp »

Awesome!
Aaaand one more thing. How do I add a Continue button to the SMS dialogue?
Creator of "Let Bions be bygones"
https://linktr.ee/bohemianpulp
User avatar
Tony Li
Posts: 22131
Joined: Thu Jul 18, 2013 1:27 pm

Re: Adding a Subtitle Panel to SMS Dialogue UI

Post by Tony Li »

Hi,

Just add one and assign it to the subtitle panel's Continue Button field. You don't need to do anything special for the SMS Dialogue UI.
User avatar
bohemian pulp
Posts: 21
Joined: Wed Apr 21, 2021 7:01 am

Re: Adding a Subtitle Panel to SMS Dialogue UI

Post by bohemian pulp »

That was easy... :?

Thanks mate!
Creator of "Let Bions be bygones"
https://linktr.ee/bohemianpulp
User avatar
Tony Li
Posts: 22131
Joined: Thu Jul 18, 2013 1:27 pm

Re: Adding a Subtitle Panel to SMS Dialogue UI

Post by Tony Li »

Glad to help!
User avatar
bohemian pulp
Posts: 21
Joined: Wed Apr 21, 2021 7:01 am

Re: Adding a Subtitle Panel to SMS Dialogue UI

Post by bohemian pulp »

Sorry for accidentally spamming someone else's post.
I set up the Continue button in the SMS UI, but now "SetContinueMode(false)" doesn't seem to work. It might be because there are multiple objects with Standard UI Subtitle Panel that refer to the same Continue Button (NPC Message Template, PC Message Template, etc. all have the component). Any ideas?
Creator of "Let Bions be bygones"
https://linktr.ee/bohemianpulp
User avatar
Tony Li
Posts: 22131
Joined: Thu Jul 18, 2013 1:27 pm

Re: Adding a Subtitle Panel to SMS Dialogue UI

Post by Tony Li »

Hi,

How are your continue button and conversation set up? (e.g., is the continue button part of a subtitle panel's hierarchy, or is it outside of the subtitle panels?)
User avatar
bohemian pulp
Posts: 21
Joined: Wed Apr 21, 2021 7:01 am

Re: Adding a Subtitle Panel to SMS Dialogue UI

Post by bohemian pulp »

It's outside
Creator of "Let Bions be bygones"
https://linktr.ee/bohemianpulp
User avatar
Tony Li
Posts: 22131
Joined: Thu Jul 18, 2013 1:27 pm

Re: Adding a Subtitle Panel to SMS Dialogue UI

Post by Tony Li »

What's not working about SetContinueButton(false)?

Also, are there any errors or warnings in the Console window?

Testing this, I noticed that SetContinueMode(false) works for one node in the SMSDialogueUI. I'll look further into that.
Post Reply