new tuto triggers ready to be setup
This commit is contained in:
@@ -3,19 +3,21 @@
|
|||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://bsxtadecl3657"
|
uid="uid://bsxtadecl3657"
|
||||||
path="res://.godot/imported/keyboard_shift_outline.svg-b2954174b97e4b2e82a8cdd72f79d4d5.ctex"
|
path.s3tc="res://.godot/imported/keyboard_shift_outline.svg-b2954174b97e4b2e82a8cdd72f79d4d5.s3tc.ctex"
|
||||||
|
path.etc2="res://.godot/imported/keyboard_shift_outline.svg-b2954174b97e4b2e82a8cdd72f79d4d5.etc2.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
||||||
|
"vram_texture": true
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://assets/ui/input-prompts/Keyboard & Mouse/Vector/keyboard_shift_outline.svg"
|
source_file="res://assets/ui/input-prompts/Keyboard & Mouse/Vector/keyboard_shift_outline.svg"
|
||||||
dest_files=["res://.godot/imported/keyboard_shift_outline.svg-b2954174b97e4b2e82a8cdd72f79d4d5.ctex"]
|
dest_files=["res://.godot/imported/keyboard_shift_outline.svg-b2954174b97e4b2e82a8cdd72f79d4d5.s3tc.ctex", "res://.godot/imported/keyboard_shift_outline.svg-b2954174b97e4b2e82a8cdd72f79d4d5.etc2.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=2
|
||||||
compress/high_quality=false
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/uastc_level=0
|
compress/uastc_level=0
|
||||||
@@ -23,7 +25,7 @@ compress/rdo_quality_loss=0.0
|
|||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=true
|
||||||
mipmaps/limit=-1
|
mipmaps/limit=-1
|
||||||
roughness/mode=0
|
roughness/mode=0
|
||||||
roughness/src_normal=""
|
roughness/src_normal=""
|
||||||
@@ -37,7 +39,7 @@ process/normal_map_invert_y=false
|
|||||||
process/hdr_as_srgb=false
|
process/hdr_as_srgb=false
|
||||||
process/hdr_clamp_exposure=false
|
process/hdr_clamp_exposure=false
|
||||||
process/size_limit=0
|
process/size_limit=0
|
||||||
detect_3d/compress_to=1
|
detect_3d/compress_to=0
|
||||||
svg/scale=1.0
|
svg/scale=1.0
|
||||||
editor/scale_with_editor_scale=false
|
editor/scale_with_editor_scale=false
|
||||||
editor/convert_colors_with_editor_theme=false
|
editor/convert_colors_with_editor_theme=false
|
||||||
|
|||||||
@@ -3,19 +3,21 @@
|
|||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://dlt8uv1mtq4a0"
|
uid="uid://dlt8uv1mtq4a0"
|
||||||
path="res://.godot/imported/mouse_right.svg-66cb44804e2971b729668b5953fcbd42.ctex"
|
path.s3tc="res://.godot/imported/mouse_right.svg-66cb44804e2971b729668b5953fcbd42.s3tc.ctex"
|
||||||
|
path.etc2="res://.godot/imported/mouse_right.svg-66cb44804e2971b729668b5953fcbd42.etc2.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
||||||
|
"vram_texture": true
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://assets/ui/input-prompts/Keyboard & Mouse/Vector/mouse_right.svg"
|
source_file="res://assets/ui/input-prompts/Keyboard & Mouse/Vector/mouse_right.svg"
|
||||||
dest_files=["res://.godot/imported/mouse_right.svg-66cb44804e2971b729668b5953fcbd42.ctex"]
|
dest_files=["res://.godot/imported/mouse_right.svg-66cb44804e2971b729668b5953fcbd42.s3tc.ctex", "res://.godot/imported/mouse_right.svg-66cb44804e2971b729668b5953fcbd42.etc2.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=2
|
||||||
compress/high_quality=false
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/uastc_level=0
|
compress/uastc_level=0
|
||||||
@@ -23,7 +25,7 @@ compress/rdo_quality_loss=0.0
|
|||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=true
|
||||||
mipmaps/limit=-1
|
mipmaps/limit=-1
|
||||||
roughness/mode=0
|
roughness/mode=0
|
||||||
roughness/src_normal=""
|
roughness/src_normal=""
|
||||||
@@ -37,7 +39,7 @@ process/normal_map_invert_y=false
|
|||||||
process/hdr_as_srgb=false
|
process/hdr_as_srgb=false
|
||||||
process/hdr_clamp_exposure=false
|
process/hdr_clamp_exposure=false
|
||||||
process/size_limit=0
|
process/size_limit=0
|
||||||
detect_3d/compress_to=1
|
detect_3d/compress_to=0
|
||||||
svg/scale=1.0
|
svg/scale=1.0
|
||||||
editor/scale_with_editor_scale=false
|
editor/scale_with_editor_scale=false
|
||||||
editor/convert_colors_with_editor_theme=false
|
editor/convert_colors_with_editor_theme=false
|
||||||
|
|||||||
@@ -3,19 +3,21 @@
|
|||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://cywwtfvguv5e6"
|
uid="uid://cywwtfvguv5e6"
|
||||||
path="res://.godot/imported/xbox_button_back_icon_outline.svg-2773343c084e1613d54e400e515d6edb.ctex"
|
path.s3tc="res://.godot/imported/xbox_button_back_icon_outline.svg-2773343c084e1613d54e400e515d6edb.s3tc.ctex"
|
||||||
|
path.etc2="res://.godot/imported/xbox_button_back_icon_outline.svg-2773343c084e1613d54e400e515d6edb.etc2.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
||||||
|
"vram_texture": true
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_button_back_icon_outline.svg"
|
source_file="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_button_back_icon_outline.svg"
|
||||||
dest_files=["res://.godot/imported/xbox_button_back_icon_outline.svg-2773343c084e1613d54e400e515d6edb.ctex"]
|
dest_files=["res://.godot/imported/xbox_button_back_icon_outline.svg-2773343c084e1613d54e400e515d6edb.s3tc.ctex", "res://.godot/imported/xbox_button_back_icon_outline.svg-2773343c084e1613d54e400e515d6edb.etc2.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=2
|
||||||
compress/high_quality=false
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/uastc_level=0
|
compress/uastc_level=0
|
||||||
@@ -23,7 +25,7 @@ compress/rdo_quality_loss=0.0
|
|||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=true
|
||||||
mipmaps/limit=-1
|
mipmaps/limit=-1
|
||||||
roughness/mode=0
|
roughness/mode=0
|
||||||
roughness/src_normal=""
|
roughness/src_normal=""
|
||||||
@@ -37,7 +39,7 @@ process/normal_map_invert_y=false
|
|||||||
process/hdr_as_srgb=false
|
process/hdr_as_srgb=false
|
||||||
process/hdr_clamp_exposure=false
|
process/hdr_clamp_exposure=false
|
||||||
process/size_limit=0
|
process/size_limit=0
|
||||||
detect_3d/compress_to=1
|
detect_3d/compress_to=0
|
||||||
svg/scale=1.0
|
svg/scale=1.0
|
||||||
editor/scale_with_editor_scale=false
|
editor/scale_with_editor_scale=false
|
||||||
editor/convert_colors_with_editor_theme=false
|
editor/convert_colors_with_editor_theme=false
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ func _ready() -> void:
|
|||||||
parry.triggered.connect(on_input_parry)
|
parry.triggered.connect(on_input_parry)
|
||||||
dash.triggered.connect(on_input_dash)
|
dash.triggered.connect(on_input_dash)
|
||||||
slam.triggered.connect(on_input_slam)
|
slam.triggered.connect(on_input_slam)
|
||||||
|
|
||||||
|
input_device_changed.emit(current_input_method == GlobalHelpers.GamepadDetectionEvent.GAMEPAD)
|
||||||
|
|
||||||
|
|
||||||
func on_input_hit():
|
func on_input_hit():
|
||||||
@@ -103,6 +105,7 @@ func on_input_slide_started():
|
|||||||
func on_input_slide_ended():
|
func on_input_slide_ended():
|
||||||
input_slide_ended.emit()
|
input_slide_ended.emit()
|
||||||
|
|
||||||
|
|
||||||
func _input(event: InputEvent) -> void:
|
func _input(event: InputEvent) -> void:
|
||||||
var event_gamepad = GlobalHelpers.is_event_gamepad(event)
|
var event_gamepad = GlobalHelpers.is_event_gamepad(event)
|
||||||
if event_gamepad == GlobalHelpers.GamepadDetectionEvent.IRRELEVANT:
|
if event_gamepad == GlobalHelpers.GamepadDetectionEvent.IRRELEVANT:
|
||||||
|
|||||||
@@ -10,6 +10,10 @@
|
|||||||
[ext_resource type="PackedScene" uid="uid://cmlud1hwkd6sv" path="res://scenes/enemies/flying_enemy/flying_enemy.tscn" id="8_dkfm7"]
|
[ext_resource type="PackedScene" uid="uid://cmlud1hwkd6sv" path="res://scenes/enemies/flying_enemy/flying_enemy.tscn" id="8_dkfm7"]
|
||||||
[ext_resource type="Script" uid="uid://jitubgv6judn" path="res://scenes/components/damage/RDamage.cs" id="9_ofbe2"]
|
[ext_resource type="Script" uid="uid://jitubgv6judn" path="res://scenes/components/damage/RDamage.cs" id="9_ofbe2"]
|
||||||
[ext_resource type="PackedScene" uid="uid://b8aet6m4m2i83" path="res://scenes/tuto_trigger/TutoTrigger.tscn" id="10_dkfm7"]
|
[ext_resource type="PackedScene" uid="uid://b8aet6m4m2i83" path="res://scenes/tuto_trigger/TutoTrigger.tscn" id="10_dkfm7"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://nrhxjdpuje3f" path="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_lt_outline.svg" id="11_xy0m1"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dlt8uv1mtq4a0" path="res://assets/ui/input-prompts/Keyboard & Mouse/Vector/mouse_right.svg" id="12_05lnh"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cjh5cnvdbq5ku" path="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_button_b_outline.svg" id="13_t5o40"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bsxtadecl3657" path="res://assets/ui/input-prompts/Keyboard & Mouse/Vector/keyboard_shift_outline.svg" id="14_prjj8"]
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_nwk5u"]
|
[sub_resource type="Resource" id="Resource_nwk5u"]
|
||||||
script = ExtResource("6_cgfmf")
|
script = ExtResource("6_cgfmf")
|
||||||
@@ -365,7 +369,11 @@ shape = SubResource("BoxShape3D_xy0m1")
|
|||||||
|
|
||||||
[node name="TutoTrigger" parent="Tutorial/Triggers" index="1" unique_id=1215265305 instance=ExtResource("10_dkfm7")]
|
[node name="TutoTrigger" parent="Tutorial/Triggers" index="1" unique_id=1215265305 instance=ExtResource("10_dkfm7")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.25, 0, -4.5)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.25, 0, -4.5)
|
||||||
tuto_text = "Aimed dash"
|
first_input_icon = ExtResource("11_xy0m1")
|
||||||
|
first_input_icon_keyboard = ExtResource("12_05lnh")
|
||||||
|
second_input_icon = ExtResource("13_t5o40")
|
||||||
|
second_input_icon_keyboard = ExtResource("14_prjj8")
|
||||||
|
tuto_text = "Blink"
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Tutorial/Triggers/TutoTrigger" index="1" unique_id=1774867326]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Tutorial/Triggers/TutoTrigger" index="1" unique_id=1774867326]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.25, -3.75, -6.75)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.25, -3.75, -6.75)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bnqhh6b5iusam" path="res://scenes/tuto_trigger/tuto_trigger.gd" id="1_w8mpv"]
|
[ext_resource type="Script" uid="uid://bnqhh6b5iusam" path="res://scenes/tuto_trigger/tuto_trigger.gd" id="1_w8mpv"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dl73t0kxkaxp0" path="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_button_a_outline.svg" id="2_w8mpv"]
|
[ext_resource type="Texture2D" uid="uid://dl73t0kxkaxp0" path="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_button_a_outline.svg" id="2_w8mpv"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cjh5cnvdbq5ku" path="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_button_b_outline.svg" id="3_njayx"]
|
||||||
|
|
||||||
[sub_resource type="LabelSettings" id="LabelSettings_4vbx1"]
|
[sub_resource type="LabelSettings" id="LabelSettings_4vbx1"]
|
||||||
font_size = 30
|
font_size = 30
|
||||||
@@ -12,9 +13,9 @@ font_size = 30
|
|||||||
[node name="TutoTrigger" type="Area3D" unique_id=840713937]
|
[node name="TutoTrigger" type="Area3D" unique_id=840713937]
|
||||||
collision_layer = 0
|
collision_layer = 0
|
||||||
script = ExtResource("1_w8mpv")
|
script = ExtResource("1_w8mpv")
|
||||||
tuto_text = null
|
|
||||||
|
|
||||||
[node name="Control" type="Control" parent="." unique_id=1871566632]
|
[node name="Control" type="Control" parent="." unique_id=1871566632]
|
||||||
|
visible = false
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
@@ -45,7 +46,6 @@ theme_override_constants/separation = 20
|
|||||||
|
|
||||||
[node name="MultipleInputsContainer" type="HBoxContainer" parent="Control/PanelContainer/MarginContainer/HBoxContainer" unique_id=487996484]
|
[node name="MultipleInputsContainer" type="HBoxContainer" parent="Control/PanelContainer/MarginContainer/HBoxContainer" unique_id=487996484]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
visible = false
|
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
theme_override_constants/separation = 0
|
theme_override_constants/separation = 0
|
||||||
|
|
||||||
@@ -53,6 +53,31 @@ theme_override_constants/separation = 0
|
|||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
texture = ExtResource("2_w8mpv")
|
texture = ExtResource("2_w8mpv")
|
||||||
|
stretch_mode = 3
|
||||||
|
|
||||||
|
[node name="first_plus_sign" type="Label" parent="Control/PanelContainer/MarginContainer/HBoxContainer/MultipleInputsContainer" unique_id=1236204840]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
text = "+"
|
||||||
|
label_settings = SubResource("LabelSettings_4vbx1")
|
||||||
|
|
||||||
|
[node name="SecondInput" type="TextureRect" parent="Control/PanelContainer/MarginContainer/HBoxContainer/MultipleInputsContainer" unique_id=523697392]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
texture = ExtResource("3_njayx")
|
||||||
|
stretch_mode = 3
|
||||||
|
|
||||||
|
[node name="second_plus_sign" type="Label" parent="Control/PanelContainer/MarginContainer/HBoxContainer/MultipleInputsContainer" unique_id=632487691]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
text = "+"
|
||||||
|
label_settings = SubResource("LabelSettings_4vbx1")
|
||||||
|
|
||||||
|
[node name="ThirdInput" type="TextureRect" parent="Control/PanelContainer/MarginContainer/HBoxContainer/MultipleInputsContainer" unique_id=150712319]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
texture = ExtResource("3_njayx")
|
||||||
|
stretch_mode = 3
|
||||||
|
|
||||||
[node name="ComplexInputLabel" type="Label" parent="Control/PanelContainer/MarginContainer/HBoxContainer/MultipleInputsContainer" unique_id=103193503]
|
[node name="ComplexInputLabel" type="Label" parent="Control/PanelContainer/MarginContainer/HBoxContainer/MultipleInputsContainer" unique_id=103193503]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
@@ -60,23 +85,11 @@ layout_mode = 2
|
|||||||
text = "while airborne"
|
text = "while airborne"
|
||||||
label_settings = SubResource("LabelSettings_4vbx1")
|
label_settings = SubResource("LabelSettings_4vbx1")
|
||||||
|
|
||||||
[node name="SecondInput" type="TextureRect" parent="Control/PanelContainer/MarginContainer/HBoxContainer/MultipleInputsContainer" unique_id=523697392]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="TutoText" type="Label" parent="Control/PanelContainer/MarginContainer/HBoxContainer" unique_id=970615593]
|
[node name="TutoText" type="Label" parent="Control/PanelContainer/MarginContainer/HBoxContainer" unique_id=970615593]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
text = "jump"
|
||||||
label_settings = SubResource("LabelSettings_g04tr")
|
label_settings = SubResource("LabelSettings_g04tr")
|
||||||
|
|
||||||
[node name="InputPrompt" type="RichTextLabel" parent="Control/PanelContainer/MarginContainer/HBoxContainer" unique_id=683811955]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
custom_minimum_size = Vector2(256, 0)
|
|
||||||
layout_mode = 2
|
|
||||||
text = "hello there"
|
|
||||||
fit_content = true
|
|
||||||
horizontal_alignment = 1
|
|
||||||
vertical_alignment = 1
|
|
||||||
|
|
||||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||||
[connection signal="body_exited" from="." to="." method="_on_body_exited"]
|
[connection signal="body_exited" from="." to="." method="_on_body_exited"]
|
||||||
|
|||||||
@@ -1,17 +1,37 @@
|
|||||||
extends Area3D
|
extends Area3D
|
||||||
class_name TutoTrigger
|
class_name TutoTrigger
|
||||||
|
|
||||||
@export var input: GUIDEAction
|
@export_group("First input")
|
||||||
@export var second_input: GUIDEAction = null
|
@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
|
@export var tuto_text: String
|
||||||
|
|
||||||
@onready var input_prompt: RichTextLabel = %InputPrompt
|
|
||||||
@onready var control: Control = $Control
|
@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
|
var current_input_method = GlobalHelpers.GamepadDetectionEvent.GAMEPAD
|
||||||
|
|
||||||
func _ready() -> void:
|
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()
|
_on_input_mappings_changed()
|
||||||
|
|
||||||
func _input(event: InputEvent) -> void:
|
func _input(event: InputEvent) -> void:
|
||||||
@@ -25,7 +45,21 @@ func _input(event: InputEvent) -> void:
|
|||||||
_on_input_mappings_changed()
|
_on_input_mappings_changed()
|
||||||
|
|
||||||
func _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:
|
func _on_body_entered(body: Node3D) -> void:
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ enum GamepadDetectionEvent {
|
|||||||
static func is_event_gamepad(event: InputEvent) -> GamepadDetectionEvent:
|
static func is_event_gamepad(event: InputEvent) -> GamepadDetectionEvent:
|
||||||
if event is InputEventKey || event is InputEventMouseButton:
|
if event is InputEventKey || event is InputEventMouseButton:
|
||||||
return GamepadDetectionEvent.KEYBOARD
|
return GamepadDetectionEvent.KEYBOARD
|
||||||
|
elif event is InputEventMouseMotion:
|
||||||
|
if not event.relative.is_zero_approx():
|
||||||
|
return GamepadDetectionEvent.KEYBOARD
|
||||||
elif event is InputEventJoypadMotion:
|
elif event is InputEventJoypadMotion:
|
||||||
if abs(event.axis_value) > 0.5:
|
if abs(event.axis_value) > 0.5:
|
||||||
return GamepadDetectionEvent.GAMEPAD
|
return GamepadDetectionEvent.GAMEPAD
|
||||||
|
|||||||
Reference in New Issue
Block a user