mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Use same logic as KeyCounterDisplay
This commit is contained in:
@ -31,6 +31,12 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private ScoreManager scoreManager { get; set; } = null!;
|
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)
|
public SoloGameplayLeaderboard(IUser trackingUser)
|
||||||
{
|
{
|
||||||
this.trackingUser = trackingUser;
|
this.trackingUser = trackingUser;
|
||||||
@ -47,6 +53,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
Scores.BindCollectionChanged((_, _) => Scheduler.AddOnce(showScores), true);
|
Scores.BindCollectionChanged((_, _) => Scheduler.AddOnce(showScores), true);
|
||||||
|
|
||||||
|
AlwaysVisible.BindValueChanged(_ => updateVisibility());
|
||||||
configVisibility.BindValueChanged(_ => updateVisibility(), true);
|
configVisibility.BindValueChanged(_ => updateVisibility(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,6 +91,6 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateVisibility() =>
|
private void updateVisibility() =>
|
||||||
Flow.FadeTo(configVisibility.Value ? 1 : 0, duration);
|
this.FadeTo(AlwaysVisible.Value || configVisibility.Value ? 1 : 0, duration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,6 +62,7 @@ namespace osu.Game.Screens.Play
|
|||||||
protected override GameplayLeaderboard CreateGameplayLeaderboard() =>
|
protected override GameplayLeaderboard CreateGameplayLeaderboard() =>
|
||||||
new SoloGameplayLeaderboard(Score.ScoreInfo.User)
|
new SoloGameplayLeaderboard(Score.ScoreInfo.User)
|
||||||
{
|
{
|
||||||
|
AlwaysVisible = { Value = true },
|
||||||
Scores = { BindTarget = LeaderboardScores }
|
Scores = { BindTarget = LeaderboardScores }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@ namespace osu.Game.Screens.Play
|
|||||||
protected override GameplayLeaderboard CreateGameplayLeaderboard() =>
|
protected override GameplayLeaderboard CreateGameplayLeaderboard() =>
|
||||||
new SoloGameplayLeaderboard(Score.ScoreInfo.User)
|
new SoloGameplayLeaderboard(Score.ScoreInfo.User)
|
||||||
{
|
{
|
||||||
|
AlwaysVisible = { Value = false },
|
||||||
Scores = { BindTarget = LeaderboardScores }
|
Scores = { BindTarget = LeaderboardScores }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user