mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-24 12:47:12 +01:00
Don't store frame of playing AnimatedSprite
This commit is contained in:
parent
9762395888
commit
903c9932e5
@ -366,6 +366,11 @@ void AnimatedSprite::_validate_property(PropertyInfo &property) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (property.name == "frame") {
|
if (property.name == "frame") {
|
||||||
|
if (playing) {
|
||||||
|
property.usage = PROPERTY_USAGE_EDITOR;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
property.hint = PROPERTY_HINT_RANGE;
|
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) > 1) {
|
||||||
property.hint_string = "0," + itos(frames->get_frame_count(animation) - 1) + ",1";
|
property.hint_string = "0," + itos(frames->get_frame_count(animation) - 1) + ",1";
|
||||||
@ -609,6 +614,7 @@ void AnimatedSprite::set_playing(bool p_playing) {
|
|||||||
playing = p_playing;
|
playing = p_playing;
|
||||||
_reset_timeout();
|
_reset_timeout();
|
||||||
set_process_internal(playing);
|
set_process_internal(playing);
|
||||||
|
property_list_changed_notify();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AnimatedSprite::is_playing() const {
|
bool AnimatedSprite::is_playing() const {
|
||||||
|
@ -900,6 +900,11 @@ void AnimatedSprite3D::_validate_property(PropertyInfo &property) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (property.name == "frame") {
|
if (property.name == "frame") {
|
||||||
|
if (playing) {
|
||||||
|
property.usage = PROPERTY_USAGE_EDITOR;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
property.hint = PROPERTY_HINT_RANGE;
|
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) > 1) {
|
||||||
property.hint_string = "0," + itos(frames->get_frame_count(animation) - 1) + ",1";
|
property.hint_string = "0," + itos(frames->get_frame_count(animation) - 1) + ",1";
|
||||||
@ -1052,6 +1057,7 @@ void AnimatedSprite3D::_set_playing(bool p_playing) {
|
|||||||
playing = p_playing;
|
playing = p_playing;
|
||||||
_reset_timeout();
|
_reset_timeout();
|
||||||
set_process_internal(playing);
|
set_process_internal(playing);
|
||||||
|
property_list_changed_notify();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AnimatedSprite3D::_is_playing() const {
|
bool AnimatedSprite3D::_is_playing() const {
|
||||||
|
Loading…
Reference in New Issue
Block a user