diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-04 16:43:43 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-04 16:43:43 +0200 |
commit | 4e66b0c8a7d2d6228d5093f9a6a5b2c9d04f739b (patch) | |
tree | 0593e7377e13c13a36b471b10fc63b51cf76c59b /editor | |
parent | e5aa5eb8067fada41ad8ecb5027a7917d6d5084c (diff) | |
parent | bedbb2e8935b3c0f1c108111213c9f053b189cb8 (diff) |
Merge pull request #66384 from schme/66165-fix-shader-list-not-marking-shaders-as-saved
Fix Shader Editor not marking files saved
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/shader_editor_plugin.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/text_shader_editor.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/text_shader_editor.h | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index de1a807721..456c28d887 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -264,6 +264,9 @@ void ShaderEditorPlugin::_menu_item_pressed(int p_index) { } else { EditorNode::get_singleton()->save_resource(edited_shaders[index].shader_inc); } + if (edited_shaders[index].shader_editor) { + edited_shaders[index].shader_editor->tag_saved_version(); + } } break; case FILE_SAVE_AS: { int index = shader_tabs->get_current_tab(); @@ -282,6 +285,9 @@ void ShaderEditorPlugin::_menu_item_pressed(int p_index) { } EditorNode::get_singleton()->save_resource_as(edited_shaders[index].shader_inc, path); } + if (edited_shaders[index].shader_editor) { + edited_shaders[index].shader_editor->tag_saved_version(); + } } break; case FILE_INSPECT: { int index = shader_tabs->get_current_tab(); diff --git a/editor/plugins/text_shader_editor.cpp b/editor/plugins/text_shader_editor.cpp index ef3f451079..5815bab806 100644 --- a/editor/plugins/text_shader_editor.cpp +++ b/editor/plugins/text_shader_editor.cpp @@ -917,6 +917,10 @@ bool TextShaderEditor::is_unsaved() const { return shader_editor->get_text_editor()->get_saved_version() != shader_editor->get_text_editor()->get_version(); } +void TextShaderEditor::tag_saved_version() { + shader_editor->get_text_editor()->tag_saved_version(); +} + void TextShaderEditor::apply_shaders() { String editor_code = shader_editor->get_text_editor()->get_text(); if (shader.is_valid()) { diff --git a/editor/plugins/text_shader_editor.h b/editor/plugins/text_shader_editor.h index abeaff1fff..c2094342ed 100644 --- a/editor/plugins/text_shader_editor.h +++ b/editor/plugins/text_shader_editor.h @@ -190,6 +190,7 @@ public: void save_external_data(const String &p_str = ""); void validate_script(); bool is_unsaved() const; + void tag_saved_version(); virtual Size2 get_minimum_size() const override { return Size2(0, 200); } |