| 544 | } |
| 545 | |
| 546 | bool UserEventStream::SetScreen(ScreenBase const & endScreen, bool isAnim, |
| 547 | TAnimationCreator const & parallelAnimCreator) |
| 548 | { |
| 549 | if (isAnim) |
| 550 | { |
| 551 | ScreenBase const & screen = GetCurrentScreen(); |
| 552 | |
| 553 | drape_ptr<Animation> anim = GetRectAnimation(screen, endScreen); |
| 554 | if (!df::IsAnimationAllowed(anim->GetDuration(), screen)) |
| 555 | { |
| 556 | anim.reset(); |
| 557 | double const moveDuration = PositionInterpolator::GetMoveDuration(screen.GetOrg(), endScreen.GetOrg(), screen); |
| 558 | if (moveDuration > kMaxAnimationTimeSec) |
| 559 | anim = GetPrettyMoveAnimation(screen, endScreen); |
| 560 | } |
| 561 | else |
| 562 | { |
| 563 | anim->SetMaxDuration(kMaxAnimationTimeSec); |
| 564 | } |
| 565 | |
| 566 | if (anim != nullptr) |
| 567 | { |
| 568 | if (parallelAnimCreator != nullptr) |
| 569 | { |
| 570 | drape_ptr<ParallelAnimation> parallelAnim = make_unique_dp<ParallelAnimation>(); |
| 571 | parallelAnim->SetCustomType(kParallelLinearAnim); |
| 572 | parallelAnim->AddAnimation(parallelAnimCreator(nullptr /* syncAnim */)); |
| 573 | parallelAnim->AddAnimation(std::move(anim)); |
| 574 | m_animationSystem.CombineAnimation(std::move(parallelAnim)); |
| 575 | } |
| 576 | else |
| 577 | { |
| 578 | m_animationSystem.CombineAnimation(std::move(anim)); |
| 579 | } |
| 580 | return false; |
| 581 | } |
| 582 | } |
| 583 | |
| 584 | ResetMapPlaneAnimations(); |
| 585 | m_navigator.SetFromScreen(endScreen); |
| 586 | return true; |
| 587 | } |
| 588 | |
| 589 | bool UserEventStream::InterruptFollowAnimations(bool force) |
| 590 | { |
nothing calls this directly
no test coverage detected