-only save scripts if changed, takes less time to run projects and does not confuse you with changed dates.

This commit is contained in:
Juan Linietsky 2016-02-02 21:10:52 -03:00
parent ff2cb6360d
commit f026838cbc
2 changed files with 12 additions and 7 deletions

View file

@ -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: {
@ -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() {

View file

@ -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);