amélioration de la commande tactile

les clues sont dépendantes du contexte
elles affichent un bouton si on est au clavier
un doigt si on est à la souris ou au doigt
This commit is contained in:
Thomas
2025-03-29 12:51:15 +01:00
parent 2125236638
commit 6edefc58d0
13 changed files with 1673 additions and 16 deletions

View File

@@ -4,12 +4,20 @@ class_name InteractionZone
@export var clue: BubbleClue
var clueEnabled = false
var player: Human
var hasMouseInside = false
func _unhandled_input(event: InputEvent) -> void:
if event is InputEventMouseButton or event is InputEventScreenTouch:
if event.pressed:
if clueEnabled:
player.wants_to_interact_with = get_parent()
if hasMouseInside:
player.wants_to_interact_with = get_parent()
func _mouse_enter() -> void:
hasMouseInside = true
func _mouse_exit() -> void:
hasMouseInside = false
func enable_interaction_clue(h: Human):
player = h