diff options
| author | Rémi Verschelde | 2017-11-05 11:48:13 +0100 |
|---|---|---|
| committer | GitHub | 2017-11-05 11:48:13 +0100 |
| commit | e5c3e3bf132622b86b554162652d074e8a4d6dde (patch) | |
| tree | 9f292110e77947900c7ad949afceb636af2d97de | |
| parent | 5bc2cf257b46b7ba52c95e43c9b0f91f6e06998e (diff) | |
| parent | a8012f1b25b1462b26b867867d2bca780fe3dd1d (diff) | |
| download | godot-e5c3e3bf132622b86b554162652d074e8a4d6dde.tar.gz godot-e5c3e3bf132622b86b554162652d074e8a4d6dde.tar.zst godot-e5c3e3bf132622b86b554162652d074e8a4d6dde.zip | |
Merge pull request #12638 from poke1024/fixcreate
Fixes random sorting order in Create New Node dialog
| -rw-r--r-- | editor/create_dialog.cpp | 6 | ||||
| -rw-r--r-- | editor/create_dialog.h | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 520bf480f..a1f66318c 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -211,9 +211,6 @@ void CreateDialog::_update_search() { _parse_fs(EditorFileSystem::get_singleton()->get_filesystem()); */ - List<StringName> type_list; - ClassDB::get_class_list(&type_list); - HashMap<String, TreeItem *> types; TreeItem *root = search_options->create_item(); @@ -615,6 +612,9 @@ void CreateDialog::_bind_methods() { CreateDialog::CreateDialog() { + ClassDB::get_class_list(&type_list); + type_list.sort_custom<StringName::AlphCompare>(); + set_resizable(true); HSplitContainer *hbc = memnew(HSplitContainer); diff --git a/editor/create_dialog.h b/editor/create_dialog.h index 2e4ce9b27..157c126c6 100644 --- a/editor/create_dialog.h +++ b/editor/create_dialog.h @@ -55,6 +55,7 @@ class CreateDialog : public ConfirmationDialog { String base_type; String preferred_search_result_type; EditorHelpBit *help_bit; + List<StringName> type_list; void _item_selected(); |
