feat: modules moved and engine moved to submodule
This commit is contained in:
parent
dfb5e645cd
commit
c33d2130cc
5136 changed files with 225275 additions and 64485 deletions
|
|
@ -83,8 +83,7 @@ void CreateDialog::_fill_type_list() {
|
|||
|
||||
EditorData &ed = EditorNode::get_editor_data();
|
||||
|
||||
for (List<StringName>::Element *I = complete_type_list.front(); I; I = I->next()) {
|
||||
StringName type = I->get();
|
||||
for (const StringName &type : complete_type_list) {
|
||||
if (!_should_hide_type(type)) {
|
||||
type_list.push_back(type);
|
||||
|
||||
|
|
@ -216,8 +215,7 @@ void CreateDialog::_update_search() {
|
|||
float highest_score = 0.0f;
|
||||
StringName best_match;
|
||||
|
||||
for (List<StringName>::Element *I = type_list.front(); I; I = I->next()) {
|
||||
StringName candidate = I->get();
|
||||
for (const StringName &candidate : type_list) {
|
||||
if (empty_search || search_text.is_subsequence_ofn(candidate)) {
|
||||
_add_type(candidate, ClassDB::class_exists(candidate) ? TypeCategory::CPP_TYPE : TypeCategory::OTHER_TYPE);
|
||||
|
||||
|
|
@ -637,7 +635,7 @@ void CreateDialog::_favorite_activated() {
|
|||
}
|
||||
|
||||
Variant CreateDialog::get_drag_data_fw(const Point2 &p_point, Control *p_from) {
|
||||
TreeItem *ti = favorites->get_item_at_position(p_point);
|
||||
TreeItem *ti = (p_point == Vector2(Math::INF, Math::INF)) ? favorites->get_selected() : favorites->get_item_at_position(p_point);
|
||||
if (ti) {
|
||||
Dictionary d;
|
||||
d["type"] = "create_favorite_drag";
|
||||
|
|
@ -669,13 +667,13 @@ bool CreateDialog::can_drop_data_fw(const Point2 &p_point, const Variant &p_data
|
|||
void CreateDialog::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) {
|
||||
Dictionary d = p_data;
|
||||
|
||||
TreeItem *ti = favorites->get_item_at_position(p_point);
|
||||
TreeItem *ti = (p_point == Vector2(Math::INF, Math::INF)) ? favorites->get_selected() : favorites->get_item_at_position(p_point);
|
||||
if (!ti) {
|
||||
return;
|
||||
}
|
||||
|
||||
String drop_at = ti->get_text(0);
|
||||
int ds = favorites->get_drop_section_at_position(p_point);
|
||||
int ds = (p_point == Vector2(Math::INF, Math::INF)) ? favorites->get_drop_section_at_position(favorites->get_item_rect(ti).position) : favorites->get_drop_section_at_position(p_point);
|
||||
|
||||
int drop_idx = favorite_list.find(drop_at);
|
||||
if (drop_idx < 0) {
|
||||
|
|
@ -789,6 +787,7 @@ CreateDialog::CreateDialog() {
|
|||
vsc->add_child(fav_vb);
|
||||
|
||||
favorites = memnew(Tree);
|
||||
favorites->set_accessibility_name(TTRC("Favorites"));
|
||||
favorites->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
|
||||
favorites->set_hide_root(true);
|
||||
favorites->set_hide_folding(true);
|
||||
|
|
@ -806,6 +805,7 @@ CreateDialog::CreateDialog() {
|
|||
rec_vb->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
|
||||
recent = memnew(ItemList);
|
||||
recent->set_accessibility_name(TTRC("Recent"));
|
||||
recent->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
|
||||
rec_vb->add_margin_child(TTR("Recent:"), recent, true);
|
||||
recent->set_allow_reselect(true);
|
||||
|
|
@ -820,6 +820,7 @@ CreateDialog::CreateDialog() {
|
|||
hsc->add_child(vbc);
|
||||
|
||||
search_box = memnew(LineEdit);
|
||||
search_box->set_accessibility_name(TTRC("Search"));
|
||||
search_box->set_clear_button_enabled(true);
|
||||
search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
search_box->connect(SceneStringName(text_changed), callable_mp(this, &CreateDialog::_text_changed));
|
||||
|
|
@ -831,11 +832,13 @@ CreateDialog::CreateDialog() {
|
|||
favorite = memnew(Button);
|
||||
favorite->set_toggle_mode(true);
|
||||
favorite->set_tooltip_text(TTR("(Un)favorite selected item."));
|
||||
favorite->set_accessibility_name(TTRC("(Un)favorite"));
|
||||
favorite->connect(SceneStringName(pressed), callable_mp(this, &CreateDialog::_favorite_toggled));
|
||||
search_hb->add_child(favorite);
|
||||
vbc->add_margin_child(TTR("Search:"), search_hb);
|
||||
|
||||
search_options = memnew(Tree);
|
||||
search_options->set_accessibility_name(TTRC("Matches"));
|
||||
search_options->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
|
||||
search_options->connect("item_activated", callable_mp(this, &CreateDialog::_confirmed));
|
||||
search_options->connect("cell_selected", callable_mp(this, &CreateDialog::_item_selected));
|
||||
|
|
@ -843,6 +846,7 @@ CreateDialog::CreateDialog() {
|
|||
vbc->add_margin_child(TTR("Matches:"), search_options, true);
|
||||
|
||||
help_bit = memnew(EditorHelpBit);
|
||||
help_bit->set_accessibility_name(TTRC("Description"));
|
||||
help_bit->set_content_height_limits(80 * EDSCALE, 80 * EDSCALE);
|
||||
help_bit->connect("request_hide", callable_mp(this, &CreateDialog::_hide_requested));
|
||||
vbc->add_margin_child(TTR("Description:"), help_bit);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue