mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Split out classes into own files and rename GroupInfoContainer
to a flow
This commit is contained in:
@ -0,0 +1,33 @@
|
||||
// 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 System.Linq;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Overlays.Profile.Header.Components
|
||||
{
|
||||
public partial class GroupBadgeFlow : FillFlowContainer
|
||||
{
|
||||
public readonly Bindable<APIUser?> User = new Bindable<APIUser?>();
|
||||
|
||||
public GroupBadgeFlow()
|
||||
{
|
||||
AutoSizeAxes = Axes.Both;
|
||||
Direction = FillDirection.Horizontal;
|
||||
Spacing = new Vector2(2);
|
||||
|
||||
User.BindValueChanged(val =>
|
||||
{
|
||||
if (val.NewValue?.Groups?.Length > 0)
|
||||
{
|
||||
Clear(true);
|
||||
Children = val.NewValue?.Groups.Select(g => new GroupBadge(g)).ToList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user