#pragma once #include "node.h" #include "node_button_custom.h" #include "node_border.h" #include "node_dialog_picker.h" #include "brush.h" #include "node_stroke_preview.h" class NodePanelQuick : public NodeBorder { public: struct MiniState { int brush_index; int color_index; std::array colors; std::array, 3> brushes; }; std::function on_color_change; std::function on_flow_change; std::function on_size_change; std::function b)> on_brush_change; using this_class = NodePanelQuick; using parent = NodeBorder; NodeSliderV* m_slider_size; NodeSliderV* m_slider_flow; std::array m_button_colors; NodeButtonCustom* m_button_color_current; NodeBorder* m_button_color_current_inner; std::array m_button_brushes; NodeButtonCustom* m_button_brush_current; NodeStrokePreview* m_button_brush_current_preview; std::shared_ptr m_picker; virtual Node* clone_instantiate() const override; virtual void clone_finalize(Node* dest) const override; virtual void init() override; void set_color(glm::vec3 color); int get_selected_brush_index() const; void set_selected_brush_index(int idx, bool fire_event = false); int get_selected_color_index() const; void set_selected_color_index(int idx, bool fire_event = false); MiniState get_state() const; void set_state(const MiniState& state, bool fire_event = false); void reset_state(bool fire_events = false); private: void init_controls(); NodeButtonCustom* init_button_brush(const std::string& name); void handle_button_brush_click(Node* target); void handle_button_color_click(Node* target); };