diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-01-03 20:10:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-03 20:10:58 +0100 |
commit | c82db39cd4066fd393dedcb0bf5dda5818a63bef (patch) | |
tree | 3ee1ba5d59807297e96c46c84b6fdd6856a8d101 | |
parent | c0fcf77b3878873704200b754cdc27d4dc88a084 (diff) | |
parent | a1fbef3d6082db7538e69f1378b703b0c38110f3 (diff) |
Merge pull request #24746 from timoschwarzer/24745-pathfollow2d-offset
Allow offset and unit_offset to be set higher than one loop
-rw-r--r-- | scene/2d/path_2d.cpp | 4 | ||||
-rw-r--r-- | scene/3d/path.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index 1b1b8222b9..271e132002 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -261,7 +261,7 @@ void PathFollow2D::_validate_property(PropertyInfo &property) const { if (path && path->get_curve().is_valid()) max = path->get_curve()->get_baked_length(); - property.hint_string = "0," + rtos(max) + ",0.01"; + property.hint_string = "0," + rtos(max) + ",0.01,or_greater"; } } @@ -304,7 +304,7 @@ void PathFollow2D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_lookahead"), &PathFollow2D::get_lookahead); ADD_PROPERTY(PropertyInfo(Variant::REAL, "offset", PROPERTY_HINT_RANGE, "0,10000,0.01,or_greater"), "set_offset", "get_offset"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_offset", PROPERTY_HINT_RANGE, "0,1,0.0001", PROPERTY_USAGE_EDITOR), "set_unit_offset", "get_unit_offset"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_offset", PROPERTY_HINT_RANGE, "0,1,0.0001,or_greater", PROPERTY_USAGE_EDITOR), "set_unit_offset", "get_unit_offset"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "h_offset"), "set_h_offset", "get_h_offset"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "v_offset"), "set_v_offset", "get_v_offset"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "rotate"), "set_rotate", "is_rotating"); diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp index a06ac973b4..4e027f43f6 100644 --- a/scene/3d/path.cpp +++ b/scene/3d/path.cpp @@ -213,7 +213,7 @@ void PathFollow::_validate_property(PropertyInfo &property) const { if (path && path->get_curve().is_valid()) max = path->get_curve()->get_baked_length(); - property.hint_string = "0," + rtos(max) + ",0.01"; + property.hint_string = "0," + rtos(max) + ",0.01,or_greater"; } } @@ -253,7 +253,7 @@ void PathFollow::_bind_methods() { ClassDB::bind_method(D_METHOD("has_loop"), &PathFollow::has_loop); ADD_PROPERTY(PropertyInfo(Variant::REAL, "offset", PROPERTY_HINT_RANGE, "0,10000,0.01,or_greater"), "set_offset", "get_offset"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_offset", PROPERTY_HINT_RANGE, "0,1,0.0001", PROPERTY_USAGE_EDITOR), "set_unit_offset", "get_unit_offset"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_offset", PROPERTY_HINT_RANGE, "0,1,0.0001,or_greater", PROPERTY_USAGE_EDITOR), "set_unit_offset", "get_unit_offset"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "h_offset"), "set_h_offset", "get_h_offset"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "v_offset"), "set_v_offset", "get_v_offset"); ADD_PROPERTY(PropertyInfo(Variant::INT, "rotation_mode", PROPERTY_HINT_ENUM, "None,Y,XY,XYZ"), "set_rotation_mode", "get_rotation_mode"); |