diff options
Diffstat (limited to 'scene/gui/control.cpp')
-rw-r--r-- | scene/gui/control.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index edc8a8bcb8..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(); } @@ -2460,8 +2474,8 @@ void Control::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::BOOL,"focus/ignore_mouse"), _SCS("set_ignore_mouse"),_SCS("is_ignoring_mouse") ); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"focus/stop_mouse"), _SCS("set_stop_mouse"),_SCS("is_stopping_mouse") ); - ADD_PROPERTYNZ( PropertyInfo(Variant::INT,"size_flags/horizontal", PROPERTY_HINT_FLAGS, "Expand,Fill"), _SCS("set_h_size_flags"),_SCS("get_h_size_flags") ); - ADD_PROPERTYNZ( PropertyInfo(Variant::INT,"size_flags/vertical", PROPERTY_HINT_FLAGS, "Expand,Fill"), _SCS("set_v_size_flags"),_SCS("get_v_size_flags") ); + ADD_PROPERTY( PropertyInfo(Variant::INT,"size_flags/horizontal", PROPERTY_HINT_FLAGS, "Expand,Fill"), _SCS("set_h_size_flags"),_SCS("get_h_size_flags") ); + ADD_PROPERTY( PropertyInfo(Variant::INT,"size_flags/vertical", PROPERTY_HINT_FLAGS, "Expand,Fill"), _SCS("set_v_size_flags"),_SCS("get_v_size_flags") ); ADD_PROPERTYNO( PropertyInfo(Variant::INT,"size_flags/stretch_ratio", PROPERTY_HINT_RANGE, "1,128,0.01"), _SCS("set_stretch_ratio"),_SCS("get_stretch_ratio") ); ADD_PROPERTYNZ( PropertyInfo(Variant::OBJECT,"theme/theme", PROPERTY_HINT_RESOURCE_TYPE, "Theme"), _SCS("set_theme"),_SCS("get_theme") ); @@ -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++) { |