summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-09-20 18:46:20 +0200
committerGitHub <noreply@github.com>2018-09-20 18:46:20 +0200
commit46d8a2831410fca339516821d3fce66938d251d2 (patch)
tree88f0cd2dcf924a23e63bc9d2101e108ad7637ef7 /editor/plugins
parent14632cf88f379645525695ba406f0f9a86779253 (diff)
parentf5c7d644923c318a1020401df068cf072427ae45 (diff)
Merge pull request #22094 from elasota/fix-visual-shader
Fix VisualShader code overwrites and save failures
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/shader_editor_plugin.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp
index 51e58b712e..361271af89 100644
--- a/editor/plugins/shader_editor_plugin.cpp
+++ b/editor/plugins/shader_editor_plugin.cpp
@@ -426,7 +426,7 @@ void ShaderEditor::ensure_select_current() {
void ShaderEditor::edit(const Ref<Shader> &p_shader) {
- if (p_shader.is_null())
+ if (p_shader.is_null() || !p_shader->is_text_shader())
return;
shader = p_shader;
@@ -606,7 +606,7 @@ void ShaderEditorPlugin::edit(Object *p_object) {
bool ShaderEditorPlugin::handles(Object *p_object) const {
Shader *shader = Object::cast_to<Shader>(p_object);
- return shader != NULL;
+ return shader != NULL && shader->is_text_shader();
}
void ShaderEditorPlugin::make_visible(bool p_visible) {