1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 02:07:34 +08:00

Add hold-to-retry support to results

This commit is contained in:
Dean Herbert 2019-11-01 15:49:36 +09:00
parent 84d17f3702
commit c532f77657

View File

@ -19,6 +19,7 @@ using osu.Game.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.Sprites;
using osu.Game.Scoring;
using osu.Game.Screens.Play;
namespace osu.Game.Screens.Ranking
{
@ -34,6 +35,9 @@ namespace osu.Game.Screens.Ranking
private ResultModeTabControl modeChangeButtons;
[Resolved(canBeNull: true)]
private Player player { get; set; }
public override bool DisallowExternalBeatmapRulesetChanges => true;
protected readonly ScoreInfo Score;
@ -100,10 +104,7 @@ namespace osu.Game.Screens.Ranking
public override bool OnExiting(IScreen next)
{
allCircles.ForEach(c =>
{
c.ScaleTo(0, transition_time, Easing.OutSine);
});
allCircles.ForEach(c => { c.ScaleTo(0, transition_time, Easing.OutSine); });
Background.ScaleTo(1f, transition_time / 4, Easing.OutQuint);
@ -253,7 +254,17 @@ namespace osu.Game.Screens.Ranking
}
}
}
}
},
new HotkeyRetryOverlay
{
Action = () =>
{
if (!this.IsCurrentScreen()) return;
player.Restart();
player.MakeCurrent();
},
},
};
var pages = CreateResultPages();