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