summaryrefslogtreecommitdiff
path: root/editor/create_dialog.h
diff options
context:
space:
mode:
Diffstat (limited to 'editor/create_dialog.h')
-rw-r--r--editor/create_dialog.h65
1 files changed, 35 insertions, 30 deletions
diff --git a/editor/create_dialog.h b/editor/create_dialog.h
index cdc91ae535..75a317275a 100644
--- a/editor/create_dialog.h
+++ b/editor/create_dialog.h
@@ -35,60 +35,65 @@
#include "scene/gui/button.h"
#include "scene/gui/dialogs.h"
#include "scene/gui/item_list.h"
-#include "scene/gui/label.h"
#include "scene/gui/line_edit.h"
#include "scene/gui/tree.h"
class CreateDialog : public ConfirmationDialog {
GDCLASS(CreateDialog, ConfirmationDialog);
- Vector<String> favorite_list;
- Tree *favorites;
- Tree *recent;
-
- Button *favorite;
LineEdit *search_box;
Tree *search_options;
- HashMap<String, TreeItem *> search_options_types;
- HashMap<String, RES> search_loaded_scripts;
- bool is_replace_mode;
+
String base_type;
+ String icon_fallback;
String preferred_search_result_type;
+
+ Button *favorite;
+ Vector<String> favorite_list;
+ Tree *favorites;
+ ItemList *recent;
EditorHelpBit *help_bit;
+
+ HashMap<String, TreeItem *> search_options_types;
+ HashMap<String, String> custom_type_parents;
+ HashMap<String, int> custom_type_indices;
List<StringName> type_list;
Set<StringName> type_blacklist;
- void _item_selected();
- void _hide_requested();
-
void _update_search();
- void _update_favorite_list();
- void _save_favorite_list();
- void _favorite_toggled();
+ 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);
+ 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;
- void _history_selected();
- void _favorite_selected();
-
- void _history_activated();
- void _favorite_activated();
+ void _fill_type_list();
+ void _cleanup();
void _sbox_input(const Ref<InputEvent> &p_ie);
+ void _text_changed(const String &p_newtext);
+ void select_type(const String &p_type);
+ void _item_selected();
+ void _hide_requested();
void _confirmed();
- void _text_changed(const String &p_newtext);
+ virtual void cancel_pressed() override;
- Ref<Texture2D> _get_editor_icon(const String &p_type) const;
+ void _favorite_toggled();
- void add_type(const String &p_type, HashMap<String, TreeItem *> &p_types, TreeItem *p_root, TreeItem **to_select);
+ void _history_selected(int p_idx);
+ void _favorite_selected();
- void select_type(const String &p_type);
+ void _history_activated(int p_idx);
+ void _favorite_activated();
Variant get_drag_data_fw(const Point2 &p_point, Control *p_from);
bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const;
void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from);
- bool _is_class_disabled_by_feature_profile(const StringName &p_class);
- bool _is_type_prefered(const String &type);
+ bool _is_class_disabled_by_feature_profile(const StringName &p_class) const;
+ void _load_favorites_and_history();
protected:
void _notification(int p_what);
@@ -100,11 +105,11 @@ public:
Object *instance_selected();
String get_selected_type();
- void set_base_type(const String &p_base);
- String get_base_type() const;
+ void set_base_type(const String &p_base) { base_type = p_base; }
+ String get_base_type() const { return base_type; }
- void set_preferred_search_result_type(const String &p_preferred_type);
- String get_preferred_search_result_type();
+ void set_preferred_search_result_type(const String &p_preferred_type) { preferred_search_result_type = p_preferred_type; }
+ String get_preferred_search_result_type() { return preferred_search_result_type; }
void popup_create(bool p_dont_clear, bool p_replace_mode = false, const String &p_select_type = "Node");