mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-27 14:17:37 +01:00
Implement the uv editor popup.
This commit is contained in:
parent
f930ee6063
commit
cd3366f6c4
@ -22,30 +22,31 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "mdr_uv_rect_editor_popup.h"
|
#include "mdr_uv_rect_editor_popup.h"
|
||||||
|
|
||||||
|
#include "mdr_uv_rect_editor.h"
|
||||||
|
#include "scene/gui/button.h"
|
||||||
|
|
||||||
void MDRUVRectEditorPopup::on_ok_pressed() {
|
void MDRUVRectEditorPopup::on_ok_pressed() {
|
||||||
//$UVEditor.ok_pressed()
|
_editor->ok_pressed();
|
||||||
}
|
}
|
||||||
void MDRUVRectEditorPopup::on_cancel_pressed() {
|
void MDRUVRectEditorPopup::on_cancel_pressed() {
|
||||||
//$UVEditor.cancel_pressed()
|
_editor->cancel_pressed();
|
||||||
}
|
|
||||||
|
|
||||||
void MDRUVRectEditorPopup::_notification(int p_what) {
|
|
||||||
/*
|
|
||||||
func _enter_tree():
|
|
||||||
if !is_connected("confirmed", self, "on_ok_pressed"):
|
|
||||||
connect("confirmed", self, "on_ok_pressed")
|
|
||||||
|
|
||||||
if !get_cancel().is_connected("pressed", self, "on_cancel_pressed"):
|
|
||||||
get_cancel().connect("pressed", self, "on_cancel_pressed")
|
|
||||||
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MDRUVRectEditorPopup::MDRUVRectEditorPopup() {
|
MDRUVRectEditorPopup::MDRUVRectEditorPopup() {
|
||||||
|
_editor = memnew(MDRUVRectEditor);
|
||||||
|
|
||||||
|
add_child(_editor);
|
||||||
|
|
||||||
|
connect("confirmed", this, "on_ok_pressed");
|
||||||
|
get_cancel()->connect("pressed", this, "on_cancel_pressed");
|
||||||
|
|
||||||
|
set_size(Vector2(700, 500));
|
||||||
}
|
}
|
||||||
|
|
||||||
MDRUVRectEditorPopup::~MDRUVRectEditorPopup() {
|
MDRUVRectEditorPopup::~MDRUVRectEditorPopup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MDRUVRectEditorPopup::_bind_methods() {
|
void MDRUVRectEditorPopup::_bind_methods() {
|
||||||
|
ClassDB::bind_method(D_METHOD("on_ok_pressed"), &MDRUVRectEditorPopup::on_ok_pressed);
|
||||||
|
ClassDB::bind_method(D_METHOD("on_cancel_pressed"), &MDRUVRectEditorPopup::on_cancel_pressed);
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,8 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "scene/gui/dialogs.h"
|
#include "scene/gui/dialogs.h"
|
||||||
|
|
||||||
|
class MDRUVRectEditor;
|
||||||
|
|
||||||
class MDRUVRectEditorPopup : public ConfirmationDialog {
|
class MDRUVRectEditorPopup : public ConfirmationDialog {
|
||||||
GDCLASS(MDRUVRectEditorPopup, ConfirmationDialog);
|
GDCLASS(MDRUVRectEditorPopup, ConfirmationDialog);
|
||||||
|
|
||||||
@ -32,12 +34,15 @@ public:
|
|||||||
void on_ok_pressed();
|
void on_ok_pressed();
|
||||||
void on_cancel_pressed();
|
void on_cancel_pressed();
|
||||||
|
|
||||||
|
MDRUVRectEditor *get_editor();
|
||||||
|
|
||||||
MDRUVRectEditorPopup();
|
MDRUVRectEditorPopup();
|
||||||
~MDRUVRectEditorPopup();
|
~MDRUVRectEditorPopup();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void _notification(int p_what);
|
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|
||||||
|
MDRUVRectEditor *_editor;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user