-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Implement an editor to customize the touchscreen controls #14933
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
Conversation
5f174a8 to
2b12121
Compare
This comment was marked as duplicate.
This comment was marked as duplicate.
No, but I might add one in a future PR. See the "Features that would be cool, but are not planned for this initial PR" section. |
|
I get the following crash when dragging a button after adding it from "Add" in the editor |
2b12121 to
22e005b
Compare
Cannot reproduce, but I assume it's this assertion failing: Replaced it with some printing for debugging (22e005b), can you tell me what it outputs? And more importantly, does it work now? If it does, I'll just remove the assertion. |
|
FWIW: Yesterday I tested this PR on Android 6 and could not reproduce any such crash. Works on my side. |
Works now |
22e005b to
ece32a9
Compare
|
something for a follow up PR but might be nice to be able to move HUD elements like the minimap and hotbar as part of this: #15021 |
ece32a9 to
ff072c7
Compare
ff072c7 to
ee6b6d8
Compare
9a1fe10 to
da80a40
Compare
da80a40 to
0d04cb6
Compare
|
@grorp I would've done that if I had an Android build system set up at all. Currently I am testing the ARM v7a builds from the buildbot and sign them manually. |
would happen with enable_touch=true on desktop platforms
"anchor" is used by formspec with a different meaning, "position" is used by HUD and formspec with the same meaning. This change thus avoids confusion.
01415b8 to
d8ff60e
Compare
SmallJoker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☑️ The layout is reset to default if any Json::RuntimeError is thrown. The user does not see any error. Luanti continues to work.
☑️ Move/add/remove buttons from the Settings menu
A few minor comments regarding code quality. Works well as-is.
At some point I tested with SDL_HINT_MOUSE_TOUCH_EVENTS=1 to be able to test the touch controls with a mouse on desktop. That resulted in the touch controls working, but mouse events arriving twice in GUIs: - once directly via mouse - once via mouse -> touch (converted by SDL) -> mouse (converted by Minetest, regular conversion that's necessary for menus to work on touchscreens at all) This resulted in a crash here because the code had more side effects iirc. Now it seems fine, and having a workaround for this specific case is questionable anyway.
|
Checked the diff since my last review. Still LGTM. Thanks for the update. 👍 |
This reverts commit d8ff60e.
|
Just tested this out on Android, this is such a massive improvement! Tysm for implementing it, this fixes multiple gripes I've had with the mobile experience all at once, and is so good for accessability and customizability! Just being able to remove the zoom button and add the inventory button in the controls is huge for me lol By the way, do you have any thoughts about how #13229 could be implemented, adding arbitrary internal keybindings as buttons through your new add-buttons prompt? |
closes #14456
This PR implements a touchscreen layout editor. Features:
editor.mp4
The UI design is inspired by Minecraft's control editor.
P.S. I have used "ChatGPT" while working on an early version of the touch control editor (but this PR doesn't include code generated by it)
To do
This PR is a Ready for Review.
Revert commit "Temp: Unbreak mainmenu security" before merging
Features that would be cool, but are not planned for this initial PR:
How to test
Play Minetest on Android. Use the touchscreen layout editor (accessible via the pause menu or the settings menu).
APKs for testing (signed with a debug keystore)
app-armeabi-v7a-release.zip
app-arm64-v8a-release.zip
app-x86-release.zip
app-x86_64-release.zip
The APKs are inside ZIP archives, so you have to extract the ZIP first. You have to delete any existing Minetest installation including data beforehand for installation to work.