mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 09:53:59 +02:00
fix AnimationLoop::setRunning() to not constantly reset the frame when the running state doesn't actually change
This commit is contained in:
parent
89231adc19
commit
1dd40af162
2 changed files with 9 additions and 5 deletions
libraries
|
@ -84,14 +84,14 @@ void AnimationLoop::setStartAutomatically(bool startAutomatically) {
|
|||
}
|
||||
|
||||
void AnimationLoop::setRunning(bool running) {
|
||||
if (_running == running) {
|
||||
// don't do anything if the new value is the same as the value we already have
|
||||
if (_running != running) {
|
||||
_running = running;
|
||||
|
||||
// If we just set running to true, then also reset the frame to the first frame
|
||||
if (running) {
|
||||
// move back to the beginning
|
||||
_frameIndex = _firstFrame;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ((_running = running)) {
|
||||
_frameIndex = _firstFrame;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -128,6 +128,10 @@ void EntityItemProperties::setSittingPoints(const QVector<SittingPoint>& sitting
|
|||
}
|
||||
}
|
||||
|
||||
bool EntityItemProperties::animationSettingsChanged() const {
|
||||
return _animationSettingsChanged;
|
||||
}
|
||||
|
||||
void EntityItemProperties::setAnimationSettings(const QString& value) {
|
||||
// the animations setting is a JSON string that may contain various animation settings.
|
||||
// if it includes fps, frameIndex, or running, those values will be parsed out and
|
||||
|
|
Loading…
Reference in a new issue