summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/node.cpp13
-rw-r--r--scene/main/node.h1
-rw-r--r--scene/main/scene_tree.cpp2
-rw-r--r--scene/main/viewport.cpp2
4 files changed, 16 insertions, 2 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index b7b26d1c55..68de7b3a0a 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -240,7 +240,7 @@ void Node::_propagate_enter_tree() {
void Node::_propagate_exit_tree() {
- //block while removing children
+//block while removing children
#ifdef DEBUG_ENABLED
@@ -725,6 +725,17 @@ const Map<StringName, MultiplayerAPI::RPCMode>::Element *Node::get_node_rset_mod
return data.rpc_properties.find(p_property);
}
+bool Node::can_process_notification(int p_what) const {
+ switch (p_what) {
+ case NOTIFICATION_PHYSICS_PROCESS: return data.physics_process;
+ case NOTIFICATION_PROCESS: return data.idle_process;
+ case NOTIFICATION_INTERNAL_PROCESS: return data.idle_process_internal;
+ case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: return data.physics_process_internal;
+ }
+
+ return true;
+}
+
bool Node::can_process() const {
ERR_FAIL_COND_V(!is_inside_tree(), false);
diff --git a/scene/main/node.h b/scene/main/node.h
index 4b8f584ba7..9ee0340678 100644
--- a/scene/main/node.h
+++ b/scene/main/node.h
@@ -364,6 +364,7 @@ public:
void set_pause_mode(PauseMode p_mode);
PauseMode get_pause_mode() const;
bool can_process() const;
+ bool can_process_notification(int p_what) const;
void request_ready();
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index 1b2e87dd99..e99f785848 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -951,6 +951,8 @@ void SceneTree::_notify_group_pause(const StringName &p_group, int p_notificatio
if (!n->can_process())
continue;
+ if (!n->can_process_notification(p_notification))
+ continue;
n->notification(p_notification);
//ERR_FAIL_COND(node_count != g.nodes.size());
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 573c401290..e43c2da02d 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -1860,7 +1860,7 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
if (over != top && !top->is_a_parent_of(over)) {
PopupMenu *popup_menu = Object::cast_to<PopupMenu>(top);
- MenuButton *popup_menu_parent;
+ MenuButton *popup_menu_parent = NULL;
MenuButton *menu_button = Object::cast_to<MenuButton>(over);
if (popup_menu)