summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-06-06 16:11:11 +0200
committerGitHub <noreply@github.com>2020-06-06 16:11:11 +0200
commit17af0104785eac9c416bb89989d82e2968f8ab8f (patch)
tree70004f6bfeac9dc7d7bc84477fbfae5bda52f238 /editor
parentf54eda121d975127f68db624265271d39d8dabf3 (diff)
parent01802074a01c41d8672664751f80b80069796f12 (diff)
Merge pull request #38967 from nekomatata/remote-inspector-builtin-res
Fix dialog spam when inspecting MeshInstance from model file
Diffstat (limited to 'editor')
-rw-r--r--editor/debugger/editor_debugger_inspector.cpp10
-rw-r--r--editor/debugger/editor_debugger_inspector.h1
2 files changed, 5 insertions, 6 deletions
diff --git a/editor/debugger/editor_debugger_inspector.cpp b/editor/debugger/editor_debugger_inspector.cpp
index 125439d09b..dcd7220ed0 100644
--- a/editor/debugger/editor_debugger_inspector.cpp
+++ b/editor/debugger/editor_debugger_inspector.cpp
@@ -153,12 +153,9 @@ ObjectID EditorDebuggerInspector::add_object(const Array &p_arr) {
if (path.find("::") != -1) {
// built-in resource
String base_path = path.get_slice("::", 0);
- if (ResourceLoader::get_resource_type(base_path) == "PackedScene") {
- if (!EditorNode::get_singleton()->is_scene_open(base_path)) {
- EditorNode::get_singleton()->load_scene(base_path);
- }
- } else {
- EditorNode::get_singleton()->load_resource(base_path);
+ RES dependency = ResourceLoader::load(base_path);
+ if (dependency.is_valid()) {
+ remote_dependencies.insert(dependency);
}
}
var = ResourceLoader::load(path);
@@ -211,6 +208,7 @@ void EditorDebuggerInspector::clear_cache() {
memdelete(E->value());
}
remote_objects.clear();
+ remote_dependencies.clear();
}
Object *EditorDebuggerInspector::get_object(ObjectID p_id) {
diff --git a/editor/debugger/editor_debugger_inspector.h b/editor/debugger/editor_debugger_inspector.h
index 638dee3c3f..7d13a4c362 100644
--- a/editor/debugger/editor_debugger_inspector.h
+++ b/editor/debugger/editor_debugger_inspector.h
@@ -69,6 +69,7 @@ class EditorDebuggerInspector : public EditorInspector {
private:
ObjectID inspected_object_id;
Map<ObjectID, EditorDebuggerRemoteObject *> remote_objects;
+ Set<RES> remote_dependencies;
EditorDebuggerRemoteObject *variables;
void _object_selected(ObjectID p_object);