It works perfect, thanks!Tony Li wrote: ↑Mon Mar 27, 2023 6:31 pm You could tell the subtitle panel to update its content:
Code: Select all
var subtitle = DialogueManager.currentConversationState.subtitle; subtitle.formattedText = FormattedText.Parse(subtitle.dialogueEntry.currentDialogueText); DialogueManager.standardDialogueUI.ShowSubtitle(subtitle);
How Can I Refresh UI Language After Change Language?
-
- Posts: 9
- Joined: Mon Dec 03, 2018 4:31 pm
Re: How Can I Refresh UI Language After Change Language?
Re: How Can I Refresh UI Language After Change Language?
Glad to help!
-
- Posts: 9
- Joined: Mon Dec 03, 2018 4:31 pm
Re: How Can I Refresh UI Language After Change Language?
Thanks, it works properlyTony Li wrote: ↑Mon Mar 27, 2023 6:31 pm You could tell the subtitle panel to update its content:
Code: Select all
var subtitle = DialogueManager.currentConversationState.subtitle; subtitle.formattedText = FormattedText.Parse(subtitle.dialogueEntry.currentDialogueText); DialogueManager.standardDialogueUI.ShowSubtitle(subtitle);
Do you know if there is something similar that I can use to update the response texts without using DialogueManager.UpdateResponses? Specifically, I would like to update the button texts when the response panel is open.
Re: How Can I Refresh UI Language After Change Language?
If you don't want to use DialogueManager.UpdateResponses() to re-evaluate conditions and re-process the dialogue entry text, you can just loop through the menu's instantiatedButtons list -- or the buttons list if you're using predesigned buttons instead of the Button Template. Example:
Code: Select all
// Apply italics to all response button text:
var menuPanel = DialogueManager.standardDialogueUI.conversationUIElements.defaultMenuPanel;
foreach (var buttonGO in menuPanel.instantiatedButtons)
{
var button = buttonGO.GetComponent<StandardUIResponseButton>();
button.label.text = $"<i>{button.label.text}</i>";
}
Re: How Can I Refresh UI Language After Change Language?
How to know if I'm displaying responses or a dialogue subtitle?elektronische wrote: ↑Mon Mar 27, 2023 4:55 pmThanks for the quick response!Tony Li wrote: ↑Mon Mar 27, 2023 4:30 pm Hi,
If you're showing a subtitle, you can replay the same dialogue entry:
If you're showing a response menu, just call DialogueManager.UpdateResponses().Code: Select all
var state = DialogueManager.converationModel.GetState(DialogueManager.currentConversationState.subtitle.dialogueEntry); DialogueManager.conversationController.GotoState(state);
Is this the only way? I ask because besides the subtitles, I also use sequences in the dialogue nodes that trigger other things like sounds, animations, etc. So it doesn't seem very efficient to replay the entire dialogue node just to update the subtitles' language.
Re: How Can I Refresh UI Language After Change Language?
Hi,
You can check if the dialogue UI's menu panel is open:
You can check if the dialogue UI's menu panel is open:
Code: Select all
bool isShowingMenu = DialogueManager.standardDialogueUI.conversationUIElements.defaultMenuPanel.isOpen;