Improve display of non-exported members in Remote Tree Inspector
This commit is contained in:
parent
98782b6c8c
commit
376b2d8f57
5 changed files with 87 additions and 14 deletions
|
|
@ -109,6 +109,7 @@ void SceneDebuggerObject::_parse_script_properties(Script *p_script, ScriptInsta
|
|||
}
|
||||
|
||||
HashSet<String> exported_members;
|
||||
HashMap<String, PropertyInfo> non_exported_members;
|
||||
|
||||
if (p_instance) {
|
||||
List<PropertyInfo> pinfo;
|
||||
|
|
@ -116,6 +117,10 @@ void SceneDebuggerObject::_parse_script_properties(Script *p_script, ScriptInsta
|
|||
for (const PropertyInfo &E : pinfo) {
|
||||
if (E.usage & (PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_CATEGORY)) {
|
||||
exported_members.insert(E.name);
|
||||
} else {
|
||||
PropertyInfo pi = E;
|
||||
pi.usage |= PROPERTY_USAGE_EDITOR;
|
||||
non_exported_members.insert(E.name, pi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -132,8 +137,17 @@ void SceneDebuggerObject::_parse_script_properties(Script *p_script, ScriptInsta
|
|||
|
||||
Variant m;
|
||||
if (p_instance->get(E, m)) {
|
||||
String script_path = sm.key == p_script ? "" : sm.key->get_path().get_file() + "/";
|
||||
PropertyInfo pi(m.get_type(), "Members/" + script_path + E);
|
||||
const String script_path = sm.key == p_script ? "" : sm.key->get_path().get_file() + "/";
|
||||
|
||||
PropertyInfo pi;
|
||||
const PropertyInfo *pi_ptr = non_exported_members.getptr(E);
|
||||
if (pi_ptr == nullptr) {
|
||||
pi.type = m.get_type();
|
||||
} else {
|
||||
pi = *pi_ptr;
|
||||
}
|
||||
pi.name = "Members/" + script_path + E;
|
||||
|
||||
properties.push_back(SceneDebuggerProperty(pi, m));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue