Skip to content

Commit

Permalink
Deleting only repeating "Scripted Variables" props
Browse files Browse the repository at this point in the history
  • Loading branch information
object71 committed May 4, 2022
1 parent 0beb721 commit f9dba44
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions editor/editor_inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3620,20 +3620,25 @@ void EditorInspector::_update_script_class_properties(const Object &p_object, Li
added.insert(pi.name);

r_list.insert_before(insert_here, pi);

List<PropertyInfo>::Element *prop_below = bottom->next();
while (prop_below) {
if (prop_below->get() == pi) {
List<PropertyInfo>::Element *to_delete = prop_below;
prop_below = prop_below->next();
r_list.erase(to_delete);
} else {
prop_below = prop_below->next();
}
}
}

// Script Variables -> NodeA (insert_here) -> A props... -> bottom
insert_here = category;
}

// NodeC -> C props... -> NodeB..C..
if (script_variables) {
r_list.erase(script_variables);
List<PropertyInfo>::Element *to_delete = bottom->next();
while (to_delete && !(to_delete->get().usage & PROPERTY_USAGE_CATEGORY)) {
r_list.erase(to_delete);
to_delete = bottom->next();
}
r_list.erase(bottom);
}
}
Expand Down

0 comments on commit f9dba44

Please sign in to comment.