mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-09 20:39:37 +01:00
Do not fire VisibilityNotifier screen_entered and screen_exited signals in the Editor
This commit is contained in:
parent
e75af6af1d
commit
f95c511c7a
@ -148,13 +148,25 @@ void VisibilityNotifier::_notification(int p_what) {
|
|||||||
ERR_FAIL_COND(!world.is_valid());
|
ERR_FAIL_COND(!world.is_valid());
|
||||||
|
|
||||||
AABB world_aabb = get_global_transform().xform(aabb);
|
AABB world_aabb = get_global_transform().xform(aabb);
|
||||||
|
#ifdef TOOLS_ENABLED
|
||||||
|
if (!Engine::get_singleton()->is_editor_hint()) {
|
||||||
|
world->_register_notifier(this, world_aabb);
|
||||||
|
}
|
||||||
|
#else
|
||||||
world->_register_notifier(this, world_aabb);
|
world->_register_notifier(this, world_aabb);
|
||||||
|
#endif
|
||||||
_world_aabb_center = world_aabb.get_center();
|
_world_aabb_center = world_aabb.get_center();
|
||||||
_refresh_portal_mode();
|
_refresh_portal_mode();
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_TRANSFORM_CHANGED: {
|
case NOTIFICATION_TRANSFORM_CHANGED: {
|
||||||
AABB world_aabb = get_global_transform().xform(aabb);
|
AABB world_aabb = get_global_transform().xform(aabb);
|
||||||
|
#ifdef TOOLS_ENABLED
|
||||||
|
if (!Engine::get_singleton()->is_editor_hint()) {
|
||||||
|
world->_update_notifier(this, world_aabb);
|
||||||
|
}
|
||||||
|
#else
|
||||||
world->_update_notifier(this, world_aabb);
|
world->_update_notifier(this, world_aabb);
|
||||||
|
#endif
|
||||||
if (_max_distance_active) {
|
if (_max_distance_active) {
|
||||||
_world_aabb_center = world_aabb.get_center();
|
_world_aabb_center = world_aabb.get_center();
|
||||||
}
|
}
|
||||||
@ -165,7 +177,13 @@ void VisibilityNotifier::_notification(int p_what) {
|
|||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_EXIT_WORLD: {
|
case NOTIFICATION_EXIT_WORLD: {
|
||||||
ERR_FAIL_COND(!world.is_valid());
|
ERR_FAIL_COND(!world.is_valid());
|
||||||
|
#ifdef TOOLS_ENABLED
|
||||||
|
if (!Engine::get_singleton()->is_editor_hint()) {
|
||||||
|
world->_remove_notifier(this);
|
||||||
|
}
|
||||||
|
#else
|
||||||
world->_remove_notifier(this);
|
world->_remove_notifier(this);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (_cull_instance_rid != RID()) {
|
if (_cull_instance_rid != RID()) {
|
||||||
RenderingServer::get_singleton()->ghost_set_scenario(_cull_instance_rid, RID(), get_instance_id(), AABB());
|
RenderingServer::get_singleton()->ghost_set_scenario(_cull_instance_rid, RID(), get_instance_id(), AABB());
|
||||||
@ -288,9 +306,11 @@ void VisibilityEnabler::_find_nodes(Node *p_node) {
|
|||||||
|
|
||||||
void VisibilityEnabler::_notification(int p_what) {
|
void VisibilityEnabler::_notification(int p_what) {
|
||||||
if (p_what == NOTIFICATION_ENTER_TREE) {
|
if (p_what == NOTIFICATION_ENTER_TREE) {
|
||||||
|
#ifdef TOOLS_ENABLED
|
||||||
if (Engine::get_singleton()->is_editor_hint()) {
|
if (Engine::get_singleton()->is_editor_hint()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Node *from = this;
|
Node *from = this;
|
||||||
//find where current scene starts
|
//find where current scene starts
|
||||||
@ -302,9 +322,11 @@ void VisibilityEnabler::_notification(int p_what) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (p_what == NOTIFICATION_EXIT_TREE) {
|
if (p_what == NOTIFICATION_EXIT_TREE) {
|
||||||
|
#ifdef TOOLS_ENABLED
|
||||||
if (Engine::get_singleton()->is_editor_hint()) {
|
if (Engine::get_singleton()->is_editor_hint()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
for (Map<Node *, Variant>::Element *E = nodes.front(); E; E = E->next()) {
|
for (Map<Node *, Variant>::Element *E = nodes.front(); E; E = E->next()) {
|
||||||
if (!visible) {
|
if (!visible) {
|
||||||
|
Loading…
Reference in New Issue
Block a user