1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-23 15:16:17 +00:00

Properly handle named class types inheriting from scripts without names.

This commit is contained in:
SaracenOne
2021-12-01 09:50:42 +00:00
parent e223a9c129
commit c63f23bcaa
2 changed files with 72 additions and 15 deletions

View File

@@ -41,6 +41,12 @@
class CreateDialog : public ConfirmationDialog {
GDCLASS(CreateDialog, ConfirmationDialog);
enum TypeCategory {
CPP_TYPE,
PATH_TYPE,
OTHER_TYPE
};
LineEdit *search_box;
Tree *search_options;
@@ -62,8 +68,8 @@ class CreateDialog : public ConfirmationDialog {
void _update_search();
bool _should_hide_type(const String &p_type) const;
void _add_type(const String &p_current, bool p_cpp_type);
void _configure_search_option_item(TreeItem *r_item, const String &p_type, const bool p_cpp_type);
void _add_type(const String &p_type, const TypeCategory p_type_category);
void _configure_search_option_item(TreeItem *r_item, const String &p_type, const TypeCategory p_type_category);
String _top_result(const Vector<String> p_candidates, const String &p_search_text) const;
float _score_type(const String &p_type, const String &p_search) const;
bool _is_type_preferred(const String &p_type) const;