mirror of
https://github.com/godotengine/godot.git
synced 2024-11-28 23:22:38 +00:00
Fix no hint_string
for frame
property in AnimatedSprite
s
This commit is contained in:
parent
6f02454634
commit
73ecd71b7d
@ -138,8 +138,11 @@ void AnimatedSprite2D::_validate_property(PropertyInfo &property) const {
|
||||
|
||||
if (property.name == "frame") {
|
||||
property.hint = PROPERTY_HINT_RANGE;
|
||||
if (frames->has_animation(animation) && frames->get_frame_count(animation) > 1) {
|
||||
if (frames->has_animation(animation) && frames->get_frame_count(animation) > 0) {
|
||||
property.hint_string = "0," + itos(frames->get_frame_count(animation) - 1) + ",1";
|
||||
} else {
|
||||
// Avoid an error, `hint_string` is required for `PROPERTY_HINT_RANGE`.
|
||||
property.hint_string = "0,0,1";
|
||||
}
|
||||
property.usage |= PROPERTY_USAGE_KEYING_INCREMENTS;
|
||||
}
|
||||
|
@ -1034,8 +1034,11 @@ void AnimatedSprite3D::_validate_property(PropertyInfo &property) const {
|
||||
|
||||
if (property.name == "frame") {
|
||||
property.hint = PROPERTY_HINT_RANGE;
|
||||
if (frames->has_animation(animation) && frames->get_frame_count(animation) > 1) {
|
||||
if (frames->has_animation(animation) && frames->get_frame_count(animation) > 0) {
|
||||
property.hint_string = "0," + itos(frames->get_frame_count(animation) - 1) + ",1";
|
||||
} else {
|
||||
// Avoid an error, `hint_string` is required for `PROPERTY_HINT_RANGE`.
|
||||
property.hint_string = "0,0,1";
|
||||
}
|
||||
property.usage |= PROPERTY_USAGE_KEYING_INCREMENTS;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user