UI: Always apply tweens after restore.

Fixes "Loading game..." persisting on load state, since that view was
created VISIBLE, and the tween wasn't making it INVISIBLE.
This commit is contained in:
Unknown W. Brackets 2017-12-09 18:18:23 -08:00
parent b10b24feea
commit 7b6e73b37a

View file

@ -19,7 +19,6 @@ void TweenBase<Value>::PersistData(PersistStatus status, std::string anonId, Per
float duration;
Value from;
Value to;
bool finishApplied;
};
PersistBuffer &buffer = storage["TweenBase::" + anonId];
@ -33,7 +32,6 @@ void TweenBase<Value>::PersistData(PersistStatus status, std::string anonId, Per
data.duration = duration_;
data.from = from_;
data.to = to_;
data.finishApplied = finishApplied_;
}
break;
case UI::PERSIST_RESTORE:
@ -43,7 +41,8 @@ void TweenBase<Value>::PersistData(PersistStatus status, std::string anonId, Per
duration_ = data.duration;
from_ = data.from;
to_ = data.to;
finishApplied_ = data.finishApplied;
// We skip finishApplied_ here so that the tween will reapply.
// This does mean it's important to remember to update tweens even after finish.
}
break;
}