-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GUI: restore the Pause Menu after closing the Settings Menu #15891
base: master
Are you sure you want to change the base?
Conversation
When I saw this PR, I was initially going to comment something along the lines of
However, I now found out that, as implied in the PR description...
... closing C++ sub-menus actually gets you back to the "main" pause menu on 5.12.0-dev. This is actually a recent regression caused by 2c50066:
This can easily be fixed by only applying that workaround to the settings button, where it is actually necessary, and reverting it for the other buttons. |
It seems this is a subjective matter because I would prefer to always return to the pause menu before explicitly closing it. This is also done similarly in other games - difference being that these layers of menus (/formspecs) are yet not visually represented in Luanti. |
Yeah, this seems like a matter of preference. I suppose either behavior is objectively fine as long as it's consistent between all the sub-menus (C++ and Lua). If you want to continue with this, you should also update the buttons that are currently labeled "Exit" to say "Back" instead: luanti/builtin/common/settings/dlg_settings.lua Lines 530 to 532 in db15bc6
luanti/src/gui/guiVolumeChange.cpp Lines 79 to 80 in db15bc6
|
d117cca
to
263024e
Compare
Because it is more intuitive this way.
When closing the in-game Settings menu, the Pause menu will be shown again.
The
GUIModalMenu
code is responsible for handling overlaid formspec "layers". C++ GUI implementations (e.g.GUIPasswordChange
) do support this well. The Lua side of the Main Menu has its own layer code, which works the same way. However, when entering the Settings menu (Lua formspec) though the Pause menu (C++), there is no way back.This PR fixes that by allowing to overlay any kind of
showPauseMenuFormSpec
formspecs (until they get closed explicitly).To do
This PR is Ready for Review.
How to test
GUIKeyChangeMenu
does not depend onm_formspec
)Also open and close some random formspecs to ensure it's not causing side-effects.