Page 6 of 14

Re: About Dialogue Actor component

Posted: Sat Mar 13, 2021 10:05 pm
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.

Re: About Dialogue Actor component

Posted: Sat Mar 13, 2021 10:25 pm
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.

Re: About Dialogue Actor component

Posted: Sat Mar 13, 2021 10:48 pm
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?

Re: About Dialogue Actor component

Posted: Sat Mar 13, 2021 11:10 pm
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().

Re: About Dialogue Actor component

Posted: Sat Mar 13, 2021 11:29 pm
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

Re: About Dialogue Actor component

Posted: Sun Mar 14, 2021 8:38 am
by Tony Li
Why not just pass null to the ForceOverrideXXXPanel() methods?

Re: About Dialogue Actor component

Posted: Sun Mar 14, 2021 8:43 am
by CHOPJZL
It need to be done immetiately, otherwise it is difficult to use the original GetPanel() feature in the later conversation

Re: About Dialogue Actor component

Posted: Sun Mar 14, 2021 9:28 am
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.

Re: About Dialogue Actor component

Posted: Sun Mar 14, 2021 9:56 am
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. :)

Re: About Dialogue Actor component

Posted: Sun Mar 14, 2021 10:11 am
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);
}