diff options
Diffstat (limited to 'editor/plugins/visual_shader_editor_plugin.h')
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/editor/plugins/visual_shader_editor_plugin.h b/editor/plugins/visual_shader_editor_plugin.h index 246e44a40d..ee2bf605d9 100644 --- a/editor/plugins/visual_shader_editor_plugin.h +++ b/editor/plugins/visual_shader_editor_plugin.h @@ -66,6 +66,34 @@ public: virtual Control *create_editor(const Ref<Resource> &p_parent_resource, const Ref<VisualShaderNode> &p_node); }; +class VSGraphNode : public GraphNode { + GDCLASS(VSGraphNode, GraphNode); + +protected: + void _draw_port(int p_slot_index, Point2i p_pos, bool p_left, const Color &p_color, const Color &p_rim_color); + virtual void draw_port(int p_slot_index, Point2i p_pos, bool p_left, const Color &p_color) override; +}; + +class VSRerouteNode : public VSGraphNode { + GDCLASS(VSRerouteNode, GraphNode); + + const float FADE_ANIMATION_LENGTH_SEC = 0.3; + + float icon_opacity = 0.0; + +protected: + void _notification(int p_what); + + virtual void draw_port(int p_slot_index, Point2i p_pos, bool p_left, const Color &p_color) override; + +public: + VSRerouteNode(); + void set_icon_opacity(float p_opacity); + + void _on_mouse_entered(); + void _on_mouse_exited(); +}; + class VisualShaderGraphPlugin : public RefCounted { GDCLASS(VisualShaderGraphPlugin, RefCounted); @@ -140,6 +168,7 @@ public: void set_frame_color_enabled(VisualShader::Type p_type, int p_node_id, bool p_enable); void set_frame_color(VisualShader::Type p_type, int p_node_id, const Color &p_color); void set_frame_autoshrink_enabled(VisualShader::Type p_type, int p_node_id, bool p_enable); + void update_reroute_nodes(); int get_constant_index(float p_constant) const; Ref<Script> get_node_script(int p_node_id) const; void update_theme(); @@ -297,6 +326,7 @@ class VisualShaderEditor : public VBoxContainer { enum ConnectionMenuOptions { INSERT_NEW_NODE, + INSERT_NEW_REROUTE, DISCONNECT, }; |