summaryrefslogtreecommitdiff
path: root/tools/editor/editor_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/editor_node.cpp')
-rw-r--r--tools/editor/editor_node.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 27a5ddbeaf..afd5ee66c5 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -3046,6 +3046,33 @@ void EditorNode::_load_error_notify(void* p_ud,const String& p_text) {
}
+
+bool EditorNode::_find_scene_in_use(Node* p_node,const String& p_path) const {
+
+ if (p_node->get_filename()==p_path) {
+ return true;
+ }
+
+ for(int i=0;i<p_node->get_child_count();i++) {
+
+ if (_find_scene_in_use(p_node->get_child(i),p_path)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+
+bool EditorNode::is_scene_in_use(const String& p_path) {
+
+ Node *es = get_edited_scene();
+ if (es)
+ return _find_scene_in_use(es,p_path);
+ return false;
+
+}
+
void EditorNode::register_editor_types() {
ObjectTypeDB::register_type<EditorPlugin>();
@@ -3212,6 +3239,7 @@ Error EditorNode::export_platform(const String& p_platform, const String& p_path
}
+
EditorNode::EditorNode() {
EditorHelp::generate_doc(); //before any editor classes are crated