From 68591bb15c51b0c0526118f8f693a556fc724fc7 Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 13 Apr 2022 23:45:16 +0200 Subject: [PATCH] Fix nonexistent signal error. --- .../editor/uv_editor/mdr_uv_rect_editor_popup.cpp | 8 +++++++- .../editor/uv_editor/mdr_uv_rect_editor_popup.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/mesh_data_resource/editor/uv_editor/mdr_uv_rect_editor_popup.cpp b/modules/mesh_data_resource/editor/uv_editor/mdr_uv_rect_editor_popup.cpp index 86acb9a72..022b13078 100644 --- a/modules/mesh_data_resource/editor/uv_editor/mdr_uv_rect_editor_popup.cpp +++ b/modules/mesh_data_resource/editor/uv_editor/mdr_uv_rect_editor_popup.cpp @@ -41,13 +41,19 @@ void MDRUVRectEditorPopup::set_plugin(MDIEdPlugin *plugin) { _editor->set_plugin(plugin); } +void MDRUVRectEditorPopup::_notification(int p_what) { + if (p_what == NOTIFICATION_POSTINITIALIZE) { + connect("confirmed", this, "on_ok_pressed"); + } +} + MDRUVRectEditorPopup::MDRUVRectEditorPopup() { _editor = memnew(MDRUVRectEditor); _editor->set_h_size_flags(SIZE_EXPAND_FILL); _editor->set_v_size_flags(SIZE_EXPAND_FILL); add_child(_editor); - connect("confirmed", this, "on_ok_pressed"); + get_cancel()->connect("pressed", this, "on_cancel_pressed"); set_size(Vector2(700, 500)); diff --git a/modules/mesh_data_resource/editor/uv_editor/mdr_uv_rect_editor_popup.h b/modules/mesh_data_resource/editor/uv_editor/mdr_uv_rect_editor_popup.h index a8c60f29c..5df8fbdef 100644 --- a/modules/mesh_data_resource/editor/uv_editor/mdr_uv_rect_editor_popup.h +++ b/modules/mesh_data_resource/editor/uv_editor/mdr_uv_rect_editor_popup.h @@ -43,6 +43,7 @@ public: ~MDRUVRectEditorPopup(); protected: + void _notification(int p_what); static void _bind_methods(); MDRUVRectEditor *_editor;