Input disable only for Dialogue System while on conversation

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

Input disable only for Dialogue System while on conversation

Post by fkkcloud »

Hello,

I see that the only way to disable input from DialogueManager is to disable the InputSystemUIInputModule.
But I hope to pop up a window (e.g. put your name) during the conversation.

Enabling the InputSystemUIInputModule will enable input for both since it also uses InputSystemUIInputModule.
Is this already a known issue? What is the suggested way to solve it?

Thank you :!:
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Input disable only for Dialogue System while on conversation

Post by Tony Li »

What input do you want to disable? In other words, what do you want to prevent the player from doing?
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

Re: Input disable only for Dialogue System while on conversation

Post by fkkcloud »

I want to disable the play input for dialogue system only while we put up another UI that needs interaction (with general Unity UI navigation) during the conversation.

Basically, another character asks you "what is your name?"
then keyboard input UI pops up and player uses their gamepad to select key buttons to put their name. Once its done, the keyboard input UI dismisses. Then we are back on the dialogue system input.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Input disable only for Dialogue System while on conversation

Post by Tony Li »

Hi,

What do you mean by "play input"? Regular gameplay control such as moving the player character around the scene? Or interacting with the dialogue UI?

When using a gamepad, the dialogue UI tries to keep the current UI selection on itself. Before you open other UI, call:

Code: Select all

PixelCrushers.UIPanel.monitorSelection = false;
Then open your other UI. After you close your UI, call:

Code: Select all

PixelCrushers.UIPanel.monitorSelection = true;
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

Re: Input disable only for Dialogue System while on conversation

Post by fkkcloud »

I meant player input by this UINavigation Move(dpad) and Submit (dualshock's X button for now)
화면 캡처 2020-11-18 172752.png
화면 캡처 2020-11-18 172752.png (71.98 KiB) Viewed 730 times
Disabling the InputSystemUIInputModule - seems like the only way to disable the interaction with the Dialogue System.

I will try to tell InputSystemUIInputModule 's eventSystem's FirstSelected to be set to that Pop Up UI (not dialogue system's UI) and make change to the variable that you mentioned. Hope that works
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Input disable only for Dialogue System while on conversation

Post by Tony Li »

That should work. You can also add a CanvasGroup to the Dialogue Panel and set its Interactable value to false.
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

Re: Input disable only for Dialogue System while on conversation

Post by fkkcloud »

For the pop-up UI, I am instantiating and destroy it in runtime.
It is really just setting Protagonist's name with the keyboard input UI (pop up) during the conversation. then, its gone.

I guess my procedure will be
  • PixelCrushers.UIPanel.monitorSelection = false;
  • GameObject obj = Instantiate(Prefab_KeyboardInputUI);
  • EventSystem.SetFirstSelected(obj);
  • ... do the protagonist name store into Dialogue system or something
  • Destroy(obj);
  • PixelCrushers.UIPanel.monitorSelection = true;
Thank you!
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Input disable only for Dialogue System while on conversation

Post by Tony Li »

That looks like a good plan. The important part is to set UIPanel.monitorSelection so prevent the dialogue UI from stealing focus from your pop-up.
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

Re: Input disable only for Dialogue System while on conversation

Post by fkkcloud »

Everything works awesome!

Code: Select all

StartNameSetter()@Message(Typed);
I made a custom Sequencer that is called once the Type event is emitted.
Post Reply