Browse Source

Project manager improvements

- Faster launch time by loading icons in a coroutine
- Faster sorting, filtering, fav'ing etc
- Refactored project list with a proper structured class
Marc Gilleron 6 years ago
parent
commit
d3652887df
2 changed files with 800 additions and 435 deletions
  1. 795 427
      editor/project_manager.cpp
  2. 5 8
      editor/project_manager.h

File diff suppressed because it is too large
+ 795 - 427
editor/project_manager.cpp


+ 5 - 8
editor/project_manager.h

@@ -39,6 +39,7 @@
 #include "scene/gui/tree.h"
 
 class ProjectDialog;
+class ProjectList;
 class ProjectListFilter;
 
 class ProjectManager : public Control {
@@ -68,16 +69,13 @@ class ProjectManager : public Control {
 	AcceptDialog *dialog_error;
 	ProjectDialog *npdialog;
 
-	ScrollContainer *scroll;
-	VBoxContainer *scroll_children;
 	HBoxContainer *projects_hb;
 	TabContainer *tabs;
+	ProjectList *_project_list;
 
 	OptionButton *language_btn;
 	Control *gui_base;
 
-	Map<String, String> selected_list; // name -> main_scene
-	String last_clicked;
 	bool importing;
 
 	void _open_asset_library();
@@ -86,7 +84,6 @@ class ProjectManager : public Control {
 	void _run_project_confirm();
 	void _open_selected_projects();
 	void _open_selected_projects_ask();
-	void _show_project(const String &p_path);
 	void _import_project();
 	void _new_project();
 	void _rename_project();
@@ -111,13 +108,13 @@ class ProjectManager : public Control {
 	void _install_project(const String &p_zip_path, const String &p_title);
 
 	void _dim_window();
-	void _panel_draw(Node *p_hb);
-	void _panel_input(const Ref<InputEvent> &p_ev, Node *p_hb);
 	void _unhandled_input(const Ref<InputEvent> &p_ev);
-	void _favorite_pressed(Node *p_hb);
 	void _files_dropped(PoolStringArray p_files, int p_screen);
 	void _scan_multiple_folders(PoolStringArray p_files);
 
+	void _on_order_option_changed();
+	void _on_filter_option_changed();
+
 protected:
 	void _notification(int p_what);
 	static void _bind_methods();

Some files were not shown because too many files changed in this diff