summaryrefslogtreecommitdiffstats
path: root/scene/2d/visibility_notifier_2d.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-05-17 18:27:15 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-05-17 18:28:44 -0300
commitc195c0df6b36debc870216dd42e49fbda70fa861 (patch)
tree194a26e39ace86d7a471f3e86159c2aed6be261c /scene/2d/visibility_notifier_2d.cpp
parent3a26e14a2bab777c9ba6aedceff6e4ef2666faf0 (diff)
downloadredot-engine-c195c0df6b36debc870216dd42e49fbda70fa861.tar.gz
-Added configuration warning system for nodes
-Added a new "add" and "instance" buttons for scene tree -Added a vformat() function to ease translation work
Diffstat (limited to 'scene/2d/visibility_notifier_2d.cpp')
-rw-r--r--scene/2d/visibility_notifier_2d.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp
index 426e86fa13..2a5108c627 100644
--- a/scene/2d/visibility_notifier_2d.cpp
+++ b/scene/2d/visibility_notifier_2d.cpp
@@ -346,6 +346,16 @@ void VisibilityEnabler2D::_node_removed(Node* p_node) {
}
+String VisibilityEnabler2D::get_configuration_warning() const {
+
+ if (is_inside_tree() && get_parent() && (get_parent()->get_filename()==String() && get_parent()!=get_tree()->get_edited_scene_root())) {
+ return TTR("VisibilityEnable2D works best when used with the edited scene root directly as parent.");
+ }
+
+ return String();
+}
+
+
void VisibilityEnabler2D::_bind_methods(){
ObjectTypeDB::bind_method(_MD("set_enabler","enabler","enabled"),&VisibilityEnabler2D::set_enabler);