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

[no squash] Touch things #14492

Merged
merged 3 commits into from Mar 30, 2024
Merged

[no squash] Touch things #14492

merged 3 commits into from Mar 30, 2024

Conversation

grorp
Copy link
Member

@grorp grorp commented Mar 24, 2024

  1. Re-add "long tap to punch" as a client-side setting

    Fixes the part of The touch_interaction introduced in 404a063fdfbbddcba32d22dd1c34dd73922bc12a needs a setting to override it #14393 that I consider acceptable. The setting doesn't seem useful to me, but it will hopefully make @j-r happy ¯\(ツ)

    Typical Minetest workflow:

    1. Make a behavior change requested for years by many users
    2. One user complains
    3. Add a setting
  2. Make long tap delay customizable and change default to 400ms

    For comparison:

    • current Minetest: 500 ms
    • Rollertest: 400 ms
    • PojavLauncher: 300 ms & configurable
    • new Minetest: 400 ms & configurable
  3. Add shorthand form for touch_interaction

    Allows replacing this

    touch_interaction = {
        pointed_nothing = "short_dig_long_place",
        pointed_node    = "short_dig_long_place",
        pointed_object  = "short_dig_long_place",
    },

    with this

    touch_interaction = "short_dig_long_place",

To do

This PR is a Ready for Review.

How to test

  1. Verify that "short tap to punch" is still the default. Verify that the touch_punch_gesture setting can be used to restore the pre-5.9 behavior of "long tap to punch".

  2. Try different values for the touch_long_tap_delay setting.

  3. Add this code to Mineclon* and verify that it works:

    minetest.register_on_mods_loaded(function()
        for name in pairs(minetest.registered_items) do
            if name:find("grenade") or name:find("bow") or name:find("shield") then
                print("overriding " .. name)
                minetest.override_item(name, {
                    touch_interaction = "short_dig_long_place",
                })
            end
        end
    end)

doc/lua_api.md Show resolved Hide resolved
src/itemdef.cpp Show resolved Hide resolved
src/itemdef.h Show resolved Hide resolved
src/script/common/c_content.cpp Outdated Show resolved Hide resolved
Copy link
Member

@sfan5 sfan5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@grorp grorp merged commit e79587c into minetest:master Mar 30, 2024
13 checks passed
@grorp grorp deleted the touch-things branch March 30, 2024 10:40
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.

None yet

2 participants