Ui Rebuild and Full Controller Support #59

Merged
Snoweuph merged 29 commits from dev-base into stable 2023-04-11 20:41:55 +00:00
Showing only changes of commit 47ddb86bbb - Show all commits

View file

@ -50,20 +50,20 @@ func start_remap(button : Button, action : String):
pass
func remap_key(event):
set_process_unhandled_key_input(false)
for key in InputMap.action_get_events(remap_action):
InputMap.action_erase_event(remap_action, key)
InputMap.action_add_event(remap_action, event)
match str(event.get_class()):
"InputEventJoypadButton":
Save.game_data["%s" % [remap_action]] = "b" + str(event.button_index)
"InputEventJoypadMotion":
if abs(event.axis_value) < 0.5: return
Save.game_data["%s" % [remap_action]] = "j" + str(event.axis) + str("/1.00" if event.axis_value > 0 else "/-1.00")
"InputEventMouseButton":
Save.game_data["%s" % [remap_action]] = "m" + str(event.button_index)
"InputEventKey":
Save.game_data["%s" % [remap_action]] = event.keycode
set_process_unhandled_key_input(false)
for key in InputMap.action_get_events(remap_action):
InputMap.action_erase_event(remap_action, key)
InputMap.action_add_event(remap_action, event)
remap_button.display_key()
remap_button.grab_focus()
remap_button.disabled = false