mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Implement MappingSubscribersButton component
This commit is contained in:
26
osu.Game/Overlays/Profile/Header/Components/FriendsButton.cs
Normal file
26
osu.Game/Overlays/Profile/Header/Components/FriendsButton.cs
Normal file
@ -0,0 +1,26 @@
|
||||
// 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.Framework.Graphics.Sprites;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Overlays.Profile.Header.Components
|
||||
{
|
||||
public class FriendsButton : ProfileHeaderStatisticsButton
|
||||
{
|
||||
public readonly Bindable<User> User = new Bindable<User>();
|
||||
|
||||
public override string TooltipText => "followers";
|
||||
|
||||
protected override IconUsage CreateIcon() => FontAwesome.Solid.User;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
// todo: when friending/unfriending is implemented, the APIAccess.Friends list should be updated accordingly.
|
||||
User.BindValueChanged(user => SetValue(user.NewValue?.FollowerCount ?? 0), true);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user