summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/script_editor_plugin.cpp2
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.cpp19
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.h2
3 files changed, 22 insertions, 1 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index ffda34653d..a1183307fb 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -2360,7 +2360,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
debug_menu->get_popup()->add_shortcut(ED_SHORTCUT("debugger/step_into", TTR("Step Into"), KEY_F11), DEBUG_STEP);
debug_menu->get_popup()->add_separator();
debug_menu->get_popup()->add_shortcut(ED_SHORTCUT("debugger/break", TTR("Break")), DEBUG_BREAK);
- debug_menu->get_popup()->add_shortcut(ED_SHORTCUT("debugger/continue", TTR("Continue")), DEBUG_CONTINUE);
+ debug_menu->get_popup()->add_shortcut(ED_SHORTCUT("debugger/continue", TTR("Continue"), KEY_F12), DEBUG_CONTINUE);
debug_menu->get_popup()->add_separator();
//debug_menu->get_popup()->add_check_item("Show Debugger",DEBUG_SHOW);
debug_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("debugger/keep_debugger_open", TTR("Keep Debugger Open")), DEBUG_SHOW_KEEP_OPEN);
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp
index dc7acd9fdc..b8274122f8 100644
--- a/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -142,6 +142,19 @@ void SpriteFramesEditor::_paste_pressed() {
undo_redo->commit_action();
}
+void SpriteFramesEditor::_copy_pressed() {
+ ERR_FAIL_COND(!frames->has_animation(edited_anim));
+
+ if (tree->get_current() < 0)
+ return;
+ Ref<Texture> r = frames->get_frame(edited_anim, tree->get_current());
+ if (!r.is_valid()) {
+ return;
+ }
+
+ EditorSettings::get_singleton()->set_resource_clipboard(r);
+}
+
void SpriteFramesEditor::_empty_pressed() {
ERR_FAIL_COND(!frames->has_animation(edited_anim));
@@ -642,6 +655,7 @@ void SpriteFramesEditor::_bind_methods() {
ClassDB::bind_method(D_METHOD("_empty_pressed"), &SpriteFramesEditor::_empty_pressed);
ClassDB::bind_method(D_METHOD("_empty2_pressed"), &SpriteFramesEditor::_empty2_pressed);
ClassDB::bind_method(D_METHOD("_delete_pressed"), &SpriteFramesEditor::_delete_pressed);
+ ClassDB::bind_method(D_METHOD("_copy_pressed"), &SpriteFramesEditor::_copy_pressed);
ClassDB::bind_method(D_METHOD("_paste_pressed"), &SpriteFramesEditor::_paste_pressed);
ClassDB::bind_method(D_METHOD("_file_load_request", "files", "at_position"), &SpriteFramesEditor::_file_load_request, DEFVAL(-1));
ClassDB::bind_method(D_METHOD("_update_library", "skipsel"), &SpriteFramesEditor::_update_library, DEFVAL(false));
@@ -725,6 +739,10 @@ SpriteFramesEditor::SpriteFramesEditor() {
load->set_tooltip(TTR("Load Resource"));
hbc->add_child(load);
+ copy = memnew(Button);
+ copy->set_text(TTR("Copy"));
+ hbc->add_child(copy);
+
paste = memnew(Button);
paste->set_text(TTR("Paste"));
hbc->add_child(paste);
@@ -772,6 +790,7 @@ SpriteFramesEditor::SpriteFramesEditor() {
load->connect("pressed", this, "_load_pressed");
_delete->connect("pressed", this, "_delete_pressed");
+ copy->connect("pressed", this, "_copy_pressed");
paste->connect("pressed", this, "_paste_pressed");
empty->connect("pressed", this, "_empty_pressed");
empty2->connect("pressed", this, "_empty2_pressed");
diff --git a/editor/plugins/sprite_frames_editor_plugin.h b/editor/plugins/sprite_frames_editor_plugin.h
index 0d1ab9fd8c..9fdab37f0e 100644
--- a/editor/plugins/sprite_frames_editor_plugin.h
+++ b/editor/plugins/sprite_frames_editor_plugin.h
@@ -44,6 +44,7 @@ class SpriteFramesEditor : public PanelContainer {
Button *load;
Button *_delete;
+ Button *copy;
Button *paste;
Button *empty;
Button *empty2;
@@ -72,6 +73,7 @@ class SpriteFramesEditor : public PanelContainer {
void _load_pressed();
void _load_scene_pressed();
void _file_load_request(const PoolVector<String> &p_path, int p_at_pos = -1);
+ void _copy_pressed();
void _paste_pressed();
void _empty_pressed();
void _empty2_pressed();