mirror of
https://github.com/ppy/osu.git
synced 2026-05-17 11:22:54 +08:00
Merge pull request #32893 from bdach/temp-replay-leaderboards-fix
Allow toggling leaderboard visibility in replays
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,6 @@ namespace osu.Game.Screens.Play
|
||||
protected override GameplayLeaderboard CreateGameplayLeaderboard() =>
|
||||
new SoloGameplayLeaderboard(Score.ScoreInfo.User)
|
||||
{
|
||||
AlwaysVisible = { Value = true },
|
||||
Scores = { BindTarget = localScores }
|
||||
};
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@ namespace osu.Game.Screens.Play
|
||||
protected override GameplayLeaderboard CreateGameplayLeaderboard() =>
|
||||
new SoloGameplayLeaderboard(Score.ScoreInfo.User)
|
||||
{
|
||||
AlwaysVisible = { Value = false },
|
||||
Scores = { BindTarget = localScores }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user