quick panel brushes slots

This commit is contained in:
2019-05-11 17:03:12 +02:00
parent 36fd575b96
commit 51dcc56dd6
3 changed files with 112 additions and 25 deletions

View File

@@ -9,6 +9,14 @@
class NodePanelQuick : public NodeBorder
{
public:
struct MiniState
{
int brush_index;
int color_index;
std::array<glm::vec4, 3> colors;
std::array<std::shared_ptr<Brush>, 3> brushes;
};
std::function<void(Node* target, glm::vec3 rgb)> on_color_change;
std::function<void(Node* target, float value)> on_flow_change;
std::function<void(Node* target, float value)> on_size_change;
@@ -16,23 +24,30 @@ public:
using this_class = NodePanelQuick;
using parent = NodeBorder;
NodeSliderV* m_slider_size;
NodeSliderV* m_slider_flow;
NodeButtonCustom* m_button_color1;
NodeButtonCustom* m_button_color2;
NodeButtonCustom* m_button_color3;
std::array<NodeButtonCustom*, 3> m_button_colors;
NodeButtonCustom* m_button_color_current;
NodeBorder* m_button_color_current_inner;
NodeButtonCustom* m_button_brush1;
NodeButtonCustom* m_button_brush2;
NodeButtonCustom* m_button_brush3;
std::array<NodeButtonCustom*, 3> m_button_brushes;
NodeButtonCustom* m_button_brush_current;
NodeStrokePreview* m_button_brush_current_preview;
std::shared_ptr<NodeColorPicker> 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);
int get_selected_color_index() const;
void set_selected_color_index(int idx);
MiniState get_state() const;
void set_state(const MiniState& state);
void reset_state();
private:
void init_controls();
NodeButtonCustom* init_button_brush(const std::string& name);