mirror of
https://github.com/osukey/osukey.git
synced 2025-05-22 22:17:36 +09:00
Merge branch 'gameplay-leaderboard-update' into spectator-driven-leaderboard
This commit is contained in:
commit
470c68d6a5
@ -25,7 +25,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
Add(leaderboard = new TestGameplayLeaderboard
|
Add(leaderboard = new TestGameplayLeaderboard
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.Centre,
|
||||||
Scale = new Vector2(2),
|
Scale = new Vector2(2),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
{
|
{
|
||||||
public GameplayLeaderboard()
|
public GameplayLeaderboard()
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
Width = GameplayLeaderboardScore.EXTENDED_WIDTH + GameplayLeaderboardScore.SHEAR_WIDTH;
|
||||||
|
|
||||||
Direction = FillDirection.Vertical;
|
Direction = FillDirection.Vertical;
|
||||||
|
|
||||||
@ -26,10 +26,17 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
public ILeaderboardScore AddPlayer(User user, bool isTracked)
|
public ILeaderboardScore AddPlayer(User user, bool isTracked)
|
||||||
{
|
{
|
||||||
var drawable = new GameplayLeaderboardScore(user, isTracked);
|
var drawable = new GameplayLeaderboardScore(user, isTracked)
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopRight,
|
||||||
|
Origin = Anchor.TopRight,
|
||||||
|
};
|
||||||
|
|
||||||
base.Add(drawable);
|
base.Add(drawable);
|
||||||
drawable.TotalScore.BindValueChanged(_ => Scheduler.AddOnce(sort), true);
|
drawable.TotalScore.BindValueChanged(_ => Scheduler.AddOnce(sort), true);
|
||||||
|
|
||||||
|
Height = Count * (GameplayLeaderboardScore.PANEL_HEIGHT + Spacing.Y);
|
||||||
|
|
||||||
return drawable;
|
return drawable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,13 +16,19 @@ using osuTK;
|
|||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play.HUD
|
namespace osu.Game.Screens.Play.HUD
|
||||||
|
|
||||||
{
|
{
|
||||||
public class GameplayLeaderboardScore : CompositeDrawable, ILeaderboardScore
|
public class GameplayLeaderboardScore : CompositeDrawable, ILeaderboardScore
|
||||||
{
|
{
|
||||||
private const float regular_width = 215f;
|
public const float EXTENDED_WIDTH = 235f;
|
||||||
private const float extended_width = 235f;
|
|
||||||
|
|
||||||
private const float panel_height = 35f;
|
private const float regular_width = 215f;
|
||||||
|
|
||||||
|
public const float PANEL_HEIGHT = 35f;
|
||||||
|
|
||||||
|
public const float SHEAR_WIDTH = PANEL_HEIGHT * panel_shear;
|
||||||
|
|
||||||
|
private const float panel_shear = 0.15f;
|
||||||
|
|
||||||
private OsuSpriteText positionText, scoreText, accuracyText, comboText, usernameText;
|
private OsuSpriteText positionText, scoreText, accuracyText, comboText, usernameText;
|
||||||
|
|
||||||
@ -67,7 +73,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
User = user;
|
User = user;
|
||||||
this.trackedPlayer = trackedPlayer;
|
this.trackedPlayer = trackedPlayer;
|
||||||
|
|
||||||
Size = new Vector2(extended_width, panel_height);
|
Size = new Vector2(EXTENDED_WIDTH, PANEL_HEIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -84,13 +90,13 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
{
|
{
|
||||||
if (scorePosition == 1)
|
if (scorePosition == 1)
|
||||||
{
|
{
|
||||||
mainFillContainer.ResizeWidthTo(extended_width, transition_duration, Easing.OutElastic);
|
mainFillContainer.ResizeWidthTo(EXTENDED_WIDTH, transition_duration, Easing.OutElastic);
|
||||||
panelColour = Color4Extensions.FromHex("7fcc33");
|
panelColour = Color4Extensions.FromHex("7fcc33");
|
||||||
textColour = Color4.White;
|
textColour = Color4.White;
|
||||||
}
|
}
|
||||||
else if (trackedPlayer)
|
else if (trackedPlayer)
|
||||||
{
|
{
|
||||||
mainFillContainer.ResizeWidthTo(extended_width, transition_duration, Easing.OutElastic);
|
mainFillContainer.ResizeWidthTo(EXTENDED_WIDTH, transition_duration, Easing.OutElastic);
|
||||||
panelColour = Color4Extensions.FromHex("ffd966");
|
panelColour = Color4Extensions.FromHex("ffd966");
|
||||||
textColour = Color4Extensions.FromHex("2e576b");
|
textColour = Color4Extensions.FromHex("2e576b");
|
||||||
}
|
}
|
||||||
@ -126,9 +132,6 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
const float panel_shear = 0.15f;
|
|
||||||
const float shear_width = panel_height * panel_shear;
|
|
||||||
|
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
mainFillContainer = new Container
|
mainFillContainer = new Container
|
||||||
@ -164,7 +167,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
{
|
{
|
||||||
positionText = new OsuSpriteText
|
positionText = new OsuSpriteText
|
||||||
{
|
{
|
||||||
Padding = new MarginPadding { Right = shear_width / 2 },
|
Padding = new MarginPadding { Right = SHEAR_WIDTH / 2 },
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Colour = Color4.White,
|
Colour = Color4.White,
|
||||||
@ -173,7 +176,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
Padding = new MarginPadding { Horizontal = shear_width / 3 },
|
Padding = new MarginPadding { Horizontal = SHEAR_WIDTH / 3 },
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
@ -195,7 +198,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
},
|
},
|
||||||
usernameText = new OsuSpriteText
|
usernameText = new OsuSpriteText
|
||||||
{
|
{
|
||||||
Padding = new MarginPadding { Left = shear_width },
|
Padding = new MarginPadding { Left = SHEAR_WIDTH },
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Width = 0.8f,
|
Width = 0.8f,
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user