summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-10-07 11:42:37 +0200
committerGitHub <noreply@github.com>2018-10-07 11:42:37 +0200
commitd4108573bf65f6e01ab58c50b561f144d499268b (patch)
tree554e94e67f5bcedc2abd5855bbada137641f15d1 /editor
parent13892f266860eac20d21e0b01d4dfb8ba7c3d8d3 (diff)
parentc4ac2707dc54b8d11e2a677f01f7bd019b72f788 (diff)
Merge pull request #22705 from DualMatrix/debugging_the_debugger_grand_finale
Cleaned up/Fixed some bugs in the remote inspector code.
Diffstat (limited to 'editor')
-rw-r--r--editor/script_editor_debugger.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index eb72d0aa6e..6fbac0d4b5 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -493,23 +493,29 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
pinfo.usage = PropertyUsageFlags(int(prop[4]));
Variant var = prop[5];
+ if (pinfo.type == Variant::OBJECT) {
+ if (var.is_zero()) {
+ var = RES();
+ } else if (var.get_type() == Variant::STRING) {
+ var = ResourceLoader::load(var);
+
+ if (pinfo.hint_string == "Script")
+ debugObj->set_script(var);
+ } else if (var.get_type() == Variant::OBJECT) {
+ if (((Object *)var)->is_class("EncodedObjectAsID")) {
+ var = Object::cast_to<EncodedObjectAsID>(var)->get_object_id();
+ pinfo.type = var.get_type();
+ pinfo.hint = PROPERTY_HINT_OBJECT_ID;
+ pinfo.hint_string = "Object";
+ }
+ }
+ }
+
if (is_new_object) {
//don't update.. it's the same, instead refresh
debugObj->prop_list.push_back(pinfo);
}
- if (var.get_type() == Variant::STRING) {
- String str = var;
- var = str.substr(4, str.length());
-
- if (str.begins_with("PATH")) {
- if (String(var).empty())
- var = RES();
- else
- var = ResourceLoader::load(var);
- }
- }
-
debugObj->prop_values[pinfo.name] = var;
}