diff --git a/osu.Game/Online/Leaderboards/UpdateableRank.cs b/osu.Game/Online/Leaderboards/UpdateableRank.cs index 717adee79d..b64fab6861 100644 --- a/osu.Game/Online/Leaderboards/UpdateableRank.cs +++ b/osu.Game/Online/Leaderboards/UpdateableRank.cs @@ -1,14 +1,19 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Transforms; using osu.Game.Scoring; namespace osu.Game.Online.Leaderboards { public partial class UpdateableRank : ModelBackedDrawable { + protected override double TransformDuration => 600; + protected override bool TransformImmediately => true; + public ScoreRank? Rank { get => Model; @@ -20,6 +25,16 @@ namespace osu.Game.Online.Leaderboards Rank = rank; } + protected override DelayedLoadWrapper CreateDelayedLoadWrapper(Func createContentFunc, double timeBeforeLoad) + { + return base.CreateDelayedLoadWrapper(createContentFunc, timeBeforeLoad) + .With(w => + { + w.Anchor = Anchor.Centre; + w.Origin = Anchor.Centre; + }); + } + protected override Drawable? CreateDrawable(ScoreRank? rank) { if (rank.HasValue) @@ -33,5 +48,18 @@ namespace osu.Game.Online.Leaderboards return null; } + + protected override TransformSequence ApplyShowTransforms(Drawable drawable) + { + drawable.ScaleTo(1); + return base.ApplyShowTransforms(drawable); + } + + protected override TransformSequence ApplyHideTransforms(Drawable drawable) + { + drawable.ScaleTo(1.8f, TransformDuration, Easing.Out); + + return base.ApplyHideTransforms(drawable); + } } } diff --git a/osu.Game/Skinning/LegacyRankDisplay.cs b/osu.Game/Skinning/LegacyRankDisplay.cs index 71d487eade..70b5ed0278 100644 --- a/osu.Game/Skinning/LegacyRankDisplay.cs +++ b/osu.Game/Skinning/LegacyRankDisplay.cs @@ -52,8 +52,8 @@ namespace osu.Game.Skinning BypassAutoSizeAxes = Axes.Both, }; AddInternal(transientRank); - transientRank.FadeOutFromOne(1200, Easing.Out) - .ScaleTo(new Vector2(1.625f), 1200, Easing.Out) + transientRank.FadeOutFromOne(500, Easing.Out) + .ScaleTo(new Vector2(1.625f), 500, Easing.Out) .Expire(); } }, true);