Best way to use multiple subtitle panels with same dialogue source
-
- Posts: 14
- Joined: Tue Dec 08, 2020 6:33 am
Best way to use multiple subtitle panels with same dialogue source
Hello,
I am trying to make an minimizable dialogue UI that players can expand or shrink it anytime. And it's not easy to make it responsive in Unity UI because the big one and the small one have different layouts. So I think it would be better to just using two individual UIs.
The two UIs would be like:
Small One: Big One: Whenever it expands or shrinks, the selected UI will show up displaying the ongoing dialogue, and another would just hide. But I couldn't figure out how do it.
(I am using StandardDialougeUI, StandardUISubtitlePanel, and StandardUIMenuPanel with little customizations.)
I've tried adding StandardDialougeUI to both UIs and using a script to switch them. But it seems like assigning DialogueManager.DialogueUI a new value wouldn't work while the conversation is running. I also tried adding SubtitlePanel to conversationUIElements.subtitlePanels but no luck either.
Is there a way to use multiple subtitle panels that shares same dialogue source?
Thanks in advance!
I am trying to make an minimizable dialogue UI that players can expand or shrink it anytime. And it's not easy to make it responsive in Unity UI because the big one and the small one have different layouts. So I think it would be better to just using two individual UIs.
The two UIs would be like:
Small One: Big One: Whenever it expands or shrinks, the selected UI will show up displaying the ongoing dialogue, and another would just hide. But I couldn't figure out how do it.
(I am using StandardDialougeUI, StandardUISubtitlePanel, and StandardUIMenuPanel with little customizations.)
I've tried adding StandardDialougeUI to both UIs and using a script to switch them. But it seems like assigning DialogueManager.DialogueUI a new value wouldn't work while the conversation is running. I also tried adding SubtitlePanel to conversationUIElements.subtitlePanels but no luck either.
Is there a way to use multiple subtitle panels that shares same dialogue source?
Thanks in advance!
Re: Best way to use multiple subtitle panels with same dialogue source
Hi,
It may be easiest to use the same UI and get the anchoring to work correctly in both orientations (big and small).
However, if you want to use them as two separate windows, you could either make them two separate sets of (subtitle panel + menu panel) in the same dialogue UI, or as two separate dialogue UIs. In either case, when you switch, you'll need to manually copy the content from old to new. To copy the accumulated subtitle text, set the subtitle panel's accumulatedText property.
To change dialogue UIs in the middle of a conversation, you must set the current conversation view's dialogueUI. Example:
It may be easiest to use the same UI and get the anchoring to work correctly in both orientations (big and small).
However, if you want to use them as two separate windows, you could either make them two separate sets of (subtitle panel + menu panel) in the same dialogue UI, or as two separate dialogue UIs. In either case, when you switch, you'll need to manually copy the content from old to new. To copy the accumulated subtitle text, set the subtitle panel's accumulatedText property.
To change dialogue UIs in the middle of a conversation, you must set the current conversation view's dialogueUI. Example:
Code: Select all
DialogueManager.conversationView.dialogueUI = newUI;
-
- Posts: 14
- Joined: Tue Dec 08, 2020 6:33 am
Re: Best way to use multiple subtitle panels with same dialogue source
Thanks Tony! That's a really good advice and I'll give it shot to see if I can get the responsive UI to work. Otherwise I'll take the harder approach you suggest.
-
- Posts: 14
- Joined: Tue Dec 08, 2020 6:33 am
Re: Best way to use multiple subtitle panels with same dialogue source
Hi Tony,
I was wondering is it possible to display one dialogue on two separate dialogue UIs (or one dialogue UI with two subtitle /menu panels) and have them running at the same time?
I was wondering is it possible to display one dialogue on two separate dialogue UIs (or one dialogue UI with two subtitle /menu panels) and have them running at the same time?
Re: Best way to use multiple subtitle panels with same dialogue source
Hi,
I think so, with a little scripting. You could make a subclass of StandardUIDialogueUI or add a script with OnConversationStart/Line/ResponseMenu/End methods, such as:
I think so, with a little scripting. You could make a subclass of StandardUIDialogueUI or add a script with OnConversationStart/Line/ResponseMenu/End methods, such as:
Code: Select all
public StandardDialogueUI otherUI;
public void OnConversationStart(Transform actor) { otherUI.Open(); }
public void OnConversationLine(Subtitle subtitle) { otherUI.ShowSubtitle(subtitle); }
public void OnConversationResponseMenu(Response[] responses)
{
otherUI.ShowResponses(DialogueManager.currentConversationState.subtitle, responses, DialogueManager.displaySettings.inputSettings.responseTimeout);
}
public void OnConversationEnd(Transform actor) { otherUI.Close(); }
-
- Posts: 14
- Joined: Tue Dec 08, 2020 6:33 am
Re: Best way to use multiple subtitle panels with same dialogue source
Thanks Tony! That's really clear
Re: Best way to use multiple subtitle panels with same dialogue source
There are no"DialogueManager.currentConversationState"and"DialogueManager.displaySettings" now?
Re: Best way to use multiple subtitle panels with same dialogue source
Hi,
Did you include:
at the top of your script?
Here's the API reference:
DialogueManager.currentConversationState
Did you include:
Code: Select all
using PixelCrushers.DialogueSystem;
Here's the API reference:
DialogueManager.currentConversationState