Re: Inserting a Canvas UI in the middle of a dialogue
Posted: Mon Feb 14, 2022 9:57 pm
Thanks for your answer! I think I am almost there! Everything else has been working other than one final glitch.
I used your code and wrapped it inside a function
I call ResumeDialogueContinueButton() together with the code that closes the getItemUI. (I have a button in the getItemUI and the onclicklistener for that button contains code to close the UI and calls ResumeDialogueContinueButton)
However, I found something weird.
The moment I close the UI, the conversation would move forward one node. If I comment out the line that calls ResumeDialogueContinueButton, the UI closes and the conversation will not go forward but the continue button wouldn't work either.
If I hold the left mouse a bit (several seconds in between the mouse down and mouse up), the mouse up action will only close the UI and continue button also resumes function, and the conversation will not go forward. If I just do a normal click, the UI closes, continue button resumes, but conversation will go forward.
Can you help me on this one please? I don't understand how resuming the continue button would move the conversation node forward, and I also do not understand why holding the mouse for a few second would make that difference.
Thank you very much!
I used your code and wrapped it inside a function
Code: Select all
void ResumeDialogueContinueButton()
{
DialogueActor actor;
var subtitle = DialogueManager.currentConversationState.subtitle;
var subtitleControls = DialogueManager.standardDialogueUI.conversationUIElements.standardSubtitleControls;
var panel = subtitleControls.GetPanel(subtitle, out actor);
var continueButton = panel.continueButton;
if (continueButton != null) continueButton.interactable = true;
if (continueButton.GetComponent<UIButtonKeyTrigger>())
continueButton.GetComponent<UIButtonKeyTrigger>().enabled = true;
}
However, I found something weird.
The moment I close the UI, the conversation would move forward one node. If I comment out the line that calls ResumeDialogueContinueButton, the UI closes and the conversation will not go forward but the continue button wouldn't work either.
If I hold the left mouse a bit (several seconds in between the mouse down and mouse up), the mouse up action will only close the UI and continue button also resumes function, and the conversation will not go forward. If I just do a normal click, the UI closes, continue button resumes, but conversation will go forward.
Can you help me on this one please? I don't understand how resuming the continue button would move the conversation node forward, and I also do not understand why holding the mouse for a few second would make that difference.
Thank you very much!