About Dialogue Actor component

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: About Dialogue Actor component

Post by CHOPJZL »

Dialogue Actor always takes priority. When you set the menu panel, can you set the panel by Dialogue Actor if there is one, and otherwise set the panel by actor ID?
I prefer to use responses[0].destinationEntry.ActorID.

The main problem I think is not to set the panel, but the GetPanel() not always return the panel I just set, Could you add something like a condition check to bypass all the checks GetPanel() has, and set the custom panel that just passed in. If this operation has not happen, do getPanel like the old way.
User avatar
Tony Li
Posts: 21926
Joined: Thu Jul 18, 2013 1:27 pm

Re: About Dialogue Actor component

Post by Tony Li »

Okay, this patch has a method StandardDialogueUI.ForceOverrideMenuPanel(panel):

DS_MenuPanelPatch_2021-03-13.unitypackage

It makes it much easier than subclassing StandardDialogueUI, etc.
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: About Dialogue Actor component

Post by CHOPJZL »

This time It should be alright. Why I didn't think of this way earlier :shock:

Could you add this to subtitle control, too?

Alert and TextInput seems work differently.
>The custom TextInput panel must find by name in Sequencer command
>Alert panel can be set in a subclass method of StandardDialogueUI

Am I right?
User avatar
Tony Li
Posts: 21926
Joined: Thu Jul 18, 2013 1:27 pm

Re: About Dialogue Actor component

Post by Tony Li »

Here's a patch:

DS_DialogueUIPatch_2021-03-13.unitypackage

It adds StandardDialogueUI.ForceOverrideSubtitlePanel(panel)

TextInput() finds the text field UI by name.

If you need to do something different with alerts, you can override ShowAlert().
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: About Dialogue Actor component

Post by CHOPJZL »

In the GetPanel() I suggest adding a line to set m_forcedOverridePanel to null

Code: Select all

if (m_forcedOverridePanel != null) 
            {
                var tempPanel = m_forcedOverridePanel;
                m_forcedOverridePanel = null;
                return tempPanel;
            }
This time you don't need to send the patch :D
User avatar
Tony Li
Posts: 21926
Joined: Thu Jul 18, 2013 1:27 pm

Re: About Dialogue Actor component

Post by Tony Li »

Why not just pass null to the ForceOverrideXXXPanel() methods?
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: About Dialogue Actor component

Post by CHOPJZL »

It need to be done immetiately, otherwise it is difficult to use the original GetPanel() feature in the later conversation
User avatar
Tony Li
Posts: 21926
Joined: Thu Jul 18, 2013 1:27 pm

Re: About Dialogue Actor component

Post by Tony Li »

I don't understand. Say you've called StandardDialogueUI.ForceOverrideMenuPanel(X) to use menu panel X. As soon as you call StandardDialogueUI.ForceOverrideMenuPanel(null), the next call to GetPanel() will work exactly like if you hadn't set menu panel X.
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: About Dialogue Actor component

Post by CHOPJZL »

It's just I need to call ForceOverrideMenuPanel(null) on every OnConversationResponseMenu() and OnConversationLine() that don't need to ForceOverride

But actually the check is already happen on every OnConversationResponseMenu() and OnConversationLine(), so it seems keep it in this way is acceptable, I thought was wrong. :)
User avatar
Tony Li
Posts: 21926
Joined: Thu Jul 18, 2013 1:27 pm

Re: About Dialogue Actor component

Post by Tony Li »

Sounds good.

Alternatively, if you're already making a subclass of StandardDialogueUI, you could override ShowResponses to reset it after showing each menu:

Code: Select all

public override void ShowResponses (Subtitle subtitle, Response[] responses, float timeout)
{
    base.ShowResponses(subtitle, responses, timeout);
    ForceOverrideMenuPanel(null);
}
Post Reply