aboutsummaryrefslogtreecommitdiff
path: root/editor/plugins/sprite_frames_editor_plugin.cpp
diff options
context:
space:
mode:
authorRémi Verschelde2017-08-27 21:07:15 +0200
committerRémi Verschelde2017-08-27 22:13:45 +0200
commit7ad14e7a3e6f87ddc450f7e34621eb5200808451 (patch)
tree8804d0dd24cc126087462edfbbbf73ed61b56b0e /editor/plugins/sprite_frames_editor_plugin.cpp
parent37da8155a4500a9386027b4d791a86186bc7ab4a (diff)
downloadgodot-7ad14e7a3e6f87ddc450f7e34621eb5200808451.tar.gz
godot-7ad14e7a3e6f87ddc450f7e34621eb5200808451.tar.zst
godot-7ad14e7a3e6f87ddc450f7e34621eb5200808451.zip
Diffstat (limited to 'editor/plugins/sprite_frames_editor_plugin.cpp')
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.cpp70
1 files changed, 0 insertions, 70 deletions
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp
index aaebabe04..c2c26bfe6 100644
--- a/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -120,63 +120,6 @@ void SpriteFramesEditor::_load_pressed() {
file->popup_centered_ratio();
}
-void SpriteFramesEditor::_item_edited() {
-
-#if 0
- if (!tree->get_selected())
- return;
-
- TreeItem *s = tree->get_selected();
-
- if (tree->get_selected_column()==0) {
- // renamed
- String old_name=s->get_metadata(0);
- String new_name=s->get_text(0);
- if (old_name==new_name)
- return;
-
- if (new_name=="" || new_name.find("\\")!=-1 || new_name.find("/")!=-1 || frames->has_resource(new_name)) {
-
- s->set_text(0,old_name);
- return;
- }
-
- RES samp = frames->get_resource(old_name);
- undo_redo->create_action("Rename Resource");
- undo_redo->add_do_method(frames,"remove_resource",old_name);
- undo_redo->add_do_method(frames,"add_resource",new_name,samp);
- undo_redo->add_undo_method(frames,"remove_resource",new_name);
- undo_redo->add_undo_method(frames,"add_resource",old_name,samp);
- undo_redo->add_do_method(this,"_update_library");
- undo_redo->add_undo_method(this,"_update_library");
- undo_redo->commit_action();
-
- }
-#endif
-}
-
-void SpriteFramesEditor::_delete_confirm_pressed() {
-
- ERR_FAIL_COND(!frames->has_animation(edited_anim));
-
- if (tree->get_current() < 0)
- return;
-
- sel -= 1;
- if (sel < 0 && frames->get_frame_count(edited_anim))
- sel = 0;
-
- int to_remove = tree->get_current();
- sel = to_remove;
- Ref<Texture> r = frames->get_frame(edited_anim, to_remove);
- undo_redo->create_action(TTR("Delete Resource"));
- undo_redo->add_do_method(frames, "remove_frame", edited_anim, to_remove);
- undo_redo->add_undo_method(frames, "add_frame", edited_anim, r, to_remove);
- undo_redo->add_do_method(this, "_update_library");
- undo_redo->add_undo_method(this, "_update_library");
- undo_redo->commit_action();
-}
-
void SpriteFramesEditor::_paste_pressed() {
ERR_FAIL_COND(!frames->has_animation(edited_anim));
@@ -303,15 +246,6 @@ void SpriteFramesEditor::_delete_pressed() {
if (tree->get_current() < 0)
return;
-
- _delete_confirm_pressed(); //it has undo.. why bother with a dialog..
- /*
- dialog->set_title("Confirm...");
- dialog->set_text("Remove Resource '"+tree->get_selected()->get_text(0)+"' ?");
- //dialog->get_cancel()->set_text("Cancel");
- //dialog->get_ok()->show();
- dialog->get_ok()->set_text("Remove");
- dialog->popup_centered(Size2(300,60));*/
}
void SpriteFramesEditor::_animation_select() {
@@ -693,10 +627,8 @@ void SpriteFramesEditor::_bind_methods() {
ClassDB::bind_method(D_METHOD("_load_pressed"), &SpriteFramesEditor::_load_pressed);
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("_item_edited"), &SpriteFramesEditor::_item_edited);
ClassDB::bind_method(D_METHOD("_delete_pressed"), &SpriteFramesEditor::_delete_pressed);
ClassDB::bind_method(D_METHOD("_paste_pressed"), &SpriteFramesEditor::_paste_pressed);
- ClassDB::bind_method(D_METHOD("_delete_confirm_pressed"), &SpriteFramesEditor::_delete_confirm_pressed);
ClassDB::bind_method(D_METHOD("_file_load_request", "files", "atpos"), &SpriteFramesEditor::_file_load_request, DEFVAL(-1));
ClassDB::bind_method(D_METHOD("_update_library", "skipsel"), &SpriteFramesEditor::_update_library, DEFVAL(false));
ClassDB::bind_method(D_METHOD("_up_pressed"), &SpriteFramesEditor::_up_pressed);
@@ -829,8 +761,6 @@ SpriteFramesEditor::SpriteFramesEditor() {
move_up->connect("pressed", this, "_up_pressed");
move_down->connect("pressed", this, "_down_pressed");
file->connect("files_selected", this, "_file_load_request");
- //dialog->connect("confirmed", this,"_delete_confirm_pressed");
- //tree->connect("item_selected", this,"_item_edited");
loading_scene = false;
sel = -1;