diff options
author | Nils ANDRÉ-CHANG <nils@nilsand.re> | 2019-09-12 21:28:49 +0100 |
---|---|---|
committer | Nils ANDRÉ-CHANG <nils@nilsand.re> | 2019-09-26 20:36:12 +0100 |
commit | 0024dd7bb5a8a5194ed0283fc506edcd8b4a7737 (patch) | |
tree | 86316cccbf4fda58a275a7451e37fda83465bb20 /editor/plugins/particles_editor_plugin.cpp | |
parent | cafb888361eba08297dd88b18dc71f4d418525c0 (diff) | |
parent | 24e1039eb6fe32115e8d1a62a84965e9be19a2ed (diff) |
Merge branch 'master' into tab_key
Diffstat (limited to 'editor/plugins/particles_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/particles_editor_plugin.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp index 75d31459e8..31b0539bfe 100644 --- a/editor/plugins/particles_editor_plugin.cpp +++ b/editor/plugins/particles_editor_plugin.cpp @@ -55,8 +55,7 @@ bool ParticlesEditorBase::_generate(PoolVector<Vector3> &points, PoolVector<Vect if (!triangle_area_map.size() || area_accum == 0) { - err_dialog->set_text(TTR("Faces contain no area!")); - err_dialog->popup_centered_minsize(); + EditorNode::get_singleton()->show_warning(TTR("The geometry's faces don't contain any area.")); return false; } @@ -90,8 +89,7 @@ bool ParticlesEditorBase::_generate(PoolVector<Vector3> &points, PoolVector<Vect if (gcount == 0) { - err_dialog->set_text(TTR("No faces!")); - err_dialog->popup_centered_minsize(); + EditorNode::get_singleton()->show_warning(TTR("The geometry doesn't contain any faces.")); return false; } @@ -169,11 +167,16 @@ void ParticlesEditorBase::_node_selected(const NodePath &p_path) { if (!sel) return; + if (!sel->is_class("Spatial")) { + + EditorNode::get_singleton()->show_warning(vformat(TTR("\"%s\" doesn't inherit from Spatial."), sel->get_name())); + return; + } + VisualInstance *vi = Object::cast_to<VisualInstance>(sel); if (!vi) { - err_dialog->set_text(TTR("Node does not contain geometry.")); - err_dialog->popup_centered_minsize(); + EditorNode::get_singleton()->show_warning(vformat(TTR("\"%s\" doesn't contain geometry."), sel->get_name())); return; } @@ -181,8 +184,7 @@ void ParticlesEditorBase::_node_selected(const NodePath &p_path) { if (geometry.size() == 0) { - err_dialog->set_text(TTR("Node does not contain geometry (faces).")); - err_dialog->popup_centered_minsize(); + EditorNode::get_singleton()->show_warning(vformat(TTR("\"%s\" doesn't contain face geometry."), sel->get_name())); return; } @@ -231,9 +233,6 @@ ParticlesEditorBase::ParticlesEditorBase() { emission_dialog->get_ok()->set_text(TTR("Create")); emission_dialog->connect("confirmed", this, "_generate_emission_points"); - err_dialog = memnew(ConfirmationDialog); - add_child(err_dialog); - emission_file_dialog = memnew(EditorFileDialog); add_child(emission_file_dialog); emission_file_dialog->connect("file_selected", this, "_resource_seleted"); |