1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

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

This commit is contained in:
Gregor Parzefall 2024-03-24 22:35:55 +01:00 committed by grorp
parent e8a8525bcd
commit 517f1602aa
8 changed files with 54 additions and 19 deletions

View file

@ -30,10 +30,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "texture_override.h" // TextureOverride
#include "tool.h"
#include "util/pointabilities.h"
#include "util/pointedthing.h"
class IGameDef;
class Client;
struct ToolCapabilities;
struct PointedThing;
#ifndef SERVER
#include "client/texturesource.h"
struct ItemMesh;
@ -57,6 +58,7 @@ enum TouchInteractionMode : u8
{
LONG_DIG_SHORT_PLACE,
SHORT_DIG_LONG_PLACE,
TouchInteractionMode_USER, // Meaning depends on client-side settings
TouchInteractionMode_END, // Dummy for validity check
};
@ -67,7 +69,9 @@ struct TouchInteraction
TouchInteractionMode pointed_object;
TouchInteraction();
TouchInteractionMode getMode(const PointedThing &pointed) const;
// Returns the right mode for the pointed thing and resolves any occurrence
// of TouchInteractionMode_USER into an actual mode.
TouchInteractionMode getMode(PointedThingType pointed_type) const;
void serialize(std::ostream &os) const;
void deSerialize(std::istream &is);
};