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

TouchControls: Implement an option for dig/place buttons #15845

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

grorp
Copy link
Member

@grorp grorp commented Feb 28, 2025

meant to resolve #13229

This PR adds the option to have dig/place buttons as a part of the touchscreen layout, instead of using long/short tap gestures for digging/placing. The biggest advantage is probably that the buttons allow for precise timing.

This PR introduces three different "modes" for the touch controls (new setting touch_interaction_style):

  • "Tap" (previously touch_use_crosshair = false)
    Long/short tap anywhere on the screen to interact. Interaction happens at finger position.
  • "Tap with crosshair" (previously touch_use_crosshair = true)
    Long/short tap anywhere on the screen to interact. Interaction happens at crosshair position.
  • "Buttons with crosshair" (NEW)
    Use dedicated dig/place buttons to interact. Interaction happens at crosshair position.

Adding an option for dig/place buttons and framing the different control schemes as "modes" (as an enumeration) in the settings was inspired by Minecraft's mobile version.

Video demo of the three modes (the new mode is at the end):

buttonn.mp4

To do

This PR is a Ready for Review.

Note: ~300 of the ~530 added lines in this PR are the new SVG icons.

How to test

  • Test the different modes, confirm that they work as expected.
  • Try upgrading from an earlier Luanti version, confirm that settings are preserved, confirm that the new mode still works as expected.
  • Confirm that dig/place buttons don't appear in modes other than "Buttons with crosshair".
  • Confirm that custom dig/place button positions aren't lost when switching away from "Buttons with crosshair" mode and going back later.

To have some fun, you could try the new control scheme in Block League on the A.E.S. server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android: Add more touchscreen buttons
1 participant