mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-02-03 14:45:57 +01:00
Cleaned up PolygonDialog.
This commit is contained in:
parent
665f8be21f
commit
5eafb2fcd5
@ -1,122 +1,100 @@
|
|||||||
|
|
||||||
#include "polygon_dialog.h"
|
#include "polygon_dialog.h"
|
||||||
|
|
||||||
|
#include "../../../nodes/bases/polygon_base.h"
|
||||||
|
|
||||||
|
#include "polygon_editor.h"
|
||||||
|
|
||||||
bool PolygonDialog::get_closed() const {
|
bool PolygonDialog::get_closed() const {
|
||||||
return closed;
|
return closed;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PolygonDialog::set_closed(const bool val) {
|
void PolygonDialog::set_closed(const bool c) {
|
||||||
closed = val;
|
closed = c;
|
||||||
}
|
if (closed) {
|
||||||
|
set_title("Edit polygon");
|
||||||
|
} else {
|
||||||
|
set_title("Edit polyline");
|
||||||
|
}
|
||||||
|
|
||||||
|
_polygon_editor->set_closed(closed);
|
||||||
|
}
|
||||||
|
|
||||||
PoolVector2Array PolygonDialog::get_previous_points() {
|
PoolVector2Array PolygonDialog::get_previous_points() {
|
||||||
return previous_points;
|
return previous_points;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PolygonDialog::set_previous_points(const PoolVector2Array &val) {
|
void PolygonDialog::set_previous_points(const PoolVector2Array &val) {
|
||||||
previous_points = val;
|
previous_points = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ref<PolygonBase> PolygonDialog::get_polygon() {
|
||||||
Variant PolygonDialog::get_Variant() {
|
return polygon;
|
||||||
return Variant;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PolygonDialog::set_Variant(const Variant &val) {
|
void PolygonDialog::set_polygon(const Ref<PolygonBase> &val) {
|
||||||
Variant = val;
|
edit_polygon(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PolygonDialog::edit_polygon(const Ref<PolygonBase> &poly) {
|
||||||
|
polygon = poly;
|
||||||
//tool;
|
previous_points = polygon->get_points();
|
||||||
//export ;
|
_polygon_editor->set_polygon(polygon);
|
||||||
// setget set_closed;
|
popup_centered();
|
||||||
bool closed = true;
|
//var result = yield(self, "return_polygon");
|
||||||
PoolVector2Array previous_points = ;
|
//queue_free();
|
||||||
Variant ;
|
//return result;
|
||||||
signal polygon_changed(polygon);
|
|
||||||
|
|
||||||
void PolygonDialog::set_closed(const bool c) {
|
|
||||||
closed = c;
|
|
||||||
window_title = "Edit polygon" if closed else "Edit polyline";
|
|
||||||
$VBoxContainer/EditorContainer/PolygonEditor.set_closed(closed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PolygonDialog::_on_CurveDialog_popup_hide() {
|
||||||
void PolygonDialog::_on_CurveDialog_popup_hide() {
|
// emit_signal("return_polygon", null);
|
||||||
// emit_signal("return_polygon", null);
|
queue_delete();
|
||||||
queue_free();
|
|
||||||
pass;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PolygonDialog::_on_OK_pressed() {
|
||||||
void PolygonDialog::_on_OK_pressed() {
|
emit_signal("polygon_changed", polygon);
|
||||||
emit_signal("polygon_changed", polygon);
|
polygon->polygon_changed();
|
||||||
polygon.polygon_changed();
|
queue_delete();
|
||||||
queue_free();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PolygonDialog::_on_Cancel_pressed() {
|
||||||
void PolygonDialog::_on_Cancel_pressed() {
|
polygon->set_points(previous_points);
|
||||||
polygon.set_points(previous_points);
|
emit_signal("polygon_changed", polygon);
|
||||||
emit_signal("polygon_changed", polygon);
|
queue_delete();
|
||||||
queue_free();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PolygonDialog::_on_PolygonEditor_value_changed(const Variant &value) {
|
||||||
void PolygonDialog::edit_polygon(const Variant &poly) {
|
emit_signal("polygon_changed", value);
|
||||||
polygon = poly;
|
|
||||||
previous_points = polygon.points;
|
|
||||||
$VBoxContainer/EditorContainer/PolygonEditor.set_polygon(polygon);
|
|
||||||
popup_centered();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//var result = yield(self, "return_polygon");
|
PolygonDialog::PolygonDialog() {
|
||||||
//queue_free();
|
closed = true;
|
||||||
//return result;
|
|
||||||
|
|
||||||
void PolygonDialog::_on_PolygonEditor_value_changed(const Variant &value) {
|
set_title("Edit polygon");
|
||||||
emit_signal("polygon_changed", value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PolygonDialog::~PolygonDialog() {
|
||||||
}
|
}
|
||||||
|
|
||||||
PolygonDialog::PolygonDialog() {
|
void PolygonDialog::_bind_methods() {
|
||||||
closed = true;
|
ADD_SIGNAL(MethodInfo("polygon_changed", PropertyInfo(Variant::OBJECT, "polygon", PROPERTY_HINT_RESOURCE_TYPE, "PolygonBase")));
|
||||||
previous_points = ;
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
PolygonDialog::~PolygonDialog() {
|
ClassDB::bind_method(D_METHOD("get_closed"), &PolygonDialog::get_closed);
|
||||||
}
|
ClassDB::bind_method(D_METHOD("set_closed", "c"), &PolygonDialog::set_closed, true);
|
||||||
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "closed"), "set_closed", "get_closed");
|
||||||
|
|
||||||
|
ClassDB::bind_method(D_METHOD("get_previous_points"), &PolygonDialog::get_previous_points);
|
||||||
|
ClassDB::bind_method(D_METHOD("set_previous_points", "value"), &PolygonDialog::set_previous_points);
|
||||||
|
ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR2_ARRAY, "previous_points"), "set_previous_points", "get_previous_points");
|
||||||
|
|
||||||
static void PolygonDialog::_bind_methods() {
|
ClassDB::bind_method(D_METHOD("get_polygon"), &PolygonDialog::get_polygon);
|
||||||
ClassDB::bind_method(D_METHOD("get_closed"), &PolygonDialog::get_closed);
|
ClassDB::bind_method(D_METHOD("set_polygon", "value"), &PolygonDialog::set_polygon);
|
||||||
ClassDB::bind_method(D_METHOD("set_closed", "value"), &PolygonDialog::set_closed);
|
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "polygon", PROPERTY_HINT_RESOURCE_TYPE, "PolygonBase"), "set_polygon", "get_polygon");
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "closed"), "set_closed", "get_closed");
|
|
||||||
|
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_previous_points"), &PolygonDialog::get_previous_points);
|
|
||||||
ClassDB::bind_method(D_METHOD("set_previous_points", "value"), &PolygonDialog::set_previous_points);
|
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR2_ARRAY, "previous_points"), "set_previous_points", "get_previous_points");
|
|
||||||
|
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_Variant"), &PolygonDialog::get_Variant);
|
|
||||||
ClassDB::bind_method(D_METHOD("set_Variant", "value"), &PolygonDialog::set_Variant);
|
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "Variant", PROPERTY_HINT_RESOURCE_TYPE, "Variant"), "set_Variant", "get_Variant");
|
|
||||||
|
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("set_closed", "c"), &PolygonDialog::set_closed, true);
|
|
||||||
ClassDB::bind_method(D_METHOD("_on_CurveDialog_popup_hide"), &PolygonDialog::_on_CurveDialog_popup_hide);
|
|
||||||
ClassDB::bind_method(D_METHOD("_on_OK_pressed"), &PolygonDialog::_on_OK_pressed);
|
|
||||||
ClassDB::bind_method(D_METHOD("_on_Cancel_pressed"), &PolygonDialog::_on_Cancel_pressed);
|
|
||||||
ClassDB::bind_method(D_METHOD("edit_polygon", "poly"), &PolygonDialog::edit_polygon);
|
|
||||||
ClassDB::bind_method(D_METHOD("_on_PolygonEditor_value_changed", "value"), &PolygonDialog::_on_PolygonEditor_value_changed);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
ClassDB::bind_method(D_METHOD("edit_polygon", "poly"), &PolygonDialog::edit_polygon);
|
||||||
|
|
||||||
|
ClassDB::bind_method(D_METHOD("_on_CurveDialog_popup_hide"), &PolygonDialog::_on_CurveDialog_popup_hide);
|
||||||
|
ClassDB::bind_method(D_METHOD("_on_OK_pressed"), &PolygonDialog::_on_OK_pressed);
|
||||||
|
ClassDB::bind_method(D_METHOD("_on_Cancel_pressed"), &PolygonDialog::_on_Cancel_pressed);
|
||||||
|
ClassDB::bind_method(D_METHOD("_on_PolygonEditor_value_changed", "value"), &PolygonDialog::_on_PolygonEditor_value_changed);
|
||||||
|
}
|
||||||
|
@ -1,325 +0,0 @@
|
|||||||
|
|
||||||
void construct() {
|
|
||||||
|
|
||||||
//Script: res://addons/mat_maker_gd/widgets/polygon_edit/polygon_dialog.gd
|
|
||||||
WindowDialog *polygondialog = memnew(WindowDialog);
|
|
||||||
polygondialog->set_name("PolygonDialog");
|
|
||||||
|
|
||||||
polygondialog->set_name("PolygonDialog");
|
|
||||||
//polygondialog->set("name", PolygonDialog));
|
|
||||||
|
|
||||||
polygondialog->set_filename("res://addons/mat_maker_gd/widgets/polygon_edit/polygon_dialog.tscn");
|
|
||||||
//polygondialog->set("filename", "res://addons/mat_maker_gd/widgets/polygon_edit/polygon_dialog.tscn");
|
|
||||||
|
|
||||||
polygondialog->set_anchor_right(1);
|
|
||||||
//polygondialog->set("anchor_right", 1);
|
|
||||||
|
|
||||||
polygondialog->set_anchor_bottom(1);
|
|
||||||
//polygondialog->set("anchor_bottom", 1);
|
|
||||||
|
|
||||||
polygondialog->set_margin_left(307);
|
|
||||||
//polygondialog->set("margin_left", 307);
|
|
||||||
|
|
||||||
polygondialog->set_margin_top(151);
|
|
||||||
//polygondialog->set("margin_top", 151);
|
|
||||||
|
|
||||||
polygondialog->set_margin_right(-508);
|
|
||||||
//polygondialog->set("margin_right", -508);
|
|
||||||
|
|
||||||
polygondialog->set_margin_bottom(-70);
|
|
||||||
//polygondialog->set("margin_bottom", -70);
|
|
||||||
|
|
||||||
polygondialog->set_rect_position(Vector2(307, 151));
|
|
||||||
//polygondialog->set("rect_position", Vector2(307, 151));
|
|
||||||
|
|
||||||
polygondialog->set_rect_global_position(Vector2(307, 151));
|
|
||||||
//polygondialog->set("rect_global_position", Vector2(307, 151));
|
|
||||||
|
|
||||||
polygondialog->set_rect_size(Vector2(0, 1));
|
|
||||||
//polygondialog->set("rect_size", Vector2(0, 1));
|
|
||||||
|
|
||||||
polygondialog->set_window_title("Edit polygon");
|
|
||||||
//polygondialog->set("window_title", "Edit polygon");
|
|
||||||
|
|
||||||
//polygondialog property __meta__ TYPE_DICTIONARY value: {_edit_use_anchors_:False}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TextureButton *texturebutton_polygondialog = memnew(TextureButton);
|
|
||||||
texturebutton_polygondialog->set_name("TextureButton");
|
|
||||||
polygondialog->add_child(texturebutton_polygondialog);
|
|
||||||
|
|
||||||
texturebutton_polygondialog->set_name("TextureButton");
|
|
||||||
//texturebutton_polygondialog->set("name", TextureButton));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
VBoxContainer *vboxcontainer_polygondialog = memnew(VBoxContainer);
|
|
||||||
vboxcontainer_polygondialog->set_name("VBoxContainer");
|
|
||||||
polygondialog->add_child(vboxcontainer_polygondialog);
|
|
||||||
|
|
||||||
vboxcontainer_polygondialog->set_name("VBoxContainer");
|
|
||||||
//vboxcontainer_polygondialog->set("name", VBoxContainer));
|
|
||||||
|
|
||||||
//vboxcontainer_polygondialog property owner TYPE_OBJECT value: PolygonDialog:[WindowDialog:42399]
|
|
||||||
|
|
||||||
vboxcontainer_polygondialog->set_anchor_right(1);
|
|
||||||
//vboxcontainer_polygondialog->set("anchor_right", 1);
|
|
||||||
|
|
||||||
vboxcontainer_polygondialog->set_anchor_bottom(1);
|
|
||||||
//vboxcontainer_polygondialog->set("anchor_bottom", 1);
|
|
||||||
|
|
||||||
vboxcontainer_polygondialog->set_margin_left(5);
|
|
||||||
//vboxcontainer_polygondialog->set("margin_left", 5);
|
|
||||||
|
|
||||||
vboxcontainer_polygondialog->set_margin_top(5);
|
|
||||||
//vboxcontainer_polygondialog->set("margin_top", 5);
|
|
||||||
|
|
||||||
vboxcontainer_polygondialog->set_margin_right(-5);
|
|
||||||
//vboxcontainer_polygondialog->set("margin_right", -5);
|
|
||||||
|
|
||||||
vboxcontainer_polygondialog->set_margin_bottom(-5);
|
|
||||||
//vboxcontainer_polygondialog->set("margin_bottom", -5);
|
|
||||||
|
|
||||||
vboxcontainer_polygondialog->set_rect_position(Vector2(5, 5));
|
|
||||||
//vboxcontainer_polygondialog->set("rect_position", Vector2(5, 5));
|
|
||||||
|
|
||||||
vboxcontainer_polygondialog->set_rect_global_position(Vector2(5, 5));
|
|
||||||
//vboxcontainer_polygondialog->set("rect_global_position", Vector2(5, 5));
|
|
||||||
|
|
||||||
//vboxcontainer_polygondialog property __meta__ TYPE_DICTIONARY value: {_edit_use_anchors_:False}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MarginContainer *editorcontainer_vboxcontainer_polygondialog = memnew(MarginContainer);
|
|
||||||
editorcontainer_vboxcontainer_polygondialog->set_name("EditorContainer");
|
|
||||||
vboxcontainer_polygondialog->add_child(editorcontainer_vboxcontainer_polygondialog);
|
|
||||||
|
|
||||||
editorcontainer_vboxcontainer_polygondialog->set_name("EditorContainer");
|
|
||||||
//editorcontainer_vboxcontainer_polygondialog->set("name", EditorContainer));
|
|
||||||
|
|
||||||
//editorcontainer_vboxcontainer_polygondialog property owner TYPE_OBJECT value: PolygonDialog:[WindowDialog:42399]
|
|
||||||
|
|
||||||
editorcontainer_vboxcontainer_polygondialog->set_margin_right(455);
|
|
||||||
//editorcontainer_vboxcontainer_polygondialog->set("margin_right", 455);
|
|
||||||
|
|
||||||
editorcontainer_vboxcontainer_polygondialog->set_margin_bottom(457);
|
|
||||||
//editorcontainer_vboxcontainer_polygondialog->set("margin_bottom", 457);
|
|
||||||
|
|
||||||
editorcontainer_vboxcontainer_polygondialog->set_rect_size(Vector2(455, 457));
|
|
||||||
//editorcontainer_vboxcontainer_polygondialog->set("rect_size", Vector2(455, 457));
|
|
||||||
|
|
||||||
editorcontainer_vboxcontainer_polygondialog->set_rect_clip_content(True);
|
|
||||||
//editorcontainer_vboxcontainer_polygondialog->set("rect_clip_content", True);
|
|
||||||
|
|
||||||
editorcontainer_vboxcontainer_polygondialog->set_size_flags_horizontal(3);
|
|
||||||
//editorcontainer_vboxcontainer_polygondialog->set("size_flags_horizontal", 3);
|
|
||||||
|
|
||||||
editorcontainer_vboxcontainer_polygondialog->set_size_flags_vertical(3);
|
|
||||||
//editorcontainer_vboxcontainer_polygondialog->set("size_flags_vertical", 3);
|
|
||||||
|
|
||||||
editorcontainer_vboxcontainer_polygondialog->set_custom_constants/margin_right(4);
|
|
||||||
//editorcontainer_vboxcontainer_polygondialog->set("custom_constants/margin_right", 4);
|
|
||||||
|
|
||||||
editorcontainer_vboxcontainer_polygondialog->set_custom_constants/margin_top(4);
|
|
||||||
//editorcontainer_vboxcontainer_polygondialog->set("custom_constants/margin_top", 4);
|
|
||||||
|
|
||||||
editorcontainer_vboxcontainer_polygondialog->set_custom_constants/margin_left(4);
|
|
||||||
//editorcontainer_vboxcontainer_polygondialog->set("custom_constants/margin_left", 4);
|
|
||||||
|
|
||||||
editorcontainer_vboxcontainer_polygondialog->set_custom_constants/margin_bottom(4);
|
|
||||||
//editorcontainer_vboxcontainer_polygondialog->set("custom_constants/margin_bottom", 4);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Script: res://addons/mat_maker_gd/widgets/polygon_edit/polygon_editor.gd
|
|
||||||
Control *polygoneditor_editorcontainer_vboxcontainer_polygondialog = memnew(Control);
|
|
||||||
polygoneditor_editorcontainer_vboxcontainer_polygondialog->set_name("PolygonEditor");
|
|
||||||
editorcontainer_vboxcontainer_polygondialog->add_child(polygoneditor_editorcontainer_vboxcontainer_polygondialog);
|
|
||||||
|
|
||||||
polygoneditor_editorcontainer_vboxcontainer_polygondialog->set_name("PolygonEditor");
|
|
||||||
//polygoneditor_editorcontainer_vboxcontainer_polygondialog->set("name", PolygonEditor));
|
|
||||||
|
|
||||||
polygoneditor_editorcontainer_vboxcontainer_polygondialog->set_filename("res://addons/mat_maker_gd/widgets/polygon_edit/polygon_editor.tscn");
|
|
||||||
//polygoneditor_editorcontainer_vboxcontainer_polygondialog->set("filename", "res://addons/mat_maker_gd/widgets/polygon_edit/polygon_editor.tscn");
|
|
||||||
|
|
||||||
//polygoneditor_editorcontainer_vboxcontainer_polygondialog property owner TYPE_OBJECT value: PolygonDialog:[WindowDialog:42399]
|
|
||||||
|
|
||||||
polygoneditor_editorcontainer_vboxcontainer_polygondialog->set_margin_left(4);
|
|
||||||
//polygoneditor_editorcontainer_vboxcontainer_polygondialog->set("margin_left", 4);
|
|
||||||
|
|
||||||
polygoneditor_editorcontainer_vboxcontainer_polygondialog->set_margin_top(4);
|
|
||||||
//polygoneditor_editorcontainer_vboxcontainer_polygondialog->set("margin_top", 4);
|
|
||||||
|
|
||||||
polygoneditor_editorcontainer_vboxcontainer_polygondialog->set_margin_right(451);
|
|
||||||
//polygoneditor_editorcontainer_vboxcontainer_polygondialog->set("margin_right", 451);
|
|
||||||
|
|
||||||
polygoneditor_editorcontainer_vboxcontainer_polygondialog->set_margin_bottom(453);
|
|
||||||
//polygoneditor_editorcontainer_vboxcontainer_polygondialog->set("margin_bottom", 453);
|
|
||||||
|
|
||||||
polygoneditor_editorcontainer_vboxcontainer_polygondialog->set_rect_position(Vector2(4, 4));
|
|
||||||
//polygoneditor_editorcontainer_vboxcontainer_polygondialog->set("rect_position", Vector2(4, 4));
|
|
||||||
|
|
||||||
polygoneditor_editorcontainer_vboxcontainer_polygondialog->set_rect_global_position(Vector2(4, 4));
|
|
||||||
//polygoneditor_editorcontainer_vboxcontainer_polygondialog->set("rect_global_position", Vector2(4, 4));
|
|
||||||
|
|
||||||
polygoneditor_editorcontainer_vboxcontainer_polygondialog->set_rect_size(Vector2(447, 449));
|
|
||||||
//polygoneditor_editorcontainer_vboxcontainer_polygondialog->set("rect_size", Vector2(447, 449));
|
|
||||||
|
|
||||||
//polygoneditor_editorcontainer_vboxcontainer_polygondialog property __meta__ TYPE_DICTIONARY value: {_edit_use_anchors_:False}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HSeparator *hseparator_vboxcontainer_polygondialog = memnew(HSeparator);
|
|
||||||
hseparator_vboxcontainer_polygondialog->set_name("HSeparator");
|
|
||||||
vboxcontainer_polygondialog->add_child(hseparator_vboxcontainer_polygondialog);
|
|
||||||
|
|
||||||
hseparator_vboxcontainer_polygondialog->set_name("HSeparator");
|
|
||||||
//hseparator_vboxcontainer_polygondialog->set("name", HSeparator));
|
|
||||||
|
|
||||||
//hseparator_vboxcontainer_polygondialog property owner TYPE_OBJECT value: PolygonDialog:[WindowDialog:42399]
|
|
||||||
|
|
||||||
hseparator_vboxcontainer_polygondialog->set_margin_top(461);
|
|
||||||
//hseparator_vboxcontainer_polygondialog->set("margin_top", 461);
|
|
||||||
|
|
||||||
hseparator_vboxcontainer_polygondialog->set_margin_right(455);
|
|
||||||
//hseparator_vboxcontainer_polygondialog->set("margin_right", 455);
|
|
||||||
|
|
||||||
hseparator_vboxcontainer_polygondialog->set_margin_bottom(465);
|
|
||||||
//hseparator_vboxcontainer_polygondialog->set("margin_bottom", 465);
|
|
||||||
|
|
||||||
hseparator_vboxcontainer_polygondialog->set_rect_position(Vector2(0, 461));
|
|
||||||
//hseparator_vboxcontainer_polygondialog->set("rect_position", Vector2(0, 461));
|
|
||||||
|
|
||||||
hseparator_vboxcontainer_polygondialog->set_rect_global_position(Vector2(0, 461));
|
|
||||||
//hseparator_vboxcontainer_polygondialog->set("rect_global_position", Vector2(0, 461));
|
|
||||||
|
|
||||||
hseparator_vboxcontainer_polygondialog->set_rect_size(Vector2(455, 4));
|
|
||||||
//hseparator_vboxcontainer_polygondialog->set("rect_size", Vector2(455, 4));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HBoxContainer *hboxcontainer_vboxcontainer_polygondialog = memnew(HBoxContainer);
|
|
||||||
hboxcontainer_vboxcontainer_polygondialog->set_name("HBoxContainer");
|
|
||||||
vboxcontainer_polygondialog->add_child(hboxcontainer_vboxcontainer_polygondialog);
|
|
||||||
|
|
||||||
hboxcontainer_vboxcontainer_polygondialog->set_name("HBoxContainer");
|
|
||||||
//hboxcontainer_vboxcontainer_polygondialog->set("name", HBoxContainer));
|
|
||||||
|
|
||||||
//hboxcontainer_vboxcontainer_polygondialog property owner TYPE_OBJECT value: PolygonDialog:[WindowDialog:42399]
|
|
||||||
|
|
||||||
hboxcontainer_vboxcontainer_polygondialog->set_margin_top(469);
|
|
||||||
//hboxcontainer_vboxcontainer_polygondialog->set("margin_top", 469);
|
|
||||||
|
|
||||||
hboxcontainer_vboxcontainer_polygondialog->set_margin_right(455);
|
|
||||||
//hboxcontainer_vboxcontainer_polygondialog->set("margin_right", 455);
|
|
||||||
|
|
||||||
hboxcontainer_vboxcontainer_polygondialog->set_margin_bottom(489);
|
|
||||||
//hboxcontainer_vboxcontainer_polygondialog->set("margin_bottom", 489);
|
|
||||||
|
|
||||||
hboxcontainer_vboxcontainer_polygondialog->set_rect_position(Vector2(0, 469));
|
|
||||||
//hboxcontainer_vboxcontainer_polygondialog->set("rect_position", Vector2(0, 469));
|
|
||||||
|
|
||||||
hboxcontainer_vboxcontainer_polygondialog->set_rect_global_position(Vector2(0, 469));
|
|
||||||
//hboxcontainer_vboxcontainer_polygondialog->set("rect_global_position", Vector2(0, 469));
|
|
||||||
|
|
||||||
hboxcontainer_vboxcontainer_polygondialog->set_rect_size(Vector2(455, 20));
|
|
||||||
//hboxcontainer_vboxcontainer_polygondialog->set("rect_size", Vector2(455, 20));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Control *control_hboxcontainer_vboxcontainer_polygondialog = memnew(Control);
|
|
||||||
control_hboxcontainer_vboxcontainer_polygondialog->set_name("Control");
|
|
||||||
hboxcontainer_vboxcontainer_polygondialog->add_child(control_hboxcontainer_vboxcontainer_polygondialog);
|
|
||||||
|
|
||||||
control_hboxcontainer_vboxcontainer_polygondialog->set_name("Control");
|
|
||||||
//control_hboxcontainer_vboxcontainer_polygondialog->set("name", Control));
|
|
||||||
|
|
||||||
//control_hboxcontainer_vboxcontainer_polygondialog property owner TYPE_OBJECT value: PolygonDialog:[WindowDialog:42399]
|
|
||||||
|
|
||||||
control_hboxcontainer_vboxcontainer_polygondialog->set_margin_right(327);
|
|
||||||
//control_hboxcontainer_vboxcontainer_polygondialog->set("margin_right", 327);
|
|
||||||
|
|
||||||
control_hboxcontainer_vboxcontainer_polygondialog->set_margin_bottom(20);
|
|
||||||
//control_hboxcontainer_vboxcontainer_polygondialog->set("margin_bottom", 20);
|
|
||||||
|
|
||||||
control_hboxcontainer_vboxcontainer_polygondialog->set_rect_size(Vector2(327, 20));
|
|
||||||
//control_hboxcontainer_vboxcontainer_polygondialog->set("rect_size", Vector2(327, 20));
|
|
||||||
|
|
||||||
control_hboxcontainer_vboxcontainer_polygondialog->set_size_flags_horizontal(3);
|
|
||||||
//control_hboxcontainer_vboxcontainer_polygondialog->set("size_flags_horizontal", 3);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Button *ok_hboxcontainer_vboxcontainer_polygondialog = memnew(Button);
|
|
||||||
ok_hboxcontainer_vboxcontainer_polygondialog->set_name("OK");
|
|
||||||
hboxcontainer_vboxcontainer_polygondialog->add_child(ok_hboxcontainer_vboxcontainer_polygondialog);
|
|
||||||
|
|
||||||
ok_hboxcontainer_vboxcontainer_polygondialog->set_name("OK");
|
|
||||||
//ok_hboxcontainer_vboxcontainer_polygondialog->set("name", OK));
|
|
||||||
|
|
||||||
//ok_hboxcontainer_vboxcontainer_polygondialog property owner TYPE_OBJECT value: PolygonDialog:[WindowDialog:42399]
|
|
||||||
|
|
||||||
ok_hboxcontainer_vboxcontainer_polygondialog->set_margin_left(331);
|
|
||||||
//ok_hboxcontainer_vboxcontainer_polygondialog->set("margin_left", 331);
|
|
||||||
|
|
||||||
ok_hboxcontainer_vboxcontainer_polygondialog->set_margin_right(391);
|
|
||||||
//ok_hboxcontainer_vboxcontainer_polygondialog->set("margin_right", 391);
|
|
||||||
|
|
||||||
ok_hboxcontainer_vboxcontainer_polygondialog->set_margin_bottom(20);
|
|
||||||
//ok_hboxcontainer_vboxcontainer_polygondialog->set("margin_bottom", 20);
|
|
||||||
|
|
||||||
ok_hboxcontainer_vboxcontainer_polygondialog->set_rect_position(Vector2(331, 0));
|
|
||||||
//ok_hboxcontainer_vboxcontainer_polygondialog->set("rect_position", Vector2(331, 0));
|
|
||||||
|
|
||||||
ok_hboxcontainer_vboxcontainer_polygondialog->set_rect_global_position(Vector2(331, 0));
|
|
||||||
//ok_hboxcontainer_vboxcontainer_polygondialog->set("rect_global_position", Vector2(331, 0));
|
|
||||||
|
|
||||||
ok_hboxcontainer_vboxcontainer_polygondialog->set_rect_size(Vector2(60, 20));
|
|
||||||
//ok_hboxcontainer_vboxcontainer_polygondialog->set("rect_size", Vector2(60, 20));
|
|
||||||
|
|
||||||
ok_hboxcontainer_vboxcontainer_polygondialog->set_rect_min_size(Vector2(60, 0));
|
|
||||||
//ok_hboxcontainer_vboxcontainer_polygondialog->set("rect_min_size", Vector2(60, 0));
|
|
||||||
|
|
||||||
ok_hboxcontainer_vboxcontainer_polygondialog->set_text("OK");
|
|
||||||
//ok_hboxcontainer_vboxcontainer_polygondialog->set("text", "OK");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Button *cancel_hboxcontainer_vboxcontainer_polygondialog = memnew(Button);
|
|
||||||
cancel_hboxcontainer_vboxcontainer_polygondialog->set_name("Cancel");
|
|
||||||
hboxcontainer_vboxcontainer_polygondialog->add_child(cancel_hboxcontainer_vboxcontainer_polygondialog);
|
|
||||||
|
|
||||||
cancel_hboxcontainer_vboxcontainer_polygondialog->set_name("Cancel");
|
|
||||||
//cancel_hboxcontainer_vboxcontainer_polygondialog->set("name", Cancel));
|
|
||||||
|
|
||||||
//cancel_hboxcontainer_vboxcontainer_polygondialog property owner TYPE_OBJECT value: PolygonDialog:[WindowDialog:42399]
|
|
||||||
|
|
||||||
cancel_hboxcontainer_vboxcontainer_polygondialog->set_margin_left(395);
|
|
||||||
//cancel_hboxcontainer_vboxcontainer_polygondialog->set("margin_left", 395);
|
|
||||||
|
|
||||||
cancel_hboxcontainer_vboxcontainer_polygondialog->set_margin_right(455);
|
|
||||||
//cancel_hboxcontainer_vboxcontainer_polygondialog->set("margin_right", 455);
|
|
||||||
|
|
||||||
cancel_hboxcontainer_vboxcontainer_polygondialog->set_margin_bottom(20);
|
|
||||||
//cancel_hboxcontainer_vboxcontainer_polygondialog->set("margin_bottom", 20);
|
|
||||||
|
|
||||||
cancel_hboxcontainer_vboxcontainer_polygondialog->set_rect_position(Vector2(395, 0));
|
|
||||||
//cancel_hboxcontainer_vboxcontainer_polygondialog->set("rect_position", Vector2(395, 0));
|
|
||||||
|
|
||||||
cancel_hboxcontainer_vboxcontainer_polygondialog->set_rect_global_position(Vector2(395, 0));
|
|
||||||
//cancel_hboxcontainer_vboxcontainer_polygondialog->set("rect_global_position", Vector2(395, 0));
|
|
||||||
|
|
||||||
cancel_hboxcontainer_vboxcontainer_polygondialog->set_rect_size(Vector2(60, 20));
|
|
||||||
//cancel_hboxcontainer_vboxcontainer_polygondialog->set("rect_size", Vector2(60, 20));
|
|
||||||
|
|
||||||
cancel_hboxcontainer_vboxcontainer_polygondialog->set_rect_min_size(Vector2(60, 0));
|
|
||||||
//cancel_hboxcontainer_vboxcontainer_polygondialog->set("rect_min_size", Vector2(60, 0));
|
|
||||||
|
|
||||||
cancel_hboxcontainer_vboxcontainer_polygondialog->set_text("Cancel");
|
|
||||||
//cancel_hboxcontainer_vboxcontainer_polygondialog->set("text", "Cancel");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,45 +1,46 @@
|
|||||||
#ifndef POLYGON_DIALOG_H
|
#ifndef POLYGON_DIALOG_H
|
||||||
#define POLYGON_DIALOG_H
|
#define POLYGON_DIALOG_H
|
||||||
|
|
||||||
|
#include "core/reference.h"
|
||||||
|
|
||||||
|
#include "scene/gui/dialogs.h"
|
||||||
|
|
||||||
|
class Button;
|
||||||
|
class PolygonEditor;
|
||||||
|
class PolygonBase;
|
||||||
|
|
||||||
class PolygonDialog : public WindowDialog {
|
class PolygonDialog : public WindowDialog {
|
||||||
GDCLASS(PolygonDialog, WindowDialog);
|
GDCLASS(PolygonDialog, WindowDialog);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
bool get_closed() const;
|
||||||
|
void set_closed(const bool c = true);
|
||||||
|
|
||||||
bool get_closed() const;
|
PoolVector2Array get_previous_points();
|
||||||
void set_closed(const bool val);
|
void set_previous_points(const PoolVector2Array &val);
|
||||||
|
|
||||||
PoolVector2Array get_previous_points();
|
Ref<PolygonBase> get_polygon();
|
||||||
void set_previous_points(const PoolVector2Array &val);
|
void set_polygon(const Ref<PolygonBase> &val);
|
||||||
|
void edit_polygon(const Ref<PolygonBase> &poly);
|
||||||
|
|
||||||
Variant get_Variant();
|
void _on_CurveDialog_popup_hide();
|
||||||
void set_Variant(const Variant &val);
|
void _on_OK_pressed();
|
||||||
|
void _on_Cancel_pressed();
|
||||||
|
void _on_PolygonEditor_value_changed(const Variant &value);
|
||||||
|
|
||||||
void set_closed(const bool c = true);
|
PolygonDialog();
|
||||||
void _on_CurveDialog_popup_hide();
|
~PolygonDialog();
|
||||||
void _on_OK_pressed();
|
|
||||||
void _on_Cancel_pressed();
|
|
||||||
void edit_polygon(const Variant &poly);
|
|
||||||
void _on_PolygonEditor_value_changed(const Variant &value);
|
|
||||||
|
|
||||||
PolygonDialog();
|
protected:
|
||||||
~PolygonDialog();
|
static void _bind_methods();
|
||||||
|
|
||||||
protected:
|
bool closed;
|
||||||
static void _bind_methods();
|
PoolVector2Array previous_points;
|
||||||
|
Ref<PolygonBase> polygon;
|
||||||
|
|
||||||
//tool
|
PolygonEditor *_polygon_editor;
|
||||||
//export
|
Button *_ok_button;
|
||||||
// setget set_closed
|
Button *_cancel_button;
|
||||||
bool closed = true;
|
|
||||||
PoolVector2Array previous_points = ;
|
|
||||||
Variant ;
|
|
||||||
signal polygon_changed(polygon);
|
|
||||||
//var result = yield(self, "return_polygon")
|
|
||||||
//queue_free()
|
|
||||||
//return result
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user