2019-10-13 19:43:30 +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.
|
|
|
|
|
|
2020-01-27 20:00:56 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
2019-10-13 19:43:30 +08:00
|
|
|
|
using osu.Framework.Bindables;
|
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Comments
|
|
|
|
|
{
|
|
|
|
|
public class CommentsShowMoreButton : ShowMoreButton
|
|
|
|
|
{
|
|
|
|
|
public readonly BindableInt Current = new BindableInt();
|
|
|
|
|
|
2020-01-27 20:00:56 +08:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OverlayColourProvider colourProvider)
|
2019-10-13 19:43:30 +08:00
|
|
|
|
{
|
2020-01-27 20:00:56 +08:00
|
|
|
|
IdleColour = colourProvider.Background2;
|
|
|
|
|
HoverColour = colourProvider.Background1;
|
|
|
|
|
ChevronIconColour = colourProvider.Foreground1;
|
2019-10-13 19:43:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
|
{
|
|
|
|
|
Current.BindValueChanged(onCurrentChanged, true);
|
|
|
|
|
base.LoadComplete();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void onCurrentChanged(ValueChangedEvent<int> count)
|
|
|
|
|
{
|
|
|
|
|
Text = $@"Show More ({count.NewValue})".ToUpper();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|