Add support for automatic scrolling in gameplay leaderboard

This commit is contained in:
Dean Herbert
2021-08-12 16:17:14 +09:00
parent f4591b01d7
commit 68dbbc17e8
3 changed files with 144 additions and 21 deletions

View File

@ -81,7 +81,10 @@ namespace osu.Game.Screens.Play.HUD
[CanBeNull]
public User User { get; }
private readonly bool trackedPlayer;
/// <summary>
/// Whether this score is the local user or a replay player (and should be focused / always visible).
/// </summary>
public readonly bool Tracked;
private Container mainFillContainer;
@ -97,11 +100,11 @@ namespace osu.Game.Screens.Play.HUD
/// Creates a new <see cref="GameplayLeaderboardScore"/>.
/// </summary>
/// <param name="user">The score's player.</param>
/// <param name="trackedPlayer">Whether the player is the local user or a replay player.</param>
public GameplayLeaderboardScore([CanBeNull] User user, bool trackedPlayer)
/// <param name="tracked">Whether the player is the local user or a replay player.</param>
public GameplayLeaderboardScore([CanBeNull] User user, bool tracked)
{
User = user;
this.trackedPlayer = trackedPlayer;
Tracked = tracked;
AutoSizeAxes = Axes.X;
Height = PANEL_HEIGHT;
@ -338,7 +341,7 @@ namespace osu.Game.Screens.Play.HUD
panelColour = BackgroundColour ?? Color4Extensions.FromHex("7fcc33");
textColour = TextColour ?? Color4.White;
}
else if (trackedPlayer)
else if (Tracked)
{
widthExtension = true;
panelColour = BackgroundColour ?? Color4Extensions.FromHex("ffd966");