diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2017-08-19 01:02:56 +0200 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2017-08-19 01:29:45 +0200 |
commit | 90b8a5b71ef79e0339826507c4b290f0c51b7cd2 (patch) | |
tree | 6f24bbc63ef9674687589f9ec9017e9fd09d266e /scene/gui | |
parent | fd69604bd9dc743494a7818f25f384cc7f521b33 (diff) |
Removes editor_hint from SceneTree
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/color_picker.cpp | 2 | ||||
-rw-r--r-- | scene/gui/control.cpp | 2 | ||||
-rw-r--r-- | scene/gui/dialogs.cpp | 4 | ||||
-rw-r--r-- | scene/gui/line_edit.cpp | 2 | ||||
-rw-r--r-- | scene/gui/popup.cpp | 4 | ||||
-rw-r--r-- | scene/gui/reference_rect.cpp | 4 | ||||
-rw-r--r-- | scene/gui/texture_progress.cpp | 4 | ||||
-rw-r--r-- | scene/gui/video_player.cpp | 2 |
8 files changed, 15 insertions, 9 deletions
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index dddd53dd95..3368d1cad9 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -204,7 +204,7 @@ void ColorPicker::_update_presets() { } void ColorPicker::_text_type_toggled() { - if (!get_tree()->is_editor_hint()) + if (!Engine::get_singleton()->is_editor_hint()) return; text_is_constructor = !text_is_constructor; if (text_is_constructor) { diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 01570e28c4..8d934d0a42 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -1353,7 +1353,7 @@ void Control::set_anchor(Margin p_margin, AnchorType p_anchor, bool p_keep_margi void Control::_set_anchor(Margin p_margin, AnchorType p_anchor) { #ifdef TOOLS_ENABLED - if (is_inside_tree() && get_tree()->is_editor_hint()) { + if (is_inside_tree() && Engine::get_singleton()->is_editor_hint()) { set_anchor(p_margin, p_anchor, EDITOR_DEF("editors/2d/keep_margins_when_changing_anchors", false)); } else { set_anchor(p_margin, p_anchor, false); diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index dedf44d407..b78a47ff6a 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -227,11 +227,11 @@ void WindowDialog::_notification(int p_what) { } break; #ifdef TOOLS_ENABLED case NOTIFICATION_POST_POPUP: { - if (get_tree() && get_tree()->is_editor_hint() && EditorNode::get_singleton()) + if (get_tree() && Engine::get_singleton()->is_editor_hint() && EditorNode::get_singleton()) EditorNode::get_singleton()->dim_editor(true); } break; case NOTIFICATION_POPUP_HIDE: { - if (get_tree() && get_tree()->is_editor_hint() && EditorNode::get_singleton()) + if (get_tree() && Engine::get_singleton()->is_editor_hint() && EditorNode::get_singleton()) EditorNode::get_singleton()->dim_editor(false); } break; #endif diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index c1784fb7ba..a5ae7eed66 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -534,7 +534,7 @@ void LineEdit::_notification(int p_what) { switch (p_what) { #ifdef TOOLS_ENABLED case NOTIFICATION_ENTER_TREE: { - if (get_tree()->is_editor_hint()) { + if (Engine::get_singleton()->is_editor_hint()) { cursor_set_blink_enabled(EDITOR_DEF("text_editor/cursor/caret_blink", false)); cursor_set_blink_speed(EDITOR_DEF("text_editor/cursor/caret_blink_speed", 0.65)); diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp index 8979e0f111..54cc8b86fd 100644 --- a/scene/gui/popup.cpp +++ b/scene/gui/popup.cpp @@ -28,6 +28,8 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "popup.h" + +#include "engine.h" #include "os/keyboard.h" void Popup::_gui_input(Ref<InputEvent> p_event) { @@ -48,7 +50,7 @@ void Popup::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { //small helper to make editing of these easier in editor #ifdef TOOLS_ENABLED - if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) { + if (Engine::get_singleton()->is_editor_hint() && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) { set_as_toplevel(false); } #endif diff --git a/scene/gui/reference_rect.cpp b/scene/gui/reference_rect.cpp index 400ff299a9..441c3e721b 100644 --- a/scene/gui/reference_rect.cpp +++ b/scene/gui/reference_rect.cpp @@ -29,13 +29,15 @@ /*************************************************************************/ #include "reference_rect.h" +#include "engine.h" + void ReferenceRect::_notification(int p_what) { if (p_what == NOTIFICATION_DRAW) { if (!is_inside_tree()) return; - if (get_tree()->is_editor_hint()) + if (Engine::get_singleton()->is_editor_hint()) draw_style_box(get_stylebox("border"), Rect2(Point2(), get_size())); } } diff --git a/scene/gui/texture_progress.cpp b/scene/gui/texture_progress.cpp index 081c7ddb73..a5ca502f71 100644 --- a/scene/gui/texture_progress.cpp +++ b/scene/gui/texture_progress.cpp @@ -29,6 +29,8 @@ /*************************************************************************/ #include "texture_progress.h" +#include "engine.h" + void TextureProgress::set_under_texture(const Ref<Texture> &p_texture) { under = p_texture; @@ -179,7 +181,7 @@ void TextureProgress::_notification(int p_what) { } draw_polygon(points, Vector<Color>(), uvs, progress); } - if (get_tree()->is_editor_hint()) { + if (Engine::get_singleton()->is_editor_hint()) { Point2 p = progress->get_size(); p.x *= get_relative_center().x; p.y *= get_relative_center().y; diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp index 9c018a4e7c..4886b1cc26 100644 --- a/scene/gui/video_player.cpp +++ b/scene/gui/video_player.cpp @@ -116,7 +116,7 @@ void VideoPlayer::_notification(int p_notification) { case NOTIFICATION_ENTER_TREE: { - if (stream.is_valid() && autoplay && !get_tree()->is_editor_hint()) { + if (stream.is_valid() && autoplay && !Engine::get_singleton()->is_editor_hint()) { play(); } } break; |