alr, multiple inputs are DONE

This commit is contained in:
JHDev2006
2025-09-29 15:04:54 +01:00
parent 99b9de4dad
commit 62df14f804
2 changed files with 7 additions and 4 deletions

View File

@@ -74,6 +74,7 @@ func load_inputs() -> void:
idx += 1 idx += 1
else: else:
bind_value_to_event(i, value, 0) bind_value_to_event(i, value, 0)
i.update_value()
func bind_value_to_event(input_node, value, idx := 0) -> void: func bind_value_to_event(input_node, value, idx := 0) -> void:
var event: InputEvent = null var event: InputEvent = null
@@ -852,6 +853,7 @@ type = 1
[node name="Pause" parent="PanelContainer/MarginContainer/VBoxContainer/Controller" groups=["Options"] instance=ExtResource("9_ksnto")] [node name="Pause" parent="PanelContainer/MarginContainer/VBoxContainer/Controller" groups=["Options"] instance=ExtResource("9_ksnto")]
layout_mode = 2 layout_mode = 2
settings_category = "controller" settings_category = "controller"
can_bind_escape = true
action_names = ["pause"] action_names = ["pause"]
title = "PAUSE" title = "PAUSE"
type = 1 type = 1

View File

@@ -3,6 +3,7 @@ extends HBoxContainer
@export var settings_category := "video" @export var settings_category := "video"
@export var selected := false @export var selected := false
@export var can_bind_escape := false
@export var action_names := [""] @export var action_names := [""]
@export var title := "" @export var title := ""
@@ -90,10 +91,10 @@ func _input(event: InputEvent) -> void:
if event.is_pressed() == false: if event.is_pressed() == false:
return return
#if event is InputEventKey: if event is InputEventKey and not can_bind_escape:
#if event.as_text_physical_keycode() == "Escape": if event.as_text_physical_keycode() == "Escape":
#cancel_remap() map_event_to_action(null, current_binding_idx)
#return return
if type == 0 and event is InputEventKey: if type == 0 and event is InputEventKey:
map_event_to_action(event, current_binding_idx) map_event_to_action(event, current_binding_idx)