implement add and remove custom brushes
This commit is contained in:
@@ -4,16 +4,17 @@
|
||||
#include "node_image.h"
|
||||
#include "node_stroke_preview.h"
|
||||
#include "brush.h"
|
||||
#include "node_scroll.h"
|
||||
|
||||
class NodeButtonBrush : public NodeButtonCustom
|
||||
{
|
||||
public:
|
||||
int m_brushID;
|
||||
//int m_brushID;
|
||||
bool m_selected = false;
|
||||
std::string brush_name;
|
||||
std::string high_path;
|
||||
std::string thumb_path;
|
||||
uint16_t high_id;
|
||||
//uint16_t high_id;
|
||||
NodeImage* img;
|
||||
virtual Node* clone_instantiate() const override;
|
||||
virtual void init() override;
|
||||
@@ -23,11 +24,15 @@ public:
|
||||
|
||||
class NodePanelBrush : public Node
|
||||
{
|
||||
std::vector<NodeButtonBrush*> m_brushes;
|
||||
//std::vector<NodeButtonBrush*> m_brushes;
|
||||
NodeButtonBrush* m_current = nullptr;
|
||||
Node* m_container;
|
||||
NodeScroll* m_container;
|
||||
NodeButtonCustom* m_btn_add;
|
||||
NodeButtonCustom* m_btn_up;
|
||||
NodeButtonCustom* m_btn_down;
|
||||
NodeButtonCustom* m_btn_remove;
|
||||
public:
|
||||
std::function<void(Node* target, int id)> on_brush_changed;
|
||||
std::function<void(Node* target, int index)> on_brush_changed;
|
||||
std::function<void(Node* target)> on_popup_close;
|
||||
virtual Node* clone_instantiate() const override;
|
||||
virtual void init() override;
|
||||
@@ -36,7 +41,7 @@ public:
|
||||
int find_brush(const std::string& name) const;
|
||||
std::string get_texture_path(int index) const;
|
||||
std::string get_thumb_path(int index) const;
|
||||
void select_brush(int brush_id);
|
||||
//void select_brush(int brush_id);
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user