summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThaddeus Crews <repiteo@outlook.com>2024-10-16 14:16:00 -0500
committerThaddeus Crews <repiteo@outlook.com>2024-10-16 14:16:00 -0500
commitc032acb86588cacde355f35854495d965cfbc68e (patch)
treee8c6e3b07f0b7735f62d3609d036c006333b359a
parent7f108cfa122da03b09089ef0c252a4c5aa7b47c3 (diff)
parent7261321d34aaf4280b412b742e647eacf907aa9f (diff)
downloadredot-engine-c032acb86588cacde355f35854495d965cfbc68e.tar.gz
Merge pull request #98156 from jaydensipe/show-custom-icons-in-remote-scene-view
Show correct icons in remote object inspector (EditorDebuggerRemoteObject)
-rw-r--r--editor/gui/editor_object_selector.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/editor/gui/editor_object_selector.cpp b/editor/gui/editor_object_selector.cpp
index b73cd3b65c..ec5caa8c2a 100644
--- a/editor/gui/editor_object_selector.cpp
+++ b/editor/gui/editor_object_selector.cpp
@@ -30,6 +30,7 @@
#include "editor_object_selector.h"
+#include "editor/debugger/editor_debugger_inspector.h"
#include "editor/editor_data.h"
#include "editor/editor_node.h"
#include "editor/editor_string_names.h"
@@ -131,6 +132,19 @@ void EditorObjectSelector::update_path() {
Ref<Texture2D> obj_icon;
if (Object::cast_to<MultiNodeEdit>(obj)) {
obj_icon = EditorNode::get_singleton()->get_class_icon(Object::cast_to<MultiNodeEdit>(obj)->get_edited_class_name());
+ } else if (Object::cast_to<EditorDebuggerRemoteObject>(obj)) {
+ String class_name;
+ Ref<Script> base_script = obj->get_script();
+ if (base_script.is_valid()) {
+ class_name = base_script->get_global_name();
+
+ if (class_name.is_empty()) {
+ // If there is no class_name in this script we just take the script path.
+ class_name = base_script->get_path();
+ }
+ }
+
+ obj_icon = EditorNode::get_singleton()->get_class_icon(class_name.is_empty() ? Object::cast_to<EditorDebuggerRemoteObject>(obj)->type_name : class_name);
} else {
obj_icon = EditorNode::get_singleton()->get_object_icon(obj);
}