mirror of
https://github.com/ppy/osu.git
synced 2025-03-16 05:37:19 +08:00
Change ResultsScreen
constructor boolean params to init-only properties
This commit is contained in:
parent
083892e753
commit
0074bdc5a1
@ -349,8 +349,9 @@ namespace osu.Game.Tests.Visual.Background
|
||||
private partial class FadeAccessibleResults : ResultsScreen
|
||||
{
|
||||
public FadeAccessibleResults(ScoreInfo score)
|
||||
: base(score, true)
|
||||
: base(score)
|
||||
{
|
||||
AllowRetry = true;
|
||||
}
|
||||
|
||||
protected override BackgroundScreen CreateBackground() => new FadeAccessibleBackground(Beatmap.Value);
|
||||
|
@ -420,9 +420,10 @@ namespace osu.Game.Tests.Visual.Playlists
|
||||
public new LoadingSpinner RightSpinner => base.RightSpinner;
|
||||
public new ScorePanelList ScorePanelList => base.ScorePanelList;
|
||||
|
||||
public TestResultsScreen([CanBeNull] ScoreInfo score, int roomId, PlaylistItem playlistItem, bool allowRetry = true)
|
||||
: base(score, roomId, playlistItem, allowRetry)
|
||||
public TestResultsScreen([CanBeNull] ScoreInfo score, int roomId, PlaylistItem playlistItem)
|
||||
: base(score, roomId, playlistItem)
|
||||
{
|
||||
AllowRetry = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -399,8 +399,9 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
public HotkeyRetryOverlay RetryOverlay;
|
||||
|
||||
public TestResultsScreen(ScoreInfo score)
|
||||
: base(score, true)
|
||||
: base(score)
|
||||
{
|
||||
AllowRetry = true;
|
||||
ShowUserStatistics = true;
|
||||
}
|
||||
|
||||
@ -470,8 +471,9 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
public HotkeyRetryOverlay RetryOverlay;
|
||||
|
||||
public UnrankedSoloResultsScreen(ScoreInfo score)
|
||||
: base(score, true)
|
||||
: base(score)
|
||||
{
|
||||
AllowRetry = true;
|
||||
Score!.BeatmapInfo!.OnlineID = 0;
|
||||
Score.BeatmapInfo.Status = BeatmapOnlineStatus.Pending;
|
||||
}
|
||||
|
@ -768,7 +768,7 @@ namespace osu.Game
|
||||
break;
|
||||
|
||||
case ScorePresentType.Results:
|
||||
screen.Push(new SoloResultsScreen(databasedScore.ScoreInfo, false));
|
||||
screen.Push(new SoloResultsScreen(databasedScore.ScoreInfo));
|
||||
break;
|
||||
}
|
||||
}, validScreens: validScreens);
|
||||
|
@ -10,7 +10,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
public partial class MultiplayerResultsScreen : PlaylistsResultsScreen
|
||||
{
|
||||
public MultiplayerResultsScreen(ScoreInfo score, long roomId, PlaylistItem playlistItem)
|
||||
: base(score, roomId, playlistItem, false)
|
||||
: base(score, roomId, playlistItem)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,10 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
||||
protected override ResultsScreen CreateResults(ScoreInfo score)
|
||||
{
|
||||
Debug.Assert(Room.RoomID.Value != null);
|
||||
return new PlaylistsResultsScreen(score, Room.RoomID.Value.Value, PlaylistItem, true);
|
||||
return new PlaylistsResultsScreen(score, Room.RoomID.Value.Value, PlaylistItem)
|
||||
{
|
||||
AllowRetry = true,
|
||||
};
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
|
@ -41,8 +41,8 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
||||
[Resolved]
|
||||
private RulesetStore rulesets { get; set; }
|
||||
|
||||
public PlaylistsResultsScreen([CanBeNull] ScoreInfo score, long roomId, PlaylistItem playlistItem, bool allowRetry, bool allowWatchingReplay = true)
|
||||
: base(score, allowRetry, allowWatchingReplay)
|
||||
public PlaylistsResultsScreen([CanBeNull] ScoreInfo score, long roomId, PlaylistItem playlistItem)
|
||||
: base(score)
|
||||
{
|
||||
this.roomId = roomId;
|
||||
this.playlistItem = playlistItem;
|
||||
|
@ -114,7 +114,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
||||
RequestResults = item =>
|
||||
{
|
||||
Debug.Assert(RoomId.Value != null);
|
||||
ParentScreen?.Push(new PlaylistsResultsScreen(null, RoomId.Value.Value, item, false));
|
||||
ParentScreen?.Push(new PlaylistsResultsScreen(null, RoomId.Value.Value, item));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -1224,9 +1224,10 @@ namespace osu.Game.Screens.Play
|
||||
/// </summary>
|
||||
/// <param name="score">The <see cref="ScoreInfo"/> to be displayed in the results screen.</param>
|
||||
/// <returns>The <see cref="ResultsScreen"/>.</returns>
|
||||
protected virtual ResultsScreen CreateResults(ScoreInfo score) => new SoloResultsScreen(score, true)
|
||||
protected virtual ResultsScreen CreateResults(ScoreInfo score) => new SoloResultsScreen(score)
|
||||
{
|
||||
ShowUserStatistics = true
|
||||
AllowRetry = true,
|
||||
ShowUserStatistics = true,
|
||||
};
|
||||
|
||||
private void fadeOut(bool instant = false)
|
||||
|
@ -92,7 +92,7 @@ namespace osu.Game.Screens.Play
|
||||
Scores = { BindTarget = LeaderboardScores }
|
||||
};
|
||||
|
||||
protected override ResultsScreen CreateResults(ScoreInfo score) => new SoloResultsScreen(score, false);
|
||||
protected override ResultsScreen CreateResults(ScoreInfo score) => new SoloResultsScreen(score);
|
||||
|
||||
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Screens.Play
|
||||
public partial class SpectatorResultsScreen : SoloResultsScreen
|
||||
{
|
||||
public SpectatorResultsScreen(ScoreInfo score)
|
||||
: base(score, false)
|
||||
: base(score)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -63,16 +63,21 @@ namespace osu.Game.Screens.Ranking
|
||||
|
||||
private bool lastFetchCompleted;
|
||||
|
||||
private readonly bool allowRetry;
|
||||
private readonly bool allowWatchingReplay;
|
||||
/// <summary>
|
||||
/// Whether the user can retry the beatmap from the results screen.
|
||||
/// </summary>
|
||||
public bool AllowRetry { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether the user can watch the replay of the completed play from the results screen.
|
||||
/// </summary>
|
||||
public bool AllowWatchingReplay { get; init; } = true;
|
||||
|
||||
private Sample popInSample;
|
||||
|
||||
protected ResultsScreen([CanBeNull] ScoreInfo score, bool allowRetry, bool allowWatchingReplay = true)
|
||||
protected ResultsScreen([CanBeNull] ScoreInfo score)
|
||||
{
|
||||
Score = score;
|
||||
this.allowRetry = allowRetry;
|
||||
this.allowWatchingReplay = allowWatchingReplay;
|
||||
|
||||
SelectedScore.Value = score;
|
||||
}
|
||||
@ -162,7 +167,7 @@ namespace osu.Game.Screens.Ranking
|
||||
ScorePanelList.AddScore(Score, shouldFlair);
|
||||
}
|
||||
|
||||
if (allowWatchingReplay)
|
||||
if (AllowWatchingReplay)
|
||||
{
|
||||
buttons.Add(new ReplayDownloadButton(SelectedScore.Value)
|
||||
{
|
||||
@ -171,7 +176,7 @@ namespace osu.Game.Screens.Ranking
|
||||
});
|
||||
}
|
||||
|
||||
if (player != null && allowRetry)
|
||||
if (player != null && AllowRetry)
|
||||
{
|
||||
buttons.Add(new RetryButton { Width = 300 });
|
||||
|
||||
|
@ -34,8 +34,8 @@ namespace osu.Game.Screens.Ranking
|
||||
private IBindable<SoloStatisticsUpdate?> latestUpdate = null!;
|
||||
private readonly Bindable<SoloStatisticsUpdate?> statisticsUpdate = new Bindable<SoloStatisticsUpdate?>();
|
||||
|
||||
public SoloResultsScreen(ScoreInfo score, bool allowRetry)
|
||||
: base(score, allowRetry)
|
||||
public SoloResultsScreen(ScoreInfo score)
|
||||
: base(score)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
|
||||
protected void PresentScore(ScoreInfo score) =>
|
||||
FinaliseSelection(score.BeatmapInfo, score.Ruleset, () => this.Push(new SoloResultsScreen(score, false)));
|
||||
FinaliseSelection(score.BeatmapInfo, score.Ruleset, () => this.Push(new SoloResultsScreen(score)));
|
||||
|
||||
protected override BeatmapDetailArea CreateBeatmapDetailArea()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user