Skip to content

Commit 7261321

Browse files
committed
Show correct icons in EditorDebuggerRemoteObject
1 parent 92e51fc commit 7261321

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

editor/gui/editor_object_selector.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#include "editor_object_selector.h"
3232

33+
#include "editor/debugger/editor_debugger_inspector.h"
3334
#include "editor/editor_data.h"
3435
#include "editor/editor_node.h"
3536
#include "editor/editor_string_names.h"
@@ -131,6 +132,19 @@ void EditorObjectSelector::update_path() {
131132
Ref<Texture2D> obj_icon;
132133
if (Object::cast_to<MultiNodeEdit>(obj)) {
133134
obj_icon = EditorNode::get_singleton()->get_class_icon(Object::cast_to<MultiNodeEdit>(obj)->get_edited_class_name());
135+
} else if (Object::cast_to<EditorDebuggerRemoteObject>(obj)) {
136+
String class_name;
137+
Ref<Script> base_script = obj->get_script();
138+
if (base_script.is_valid()) {
139+
class_name = base_script->get_global_name();
140+
141+
if (class_name.is_empty()) {
142+
// If there is no class_name in this script we just take the script path.
143+
class_name = base_script->get_path();
144+
}
145+
}
146+
147+
obj_icon = EditorNode::get_singleton()->get_class_icon(class_name.is_empty() ? Object::cast_to<EditorDebuggerRemoteObject>(obj)->type_name : class_name);
134148
} else {
135149
obj_icon = EditorNode::get_singleton()->get_object_icon(obj);
136150
}

0 commit comments

Comments
 (0)