mirror of
https://github.com/ppy/osu
synced 2025-01-04 05:12:10 +00:00
Add the ability to set custom overriding colours on GameplayLeaderboardScore
s
This commit is contained in:
parent
ab522e1569
commit
e1d4eee1d2
@ -48,10 +48,9 @@ namespace osu.Game.Screens.Play.HUD
|
||||
/// </param>
|
||||
public ILeaderboardScore AddPlayer([CanBeNull] User user, bool isTracked)
|
||||
{
|
||||
var drawable = new GameplayLeaderboardScore(user, isTracked)
|
||||
{
|
||||
Expanded = { BindTarget = Expanded },
|
||||
};
|
||||
var drawable = CreateLeaderboardScoreDrawable(user, isTracked);
|
||||
|
||||
drawable.Expanded.BindTo(Expanded);
|
||||
|
||||
base.Add(drawable);
|
||||
drawable.TotalScore.BindValueChanged(_ => sorting.Invalidate(), true);
|
||||
@ -61,6 +60,9 @@ namespace osu.Game.Screens.Play.HUD
|
||||
return drawable;
|
||||
}
|
||||
|
||||
protected virtual GameplayLeaderboardScore CreateLeaderboardScoreDrawable(User user, bool isTracked) =>
|
||||
new GameplayLeaderboardScore(user, isTracked);
|
||||
|
||||
public sealed override void Add(GameplayLeaderboardScore drawable)
|
||||
{
|
||||
throw new NotSupportedException($"Use {nameof(AddPlayer)} instead.");
|
||||
|
@ -54,6 +54,10 @@ namespace osu.Game.Screens.Play.HUD
|
||||
public BindableInt Combo { get; } = new BindableInt();
|
||||
public BindableBool HasQuit { get; } = new BindableBool();
|
||||
|
||||
public Color4? BackgroundColour { get; set; }
|
||||
|
||||
public Color4? TextColour { get; set; }
|
||||
|
||||
private int? scorePosition;
|
||||
|
||||
public int? ScorePosition
|
||||
@ -331,19 +335,19 @@ namespace osu.Game.Screens.Play.HUD
|
||||
if (scorePosition == 1)
|
||||
{
|
||||
widthExtension = true;
|
||||
panelColour = Color4Extensions.FromHex("7fcc33");
|
||||
textColour = Color4.White;
|
||||
panelColour = BackgroundColour ?? Color4Extensions.FromHex("7fcc33");
|
||||
textColour = TextColour ?? Color4.White;
|
||||
}
|
||||
else if (trackedPlayer)
|
||||
{
|
||||
widthExtension = true;
|
||||
panelColour = Color4Extensions.FromHex("ffd966");
|
||||
textColour = Color4Extensions.FromHex("2e576b");
|
||||
panelColour = BackgroundColour ?? Color4Extensions.FromHex("ffd966");
|
||||
textColour = TextColour ?? Color4Extensions.FromHex("2e576b");
|
||||
}
|
||||
else
|
||||
{
|
||||
panelColour = Color4Extensions.FromHex("3399cc");
|
||||
textColour = Color4.White;
|
||||
panelColour = BackgroundColour ?? Color4Extensions.FromHex("3399cc");
|
||||
textColour = TextColour ?? Color4.White;
|
||||
}
|
||||
|
||||
this.TransformTo(nameof(SizeContainerLeftPadding), widthExtension ? -top_player_left_width_extension : 0, panel_transition_duration, Easing.OutElastic);
|
||||
|
Loading…
Reference in New Issue
Block a user