From de097b93273944309054596c4183814b3ff39e88 Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Sun, 6 Sep 2020 12:09:15 +0300 Subject: [PATCH] Removes redundant code & fix documentation for VisualShaderNodeCustom --- doc/classes/VisualShaderNodeCustom.xml | 4 ++-- .../plugins/visual_shader_editor_plugin.cpp | 20 ------------------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/doc/classes/VisualShaderNodeCustom.xml b/doc/classes/VisualShaderNodeCustom.xml index 3be9b803e9c..59b501660a7 100644 --- a/doc/classes/VisualShaderNodeCustom.xml +++ b/doc/classes/VisualShaderNodeCustom.xml @@ -5,9 +5,9 @@ By inheriting this class you can create a custom [VisualShader] script addon which will be automatically added to the Visual Shader Editor. The [VisualShaderNode]'s behavior is defined by overriding the provided virtual methods. - In order for the node to be registered as an editor addon, you must use the [code]tool[/code] keyword and provide a [code]class_name[/code] for your custom script. For example: + In order for the node to be registered as an editor addon, you must use the [code]@tool[/code] annotation and provide a [code]class_name[/code] for your custom script. For example: [codeblock] - tool + @tool extends VisualShaderNodeCustom class_name VisualShaderNodeNoise [/codeblock] diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index f2354dc69f6..30ae3dd4bbf 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -183,26 +183,6 @@ bool VisualShaderEditor::_is_available(int p_mode) { default: break; } - - int temp_mode = 0; - - if (p_mode & TYPE_FLAGS_VERTEX) { - temp_mode |= 1; - } - - if (p_mode & TYPE_FLAGS_FRAGMENT) { - temp_mode |= 2; - } - - if (p_mode & TYPE_FLAGS_LIGHT) { - temp_mode |= 4; - } - - if (p_mode & TYPE_FLAGS_COMPUTE) { - temp_mode |= 8; - } - - p_mode = temp_mode; } return (p_mode == -1 || (p_mode & current_mode) != 0);