diff options
Diffstat (limited to 'editor/plugins/visual_shader_editor_plugin.h')
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/editor/plugins/visual_shader_editor_plugin.h b/editor/plugins/visual_shader_editor_plugin.h index 02beba971b..e26b606397 100644 --- a/editor/plugins/visual_shader_editor_plugin.h +++ b/editor/plugins/visual_shader_editor_plugin.h @@ -139,6 +139,8 @@ class VisualShaderEditor : public VBoxContainer { Ref<VisualShader> visual_shader; GraphEdit *graph = nullptr; Button *add_node = nullptr; + Button *varying_button = nullptr; + PopupMenu *varying_options = nullptr; Button *preview_shader = nullptr; OptionButton *edit_type = nullptr; @@ -169,6 +171,15 @@ class VisualShaderEditor : public VBoxContainer { PopupMenu *constants_submenu = nullptr; MenuButton *tools = nullptr; + ConfirmationDialog *add_varying_dialog = nullptr; + OptionButton *varying_type = nullptr; + LineEdit *varying_name = nullptr; + OptionButton *varying_mode = nullptr; + Label *varying_error_label = nullptr; + + ConfirmationDialog *remove_varying_dialog = nullptr; + Tree *varyings = nullptr; + PopupPanel *comment_title_change_popup = nullptr; LineEdit *comment_title_change_edit = nullptr; @@ -232,6 +243,11 @@ class VisualShaderEditor : public VBoxContainer { SET_COMMENT_DESCRIPTION, }; + enum class VaryingMenuOptions { + ADD, + REMOVE, + }; + Tree *members = nullptr; AcceptDialog *alert = nullptr; LineEdit *node_filter = nullptr; @@ -241,6 +257,11 @@ class VisualShaderEditor : public VBoxContainer { void _tools_menu_option(int p_idx); void _show_members_dialog(bool at_mouse_pos, VisualShaderNode::PortType p_input_port_type = VisualShaderNode::PORT_TYPE_MAX, VisualShaderNode::PortType p_output_port_type = VisualShaderNode::PORT_TYPE_MAX); + void _show_varying_menu(); + void _varying_menu_id_pressed(int p_idx); + void _show_add_varying_dialog(); + void _show_remove_varying_dialog(); + void _update_graph(); struct AddOption { @@ -291,6 +312,8 @@ class VisualShaderEditor : public VBoxContainer { void _setup_node(VisualShaderNode *p_node, const Vector<Variant> &p_ops); void _add_node(int p_idx, const Vector<Variant> &p_ops, String p_resource_path = "", int p_node_idx = -1); + void _add_varying(const String &p_name, VisualShader::VaryingMode p_mode, VisualShader::VaryingType p_type); + void _remove_varying(const String &p_name); void _update_options_menu(); void _set_mode(int p_which); @@ -394,6 +417,7 @@ class VisualShaderEditor : public VBoxContainer { void _input_select_item(Ref<VisualShaderNodeInput> input, String name); void _uniform_select_item(Ref<VisualShaderNodeUniformRef> p_uniform, String p_name); + void _varying_select_item(Ref<VisualShaderNodeVarying> p_varying, String p_name); void _float_constant_selected(int p_which); @@ -425,6 +449,13 @@ class VisualShaderEditor : public VBoxContainer { void _member_create(); void _member_cancel(); + void _varying_create(); + void _varying_name_changed(const String &p_text); + void _varying_deleted(); + void _varying_selected(); + void _varying_unselected(); + void _update_varying_tree(); + Vector2 menu_point; void _node_menu_id_pressed(int p_idx); @@ -436,6 +467,7 @@ class VisualShaderEditor : public VBoxContainer { void _update_created_node(GraphNode *node); void _update_uniforms(bool p_update_refs); void _update_uniform_refs(Set<String> &p_names); + void _update_varyings(); void _visibility_changed(); |