new tuto triggers ready to be setup
This commit is contained in:
@@ -1,17 +1,37 @@
|
||||
extends Area3D
|
||||
class_name TutoTrigger
|
||||
|
||||
@export var input: GUIDEAction
|
||||
@export var second_input: GUIDEAction = null
|
||||
@export_group("First input")
|
||||
@export var first_input_icon: Texture
|
||||
@export var first_input_icon_keyboard: Texture
|
||||
@export_group("Second input")
|
||||
@export var second_input_icon: Texture
|
||||
@export var second_input_icon_keyboard: Texture
|
||||
@export_group("Third input")
|
||||
@export var third_input_icon: Texture
|
||||
@export var third_input_icon_keyboard: Texture
|
||||
|
||||
@export_group("Text")
|
||||
@export var input_related_text: String
|
||||
@export var tuto_text: String
|
||||
|
||||
@onready var input_prompt: RichTextLabel = %InputPrompt
|
||||
@onready var control: Control = $Control
|
||||
@onready var inputs_container: HBoxContainer = %MultipleInputsContainer
|
||||
@onready var first_input: TextureRect = %FirstInput
|
||||
@onready var first_plus_sign: Label = %first_plus_sign
|
||||
@onready var second_input: TextureRect = %SecondInput
|
||||
@onready var second_plus_sign: Label = %second_plus_sign
|
||||
@onready var third_input: TextureRect = %ThirdInput
|
||||
@onready var complex_input_label: Label = %ComplexInputLabel
|
||||
@onready var tuto_text_label: Label = %TutoText
|
||||
|
||||
var current_input_method = GlobalHelpers.GamepadDetectionEvent.GAMEPAD
|
||||
|
||||
func _ready() -> void:
|
||||
control.visible = false
|
||||
complex_input_label.visible = !input_related_text.is_empty()
|
||||
complex_input_label.text = input_related_text
|
||||
tuto_text_label.text = tuto_text
|
||||
|
||||
_on_input_mappings_changed()
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
@@ -25,7 +45,21 @@ func _input(event: InputEvent) -> void:
|
||||
_on_input_mappings_changed()
|
||||
|
||||
func _on_input_mappings_changed():
|
||||
pass
|
||||
var is_gamepad = current_input_method == GlobalHelpers.GamepadDetectionEvent.GAMEPAD
|
||||
|
||||
first_input.visible = first_input_icon != null
|
||||
if first_input.visible:
|
||||
first_input.texture = first_input_icon if is_gamepad else first_input_icon_keyboard
|
||||
|
||||
second_input.visible = second_input_icon != null
|
||||
first_plus_sign.visible = second_input.visible
|
||||
if second_input.visible:
|
||||
second_input.texture = second_input_icon if is_gamepad else second_input_icon_keyboard
|
||||
|
||||
third_input.visible = third_input_icon != null
|
||||
second_plus_sign.visible = third_input.visible
|
||||
if third_input.visible:
|
||||
third_input.texture = third_input_icon if is_gamepad else third_input_icon_keyboard
|
||||
|
||||
|
||||
func _on_body_entered(body: Node3D) -> void:
|
||||
|
||||
Reference in New Issue
Block a user