summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/code_edit.cpp2
-rw-r--r--scene/gui/container.cpp6
-rw-r--r--scene/gui/container.h3
-rw-r--r--scene/main/viewport.cpp10
-rw-r--r--scene/scene_string_names.cpp1
-rw-r--r--scene/scene_string_names.h1
6 files changed, 16 insertions, 7 deletions
diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp
index b816f12bc3..46ec7b4d3d 100644
--- a/scene/gui/code_edit.cpp
+++ b/scene/gui/code_edit.cpp
@@ -433,7 +433,7 @@ void CodeEdit::gui_input(const Ref<InputEvent> &p_gui_input) {
return;
}
if (k->is_action("ui_end", true)) {
- code_completion_current_selected = MIN(code_completion_options.size() - 1, code_completion_current_selected + code_completion_max_lines);
+ code_completion_current_selected = code_completion_options.size() - 1;
update();
accept_event();
return;
diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp
index 11941529cd..a1bd82f6f7 100644
--- a/scene/gui/container.cpp
+++ b/scene/gui/container.cpp
@@ -87,6 +87,9 @@ void Container::_sort_children() {
return;
}
+ notification(NOTIFICATION_PRE_SORT_CHILDREN);
+ emit_signal(SceneStringNames::get_singleton()->pre_sort_children);
+
notification(NOTIFICATION_SORT_CHILDREN);
emit_signal(SceneStringNames::get_singleton()->sort_children);
pending_sort = false;
@@ -174,7 +177,10 @@ void Container::_bind_methods() {
ClassDB::bind_method(D_METHOD("queue_sort"), &Container::queue_sort);
ClassDB::bind_method(D_METHOD("fit_child_in_rect", "child", "rect"), &Container::fit_child_in_rect);
+ BIND_CONSTANT(NOTIFICATION_PRE_SORT_CHILDREN);
BIND_CONSTANT(NOTIFICATION_SORT_CHILDREN);
+
+ ADD_SIGNAL(MethodInfo("pre_sort_children"));
ADD_SIGNAL(MethodInfo("sort_children"));
}
diff --git a/scene/gui/container.h b/scene/gui/container.h
index bce3085f0c..f3ae948556 100644
--- a/scene/gui/container.h
+++ b/scene/gui/container.h
@@ -51,7 +51,8 @@ protected:
public:
enum {
- NOTIFICATION_SORT_CHILDREN = 50
+ NOTIFICATION_PRE_SORT_CHILDREN = 50,
+ NOTIFICATION_SORT_CHILDREN = 51,
};
void fit_child_in_rect(Control *p_child, const Rect2 &p_rect);
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index b3b743370b..e88bb3b952 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -57,17 +57,17 @@
#include "servers/audio_server.h"
void ViewportTexture::setup_local_to_scene() {
+ Node *local_scene = get_local_scene();
+ if (!local_scene) {
+ return;
+ }
+
if (vp) {
vp->viewport_textures.erase(this);
}
vp = nullptr;
- Node *local_scene = get_local_scene();
- if (!local_scene) {
- return;
- }
-
Node *vpn = local_scene->get_node(path);
ERR_FAIL_COND_MSG(!vpn, "ViewportTexture: Path to node is invalid.");
diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp
index b283749ffa..29e5dd6056 100644
--- a/scene/scene_string_names.cpp
+++ b/scene/scene_string_names.cpp
@@ -73,6 +73,7 @@ SceneStringNames::SceneStringNames() {
focus_entered = StaticCString::create("focus_entered");
focus_exited = StaticCString::create("focus_exited");
+ pre_sort_children = StaticCString::create("pre_sort_children");
sort_children = StaticCString::create("sort_children");
body_shape_entered = StaticCString::create("body_shape_entered");
diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h
index 2923351eab..5e3195952e 100644
--- a/scene/scene_string_names.h
+++ b/scene/scene_string_names.h
@@ -89,6 +89,7 @@ public:
StringName focus_entered;
StringName focus_exited;
+ StringName pre_sort_children;
StringName sort_children;
StringName finished;