mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Change layers with Control + Up/Down arrow keys
We already have Control + Left/Right for changing frames, so it makes sense to have Up/Down for layers
This commit is contained in:
parent
4e8a02c1a4
commit
92e8666da2
|
@ -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]
|
||||
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue