1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:37:28 +08:00

Merge pull request #18726 from peppy/disclaimer-stop-handling-after-suspend

Fix `Disclaimer` screen handling user change events after initial display
This commit is contained in:
Dean Herbert 2022-06-17 18:28:06 +09:00 committed by GitHub
commit 5d93db1522
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,16 +146,17 @@ namespace osu.Game.Screens.Menu
supportFlow.AddText(" to help support osu!'s development", formatSemiBold);
}
heart = supportFlow.AddIcon(FontAwesome.Solid.Heart, t =>
supportFlow.AddIcon(FontAwesome.Solid.Heart, t =>
{
heart = t;
t.Padding = new MarginPadding { Left = 5, Top = 3 };
t.Font = t.Font.With(size: 20);
t.Origin = Anchor.Centre;
t.Colour = colours.Pink;
}).Drawables.First();
if (IsLoaded)
animateHeart();
Schedule(() => heart?.FlashColour(Color4.White, 750, Easing.OutQuint).Loop());
});
if (supportFlow.IsPresent)
supportFlow.FadeInFromZero(500);
@ -171,6 +172,14 @@ namespace osu.Game.Screens.Menu
((IBindable<APIUser>)currentUser).BindTo(api.LocalUser);
}
public override void OnSuspending(ScreenTransitionEvent e)
{
base.OnSuspending(e);
// Once this screen has finished being displayed, we don't want to unnecessarily handle user change events.
currentUser.UnbindAll();
}
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(e);
@ -206,8 +215,6 @@ namespace osu.Game.Screens.Menu
foreach (var c in textFlow.Children)
c.FadeTo(0.001f).Delay(delay += 20).FadeIn(500);
animateHeart();
this
.FadeInFromZero(500)
.Then(5500)
@ -244,10 +251,5 @@ namespace osu.Game.Screens.Menu
return tips[RNG.Next(0, tips.Length)];
}
private void animateHeart()
{
heart.FlashColour(Color4.White, 750, Easing.OutQuint).Loop();
}
}
}