1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-19 11:03:21 +08:00

Use same logic as KeyCounterDisplay

This commit is contained in:
Dean Herbert 2022-09-27 14:43:08 +09:00
parent bac3108aea
commit 320f134634
3 changed files with 10 additions and 1 deletions

View File

@ -31,6 +31,12 @@ namespace osu.Game.Screens.Play.HUD
[Resolved]
private ScoreManager scoreManager { get; set; } = null!;
/// <summary>
/// Whether the leaderboard should be visible regardless of the configuration value.
/// This is true by default, but can be changed.
/// </summary>
public readonly Bindable<bool> AlwaysVisible = new Bindable<bool>(true);
public SoloGameplayLeaderboard(IUser trackingUser)
{
this.trackingUser = trackingUser;
@ -47,6 +53,7 @@ namespace osu.Game.Screens.Play.HUD
base.LoadComplete();
Scores.BindCollectionChanged((_, _) => Scheduler.AddOnce(showScores), true);
AlwaysVisible.BindValueChanged(_ => updateVisibility());
configVisibility.BindValueChanged(_ => updateVisibility(), true);
}
@ -84,6 +91,6 @@ namespace osu.Game.Screens.Play.HUD
}
private void updateVisibility() =>
Flow.FadeTo(configVisibility.Value ? 1 : 0, duration);
this.FadeTo(AlwaysVisible.Value || configVisibility.Value ? 1 : 0, duration);
}
}

View File

@ -62,6 +62,7 @@ namespace osu.Game.Screens.Play
protected override GameplayLeaderboard CreateGameplayLeaderboard() =>
new SoloGameplayLeaderboard(Score.ScoreInfo.User)
{
AlwaysVisible = { Value = true },
Scores = { BindTarget = LeaderboardScores }
};

View File

@ -48,6 +48,7 @@ namespace osu.Game.Screens.Play
protected override GameplayLeaderboard CreateGameplayLeaderboard() =>
new SoloGameplayLeaderboard(Score.ScoreInfo.User)
{
AlwaysVisible = { Value = false },
Scores = { BindTarget = LeaderboardScores }
};