summaryrefslogtreecommitdiff
path: root/editor/editor_inspector.cpp
diff options
context:
space:
mode:
authorHristo Stamenov <capitane71@gmail.com>2022-02-22 20:25:33 +0200
committerHristo Stamenov <capitane71@gmail.com>2022-05-04 09:09:26 +0300
commitf9dba447b9bd22f1d166c48a0bcd622b97bc9aa6 (patch)
treecaf255f54fc323b03154d0fa3acd6bfce393bb56 /editor/editor_inspector.cpp
parent0beb721c70dae9220f89f09f455d6843e638cd9f (diff)
Deleting only repeating "Scripted Variables" props
Diffstat (limited to 'editor/editor_inspector.cpp')
-rw-r--r--editor/editor_inspector.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 675ef808e1..314a65ad56 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -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);
}
}