| 1045 | } |
| 1046 | |
| 1047 | void ScriptEditor::_resave_scripts(const String &p_str) { |
| 1048 | apply_scripts(); |
| 1049 | |
| 1050 | for (int i = 0; i < tab_container->get_tab_count(); i++) { |
| 1051 | ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(tab_container->get_tab_control(i)); |
| 1052 | if (!se) { |
| 1053 | continue; |
| 1054 | } |
| 1055 | |
| 1056 | Ref<Resource> scr = se->get_edited_resource(); |
| 1057 | |
| 1058 | if (scr->is_built_in()) { |
| 1059 | continue; // Internal script, who cares. |
| 1060 | } |
| 1061 | |
| 1062 | if (trim_trailing_whitespace_on_save) { |
| 1063 | se->trim_trailing_whitespace(); |
| 1064 | } |
| 1065 | |
| 1066 | if (trim_final_newlines_on_save) { |
| 1067 | se->trim_final_newlines(); |
| 1068 | } |
| 1069 | |
| 1070 | if (convert_indent_on_save) { |
| 1071 | se->convert_indent(); |
| 1072 | } |
| 1073 | |
| 1074 | Ref<TextFile> text_file = scr; |
| 1075 | if (text_file.is_valid()) { |
| 1076 | se->apply_code(); |
| 1077 | _save_text_file(text_file, text_file->get_path()); |
| 1078 | break; |
| 1079 | } else { |
| 1080 | EditorNode::get_singleton()->save_resource(scr); |
| 1081 | } |
| 1082 | se->tag_saved_version(); |
| 1083 | } |
| 1084 | |
| 1085 | disk_changed->hide(); |
| 1086 | } |
| 1087 | |
| 1088 | void ScriptEditor::_res_saved_callback(const Ref<Resource> &p_res) { |
| 1089 | for (int i = 0; i < tab_container->get_tab_count(); i++) { |
nothing calls this directly
no test coverage detected