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.Framework.Graphics.Shapes;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Scoring; using osu.Game.Scoring;
using osu.Game.Screens.Play;
namespace osu.Game.Screens.Ranking namespace osu.Game.Screens.Ranking
{ {
@ -34,6 +35,9 @@ namespace osu.Game.Screens.Ranking
private ResultModeTabControl modeChangeButtons; private ResultModeTabControl modeChangeButtons;
[Resolved(canBeNull: true)]
private Player player { get; set; }
public override bool DisallowExternalBeatmapRulesetChanges => true; public override bool DisallowExternalBeatmapRulesetChanges => true;
protected readonly ScoreInfo Score; protected readonly ScoreInfo Score;
@ -100,10 +104,7 @@ namespace osu.Game.Screens.Ranking
public override bool OnExiting(IScreen next) public override bool OnExiting(IScreen next)
{ {
allCircles.ForEach(c => allCircles.ForEach(c => { c.ScaleTo(0, transition_time, Easing.OutSine); });
{
c.ScaleTo(0, transition_time, Easing.OutSine);
});
Background.ScaleTo(1f, transition_time / 4, Easing.OutQuint); 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(); var pages = CreateResultPages();