1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 05:02:55 +08:00

Merge pull request #2682 from peppy/fix-osu-logo-discrepancies

Fix logo animation discrepancies
This commit is contained in:
Dan Balasescu 2018-05-31 15:31:43 +09:00 committed by GitHub
commit 824d6ae718
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 16 deletions

View File

@ -254,9 +254,6 @@ namespace osu.Game.Screens.Menu
backButton.ContractStyle = 0; backButton.ContractStyle = 0;
settingsButton.ContractStyle = 0; settingsButton.ContractStyle = 0;
if (state == MenuState.TopLevel)
buttonArea.FinishTransforms(true);
updateLogoState(lastState); updateLogoState(lastState);
using (buttonArea.BeginDelayedSequence(lastState == MenuState.Initial ? 150 : 0, true)) using (buttonArea.BeginDelayedSequence(lastState == MenuState.Initial ? 150 : 0, true))
@ -325,16 +322,15 @@ namespace osu.Game.Screens.Menu
{ {
if (logo == null) return; if (logo == null) return;
logoDelayedAction?.Cancel();
switch (state) switch (state)
{ {
case MenuState.Exit: case MenuState.Exit:
case MenuState.Initial: case MenuState.Initial:
logoTracking = false; logoDelayedAction?.Cancel();
logoDelayedAction = Scheduler.AddDelayed(() => logoDelayedAction = Scheduler.AddDelayed(() =>
{ {
logoTracking = false;
hideOverlaysOnEnter.Value = true; hideOverlaysOnEnter.Value = true;
allowOpeningOverlays.Value = false; allowOpeningOverlays.Value = false;
@ -343,27 +339,31 @@ namespace osu.Game.Screens.Menu
logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo); logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo);
logo.ScaleTo(1, 800, Easing.OutExpo); logo.ScaleTo(1, 800, Easing.OutExpo);
}, 150); }, buttonArea.Alpha * 150);
break; break;
case MenuState.TopLevel: case MenuState.TopLevel:
case MenuState.Play: case MenuState.Play:
logo.ClearTransforms(targetMember: nameof(Position));
logo.RelativePositionAxes = Axes.None;
switch (lastState) switch (lastState)
{ {
case MenuState.TopLevel: // coming from toplevel to play case MenuState.TopLevel: // coming from toplevel to play
break;
case MenuState.Initial: case MenuState.Initial:
logoTracking = false; logo.ClearTransforms(targetMember: nameof(Position));
logo.RelativePositionAxes = Axes.None;
bool impact = logo.Scale.X > 0.6f;
if (lastState == MenuState.Initial)
logo.ScaleTo(0.5f, 200, Easing.In); logo.ScaleTo(0.5f, 200, Easing.In);
logo.MoveTo(logoTrackingPosition, lastState == MenuState.EnteringMode ? 0 : 200, Easing.In); logo.MoveTo(logoTrackingPosition, lastState == MenuState.EnteringMode ? 0 : 200, Easing.In);
logoDelayedAction?.Cancel();
logoDelayedAction = Scheduler.AddDelayed(() => logoDelayedAction = Scheduler.AddDelayed(() =>
{ {
logoTracking = true; logoTracking = true;
if (impact)
logo.Impact(); logo.Impact();
hideOverlaysOnEnter.Value = false; hideOverlaysOnEnter.Value = false;
@ -371,6 +371,8 @@ namespace osu.Game.Screens.Menu
}, 200); }, 200);
break; break;
default: default:
logo.ClearTransforms(targetMember: nameof(Position));
logo.RelativePositionAxes = Axes.None;
logoTracking = true; logoTracking = true;
logo.ScaleTo(0.5f, 200, Easing.OutQuint); logo.ScaleTo(0.5f, 200, Easing.OutQuint);
break; break;

View File

@ -231,7 +231,10 @@ namespace osu.Game.Screens
private void applyArrivingDefaults(bool isResuming) private void applyArrivingDefaults(bool isResuming)
{ {
logo.AppendAnimatingAction(() => LogoArriving(logo, isResuming), true); logo.AppendAnimatingAction(() =>
{
if (IsCurrentScreen) LogoArriving(logo, isResuming);
}, true);
if (backgroundParallaxContainer != null) if (backgroundParallaxContainer != null)
backgroundParallaxContainer.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * BackgroundParallaxAmount; backgroundParallaxContainer.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * BackgroundParallaxAmount;