osu/osu.Game/Overlays/Comments/Buttons/ShowRepliesButton.cs

32 lines
864 B
C#
Raw Normal View History

2020-07-11 04:47:17 +00: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 Humanizer;
using osu.Framework.Bindables;
using osu.Framework.Input.Events;
2020-07-11 04:47:17 +00:00
namespace osu.Game.Overlays.Comments.Buttons
{
public class ShowRepliesButton : CommentRepliesButton
{
public readonly BindableBool Expanded = new BindableBool(true);
2020-07-11 04:47:17 +00:00
public ShowRepliesButton(int count)
{
2020-07-12 09:27:26 +00:00
Text = "reply".ToQuantity(count);
2020-07-11 04:47:17 +00:00
}
protected override void LoadComplete()
{
base.LoadComplete();
2020-07-14 00:01:14 +00:00
Expanded.BindValueChanged(expanded => SetIconDirection(expanded.NewValue), true);
}
protected override bool OnClick(ClickEvent e)
{
Expanded.Toggle();
2020-07-14 18:18:46 +00:00
return true;
}
2020-07-11 04:47:17 +00:00
}
}