Refactoring tools (#281)

* Refactoring tools

* Remove unused code

* Fixed some inferring errors and added translations

* Attempt to fix some Script Errors found in the CI workflow

* Fix bucket crash.

* Fix static type convert.

Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
This commit is contained in:
Kinwailo 2020-07-09 20:22:17 +08:00 committed by GitHub
parent e1724148fc
commit 4a668f71f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 2489 additions and 2389 deletions

View file

@ -39,6 +39,9 @@ func setup_edit_menu() -> void:
var edit_menu_items := {
"Undo" : InputMap.get_action_list("undo")[0].get_scancode_with_modifiers(),
"Redo" : InputMap.get_action_list("redo")[0].get_scancode_with_modifiers(),
"Copy" : InputMap.get_action_list("copy")[0].get_scancode_with_modifiers(),
"Paste" : InputMap.get_action_list("paste")[0].get_scancode_with_modifiers(),
"Delete" : InputMap.get_action_list("delete")[0].get_scancode_with_modifiers(),
"Clear Selection" : 0,
"Preferences" : 0
}
@ -201,15 +204,16 @@ func edit_menu_id_pressed(id : int) -> void:
Global.control.redone = true
Global.current_project.undo_redo.redo()
Global.control.redone = false
2: # Clear selection
Global.canvas.handle_undo("Rectangle Select")
Global.selection_rectangle.polygon[0] = Vector2.ZERO
Global.selection_rectangle.polygon[1] = Vector2.ZERO
Global.selection_rectangle.polygon[2] = Vector2.ZERO
Global.selection_rectangle.polygon[3] = Vector2.ZERO
Global.current_project.selected_pixels.clear()
Global.canvas.handle_redo("Rectangle Select")
3: # Preferences
2: # Copy
Global.selection_rectangle.copy()
3: # paste
Global.selection_rectangle.paste()
4: # Delete
Global.selection_rectangle.delete()
5: # Clear selection
Global.selection_rectangle.set_rect(Rect2(0, 0, 0, 0))
Global.selection_rectangle.select_rect()
6: # Preferences
Global.preferences_dialog.popup_centered(Vector2(400, 280))
Global.dialog_open(true)