Good afternoon. I already broke my whole head...
Textline Dialogue UI does not want to register an additional subtitle panel.
I have a dialogue between the Player and NPS.
Sometimes I need to insert subtitles from the author (He is defined in the database as a separate NPS, in the scene there is a GO with Dilogue Actror component with the panel number and color of subtitles).
when you play the dialog, the author's lines get into the standard NPS panel.
Where do I search?
Textline Dialogue UI does not want to register an additional subtitle panel.
- Stalker_EG
- Posts: 31
- Joined: Sun Jul 07, 2019 7:57 pm
Re: Textline Dialogue UI does not want to register an additional subtitle panel.
Hi,
Make a subclass of TextlineDialogueUI.cs. Use this subclass instead of TextlineDialogueUI. Override the GetTemplate method. The base method looks like this:
If the subtitle's speaker is an NPC, it uses the default NPC panel. Otherwise it uses the default PC panel.
In your overridden method, you can get the speaker's desired panel instead:
(Note: You may need to update to version 2.2.5 to have access to the GetPanel() method.)
Make a subclass of TextlineDialogueUI.cs. Use this subclass instead of TextlineDialogueUI. Override the GetTemplate method. The base method looks like this:
Code: Select all
protected virtual StandardUISubtitlePanel GetTemplate(Subtitle subtitle)
{
return subtitle.speakerInfo.IsNPC ? conversationUIElements.defaultNPCSubtitlePanel : conversationUIElements.defaultPCSubtitlePanel;
}
In your overridden method, you can get the speaker's desired panel instead:
Code: Select all
protected virtual StandardUISubtitlePanel GetTemplate(Subtitle subtitle)
{
var ui = DialogueManager.dialogueUI as StandardDialogueUI;
DialogueActor dialogueActor;
var panel = ui.conversationUIElements.standardSubtitleControls.GetPanel(subtitle, out dialogueActor);
if (dialogueActor != null) subtitle.formattedText.text = dialogueActor.AdjustSubtitleColor(subtitle);
return panel;
}
- Stalker_EG
- Posts: 31
- Joined: Sun Jul 07, 2019 7:57 pm
Re: Textline Dialogue UI does not want to register an additional subtitle panel.
Thank you. It works with the tag [panel=2].
but if you define this panel in the Dilogue Actror component, it does not work(
but if you define this panel in the Dilogue Actror component, it does not work(
- Stalker_EG
- Posts: 31
- Joined: Sun Jul 07, 2019 7:57 pm
Re: Textline Dialogue UI does not want to register an additional subtitle panel.
It's working now! Thank you so much. The last problem was that there was a second NPS entry for the author in the attached database. I removed it and now everything is working.
- Stalker_EG
- Posts: 31
- Joined: Sun Jul 07, 2019 7:57 pm
Re: Textline Dialogue UI does not want to register an additional subtitle panel.
Everything works except the color and other subtitle settings of the Dilogue Actror component.
Re: Textline Dialogue UI does not want to register an additional subtitle panel.
You'll need to add a couple of lines to the script. I updated my previous post with the extra lines of code.