mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 17:32:54 +08:00
Merge pull request #21804 from bdach/hide-global-rankings-when-presenting-scores
Only show global rankings on solo results screen when progressing from gameplay
This commit is contained in:
commit
df6f2ad0a1
@ -1159,7 +1159,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, true)
|
||||
{
|
||||
ShowUserStatistics = true
|
||||
};
|
||||
|
||||
private void fadeOut(bool instant = false)
|
||||
{
|
||||
|
@ -20,6 +20,12 @@ namespace osu.Game.Screens.Ranking
|
||||
{
|
||||
public partial class SoloResultsScreen : ResultsScreen
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether the user's personal statistics should be shown on the extended statistics panel
|
||||
/// after clicking the score panel associated with the <see cref="ResultsScreen.Score"/> being presented.
|
||||
/// </summary>
|
||||
public bool ShowUserStatistics { get; init; }
|
||||
|
||||
private GetScoresRequest getScoreRequest;
|
||||
|
||||
[Resolved]
|
||||
@ -39,13 +45,22 @@ namespace osu.Game.Screens.Ranking
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
soloStatisticsWatcher.RegisterForStatisticsUpdateAfter(Score, update => statisticsUpdate.Value = update);
|
||||
if (ShowUserStatistics)
|
||||
soloStatisticsWatcher.RegisterForStatisticsUpdateAfter(Score, update => statisticsUpdate.Value = update);
|
||||
}
|
||||
|
||||
protected override StatisticsPanel CreateStatisticsPanel() => new SoloStatisticsPanel(Score)
|
||||
protected override StatisticsPanel CreateStatisticsPanel()
|
||||
{
|
||||
StatisticsUpdate = { BindTarget = statisticsUpdate }
|
||||
};
|
||||
if (ShowUserStatistics)
|
||||
{
|
||||
return new SoloStatisticsPanel(Score)
|
||||
{
|
||||
StatisticsUpdate = { BindTarget = statisticsUpdate }
|
||||
};
|
||||
}
|
||||
|
||||
return base.CreateStatisticsPanel();
|
||||
}
|
||||
|
||||
protected override APIRequest FetchScores(Action<IEnumerable<ScoreInfo>> scoresCallback)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user