summaryrefslogtreecommitdiff
path: root/tools/editor/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/plugins')
-rw-r--r--tools/editor/plugins/mesh_editor_plugin.cpp5
-rw-r--r--tools/editor/plugins/shader_graph_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/sprite_frames_editor_plugin.cpp37
-rw-r--r--tools/editor/plugins/sprite_frames_editor_plugin.h2
4 files changed, 43 insertions, 3 deletions
diff --git a/tools/editor/plugins/mesh_editor_plugin.cpp b/tools/editor/plugins/mesh_editor_plugin.cpp
index a3884f9be4..f8c75e1cf5 100644
--- a/tools/editor/plugins/mesh_editor_plugin.cpp
+++ b/tools/editor/plugins/mesh_editor_plugin.cpp
@@ -33,7 +33,7 @@ void MeshInstanceEditor::_menu_option(int p_option) {
Ref<Mesh> mesh = node->get_mesh();
if (mesh.is_null()) {
err_dialog->set_text("Mesh is empty!");
- err_dialog->popup_centered(Size2(100,50));
+ err_dialog->popup_centered(Size2(100,80));
return;
}
@@ -240,6 +240,9 @@ MeshInstanceEditor::MeshInstanceEditor() {
add_child(outline_dialog);
outline_dialog->connect("confirmed",this,"_create_outline_mesh");
+ err_dialog = memnew( AcceptDialog );
+ add_child(err_dialog);
+
}
diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp
index 508e8b4cba..e829c06e6f 100644
--- a/tools/editor/plugins/shader_graph_editor_plugin.cpp
+++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp
@@ -376,7 +376,7 @@ void GraphCurveMapEdit::_input_event(const InputEvent& p_event) {
update();
}
- if (p_event.type==InputEvent::MOUSE_MOTION && grabbing) {
+ if (p_event.type==InputEvent::MOUSE_MOTION && grabbing && grabbed != -1) {
Point2 p = Vector2(p_event.mouse_button.x,p_event.mouse_button.y)/get_size();
p.y=1.0-p.y;
diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.cpp b/tools/editor/plugins/sprite_frames_editor_plugin.cpp
index e04d9dfddb..9a9e8ee611 100644
--- a/tools/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/tools/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -229,6 +229,33 @@ void SpriteFramesEditor::_empty_pressed() {
}
+void SpriteFramesEditor::_empty2_pressed() {
+
+
+ int from=-1;
+
+ if (tree->get_selected()) {
+
+ from = tree->get_selected()->get_metadata(0);
+ sel=from;
+
+ } else {
+ from=frames->get_frame_count();
+ }
+
+
+
+ Ref<Texture> r;
+
+ undo_redo->create_action("Add Empty");
+ undo_redo->add_do_method(frames,"add_frame",r,from+1);
+ undo_redo->add_undo_method(frames,"remove_frame",from+1);
+ undo_redo->add_do_method(this,"_update_library");
+ undo_redo->add_undo_method(this,"_update_library");
+ undo_redo->commit_action();
+
+}
+
void SpriteFramesEditor::_up_pressed() {
if (!tree->get_selected())
@@ -322,6 +349,8 @@ void SpriteFramesEditor::_update_library() {
ti->set_text(0,"Frame "+itos(i));
ti->set_icon(0,frames->get_frame(i));
}
+ if (frames->get_frame(i).is_valid())
+ ti->set_tooltip(0,frames->get_frame(i)->get_path());
ti->set_metadata(0,i);
ti->set_icon_max_width(0,96);
if (sel==i)
@@ -355,6 +384,7 @@ void SpriteFramesEditor::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_input_event"),&SpriteFramesEditor::_input_event);
ObjectTypeDB::bind_method(_MD("_load_pressed"),&SpriteFramesEditor::_load_pressed);
ObjectTypeDB::bind_method(_MD("_empty_pressed"),&SpriteFramesEditor::_empty_pressed);
+ ObjectTypeDB::bind_method(_MD("_empty2_pressed"),&SpriteFramesEditor::_empty2_pressed);
ObjectTypeDB::bind_method(_MD("_item_edited"),&SpriteFramesEditor::_item_edited);
ObjectTypeDB::bind_method(_MD("_delete_pressed"),&SpriteFramesEditor::_delete_pressed);
ObjectTypeDB::bind_method(_MD("_paste_pressed"),&SpriteFramesEditor::_paste_pressed);
@@ -387,9 +417,13 @@ SpriteFramesEditor::SpriteFramesEditor() {
hbc->add_child(paste);
empty = memnew( Button );
- empty->set_text("Insert Empty");
+ empty->set_text("Insert Empty (Before)");
hbc->add_child(empty);
+ empty2 = memnew( Button );
+ empty2->set_text("Insert Empty (After)");
+ hbc->add_child(empty2);
+
move_up = memnew( Button );
move_up->set_text("Up");
hbc->add_child(move_up);
@@ -422,6 +456,7 @@ SpriteFramesEditor::SpriteFramesEditor() {
_delete->connect("pressed", this,"_delete_pressed");
paste->connect("pressed", this,"_paste_pressed");
empty->connect("pressed", this,"_empty_pressed");
+ empty2->connect("pressed", this,"_empty2_pressed");
move_up->connect("pressed", this,"_up_pressed");
move_down->connect("pressed", this,"_down_pressed");
file->connect("files_selected", this,"_file_load_request");
diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.h b/tools/editor/plugins/sprite_frames_editor_plugin.h
index 99c6ad486e..b0f2201b9e 100644
--- a/tools/editor/plugins/sprite_frames_editor_plugin.h
+++ b/tools/editor/plugins/sprite_frames_editor_plugin.h
@@ -46,6 +46,7 @@ class SpriteFramesEditor : public PanelContainer {
Button *_delete;
Button *paste;
Button *empty;
+ Button *empty2;
Button *move_up;
Button *move_down;
Tree *tree;
@@ -65,6 +66,7 @@ class SpriteFramesEditor : public PanelContainer {
void _file_load_request(const DVector<String>& p_path);
void _paste_pressed();
void _empty_pressed();
+ void _empty2_pressed();
void _delete_pressed();
void _delete_confirm_pressed();
void _up_pressed();