diff --git a/modules/material_maker/editor/widgets/polygon_edit/polygon_edit.cpp b/modules/material_maker/editor/widgets/polygon_edit/polygon_edit.cpp index 93db9ed6a..9a60adbcb 100644 --- a/modules/material_maker/editor/widgets/polygon_edit/polygon_edit.cpp +++ b/modules/material_maker/editor/widgets/polygon_edit/polygon_edit.cpp @@ -55,6 +55,12 @@ PolygonEdit::PolygonEdit() { PolygonEdit::~PolygonEdit() { } +void PolygonEdit::_notification(int p_what) { + if (p_what == NOTIFICATION_POSTINITIALIZE) { + connect("pressed", this, "_on_PolygonEdit_pressed"); + } +} + void PolygonEdit::_bind_methods() { ADD_SIGNAL(MethodInfo("updated", PropertyInfo(Variant::OBJECT, "polygon", PROPERTY_HINT_RESOURCE_TYPE, "PolygonBase"))); diff --git a/modules/material_maker/editor/widgets/polygon_edit/polygon_edit.h b/modules/material_maker/editor/widgets/polygon_edit/polygon_edit.h index 1bc63526b..f4e573f65 100644 --- a/modules/material_maker/editor/widgets/polygon_edit/polygon_edit.h +++ b/modules/material_maker/editor/widgets/polygon_edit/polygon_edit.h @@ -3,13 +3,13 @@ #include "core/reference.h" -#include "scene/gui/control.h" +#include "scene/gui/button.h" class PolygonBase; class PolygonView; -class PolygonEdit : public Control { - GDCLASS(PolygonEdit, Control); +class PolygonEdit : public Button { + GDCLASS(PolygonEdit, Button); public: bool get_closed() const; @@ -25,6 +25,8 @@ public: ~PolygonEdit(); protected: + void _notification(int p_what); + static void _bind_methods(); bool closed;