mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 03:02:56 +08:00
Merge pull request #8490 from peppy/dont-retry-on-replay-results
Hide "retry" button on results screen after watching a replay
This commit is contained in:
commit
f52509ab9c
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
|
using osu.Game.Screens.Ranking;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play
|
namespace osu.Game.Screens.Play
|
||||||
{
|
{
|
||||||
@ -29,6 +30,8 @@ namespace osu.Game.Screens.Play
|
|||||||
this.Push(CreateResults(DrawableRuleset.ReplayScore.ScoreInfo));
|
this.Push(CreateResults(DrawableRuleset.ReplayScore.ScoreInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override ResultsScreen CreateResults(ScoreInfo score) => new ResultsScreen(score, false);
|
||||||
|
|
||||||
protected override ScoreInfo CreateScore() => score.ScoreInfo;
|
protected override ScoreInfo CreateScore() => score.ScoreInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,16 +33,21 @@ namespace osu.Game.Screens.Ranking
|
|||||||
|
|
||||||
public readonly ScoreInfo Score;
|
public readonly ScoreInfo Score;
|
||||||
|
|
||||||
|
private readonly bool allowRetry;
|
||||||
|
|
||||||
private Drawable bottomPanel;
|
private Drawable bottomPanel;
|
||||||
|
|
||||||
public ResultsScreen(ScoreInfo score)
|
public ResultsScreen(ScoreInfo score, bool allowRetry = true)
|
||||||
{
|
{
|
||||||
Score = score;
|
Score = score;
|
||||||
|
this.allowRetry = allowRetry;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
|
FillFlowContainer buttons;
|
||||||
|
|
||||||
InternalChildren = new[]
|
InternalChildren = new[]
|
||||||
{
|
{
|
||||||
new ResultsScrollContainer
|
new ResultsScrollContainer
|
||||||
@ -68,7 +73,7 @@ namespace osu.Game.Screens.Ranking
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = Color4Extensions.FromHex("#333")
|
Colour = Color4Extensions.FromHex("#333")
|
||||||
},
|
},
|
||||||
new FillFlowContainer
|
buttons = new FillFlowContainer
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
@ -78,15 +83,16 @@ namespace osu.Game.Screens.Ranking
|
|||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new ReplayDownloadButton(Score) { Width = 300 },
|
new ReplayDownloadButton(Score) { Width = 300 },
|
||||||
new RetryButton { Width = 300 },
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (player != null)
|
if (player != null && allowRetry)
|
||||||
{
|
{
|
||||||
|
buttons.Add(new RetryButton { Width = 300 });
|
||||||
|
|
||||||
AddInternal(new HotkeyRetryOverlay
|
AddInternal(new HotkeyRetryOverlay
|
||||||
{
|
{
|
||||||
Action = () =>
|
Action = () =>
|
||||||
|
Loading…
Reference in New Issue
Block a user