gd: inputs for dash
This commit is contained in:
@ -1,12 +1,44 @@
|
||||
extends Node3D
|
||||
|
||||
@export var move:GUIDEAction
|
||||
@export var rotate_player:GUIDEAction
|
||||
@export_group("Mapping contexts")
|
||||
@export var walk_mode:GUIDEMappingContext
|
||||
|
||||
@export_group("Move actions")
|
||||
@export var move:GUIDEAction
|
||||
@export var rotate_y:GUIDEAction
|
||||
@export var rotate_floorplane:GUIDEAction
|
||||
|
||||
@export_group("Trigger actions")
|
||||
@export var aim_pressed:GUIDEAction
|
||||
@export var aim_released:GUIDEAction
|
||||
@export var aim_canceled:GUIDEAction
|
||||
|
||||
signal input_move(value: Vector3)
|
||||
signal input_rotate_y(value: float)
|
||||
signal input_rotate_floorplane(value: float)
|
||||
|
||||
signal input_aim_pressed
|
||||
signal input_aim_released
|
||||
signal input_aim_canceled
|
||||
|
||||
func _ready() -> void:
|
||||
GUIDE.enable_mapping_context(walk_mode)
|
||||
|
||||
aim_pressed.triggered.connect(on_input_aim_pressed)
|
||||
aim_released.triggered.connect(on_input_aim_released)
|
||||
aim_canceled.triggered.connect(on_input_aim_canceled)
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
# print(move.value_axis_3d)
|
||||
pass
|
||||
func on_input_aim_pressed():
|
||||
input_aim_pressed.emit()
|
||||
|
||||
func on_input_aim_released():
|
||||
input_aim_released.emit()
|
||||
|
||||
func on_input_aim_canceled():
|
||||
input_aim_canceled.emit()
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
input_move.emit(move.value_axis_3d)
|
||||
input_rotate_y.emit(rotate_y.value_axis_1d)
|
||||
input_rotate_floorplane.emit(rotate_floorplane.value_axis_1d)
|
||||
|
14
systems/inputs/walk_mode/aim.tres
Normal file
14
systems/inputs/walk_mode/aim.tres
Normal file
@ -0,0 +1,14 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://dgfww8118d8gj"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cluhc11vixkf1" path="res://addons/guide/guide_action.gd" id="1_tm2gl"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_tm2gl")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
block_lower_priority_actions = true
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
metadata/_custom_type_script = "uid://cluhc11vixkf1"
|
14
systems/inputs/walk_mode/aim_cancel.tres
Normal file
14
systems/inputs/walk_mode/aim_cancel.tres
Normal file
@ -0,0 +1,14 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://7wm8ywvujwf"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cluhc11vixkf1" path="res://addons/guide/guide_action.gd" id="1_36r6u"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_36r6u")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
block_lower_priority_actions = true
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
metadata/_custom_type_script = "uid://cluhc11vixkf1"
|
14
systems/inputs/walk_mode/aim_release.tres
Normal file
14
systems/inputs/walk_mode/aim_release.tres
Normal file
@ -0,0 +1,14 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://j1o5ud0plk4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cluhc11vixkf1" path="res://addons/guide/guide_action.gd" id="1_8q4sr"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_8q4sr")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
block_lower_priority_actions = true
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
metadata/_custom_type_script = "uid://cluhc11vixkf1"
|
@ -1,4 +1,4 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEMappingContext" load_steps=49 format=3 uid="uid://dijkqkltwkrfe"]
|
||||
[gd_resource type="Resource" script_class="GUIDEMappingContext" load_steps=74 format=3 uid="uid://dijkqkltwkrfe"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cpplm41b5bt6m" path="res://addons/guide/guide_action_mapping.gd" id="1_gh445"]
|
||||
[ext_resource type="Resource" uid="uid://htqvokm8mufq" path="res://systems/inputs/walk_mode/move.tres" id="2_h1oqo"]
|
||||
@ -15,7 +15,16 @@
|
||||
[ext_resource type="Script" uid="uid://cgy4anjdob2tp" path="res://addons/guide/modifiers/guide_modifier_window_relative.gd" id="12_xnlyn"]
|
||||
[ext_resource type="Script" uid="uid://bjm4myqxg4phm" path="res://addons/guide/modifiers/guide_modifier_scale.gd" id="13_dlt74"]
|
||||
[ext_resource type="Script" uid="uid://bbhoxsiqwo07l" path="res://addons/guide/inputs/guide_input_joy_axis_1d.gd" id="14_74dxk"]
|
||||
[ext_resource type="Script" uid="uid://c47lkb48itd6l" path="res://addons/guide/modifiers/guide_modifier_deadzone.gd" id="15_6cen8"]
|
||||
[ext_resource type="Resource" uid="uid://ccrb5xsnphc8" path="res://systems/inputs/walk_mode/rotate_floorplane.tres" id="15_xnlyn"]
|
||||
[ext_resource type="Resource" uid="uid://dgfww8118d8gj" path="res://systems/inputs/walk_mode/aim.tres" id="17_1l8ly"]
|
||||
[ext_resource type="Script" uid="uid://b52rqq28tuqpg" path="res://addons/guide/triggers/guide_trigger_pressed.gd" id="18_1l8ly"]
|
||||
[ext_resource type="Script" uid="uid://b4cdrn4paoj3i" path="res://addons/guide/triggers/guide_trigger_down.gd" id="18_qctwy"]
|
||||
[ext_resource type="Resource" uid="uid://j1o5ud0plk4" path="res://systems/inputs/walk_mode/aim_release.tres" id="19_xq5tv"]
|
||||
[ext_resource type="Script" uid="uid://biiggjw6tv4uq" path="res://addons/guide/triggers/guide_trigger_released.gd" id="20_lh6n3"]
|
||||
[ext_resource type="Resource" uid="uid://7wm8ywvujwf" path="res://systems/inputs/walk_mode/aim_cancel.tres" id="21_5y4tx"]
|
||||
[ext_resource type="Script" uid="uid://rvttn472ix6v" path="res://addons/guide/inputs/guide_input_joy_button.gd" id="22_81iec"]
|
||||
[ext_resource type="Script" uid="uid://brsxcrai2te83" path="res://addons/guide/triggers/guide_trigger_chorded_action.gd" id="23_w6gvf"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_dlt74"]
|
||||
script = ExtResource("4_t5475")
|
||||
@ -124,6 +133,11 @@ joy_index = -1
|
||||
script = ExtResource("7_54nr4")
|
||||
order = 2
|
||||
|
||||
[sub_resource type="Resource" id="Resource_6cen8"]
|
||||
script = ExtResource("15_6cen8")
|
||||
lower_threshold = 0.1
|
||||
upper_threshold = 1.0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_5sx4a"]
|
||||
script = ExtResource("3_pgmnb")
|
||||
override_action_settings = false
|
||||
@ -131,13 +145,14 @@ is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_r2gek")
|
||||
modifiers = Array[ExtResource("5_dts0n")]([SubResource("Resource_t5475")])
|
||||
modifiers = Array[ExtResource("5_dts0n")]([SubResource("Resource_t5475"), SubResource("Resource_6cen8")])
|
||||
triggers = Array[ExtResource("8_tlno4")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_nd8wu"]
|
||||
script = ExtResource("1_gh445")
|
||||
action = ExtResource("2_h1oqo")
|
||||
input_mappings = Array[ExtResource("3_pgmnb")]([SubResource("Resource_vagbc"), SubResource("Resource_nt051"), SubResource("Resource_1g8ta"), SubResource("Resource_0avlp"), SubResource("Resource_5sx4a")])
|
||||
metadata/_guide_input_mappings_collapsed = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_7dbe7"]
|
||||
script = ExtResource("11_tlno4")
|
||||
@ -172,6 +187,11 @@ script = ExtResource("14_74dxk")
|
||||
axis = 2
|
||||
joy_index = -1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_posty"]
|
||||
script = ExtResource("15_6cen8")
|
||||
lower_threshold = 0.1
|
||||
upper_threshold = 1.0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_a5vma"]
|
||||
script = ExtResource("3_pgmnb")
|
||||
override_action_settings = false
|
||||
@ -179,13 +199,14 @@ is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_agr80")
|
||||
modifiers = Array[ExtResource("5_dts0n")]([])
|
||||
modifiers = Array[ExtResource("5_dts0n")]([SubResource("Resource_posty")])
|
||||
triggers = Array[ExtResource("8_tlno4")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_fnf72"]
|
||||
script = ExtResource("1_gh445")
|
||||
action = ExtResource("10_tlno4")
|
||||
input_mappings = Array[ExtResource("3_pgmnb")]([SubResource("Resource_lhbic"), SubResource("Resource_a5vma")])
|
||||
metadata/_guide_input_mappings_collapsed = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_q3p6c"]
|
||||
script = ExtResource("11_tlno4")
|
||||
@ -220,6 +241,11 @@ script = ExtResource("14_74dxk")
|
||||
axis = 3
|
||||
joy_index = -1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_tfgyj"]
|
||||
script = ExtResource("15_6cen8")
|
||||
lower_threshold = 0.1
|
||||
upper_threshold = 1.0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_1hcnu"]
|
||||
script = ExtResource("3_pgmnb")
|
||||
override_action_settings = false
|
||||
@ -227,16 +253,96 @@ is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_oov4j")
|
||||
modifiers = Array[ExtResource("5_dts0n")]([])
|
||||
modifiers = Array[ExtResource("5_dts0n")]([SubResource("Resource_tfgyj")])
|
||||
triggers = Array[ExtResource("8_tlno4")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_der0j"]
|
||||
script = ExtResource("1_gh445")
|
||||
action = ExtResource("15_xnlyn")
|
||||
input_mappings = Array[ExtResource("3_pgmnb")]([SubResource("Resource_kyrsw"), SubResource("Resource_1hcnu")])
|
||||
metadata/_guide_input_mappings_collapsed = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_o8dy0"]
|
||||
script = ExtResource("14_74dxk")
|
||||
axis = 4
|
||||
joy_index = -1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_qctwy"]
|
||||
script = ExtResource("18_qctwy")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_umy6c"]
|
||||
script = ExtResource("3_pgmnb")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_o8dy0")
|
||||
modifiers = Array[ExtResource("5_dts0n")]([])
|
||||
triggers = Array[ExtResource("8_tlno4")]([SubResource("Resource_qctwy")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ug3gn"]
|
||||
script = ExtResource("1_gh445")
|
||||
action = ExtResource("17_1l8ly")
|
||||
input_mappings = Array[ExtResource("3_pgmnb")]([SubResource("Resource_umy6c")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_jjjri"]
|
||||
script = ExtResource("14_74dxk")
|
||||
axis = 4
|
||||
joy_index = -1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_stt4v"]
|
||||
script = ExtResource("20_lh6n3")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_wrn13"]
|
||||
script = ExtResource("3_pgmnb")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_jjjri")
|
||||
modifiers = Array[ExtResource("5_dts0n")]([])
|
||||
triggers = Array[ExtResource("8_tlno4")]([SubResource("Resource_stt4v")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ake3v"]
|
||||
script = ExtResource("1_gh445")
|
||||
action = ExtResource("19_xq5tv")
|
||||
input_mappings = Array[ExtResource("3_pgmnb")]([SubResource("Resource_wrn13")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_y46dx"]
|
||||
script = ExtResource("22_81iec")
|
||||
button = 2
|
||||
joy_index = -1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_xq5tv"]
|
||||
script = ExtResource("23_w6gvf")
|
||||
action = ExtResource("17_1l8ly")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_1l8ly"]
|
||||
script = ExtResource("18_1l8ly")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_s03q7"]
|
||||
script = ExtResource("3_pgmnb")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_y46dx")
|
||||
modifiers = Array[ExtResource("5_dts0n")]([])
|
||||
triggers = Array[ExtResource("8_tlno4")]([SubResource("Resource_xq5tv"), SubResource("Resource_1l8ly")])
|
||||
metadata/_guide_triggers_collapsed = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_1qg80"]
|
||||
script = ExtResource("1_gh445")
|
||||
action = ExtResource("21_5y4tx")
|
||||
input_mappings = Array[ExtResource("3_pgmnb")]([SubResource("Resource_s03q7")])
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_vcm25")
|
||||
display_name = ""
|
||||
mappings = Array[ExtResource("1_gh445")]([SubResource("Resource_nd8wu"), SubResource("Resource_fnf72"), SubResource("Resource_der0j")])
|
||||
mappings = Array[ExtResource("1_gh445")]([SubResource("Resource_nd8wu"), SubResource("Resource_fnf72"), SubResource("Resource_der0j"), SubResource("Resource_ug3gn"), SubResource("Resource_ake3v"), SubResource("Resource_1qg80")])
|
||||
metadata/_custom_type_script = "uid://dsa1dnifd6w32"
|
||||
metadata/_guide_action_mappings_collapsed = false
|
||||
|
Reference in New Issue
Block a user