mirror of https://github.com/ppy/osu
Delay medal display when wanting to show results animation
This commit is contained in:
parent
96825915f7
commit
611e3fe76b
|
@ -54,7 +54,7 @@ protected override void LoadComplete()
|
||||||
|
|
||||||
OverlayActivationMode.BindValueChanged(val =>
|
OverlayActivationMode.BindValueChanged(val =>
|
||||||
{
|
{
|
||||||
if (val.NewValue != OverlayActivation.Disabled && (queuedMedals.Any() || medalContainer.Any()))
|
if (val.NewValue == OverlayActivation.All && (queuedMedals.Any() || medalContainer.Any()))
|
||||||
Show();
|
Show();
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
@ -81,6 +81,7 @@ private void handleMedalMessages(SocketMessage obj)
|
||||||
|
|
||||||
var medalAnimation = new MedalAnimation(medal);
|
var medalAnimation = new MedalAnimation(medal);
|
||||||
queuedMedals.Enqueue(medalAnimation);
|
queuedMedals.Enqueue(medalAnimation);
|
||||||
|
if (OverlayActivationMode.Value == OverlayActivation.All)
|
||||||
Scheduler.AddOnce(Show);
|
Scheduler.AddOnce(Show);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,11 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class AccuracyCircle : CompositeDrawable
|
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>
|
/// <summary>
|
||||||
/// Duration for the transforms causing this component to appear.
|
/// Duration for the transforms causing this component to appear.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -25,8 +25,10 @@
|
||||||
using osu.Game.Localisation;
|
using osu.Game.Localisation;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.Placeholders;
|
using osu.Game.Online.Placeholders;
|
||||||
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
|
using osu.Game.Screens.Ranking.Expanded.Accuracy;
|
||||||
using osu.Game.Screens.Ranking.Statistics;
|
using osu.Game.Screens.Ranking.Statistics;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
|
@ -41,6 +43,8 @@ public abstract partial class ResultsScreen : ScreenWithBeatmapBackground, IKeyB
|
||||||
|
|
||||||
public override bool? AllowGlobalTrackControl => true;
|
public override bool? AllowGlobalTrackControl => true;
|
||||||
|
|
||||||
|
protected override OverlayActivation InitialOverlayActivationMode => OverlayActivation.UserTriggered;
|
||||||
|
|
||||||
public readonly Bindable<ScoreInfo> SelectedScore = new Bindable<ScoreInfo>();
|
public readonly Bindable<ScoreInfo> SelectedScore = new Bindable<ScoreInfo>();
|
||||||
|
|
||||||
[CanBeNull]
|
[CanBeNull]
|
||||||
|
@ -160,6 +164,10 @@ private void load(AudioManager audio)
|
||||||
bool shouldFlair = player != null && !Score.User.IsBot;
|
bool shouldFlair = player != null && !Score.User.IsBot;
|
||||||
|
|
||||||
ScorePanelList.AddScore(Score, shouldFlair);
|
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)
|
if (allowWatchingReplay)
|
||||||
|
|
Loading…
Reference in New Issue