mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Implement CommentsShowMoreButton
This commit is contained in:
32
osu.Game/Overlays/Comments/CommentsShowMoreButton.cs
Normal file
32
osu.Game/Overlays/Comments/CommentsShowMoreButton.cs
Normal file
@ -0,0 +1,32 @@
|
||||
// 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.Bindables;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
||||
namespace osu.Game.Overlays.Comments
|
||||
{
|
||||
public class CommentsShowMoreButton : ShowMoreButton
|
||||
{
|
||||
public readonly BindableInt Current = new BindableInt();
|
||||
|
||||
public CommentsShowMoreButton()
|
||||
{
|
||||
IdleColour = OsuColour.Gray(0.3f);
|
||||
HoverColour = OsuColour.Gray(0.4f);
|
||||
ChevronIconColour = OsuColour.Gray(0.5f);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
Current.BindValueChanged(onCurrentChanged, true);
|
||||
base.LoadComplete();
|
||||
}
|
||||
|
||||
private void onCurrentChanged(ValueChangedEvent<int> count)
|
||||
{
|
||||
Text = $@"Show More ({count.NewValue})".ToUpper();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user