added in pause button rebinding

This commit is contained in:
JHDev2006
2025-09-27 21:17:50 +01:00
parent 1f21cb646f
commit 872e7fe468
4 changed files with 26 additions and 12 deletions

View File

@@ -36,7 +36,8 @@ var file := {
"move_up": "Up",
"move_down": "Down",
"ui_accept": "Z",
"ui_back": "X"
"ui_back": "X",
"pause": "Escape"
},
"controller":
{
@@ -48,7 +49,8 @@ var file := {
"move_up": "1,-1",
"move_down": "1,1",
"ui_accept": 0,
"ui_back": 1
"ui_back": 1,
"pause": 6
},
"visuals":
{

View File

@@ -75,10 +75,10 @@ func _input(event: InputEvent) -> void:
if event.is_pressed() == false:
return
if event is InputEventKey:
if event.as_text_physical_keycode() == "Escape":
cancel_remap()
return
#if event is InputEventKey:
#if event.as_text_physical_keycode() == "Escape":
#cancel_remap()
#return
if type == 0 and event is InputEventKey:
map_event_to_action(event)
@@ -90,7 +90,7 @@ func _input(event: InputEvent) -> void:
func map_event_to_action(event) -> void:
for action_name in action_names:
var action = action_name
if action.contains("ui_") == false:
if action.contains("ui_") == false and action != "pause":
action = action_name + "_" + str(player_idx)
var events = InputMap.action_get_events(action).duplicate()
events[type] = event