mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
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.
This commit is contained in:
parent
0f4c30fb71
commit
c4ac2707dc
2 changed files with 36 additions and 19 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue