mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09: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:
@ -146,16 +146,17 @@ namespace osu.Game.Screens.Menu
|
|||||||
supportFlow.AddText(" to help support osu!'s development", formatSemiBold);
|
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.Padding = new MarginPadding { Left = 5, Top = 3 };
|
||||||
t.Font = t.Font.With(size: 20);
|
t.Font = t.Font.With(size: 20);
|
||||||
t.Origin = Anchor.Centre;
|
t.Origin = Anchor.Centre;
|
||||||
t.Colour = colours.Pink;
|
t.Colour = colours.Pink;
|
||||||
}).Drawables.First();
|
|
||||||
|
|
||||||
if (IsLoaded)
|
Schedule(() => heart?.FlashColour(Color4.White, 750, Easing.OutQuint).Loop());
|
||||||
animateHeart();
|
});
|
||||||
|
|
||||||
if (supportFlow.IsPresent)
|
if (supportFlow.IsPresent)
|
||||||
supportFlow.FadeInFromZero(500);
|
supportFlow.FadeInFromZero(500);
|
||||||
@ -171,6 +172,14 @@ namespace osu.Game.Screens.Menu
|
|||||||
((IBindable<APIUser>)currentUser).BindTo(api.LocalUser);
|
((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)
|
public override void OnEntering(ScreenTransitionEvent e)
|
||||||
{
|
{
|
||||||
base.OnEntering(e);
|
base.OnEntering(e);
|
||||||
@ -206,8 +215,6 @@ namespace osu.Game.Screens.Menu
|
|||||||
foreach (var c in textFlow.Children)
|
foreach (var c in textFlow.Children)
|
||||||
c.FadeTo(0.001f).Delay(delay += 20).FadeIn(500);
|
c.FadeTo(0.001f).Delay(delay += 20).FadeIn(500);
|
||||||
|
|
||||||
animateHeart();
|
|
||||||
|
|
||||||
this
|
this
|
||||||
.FadeInFromZero(500)
|
.FadeInFromZero(500)
|
||||||
.Then(5500)
|
.Then(5500)
|
||||||
@ -244,10 +251,5 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
return tips[RNG.Next(0, tips.Length)];
|
return tips[RNG.Next(0, tips.Length)];
|
||||||
}
|
}
|
||||||
|
|
||||||
private void animateHeart()
|
|
||||||
{
|
|
||||||
heart.FlashColour(Color4.White, 750, Easing.OutQuint).Loop();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user