From c4ac2707dc54b8d11e2a677f01f7bd019b72f788 Mon Sep 17 00:00:00 2001 From: DualMatrix Date: Thu, 4 Oct 2018 01:59:24 +0200 Subject: 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. --- editor/script_editor_debugger.cpp | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'editor') 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(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; } -- cgit v1.2.3