Skip to content
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

Add Settings to in-game menu, and rewrite it in C++ #14781

Closed
wants to merge 1 commit into from

Conversation

swagtoy
Copy link
Contributor

@swagtoy swagtoy commented Jun 26, 2024

This PR adds settings to the pause menu.

In the past, you need to quit the current game to change settings. This is tedious, especially when on servers where you need to re-enter your password. It's also frustrating as you can't fine-tune settings such as FOV.

To do this, the lua is slowly rewritten in C++. This will probably benefit my other PR #14763, so I am going to finish this first.

Also, we can probably remove the "Sound" subsection. We could also move all the "Controls" configuration to this settings menu (which also lets us tweak controls on the main menu.. 2 birds dead with 1 stone!)

image

Fixes #6722, #3165, #6922, etc etc etc

How to test

  1. Start a world
  2. Press ESC
  3. Press "settings"

(Note: As of typing this, the main menu's settings button is still the lua one)

@swagtoy swagtoy marked this pull request as draft June 26, 2024 03:27
@Zughy Zughy added Feature ✨ PRs that add or enhance a feature @ Builtin Concept approved Approved by a core dev: PRs welcomed! UI/UX labels Jun 26, 2024
@v-rob
Copy link
Contributor

v-rob commented Jun 26, 2024

I strongly disapprove of moving GUIs to the C++ side. Formspecs were always designed to be used from Lua, and using them in C++ has always been a hack. I fully intend to move the pause menu and death screen to Lua in the future (post-formspecs).

Moreover, the formspec replacement (#14263) has zero support for usage from C++, save by serializing the GUI to a binary stream and sending it to the GUI subsystem. Moving formspecs to the C++ side is a very poor choice from a forward-looking standpoint.

@swagtoy
Copy link
Contributor Author

swagtoy commented Jun 26, 2024

I strongly disapprove of moving GUIs to the C++ side. Formspecs were always designed to be used from Lua, and using them in C++ has always been a hack. I fully intend to move the pause menu and death screen to Lua in the future (post-formspecs).

Moreover, the formspec replacement (#14263) has zero support for usage from C++, save by serializing the GUI to a binary stream and sending it to the GUI subsystem. Moving formspecs to the C++ side is a very poor choice from a forward-looking standpoint.

Initially, I wanted to do this all in Lua, however I was having trouble moving it over to the game.cpp file.

Would you like me to move them all to Lua instead, including the pause menu?

I apologize. I did not know that formspecs were discouraged from C++ usage.

@rubenwardy
Copy link
Contributor

rubenwardy commented Jun 26, 2024

Hey, the settings GUI should stay in Lua. To show it in the mainmenu, there will need to be a secure client side Lua environment. Moving the pause menu to Lua is fine

@swagtoy
Copy link
Contributor Author

swagtoy commented Jun 27, 2024

For any future readers stumbling across this PR, please see #14785 for the Lua version 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Builtin Concept approved Approved by a core dev: PRs welcomed! Feature ✨ PRs that add or enhance a feature Possible close UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more settings to the pause menu.
4 participants