summaryrefslogtreecommitdiff
path: root/tools/editor/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/plugins')
-rw-r--r--tools/editor/plugins/animation_player_editor_plugin.cpp9
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp19
-rw-r--r--tools/editor/plugins/script_editor_plugin.h2
3 files changed, 14 insertions, 16 deletions
diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp
index 43b4276d45..32afd86970 100644
--- a/tools/editor/plugins/animation_player_editor_plugin.cpp
+++ b/tools/editor/plugins/animation_player_editor_plugin.cpp
@@ -128,16 +128,9 @@ void AnimationPlayerEditor::_notification(int p_what) {
anim_editor_load->set_hover_texture( get_icon("AnimGetHl","EditorIcons"));
anim_editor_store->set_hover_texture( get_icon("AnimSetHl","EditorIcons"));
*/
- }
-
- if (p_what==NOTIFICATION_READY) {
get_tree()->connect("node_removed",this,"_node_removed");
}
-
- if (p_what==NOTIFICATION_DRAW) {
-
- }
}
void AnimationPlayerEditor::_autoplay_pressed() {
@@ -1305,7 +1298,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) {
frame = memnew( SpinBox );
hb->add_child(frame);
- frame->set_custom_minimum_size(Size2(80,0));
+ frame->set_custom_minimum_size(Size2(60,0));
frame->set_stretch_ratio(2);
frame->set_tooltip("Animation position (in seconds).");
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index 34d7e89760..5b1dd37a61 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -935,6 +935,9 @@ void ScriptEditor::_menu_option(int p_option) {
if (!_test_script_times_on_disk())
return;
+ save_all_scripts();
+
+#if 0
for(int i=0;i<tab_container->get_child_count();i++) {
ScriptTextEditor *ste = tab_container->get_child(i)->cast_to<ScriptTextEditor>();
@@ -951,7 +954,7 @@ void ScriptEditor::_menu_option(int p_option) {
editor->save_resource( script );
}
-
+#endif
} break;
case SEARCH_HELP: {
@@ -1694,7 +1697,7 @@ void ScriptEditor::ensure_select_current() {
Ref<Script> script = ste->get_edited_script();
- if (!grab_focus_block && is_inside_tree())
+ if (!grab_focus_block && is_visible())
ste->get_text_edit()->grab_focus();
edit_menu->show();
@@ -1938,9 +1941,7 @@ void ScriptEditor::edit(const Ref<Script>& p_script) {
}
}
-void ScriptEditor::save_external_data() {
-
- apply_scripts();
+void ScriptEditor::save_all_scripts() {
for(int i=0;i<tab_container->get_child_count();i++) {
@@ -1949,9 +1950,13 @@ void ScriptEditor::save_external_data() {
if (!ste)
continue;
+ if (ste->get_text_edit()->get_version()==ste->get_text_edit()->get_saved_version())
+ continue;
+
Ref<Script> script = ste->get_edited_script();
if (script->get_path()!="" && script->get_path().find("local://")==-1 &&script->get_path().find("::")==-1) {
//external script, save it
+ ste->apply_code();
editor->save_resource(script);
//ResourceSaver::save(script->get_path(),script);
}
@@ -2063,7 +2068,7 @@ void ScriptEditor::_editor_settings_changed() {
void ScriptEditor::_autosave_scripts() {
print_line("autosaving");
- save_external_data();
+ save_all_scripts();
}
void ScriptEditor::_tree_changed() {
@@ -2628,7 +2633,7 @@ void ScriptEditorPlugin::clear() {
void ScriptEditorPlugin::save_external_data() {
- script_editor->save_external_data();
+ script_editor->save_all_scripts();
}
void ScriptEditorPlugin::apply_changes() {
diff --git a/tools/editor/plugins/script_editor_plugin.h b/tools/editor/plugins/script_editor_plugin.h
index c52da41a43..5664b26580 100644
--- a/tools/editor/plugins/script_editor_plugin.h
+++ b/tools/editor/plugins/script_editor_plugin.h
@@ -295,7 +295,7 @@ public:
void swap_lines(TextEdit *tx, int line1, int line2);
- void save_external_data();
+ void save_all_scripts();
void set_window_layout(Ref<ConfigFile> p_layout);
void get_window_layout(Ref<ConfigFile> p_layout);