Explorar o código

Visualscript: Hide empty categories for basic types and methods.

K. S. Ernest (iFire) Lee %!s(int64=7) %!d(string=hai) anos
pai
achega
5b2c4b77e2
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      modules/visual_script/visual_script_property_selector.cpp

+ 8 - 0
modules/visual_script/visual_script_property_selector.cpp

@@ -222,6 +222,10 @@ void VisualScriptPropertySelector::_update_search() {
 				item->set_selectable(0, true);
 				item->set_selectable(0, true);
 			}
 			}
 		}
 		}
+
+		if (category && category->get_children() == NULL) {
+			memdelete(category); //old category was unused
+		}
 	}
 	}
 
 
 	if (seq_connect == true && visual_script_generic == false) {
 	if (seq_connect == true && visual_script_generic == false) {
@@ -348,6 +352,10 @@ void VisualScriptPropertySelector::_update_search() {
 		found = true;
 		found = true;
 	}
 	}
 
 
+	if (category && category->get_children() == NULL) {
+		memdelete(category); //old category was unused
+	}
+
 	get_ok()->set_disabled(root->get_children() == NULL);
 	get_ok()->set_disabled(root->get_children() == NULL);
 }
 }