diff options
Diffstat (limited to 'scene/resources/visual_shader.h')
-rw-r--r-- | scene/resources/visual_shader.h | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/scene/resources/visual_shader.h b/scene/resources/visual_shader.h index f02ada7ee8..3ef6dcd4f9 100644 --- a/scene/resources/visual_shader.h +++ b/scene/resources/visual_shader.h @@ -226,6 +226,9 @@ public: // internal methods void connect_nodes_forced(Type p_type, int p_from_node, int p_from_port, int p_to_node, int p_to_port); bool is_port_types_compatible(int p_a, int p_b) const; + void attach_node_to_frame(Type p_type, int p_node, int p_frame); + void detach_node_from_frame(Type p_type, int p_node); + void rebuild(); void get_node_connections(Type p_type, List<Connection> *r_connections) const; @@ -287,6 +290,7 @@ public: private: int port_preview = -1; + int linked_parent_graph_frame = -1; HashMap<int, bool> connected_input_ports; HashMap<int, int> connected_output_ports; @@ -351,8 +355,11 @@ public: bool is_disabled() const; void set_disabled(bool p_disabled = true); - bool is_closable() const; - void set_closable(bool p_closable = true); + bool is_deletable() const; + void set_deletable(bool p_closable = true); + + void set_frame(int p_node); + int get_frame() const; virtual Vector<StringName> get_editable_properties() const; virtual HashMap<StringName, String> get_editable_properties_names() const; @@ -712,12 +719,15 @@ public: VisualShaderNodeResizableBase(); }; -class VisualShaderNodeComment : public VisualShaderNodeResizableBase { - GDCLASS(VisualShaderNodeComment, VisualShaderNodeResizableBase); +class VisualShaderNodeFrame : public VisualShaderNodeResizableBase { + GDCLASS(VisualShaderNodeFrame, VisualShaderNodeResizableBase); protected: - String title = "Comment"; - String description = ""; + String title = "Title"; + bool tint_color_enabled = false; + Color tint_color = Color(0.3, 0.3, 0.3, 0.75); + bool autoshrink = true; + HashSet<int> attached_nodes; protected: static void _bind_methods(); @@ -738,12 +748,23 @@ public: void set_title(const String &p_title); String get_title() const; - void set_description(const String &p_description); - String get_description() const; + void set_tint_color_enabled(bool p_enable); + bool is_tint_color_enabled() const; - virtual Category get_category() const override { return CATEGORY_SPECIAL; } + void set_tint_color(const Color &p_color); + Color get_tint_color() const; + + void set_autoshrink_enabled(bool p_enable); + bool is_autoshrink_enabled() const; + + void add_attached_node(int p_node); + void remove_attached_node(int p_node); + void set_attached_nodes(const PackedInt32Array &p_nodes); + PackedInt32Array get_attached_nodes() const; + + virtual Category get_category() const override { return CATEGORY_NONE; } - VisualShaderNodeComment(); + VisualShaderNodeFrame(); }; class VisualShaderNodeGroupBase : public VisualShaderNodeResizableBase { |