Inspector: Fix PROPERTY_HINT_SPRITE_FRAME not behaving as RANGE

This was a regression in 3.1 and later from the new inspector, where
PROPERTY_HINT_SPRITE_FRAME was not fully re-implemented. It's meant to
be a normal PROPERTY_HINT_RANGE which also automatically increments its
value when keyed in the animation player.

To avoid code duplication, I made the frames properties use the actual
PROPERTY_HINT_RANGE and introduced a PROPERTY_USAGE_KEYING_INCREMENTS
usage flag instead.
This commit is contained in:
Rémi Verschelde
2019-07-25 09:11:41 +02:00
parent eb300ba8fe
commit 336846e547
6 changed files with 21 additions and 24 deletions

View File

@@ -504,7 +504,7 @@ bool EditorProperty::use_keying_next() const {
PropertyInfo &p = I->get();
if (p.name == property) {
return p.hint == PROPERTY_HINT_SPRITE_FRAME;
return (p.usage & PROPERTY_USAGE_KEYING_INCREMENTS);
}
}