#Trying to block all inputs when my pop up window is visible

1 messages · Page 1 of 1 (latest)

maiden wave
#

I'm making a 2D game with different UI elements and one of them is a pop up window that appears when you, for example, select one of the quests.
The pop up and the questboard are CanvasLayer scenes. The problem that I need to solve is only giving the inputs to that pop up window when it is active or else the player can still interact with the rest of the environment while deciding if they are going to accept or not. What's the best approach?
My inputs for now are different TouchScreenButtons and a _input method that's tracking touches to do different things.
Thanks!

wild sinew
#

welp i would like to know too, but per now i made it in the game over screen with a return

#

locks everything else tho

night shell
#

If you're using touchscreen controls the normal UI stuff won't work

#

so i guess you have to set a bool that all the input methods check

#

and disable the buttons

wild sinew
#

maybe consider keeping it like this and making the pop up disappear when you ran away too far from the quest giver

floral quarry
#

Why not just pause the game? You can set your UI to ignore pauses.

night shell
#

that too

wild sinew
maiden wave
wild sinew
#

please tell me it just exists "pause"

maiden wave
#

If you could give me more info that sounds like the answer I'm looking for

floral quarry
#

get_tree().paused = true

night shell
#

get_tree().paused = true

#

noooo u said it first gdlament

wild sinew
#

CMON ARE YOU FOR REAL

#

WAS IT THIS SIMPLE

maiden wave
#

lul

night shell
#

You also need to change the process mode on the popup

maiden wave
#

But, if the game is paused, will the popup buttons even be clickable?

night shell
#

otherwise, the game will pause forever

wild sinew
night shell
#

No, it does

floral quarry
wild sinew
#

also herald and paint if i can request your help here #1357013554901024855 🥺

maiden wave
floral quarry
#

It pauses everything by default. You need to change the process mode found in the node section of the inspector

night shell
#

so you only need to set the parent node as always run so that all the children always run as well

maiden wave
#

But, I need them to be paused, so everything must be default, even the root node and the popup node must be always active so it can be interacted with even if the game is paused

#

Right?

wild sinew
#

But how do you make It resume after the pause?

night shell
#

the code needs to be on an unpaused node

#

just set paused to false

maiden wave
night shell
#

yes

wild sinew
#

Like on the signal of let's say a button pressed?

night shell
#

yeah u can do that

maiden wave
#

IT WORKS!

#

Wow, will that give me headaches in the futures? I hope not hahaha

wild sinew
#

That's a problem for the future you

maiden wave
#

Yup, future me hates me

wild sinew
#

Put the tag solved now in the thread