mirror of
https://github.com/ppy/osu.git
synced 2025-02-12 13:22:56 +08:00
Delay medal display when wanting to show results animation
This commit is contained in:
parent
96825915f7
commit
611e3fe76b
@ -54,7 +54,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
OverlayActivationMode.BindValueChanged(val =>
|
||||
{
|
||||
if (val.NewValue != OverlayActivation.Disabled && (queuedMedals.Any() || medalContainer.Any()))
|
||||
if (val.NewValue == OverlayActivation.All && (queuedMedals.Any() || medalContainer.Any()))
|
||||
Show();
|
||||
}, true);
|
||||
}
|
||||
@ -81,7 +81,8 @@ namespace osu.Game.Overlays
|
||||
|
||||
var medalAnimation = new MedalAnimation(medal);
|
||||
queuedMedals.Enqueue(medalAnimation);
|
||||
Scheduler.AddOnce(Show);
|
||||
if (OverlayActivationMode.Value == OverlayActivation.All)
|
||||
Scheduler.AddOnce(Show);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
|
@ -31,6 +31,11 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
||||
/// </summary>
|
||||
public partial class AccuracyCircle : CompositeDrawable
|
||||
{
|
||||
/// <summary>
|
||||
/// The total duration of the animation.
|
||||
/// </summary>
|
||||
public const double TOTAL_DURATION = APPEAR_DURATION + ACCURACY_TRANSFORM_DELAY + ACCURACY_TRANSFORM_DURATION;
|
||||
|
||||
/// <summary>
|
||||
/// Duration for the transforms causing this component to appear.
|
||||
/// </summary>
|
||||
|
@ -25,8 +25,10 @@ using osu.Game.Input.Bindings;
|
||||
using osu.Game.Localisation;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.Placeholders;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Screens.Ranking.Expanded.Accuracy;
|
||||
using osu.Game.Screens.Ranking.Statistics;
|
||||
using osuTK;
|
||||
|
||||
@ -41,6 +43,8 @@ namespace osu.Game.Screens.Ranking
|
||||
|
||||
public override bool? AllowGlobalTrackControl => true;
|
||||
|
||||
protected override OverlayActivation InitialOverlayActivationMode => OverlayActivation.UserTriggered;
|
||||
|
||||
public readonly Bindable<ScoreInfo> SelectedScore = new Bindable<ScoreInfo>();
|
||||
|
||||
[CanBeNull]
|
||||
@ -160,6 +164,10 @@ namespace osu.Game.Screens.Ranking
|
||||
bool shouldFlair = player != null && !Score.User.IsBot;
|
||||
|
||||
ScorePanelList.AddScore(Score, shouldFlair);
|
||||
// this is mostly for medal display.
|
||||
// we don't want the medal animation to trample on the results screen animation, so we (ab)use `OverlayActivationMode`
|
||||
// to give the results screen enough time to play the animation out before the medals can be shown.
|
||||
Scheduler.AddDelayed(() => OverlayActivationMode.Value = OverlayActivation.All, shouldFlair ? AccuracyCircle.TOTAL_DURATION + 1000 : 0);
|
||||
}
|
||||
|
||||
if (allowWatchingReplay)
|
||||
|
Loading…
Reference in New Issue
Block a user