mirror of
https://github.com/Relintai/broken_seals.git
synced 2025-01-22 02:17:18 +01:00
Now the movement keys are bindable.
This commit is contained in:
parent
92ae39d933
commit
59d57669fa
@ -420,17 +420,23 @@ func _input(event: InputEvent) -> void:
|
|||||||
camera_pivot.rotate_delta(-relx, -rely)
|
camera_pivot.rotate_delta(-relx, -rely)
|
||||||
|
|
||||||
func _unhandled_input(event: InputEvent) -> void:
|
func _unhandled_input(event: InputEvent) -> void:
|
||||||
if event is InputEventKey:
|
if event.is_action_type():
|
||||||
var ievkey : InputEventKey = event as InputEventKey
|
if event.is_action("move_forward"):
|
||||||
|
key_up = event.pressed
|
||||||
if ievkey.scancode == KEY_W:
|
get_tree().set_input_as_handled()
|
||||||
key_up = ievkey.pressed
|
return
|
||||||
if ievkey.scancode == KEY_S:
|
elif event.is_action("move_backward"):
|
||||||
key_down = ievkey.pressed
|
key_down = event.pressed
|
||||||
if ievkey.scancode == KEY_A:
|
get_tree().set_input_as_handled()
|
||||||
key_left = ievkey.pressed
|
return
|
||||||
if ievkey.scancode == KEY_D:
|
elif event.is_action("move_left"):
|
||||||
key_right = ievkey.pressed
|
key_left = event.pressed
|
||||||
|
get_tree().set_input_as_handled()
|
||||||
|
return
|
||||||
|
elif event.is_action("move_right"):
|
||||||
|
key_right = event.pressed
|
||||||
|
get_tree().set_input_as_handled()
|
||||||
|
return
|
||||||
|
|
||||||
if event is InputEventMouseMotion and not (mouse_right_down or mouse_left_down) and event.device != -1:
|
if event is InputEventMouseMotion and not (mouse_right_down or mouse_left_down) and event.device != -1:
|
||||||
cmouseover(event)
|
cmouseover(event)
|
||||||
@ -464,10 +470,11 @@ func _unhandled_input(event: InputEvent) -> void:
|
|||||||
if not event.pressed and event.button_index == BUTTON_LEFT and event.device != -1:
|
if not event.pressed and event.button_index == BUTTON_LEFT and event.device != -1:
|
||||||
if mouse_down_delta.length() < MOUSE_TARGET_MAX_OFFSET:
|
if mouse_down_delta.length() < MOUSE_TARGET_MAX_OFFSET:
|
||||||
target(event.position)
|
target(event.position)
|
||||||
|
|
||||||
|
|
||||||
if event is InputEventScreenTouch and event.pressed:
|
if event is InputEventScreenTouch and event.pressed:
|
||||||
target(event.position)
|
target(event.position)
|
||||||
|
|
||||||
update_cursor_mode()
|
update_cursor_mode()
|
||||||
|
|
||||||
func update_cursor_mode():
|
func update_cursor_mode():
|
||||||
|
@ -325,6 +325,26 @@ sheath={
|
|||||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":80,"unicode":0,"echo":false,"script":null)
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":80,"unicode":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
move_forward={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
move_backward={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
move_left={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
move_right={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
[layer_names]
|
[layer_names]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user