You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-02 16:48:55 +00:00
Don't show exported script variables twice in the remote inspector
This commit is contained in:
@@ -751,7 +751,7 @@ SceneDebuggerObject::SceneDebuggerObject(Object *p_obj) {
|
|||||||
class_name = p_obj->get_class();
|
class_name = p_obj->get_class();
|
||||||
|
|
||||||
if (ScriptInstance *si = p_obj->get_script_instance()) {
|
if (ScriptInstance *si = p_obj->get_script_instance()) {
|
||||||
// Read script instance constants and variables
|
// Read script instance constants and variables.
|
||||||
if (!si->get_script().is_null()) {
|
if (!si->get_script().is_null()) {
|
||||||
Script *s = si->get_script().ptr();
|
Script *s = si->get_script().ptr();
|
||||||
_parse_script_properties(s, si);
|
_parse_script_properties(s, si);
|
||||||
@@ -815,9 +815,23 @@ void SceneDebuggerObject::_parse_script_properties(Script *p_script, ScriptInsta
|
|||||||
base = base->get_base_script();
|
base = base->get_base_script();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HashSet<String> exported_members;
|
||||||
|
|
||||||
|
List<PropertyInfo> pinfo;
|
||||||
|
p_instance->get_property_list(&pinfo);
|
||||||
|
for (const PropertyInfo &E : pinfo) {
|
||||||
|
if (E.usage & (PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_CATEGORY)) {
|
||||||
|
exported_members.insert(E.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Members
|
// Members
|
||||||
for (KeyValue<const Script *, HashSet<StringName>> sm : members) {
|
for (KeyValue<const Script *, HashSet<StringName>> sm : members) {
|
||||||
for (const StringName &E : sm.value) {
|
for (const StringName &E : sm.value) {
|
||||||
|
if (exported_members.has(E)) {
|
||||||
|
continue; // Exported variables already show up in the inspector.
|
||||||
|
}
|
||||||
|
|
||||||
Variant m;
|
Variant m;
|
||||||
if (p_instance->get(E, m)) {
|
if (p_instance->get(E, m)) {
|
||||||
String script_path = sm.key == p_script ? "" : sm.key->get_path().get_file() + "/";
|
String script_path = sm.key == p_script ? "" : sm.key->get_path().get_file() + "/";
|
||||||
|
|||||||
Reference in New Issue
Block a user