mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-11 05:19:50 +01:00
Added a button that adds PaintCanvas to the PaintProjectToolsPropertyInspector.
This commit is contained in:
parent
617286dd27
commit
900605e2c9
@ -31,6 +31,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "core/os/dir_access.h"
|
#include "core/os/dir_access.h"
|
||||||
|
|
||||||
|
#include "../../nodes/paint_canvas.h"
|
||||||
#include "../../nodes/paint_node.h"
|
#include "../../nodes/paint_node.h"
|
||||||
#include "../../nodes/paint_project.h"
|
#include "../../nodes/paint_project.h"
|
||||||
|
|
||||||
@ -113,6 +114,7 @@ PaintProjectToolsPropertyInspector::PaintProjectToolsPropertyInspector() {
|
|||||||
add_action_button("_on_set_colors_as_default_pressed", "Set Colors as Default", "Theme", "EditorIcons");
|
add_action_button("_on_set_colors_as_default_pressed", "Set Colors as Default", "Theme", "EditorIcons");
|
||||||
add_action_button("_on_add_paint_visual_grid_pressed", "Add Paint Visual Grid", "PaintVisualGrid", "EditorIcons");
|
add_action_button("_on_add_paint_visual_grid_pressed", "Add Paint Visual Grid", "PaintVisualGrid", "EditorIcons");
|
||||||
add_action_button("_on_add_paint_canvas_background_pressed", "Add Paint Canvas Background", "PaintCanvasBackground", "EditorIcons");
|
add_action_button("_on_add_paint_canvas_background_pressed", "Add Paint Canvas Background", "PaintCanvasBackground", "EditorIcons");
|
||||||
|
add_action_button("_on_add_paint_canvas_pressed", "Add Paint Canvas Background", "PaintCanvas", "EditorIcons");
|
||||||
}
|
}
|
||||||
|
|
||||||
PaintProjectToolsPropertyInspector::~PaintProjectToolsPropertyInspector() {
|
PaintProjectToolsPropertyInspector::~PaintProjectToolsPropertyInspector() {
|
||||||
@ -187,6 +189,16 @@ void PaintProjectToolsPropertyInspector::_on_add_paint_canvas_background_pressed
|
|||||||
paint_project->add_paint_canvas_backgorund();
|
paint_project->add_paint_canvas_backgorund();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PaintProjectToolsPropertyInspector::_on_add_paint_canvas_pressed() {
|
||||||
|
PaintProject *paint_project = Object::cast_to<PaintProject>(ObjectDB::get_instance(_current_paint_project));
|
||||||
|
|
||||||
|
ERR_FAIL_COND(!paint_project);
|
||||||
|
|
||||||
|
PaintCanvas *canvas = memnew(PaintCanvas);
|
||||||
|
paint_project->add_child(canvas);
|
||||||
|
canvas->set_owner(paint_project->get_tree()->get_edited_scene_root());
|
||||||
|
}
|
||||||
|
|
||||||
//void PaintProjectToolsPropertyInspector::_notification(int p_what) {
|
//void PaintProjectToolsPropertyInspector::_notification(int p_what) {
|
||||||
//if (p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_ENTER_TREE) {
|
//if (p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_ENTER_TREE) {
|
||||||
//_add_color_button->set_icon(get_theme_icon("Add", "EditorIcons"));
|
//_add_color_button->set_icon(get_theme_icon("Add", "EditorIcons"));
|
||||||
@ -202,4 +214,5 @@ void PaintProjectToolsPropertyInspector::_bind_methods() {
|
|||||||
ClassDB::bind_method(D_METHOD("_on_set_colors_as_default_pressed"), &PaintProjectToolsPropertyInspector::_on_set_colors_as_default_pressed);
|
ClassDB::bind_method(D_METHOD("_on_set_colors_as_default_pressed"), &PaintProjectToolsPropertyInspector::_on_set_colors_as_default_pressed);
|
||||||
ClassDB::bind_method(D_METHOD("_on_add_paint_visual_grid_pressed"), &PaintProjectToolsPropertyInspector::_on_add_paint_visual_grid_pressed);
|
ClassDB::bind_method(D_METHOD("_on_add_paint_visual_grid_pressed"), &PaintProjectToolsPropertyInspector::_on_add_paint_visual_grid_pressed);
|
||||||
ClassDB::bind_method(D_METHOD("_on_add_paint_canvas_background_pressed"), &PaintProjectToolsPropertyInspector::_on_add_paint_canvas_background_pressed);
|
ClassDB::bind_method(D_METHOD("_on_add_paint_canvas_background_pressed"), &PaintProjectToolsPropertyInspector::_on_add_paint_canvas_background_pressed);
|
||||||
|
ClassDB::bind_method(D_METHOD("_on_add_paint_canvas_pressed"), &PaintProjectToolsPropertyInspector::_on_add_paint_canvas_pressed);
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,7 @@ protected:
|
|||||||
void _on_set_colors_as_default_pressed();
|
void _on_set_colors_as_default_pressed();
|
||||||
void _on_add_paint_visual_grid_pressed();
|
void _on_add_paint_visual_grid_pressed();
|
||||||
void _on_add_paint_canvas_background_pressed();
|
void _on_add_paint_canvas_background_pressed();
|
||||||
|
void _on_add_paint_canvas_pressed();
|
||||||
|
|
||||||
//void _notification(int p_what);
|
//void _notification(int p_what);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user