summaryrefslogtreecommitdiff
path: root/scene/2d/navigation_polygon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/navigation_polygon.cpp')
-rw-r--r--scene/2d/navigation_polygon.cpp63
1 files changed, 32 insertions, 31 deletions
diff --git a/scene/2d/navigation_polygon.cpp b/scene/2d/navigation_polygon.cpp
index 5c1837ad65..9dbbd34ae9 100644
--- a/scene/2d/navigation_polygon.cpp
+++ b/scene/2d/navigation_polygon.cpp
@@ -137,7 +137,7 @@ PoolVector<Vector2> NavigationPolygon::get_outline(int p_idx) const {
void NavigationPolygon::clear_outlines(){
- outlines.clear();;
+ outlines.clear();
}
void NavigationPolygon::make_polygons_from_outlines(){
@@ -247,32 +247,32 @@ void NavigationPolygon::make_polygons_from_outlines(){
void NavigationPolygon::_bind_methods() {
- ClassDB::bind_method(_MD("set_vertices","vertices"),&NavigationPolygon::set_vertices);
- ClassDB::bind_method(_MD("get_vertices"),&NavigationPolygon::get_vertices);
+ ClassDB::bind_method(D_METHOD("set_vertices","vertices"),&NavigationPolygon::set_vertices);
+ ClassDB::bind_method(D_METHOD("get_vertices"),&NavigationPolygon::get_vertices);
- ClassDB::bind_method(_MD("add_polygon","polygon"),&NavigationPolygon::add_polygon);
- ClassDB::bind_method(_MD("get_polygon_count"),&NavigationPolygon::get_polygon_count);
- ClassDB::bind_method(_MD("get_polygon","idx"),&NavigationPolygon::get_polygon);
- ClassDB::bind_method(_MD("clear_polygons"),&NavigationPolygon::clear_polygons);
+ ClassDB::bind_method(D_METHOD("add_polygon","polygon"),&NavigationPolygon::add_polygon);
+ ClassDB::bind_method(D_METHOD("get_polygon_count"),&NavigationPolygon::get_polygon_count);
+ ClassDB::bind_method(D_METHOD("get_polygon","idx"),&NavigationPolygon::get_polygon);
+ ClassDB::bind_method(D_METHOD("clear_polygons"),&NavigationPolygon::clear_polygons);
- ClassDB::bind_method(_MD("add_outline","outline"),&NavigationPolygon::add_outline);
- ClassDB::bind_method(_MD("add_outline_at_index","outline","index"),&NavigationPolygon::add_outline_at_index);
- ClassDB::bind_method(_MD("get_outline_count"),&NavigationPolygon::get_outline_count);
- ClassDB::bind_method(_MD("set_outline","idx","outline"),&NavigationPolygon::set_outline);
- ClassDB::bind_method(_MD("get_outline","idx"),&NavigationPolygon::get_outline);
- ClassDB::bind_method(_MD("remove_outline","idx"),&NavigationPolygon::remove_outline);
- ClassDB::bind_method(_MD("clear_outlines"),&NavigationPolygon::clear_outlines);
- ClassDB::bind_method(_MD("make_polygons_from_outlines"),&NavigationPolygon::make_polygons_from_outlines);
+ ClassDB::bind_method(D_METHOD("add_outline","outline"),&NavigationPolygon::add_outline);
+ ClassDB::bind_method(D_METHOD("add_outline_at_index","outline","index"),&NavigationPolygon::add_outline_at_index);
+ ClassDB::bind_method(D_METHOD("get_outline_count"),&NavigationPolygon::get_outline_count);
+ ClassDB::bind_method(D_METHOD("set_outline","idx","outline"),&NavigationPolygon::set_outline);
+ ClassDB::bind_method(D_METHOD("get_outline","idx"),&NavigationPolygon::get_outline);
+ ClassDB::bind_method(D_METHOD("remove_outline","idx"),&NavigationPolygon::remove_outline);
+ ClassDB::bind_method(D_METHOD("clear_outlines"),&NavigationPolygon::clear_outlines);
+ ClassDB::bind_method(D_METHOD("make_polygons_from_outlines"),&NavigationPolygon::make_polygons_from_outlines);
- ClassDB::bind_method(_MD("_set_polygons","polygons"),&NavigationPolygon::_set_polygons);
- ClassDB::bind_method(_MD("_get_polygons"),&NavigationPolygon::_get_polygons);
+ ClassDB::bind_method(D_METHOD("_set_polygons","polygons"),&NavigationPolygon::_set_polygons);
+ ClassDB::bind_method(D_METHOD("_get_polygons"),&NavigationPolygon::_get_polygons);
- ClassDB::bind_method(_MD("_set_outlines","outlines"),&NavigationPolygon::_set_outlines);
- ClassDB::bind_method(_MD("_get_outlines"),&NavigationPolygon::_get_outlines);
+ ClassDB::bind_method(D_METHOD("_set_outlines","outlines"),&NavigationPolygon::_set_outlines);
+ ClassDB::bind_method(D_METHOD("_get_outlines"),&NavigationPolygon::_get_outlines);
- ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY,"vertices",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_vertices"),_SCS("get_vertices"));
- ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"polygons",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_polygons"),_SCS("_get_polygons"));
- ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"outlines",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_outlines"),_SCS("_get_outlines"));
+ ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY,"vertices",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_vertices","get_vertices");
+ ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"polygons",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"_set_polygons","_get_polygons");
+ ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"outlines",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"_set_outlines","_get_outlines");
}
NavigationPolygon::NavigationPolygon() {
@@ -310,7 +310,7 @@ void NavigationPolygonInstance::set_enabled(bool p_enabled) {
if (get_tree()->is_editor_hint() || get_tree()->is_debugging_navigation_hint())
update();
-// update_gizmo();
+ //update_gizmo();
}
bool NavigationPolygonInstance::is_enabled() const {
@@ -459,7 +459,7 @@ void NavigationPolygonInstance::_navpoly_changed() {
String NavigationPolygonInstance::get_configuration_warning() const {
- if (!is_visible() || !is_inside_tree())
+ if (!is_visible_in_tree() || !is_inside_tree())
return String();
if (!navpoly.is_valid()) {
@@ -480,16 +480,16 @@ String NavigationPolygonInstance::get_configuration_warning() const {
void NavigationPolygonInstance::_bind_methods() {
- ClassDB::bind_method(_MD("set_navigation_polygon","navpoly:NavigationPolygon"),&NavigationPolygonInstance::set_navigation_polygon);
- ClassDB::bind_method(_MD("get_navigation_polygon:NavigationPolygon"),&NavigationPolygonInstance::get_navigation_polygon);
+ ClassDB::bind_method(D_METHOD("set_navigation_polygon","navpoly:NavigationPolygon"),&NavigationPolygonInstance::set_navigation_polygon);
+ ClassDB::bind_method(D_METHOD("get_navigation_polygon:NavigationPolygon"),&NavigationPolygonInstance::get_navigation_polygon);
- ClassDB::bind_method(_MD("set_enabled","enabled"),&NavigationPolygonInstance::set_enabled);
- ClassDB::bind_method(_MD("is_enabled"),&NavigationPolygonInstance::is_enabled);
+ ClassDB::bind_method(D_METHOD("set_enabled","enabled"),&NavigationPolygonInstance::set_enabled);
+ ClassDB::bind_method(D_METHOD("is_enabled"),&NavigationPolygonInstance::is_enabled);
- ClassDB::bind_method(_MD("_navpoly_changed"),&NavigationPolygonInstance::_navpoly_changed);
+ ClassDB::bind_method(D_METHOD("_navpoly_changed"),&NavigationPolygonInstance::_navpoly_changed);
- ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"navpoly",PROPERTY_HINT_RESOURCE_TYPE,"NavigationPolygon"),_SCS("set_navigation_polygon"),_SCS("get_navigation_polygon"));
- ADD_PROPERTY( PropertyInfo(Variant::BOOL,"enabled"),_SCS("set_enabled"),_SCS("is_enabled"));
+ ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"navpoly",PROPERTY_HINT_RESOURCE_TYPE,"NavigationPolygon"),"set_navigation_polygon","get_navigation_polygon");
+ ADD_PROPERTY( PropertyInfo(Variant::BOOL,"enabled"),"set_enabled","is_enabled");
}
NavigationPolygonInstance::NavigationPolygonInstance() {
@@ -497,5 +497,6 @@ NavigationPolygonInstance::NavigationPolygonInstance() {
navigation=NULL;
nav_id=-1;
enabled=true;
+ set_notify_transform(true);
}