summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-06-07 22:08:12 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-06-07 22:10:09 -0300
commitd61b91cbe0c05466182b15a6dd1899e92fcac749 (patch)
tree3021e43e4e99650062275407616d613b105e13d8 /tools/editor
parent193272aa8a809168b836dde3535cf96ce1f52264 (diff)
-Heavily improved editor startup and exit performance
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/editor_node.cpp3
-rw-r--r--tools/editor/editor_node.h3
-rw-r--r--tools/editor/property_editor.cpp23
-rw-r--r--tools/editor/scene_tree_editor.cpp5
4 files changed, 26 insertions, 8 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 01a6e3514c..cc5a44a650 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -2414,6 +2414,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
_menu_option_confirm(RUN_STOP,true);
+ exiting=true;
get_tree()->quit();
} break;
@@ -2747,6 +2748,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
}
_menu_option_confirm(RUN_STOP,true);
+ exiting=true;
get_tree()->quit();
String exec = OS::get_singleton()->get_executable_path();
@@ -5244,6 +5246,7 @@ EditorNode::EditorNode() {
singleton=this;
+ exiting=false;
last_checked_version=0;
changing_scene=false;
_initializing_addons=false;
diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h
index 7d9b11ed83..65a5687dce 100644
--- a/tools/editor/editor_node.h
+++ b/tools/editor/editor_node.h
@@ -227,6 +227,7 @@ private:
Tabs *scene_tabs;
int tab_closing;
+ bool exiting;
int old_split_ofs;
VSplitContainer *top_split;
@@ -712,6 +713,8 @@ public:
void update_keying();
+ bool is_exiting() const { return exiting; }
+
ToolButton *get_pause_button() { return pause_button; }
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp
index 3258bc6d74..2f0ba2da99 100644
--- a/tools/editor/property_editor.cpp
+++ b/tools/editor/property_editor.cpp
@@ -247,7 +247,8 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
hint=p_hint;
hint_text=p_hint_text;
type_button->hide();
- color_picker->hide();
+ if (color_picker)
+ color_picker->hide();
texture_preview->hide();
inheritors_array.clear();
text_edit->hide();
@@ -596,6 +597,16 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
} break;
case Variant::COLOR: {
+ if (!color_picker) {
+ //late init for performance
+ color_picker = memnew( ColorPicker );
+ add_child(color_picker);
+ color_picker->hide();
+ color_picker->set_area_as_parent_rect();
+ for(int i=0;i<4;i++)
+ color_picker->set_margin((Margin)i,5);
+ color_picker->connect("color_changed",this,"_color_changed");
+ }
color_picker->show();
color_picker->set_edit_alpha(hint!=PROPERTY_HINT_COLOR_NO_ALPHA);
@@ -1757,13 +1768,9 @@ CustomPropertyEditor::CustomPropertyEditor() {
action_buttons[i]->connect("pressed", this,"_action_pressed",binds);
}
- color_picker = memnew( ColorPicker );
- add_child(color_picker);
- color_picker->hide();
- color_picker->set_area_as_parent_rect();
- for(int i=0;i<4;i++)
- color_picker->set_margin((Margin)i,5);
- color_picker->connect("color_changed",this,"_color_changed");
+ color_picker=NULL;
+
+
set_as_toplevel(true);
file = memnew ( EditorFileDialog );
diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp
index bc12ff23e5..f8ce121690 100644
--- a/tools/editor/scene_tree_editor.cpp
+++ b/tools/editor/scene_tree_editor.cpp
@@ -461,6 +461,9 @@ void SceneTreeEditor::_node_script_changed(Node *p_node) {
void SceneTreeEditor::_node_removed(Node *p_node) {
+ if (EditorNode::get_singleton()->is_exiting())
+ return; //speed up exit
+
if (p_node->is_connected("script_changed",this,"_node_script_changed"))
p_node->disconnect("script_changed",this,"_node_script_changed");
@@ -534,6 +537,8 @@ void SceneTreeEditor::_test_update_tree() {
void SceneTreeEditor::_tree_changed() {
+ if (EditorNode::get_singleton()->is_exiting())
+ return; //speed up exit
if (pending_test_update)
return;
if (tree_dirty)