Block the room while a GUI is shown

Started by nightmarer, Thu 21/07/2022 23:01:00

Previous topic - Next topic

nightmarer

Hello.

I'm trying to block the character while a GUI is shown, but I don't want to pause the game.
The problem is that this GUI doesn't block the whole window, so while this GUI is shown if I click outside of it,
the player walks and even it can do interactions. So I want to block any interaction with the room while this GUI is opened.
How can I do this?

Thanks and regards.

Crimson Wizard

Usually you'd just add a condition in on_mouse_click, saying that if certain GUIs are shown, then don't process clicks in the room.

Tarnos12

Did you try making GUI full screen and set it to Clickable?
You can position your buttons withing that GUI.
I am using it for my backdrop for pop ups.

If that doesn't work, then try attaching an on click event on that GUI as well(even if it does nothing)
That might force the game to think that you are clicking the GUI.

Pax Animo

#3
Quote from: nightmarer on Thu 21/07/2022 23:01:00

The problem is that this GUI doesn't block the whole window, so while this GUI is shown if I click outside of it,

What's the reason why your GUI could not cover the hole screen which would block all clicks outside of the GUI? (depending on the value of the ZOrder of that GUI just in case you have other GUI's visible at the same time)
Misunderstood

Tarnos12

Quote from: Pax Animo on Fri 22/07/2022 00:04:45
Quote from: nightmarer on Thu 21/07/2022 23:01:00

The problem is that this GUI doesn't block the whole window, so while this GUI is shown if I click outside of it,

What's the reason why the GUI could not cover the hole screen which would block all clicks outside of the GUI? (depending on the value of the ZOrder of that GUI just in case you have other GUI's visible at the same time)

Oh, in that case the simplest solution is to find a script responsible for the character moving/interacting and check if that GUI is visible.
Depending on where that script is, you might even use ClaimEvent(); to disable it while the GUI is visible.

Is there any reason you can't have full screen GUI tho?

nightmarer

#5
The only reason is an aesthetic reason. You can check it here, but maybe the solution is to feel the whole screen with transparent background.
https://imgur.com/a/RzDoDmU

Tarnos12

Quote from: nightmarer on Fri 22/07/2022 08:33:31
The only reason is an aesthetic reason. You can check it here, but maybe the solution is to feel the whole screen with transparent background.
https://imgur.com/a/RzDoDmU

Yes, whole screen with transparent background is what I mean.
Another way is to use separate GUI with transparent background and place it underneath this one.
Every time you open this GUI, you also open the transparent background GUI.

SMF spam blocked by CleanTalk