1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-03 03:59:55 +08:00

Allow toggling leaderboard visibility in replays

Closes https://github.com/ppy/osu/issues/31744 I guess.

This isn't the resolution that I had in mind for this but my hand has
been basically forced by user feedback to do this, at least in the
short-term.
This commit is contained in:
Bartłomiej Dach
2025-04-21 08:49:27 +02:00
Unverified
parent 99e882bfbc
commit d8df499e72
4 changed files with 1 additions and 17 deletions
@@ -57,7 +57,6 @@ namespace osu.Game.Tests.Visual.Gameplay
Scores = { BindTarget = scores },
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
AlwaysVisible = { Value = false },
Expanded = { Value = true },
};
});
@@ -101,12 +100,6 @@ namespace osu.Game.Tests.Visual.Gameplay
AddStep("set config visible false", () => configVisibility.Value = false);
AddUntilStep("leaderboard not visible", () => leaderboard.Alpha == 0);
AddStep("set always visible", () => leaderboard.AlwaysVisible.Value = true);
AddUntilStep("leaderboard visible", () => leaderboard.Alpha == 1);
AddStep("set config visible true", () => configVisibility.Value = true);
AddAssert("leaderboard still visible", () => leaderboard.Alpha == 1);
}
private static List<ScoreInfo> createSampleScores()
@@ -30,12 +30,6 @@ namespace osu.Game.Screens.Play.HUD
[Resolved]
private ScoreProcessor scoreProcessor { 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;
@@ -57,7 +51,6 @@ namespace osu.Game.Screens.Play.HUD
// Alpha will be updated via `updateVisibility` below.
Alpha = 0;
AlwaysVisible.BindValueChanged(_ => updateVisibility());
configVisibility.BindValueChanged(_ => updateVisibility(), true);
}
@@ -103,6 +96,6 @@ namespace osu.Game.Screens.Play.HUD
}
private void updateVisibility() =>
this.FadeTo(AlwaysVisible.Value || configVisibility.Value ? 1 : 0, duration);
this.FadeTo(configVisibility.Value ? 1 : 0, duration);
}
}
-1
View File
@@ -121,7 +121,6 @@ namespace osu.Game.Screens.Play
protected override GameplayLeaderboard CreateGameplayLeaderboard() =>
new SoloGameplayLeaderboard(Score.ScoreInfo.User)
{
AlwaysVisible = { Value = true },
Scores = { BindTarget = localScores }
};
-1
View File
@@ -68,7 +68,6 @@ namespace osu.Game.Screens.Play
protected override GameplayLeaderboard CreateGameplayLeaderboard() =>
new SoloGameplayLeaderboard(Score.ScoreInfo.User)
{
AlwaysVisible = { Value = false },
Scores = { BindTarget = localScores }
};