WIP: controls:android:fix bow/rocket/spyglass/burger_follow #4066

Draft
Bakawun wants to merge 1 commits from Bakawun/MineClone2:android_support into master
Member

Minetest pr https://github.com/minetest/minetest/pull/14087 adds the ability for games to modify the touch controls.

Add the customized controls for bows, spyglass, rocket and villager Hamburg (un)follow.

To be able to target while holding a bow or spyglass you need to enable touch_use_crosshair in the minetest settings

Testing

Without the commit these items can't be used
With the commit they can be used
Android users without the minetest pr can still play the game with those items in the unusable state

Minetest pr https://github.com/minetest/minetest/pull/14087 adds the ability for games to modify the touch controls. Add the customized controls for bows, spyglass, rocket and villager Hamburg (un)follow. To be able to target while holding a bow or spyglass you need to enable touch_use_crosshair in the minetest settings ### Testing Without the commit these items can't be used With the commit they can be used Android users without the minetest pr can still play the game with those items in the unusable state
Bakawun added 1 commit 2023-12-11 11:52:44 +01:00
Author
Member

Does anyone know how to make offhand shield work under this new control scheme?

Does anyone know how to make offhand shield work under this new control scheme?
ancientmarinerdev reviewed 2023-12-13 00:50:38 +01:00
@ -0,0 +35,4 @@
for name in pairs(minetest.registered_items) do
if name:find("hamburger") then
minetest.override_item(name, {
touch_controls = {

This is duplicated 4 times. It would be better as a variable and just reference it.

But on reflection, why are we overriding the item? Can we not just add touch controls to the definitions for these items?

The logic for this is quite expensive, as you'd iterate over item, check for 1 name. Iterate over every item, check for another. Checking for the different names during that iteration would be better, but unless there is a good reason not to, these touch controls could be put on the item. Would this impact on desktop if these were on, or does it just add additional controls to the items?

This is duplicated 4 times. It would be better as a variable and just reference it. But on reflection, why are we overriding the item? Can we not just add touch controls to the definitions for these items? The logic for this is quite expensive, as you'd iterate over item, check for 1 name. Iterate over every item, check for another. Checking for the different names during that iteration would be better, but unless there is a good reason not to, these touch controls could be put on the item. Would this impact on desktop if these were on, or does it just add additional controls to the items?
the-real-herowl added the
controls
delayed for engine release
mobile
labels 2023-12-13 02:52:43 +01:00
Contributor

https://github.com/minetest/minetest/pull/14087 is now merged, with touch_controls renamed to touch_interaction because of reviews.

But on reflection, why are we overriding the item? Can we not just add touch controls to the definitions for these items?

Yes, you can.

Would this impact on desktop if these were on, or does it just add additional controls to the items?

This would have no impact on desktop and also no impact on older Minetest versions.

https://github.com/minetest/minetest/pull/14087 is now merged, with `touch_controls` renamed to `touch_interaction` because of reviews. > But on reflection, why are we overriding the item? Can we not just add touch controls to the definitions for these items? Yes, you can. > Would this impact on desktop if these were on, or does it just add additional controls to the items? This would have no impact on desktop and also no impact on older Minetest versions.
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: VoxeLibre/VoxeLibre#4066
No description provided.