Now the paint plugin handles paint nodes.

This commit is contained in:
Relintai 2022-11-15 22:11:49 +01:00
parent e044b007f6
commit ff701c35ad
2 changed files with 28 additions and 1 deletions

View File

@ -29,6 +29,8 @@ SOFTWARE.
#include "ui/paint_sidebar.h" #include "ui/paint_sidebar.h"
#include "ui/sidebar_modules/paint_color_grid.h" #include "ui/sidebar_modules/paint_color_grid.h"
#include "nodes/paint_node.h"
PaintSidebar *PaintEditorPlugin::get_sidebar() { PaintSidebar *PaintEditorPlugin::get_sidebar() {
return _sidebar; return _sidebar;
} }
@ -41,6 +43,24 @@ String PaintEditorPlugin::get_name() const {
return "Paint"; return "Paint";
} }
void PaintEditorPlugin::edit(Object *p_object) {
_sidebar->on_paint_node_selected(Object::cast_to<PaintNode>(p_object));
//make_visible(true);
}
bool PaintEditorPlugin::handles(Object *p_object) const {
return p_object->is_class("PaintNode");
}
void PaintEditorPlugin::edited_scene_changed() {
}
bool PaintEditorPlugin::forward_canvas_gui_input(const Ref<InputEvent> &p_event) {
return false;
}
void PaintEditorPlugin::forward_canvas_draw_over_viewport(Control *p_overlay) {
}
void PaintEditorPlugin::forward_canvas_force_draw_over_viewport(Control *p_overlay) {
}
PaintEditorPlugin::PaintEditorPlugin(EditorNode *p_node) { PaintEditorPlugin::PaintEditorPlugin(EditorNode *p_node) {
editor = p_node; editor = p_node;

View File

@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#include "editor/editor_plugin.h"
#include "core/object/reference.h" #include "core/object/reference.h"
#include "editor/editor_plugin.h"
class PaintWindow; class PaintWindow;
class Texture; class Texture;
@ -39,6 +39,13 @@ public:
void make_visible(const bool visible); void make_visible(const bool visible);
String get_name() const; String get_name() const;
void edit(Object *p_object);
bool handles(Object *p_object) const;
void edited_scene_changed();
bool forward_canvas_gui_input(const Ref<InputEvent> &p_event);
void forward_canvas_draw_over_viewport(Control *p_overlay);
void forward_canvas_force_draw_over_viewport(Control *p_overlay);
PaintEditorPlugin(EditorNode *p_node); PaintEditorPlugin(EditorNode *p_node);
~PaintEditorPlugin(); ~PaintEditorPlugin();