diff --git a/project.godot b/project.godot index 18bf4df63..cb8c5af86 100644 --- a/project.godot +++ b/project.godot @@ -853,6 +853,16 @@ pixelize={ "deadzone": 0.5, "events": [] } +go_to_previous_layer={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"command_or_control_autoremap":true,"alt_pressed":false,"shift_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"echo":false,"script":null) +] +} +go_to_next_layer={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"command_or_control_autoremap":true,"alt_pressed":false,"shift_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"echo":false,"script":null) +] +} [input_devices] diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index ebff80274..ca0f1724f 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -796,6 +796,8 @@ func _initialize_keychain() -> void: "go_to_last_frame": Keychain.InputAction.new("", "Buttons"), "go_to_previous_frame": Keychain.InputAction.new("", "Buttons"), "go_to_next_frame": Keychain.InputAction.new("", "Buttons"), + "go_to_previous_layer": Keychain.InputAction.new("", "Buttons"), + "go_to_next_layer": Keychain.InputAction.new("", "Buttons"), "play_backwards": Keychain.InputAction.new("", "Buttons"), "play_forward": Keychain.InputAction.new("", "Buttons"), "onion_skinning_toggle": Keychain.InputAction.new("", "Buttons"), diff --git a/src/UI/Timeline/AnimationTimeline.gd b/src/UI/Timeline/AnimationTimeline.gd index 8c95c474a..28b29912b 100644 --- a/src/UI/Timeline/AnimationTimeline.gd +++ b/src/UI/Timeline/AnimationTimeline.gd @@ -136,6 +136,20 @@ func _notification(what: int) -> void: func _input(event: InputEvent) -> void: + var project := Global.current_project + if event.is_action_pressed("go_to_previous_layer"): + project.selected_cels.clear() + if project.current_layer > 0: + project.change_cel(-1, project.current_layer - 1) + else: + project.change_cel(-1, project.layers.size() - 1) + elif event.is_action_pressed("go_to_next_layer"): + project.selected_cels.clear() + if project.current_layer < project.layers.size() - 1: + project.change_cel(-1, project.current_layer + 1) + else: + project.change_cel(-1, 0) + var mouse_pos := get_global_mouse_position() var timeline_rect := Rect2(global_position, size) if timeline_rect.has_point(mouse_pos):