finally cleaned up input method detection
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 21s
Create tag and build when new code gets to main / Test (push) Successful in 6m46s
Create tag and build when new code gets to main / Export (push) Successful in 8m3s

This commit is contained in:
2026-02-16 23:15:25 +01:00
parent 759d972b6d
commit b9ae83cd92
10 changed files with 808 additions and 61 deletions

View File

@@ -1,38 +1,35 @@
extends Area3D
class_name TutoTrigger
@onready var control: Control = $Control
@onready var multiple_inputs_container: HBoxContainer = %MultipleInputsContainer
@onready var first_input: TextureRect = %FirstInput
@onready var complex_input_label: Label = %ComplexInputLabel
@onready var second_input: TextureRect = %SecondInput
@onready var tuto_label: Label = %TutoText
@export var first_input_texture: CompressedTexture2D
@export var second_input_texture: CompressedTexture2D
@export var complex_input_text: String
@export var input: GUIDEAction
@export var second_input: GUIDEAction = null
@export var tuto_text: String
@onready var input_prompt: RichTextLabel = %InputPrompt
@onready var control: Control = $Control
var current_input_method = GlobalHelpers.GamepadDetectionEvent.GAMEPAD
func _ready() -> void:
tuto_label.text = tuto_text
first_input.texture = first_input_texture
second_input.texture = second_input_texture
complex_input_label.text = complex_input_text
control.visible = false
_on_input_mappings_changed()
if second_input_texture != null:
complex_input_label.text = "+"
if second_input_texture == null and complex_input_text.is_empty():
complex_input_label.visible = false
second_input.visible = false
func _input(event: InputEvent) -> void:
var event_gamepad = GlobalHelpers.is_event_gamepad(event)
if event_gamepad == GlobalHelpers.GamepadDetectionEvent.IRRELEVANT:
return
if current_input_method == event_gamepad:
return
current_input_method = event_gamepad
_on_input_mappings_changed()
func _on_input_mappings_changed():
pass
func _on_body_entered(body: Node3D) -> void:
control.visible = true
func _on_body_exited(body: Node3D) -> void:
control.visible = false