summaryrefslogtreecommitdiffstats
path: root/scene/2d/collision_shape_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/collision_shape_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/collision_shape_2d.cpp')
-rw-r--r--scene/2d/collision_shape_2d.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp
index 405310450b..c737cf0faf 100644
--- a/scene/2d/collision_shape_2d.cpp
+++ b/scene/2d/collision_shape_2d.cpp
@@ -201,6 +201,19 @@ int CollisionShape2D::_get_update_shape_index() const{
return update_shape_index;
}
+String CollisionShape2D::get_configuration_warning() const {
+
+ if (!get_parent()->cast_to<CollisionObject2D>()) {
+ return TTR("CollisionShape2D only serves to provide a collision shape to a CollisionObject2D derived node. Please only use it as a child of Area2D, StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape.");
+ }
+
+ if (!shape.is_valid()) {
+ return TTR("A shape must be provided for CollisionShape2D to function. Please create a shape resource for it!");
+ }
+
+ return String();
+}
+
void CollisionShape2D::_bind_methods() {