mirror of
https://github.com/ppy/osu.git
synced 2024-12-26 17:13:07 +08:00
36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
// 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;
|
|
using osu.Framework.Bindables;
|
|
using osu.Game.Graphics.UserInterface;
|
|
|
|
namespace osu.Game.Overlays.Comments
|
|
{
|
|
public class CommentsShowMoreButton : ShowMoreButton
|
|
{
|
|
public readonly BindableInt Current = new BindableInt();
|
|
|
|
[BackgroundDependencyLoader]
|
|
private void load(OverlayColourProvider colourProvider)
|
|
{
|
|
Height = 20;
|
|
|
|
IdleColour = colourProvider.Background2;
|
|
HoverColour = colourProvider.Background1;
|
|
ChevronIconColour = colourProvider.Foreground1;
|
|
}
|
|
|
|
protected override void LoadComplete()
|
|
{
|
|
Current.BindValueChanged(onCurrentChanged, true);
|
|
base.LoadComplete();
|
|
}
|
|
|
|
private void onCurrentChanged(ValueChangedEvent<int> count)
|
|
{
|
|
Text = $@"Show More ({count.NewValue})".ToUpper();
|
|
}
|
|
}
|
|
}
|