2020-07-28 21:08:10 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
2021-12-13 05:54:57 +08:00
|
|
|
using osu.Framework.Bindables;
|
2020-07-28 21:08:10 +08:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
using osu.Game.Graphics.Sprites;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Ranking.Contracted
|
|
|
|
{
|
2022-11-24 13:32:20 +08:00
|
|
|
public partial class ContractedPanelTopContent : CompositeDrawable
|
2020-07-28 21:08:10 +08:00
|
|
|
{
|
2021-12-13 05:54:57 +08:00
|
|
|
public readonly Bindable<int?> ScorePosition = new Bindable<int?>();
|
2020-07-28 21:08:10 +08:00
|
|
|
|
2024-05-14 19:11:21 +08:00
|
|
|
private OsuSpriteText text = null!;
|
2020-07-28 21:08:10 +08:00
|
|
|
|
2021-12-13 05:54:57 +08:00
|
|
|
public ContractedPanelTopContent()
|
|
|
|
{
|
2020-07-28 21:08:10 +08:00
|
|
|
RelativeSizeAxes = Axes.Both;
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
2021-12-13 05:54:57 +08:00
|
|
|
InternalChild = text = new OsuSpriteText
|
2020-07-28 21:08:10 +08:00
|
|
|
{
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
Y = 6,
|
|
|
|
Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold)
|
|
|
|
};
|
|
|
|
}
|
2021-12-13 05:54:57 +08:00
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
{
|
|
|
|
base.LoadComplete();
|
|
|
|
|
|
|
|
ScorePosition.BindValueChanged(pos => text.Text = pos.NewValue != null ? $"#{pos.NewValue}" : string.Empty, true);
|
|
|
|
}
|
2020-07-28 21:08:10 +08:00
|
|
|
}
|
|
|
|
}
|