summaryrefslogtreecommitdiff
path: root/scene/gui/control.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/control.cpp')
-rw-r--r--scene/gui/control.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 2e28baa137..fc27c0d24f 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -49,14 +49,22 @@
Variant Control::edit_get_state() const {
- return get_rect();
+ Dictionary s;
+ s["rect"]=get_rect();
+ s["rot"]=get_rotation();
+ s["scale"]=get_scale();
+ return s;
}
void Control::edit_set_state(const Variant& p_state) {
- Rect2 state=p_state;
+ Dictionary s=p_state;
+
+ Rect2 state=s["rect"];
set_pos(state.pos);
set_size(state.size);
+ set_rotation(s["rot"]);
+ set_scale(s["scale"]);
}
void Control::set_custom_minimum_size(const Size2& p_custom) {
@@ -754,6 +762,11 @@ bool Control::is_window_modal_on_top() const {
return get_viewport()->_gui_is_modal_on_top(this);
}
+uint64_t Control::get_modal_frame() const {
+
+ return data.modal_frame;
+}
+
Size2 Control::get_minimum_size() const {
@@ -1829,6 +1842,7 @@ void Control::show_modal(bool p_exclusive) {
raise();
data.modal_exclusive=p_exclusive;
data.MI=get_viewport()->_gui_show_modal(this);
+ data.modal_frame=OS::get_singleton()->get_frames_drawn();
}
@@ -2539,6 +2553,7 @@ Control::Control() {
data.parent_canvas_item=NULL;
data.scale=Vector2(1,1);
data.drag_owner=0;
+ data.modal_frame=0;
for (int i=0;i<4;i++) {