diff options
author | DualMatrix <piet.goris@gmail.com> | 2018-10-04 01:59:24 +0200 |
---|---|---|
committer | DualMatrix <piet.goris@gmail.com> | 2018-10-04 15:13:44 +0200 |
commit | c4ac2707dc54b8d11e2a677f01f7bd019b72f788 (patch) | |
tree | 1d56f4d7ba8f043f4de9be861a9f1e2c79aaa4b4 /editor | |
parent | 0f4c30fb7166e84d93f0b2cb20d726f869155d98 (diff) |
Cleaned up/Fixed some bugs in the remote inspector code.
Cleaned up/Fixed some bugs in the remote inspector code.
This makes some of my previous code cleaner while resolving a bunch of bugs.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/script_editor_debugger.cpp | 30 |
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; } |