1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 11:47:18 +08:00

Disable watching replays from realtime results screen

This commit is contained in:
smoogipoo 2020-12-21 00:14:54 +09:00
parent 07077b8f4e
commit 5b4197a9ef
3 changed files with 16 additions and 13 deletions

View File

@ -32,8 +32,8 @@ namespace osu.Game.Screens.Multi.Ranking
[Resolved]
private IAPIProvider api { get; set; }
public TimeshiftResultsScreen(ScoreInfo score, int roomId, PlaylistItem playlistItem, bool allowRetry)
: base(score, allowRetry)
public TimeshiftResultsScreen(ScoreInfo score, int roomId, PlaylistItem playlistItem, bool allowRetry, bool allowWatchingReplay = true)
: base(score, allowRetry, allowWatchingReplay)
{
this.roomId = roomId;
this.playlistItem = playlistItem;

View File

@ -10,7 +10,7 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer
public class RealtimeResultsScreen : TimeshiftResultsScreen
{
public RealtimeResultsScreen(ScoreInfo score, int roomId, PlaylistItem playlistItem)
: base(score, roomId, playlistItem, false)
: base(score, roomId, playlistItem, false, false)
{
}
}

View File

@ -57,11 +57,13 @@ namespace osu.Game.Screens.Ranking
private APIRequest nextPageRequest;
private readonly bool allowRetry;
private readonly bool allowWatchingReplay;
protected ResultsScreen(ScoreInfo score, bool allowRetry)
protected ResultsScreen(ScoreInfo score, bool allowRetry, bool allowWatchingReplay = true)
{
Score = score;
this.allowRetry = allowRetry;
this.allowWatchingReplay = allowWatchingReplay;
SelectedScore.Value = score;
}
@ -128,15 +130,7 @@ namespace osu.Game.Screens.Ranking
Origin = Anchor.Centre,
AutoSizeAxes = Axes.Both,
Spacing = new Vector2(5),
Direction = FillDirection.Horizontal,
Children = new Drawable[]
{
new ReplayDownloadButton(null)
{
Score = { BindTarget = SelectedScore },
Width = 300
},
}
Direction = FillDirection.Horizontal
}
}
}
@ -157,6 +151,15 @@ namespace osu.Game.Screens.Ranking
ScorePanelList.AddScore(Score, shouldFlair);
}
if (allowWatchingReplay)
{
buttons.Add(new ReplayDownloadButton(null)
{
Score = { BindTarget = SelectedScore },
Width = 300
});
}
if (player != null && allowRetry)
{
buttons.Add(new RetryButton { Width = 300 });