mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Add displaying users
This commit is contained in:
@ -1,12 +1,17 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Overlays.Browse;
|
||||
using osu.Game.Overlays.Social;
|
||||
using osu.Game.Users;
|
||||
|
||||
using Container = osu.Framework.Graphics.Containers.Container;
|
||||
|
||||
@ -14,6 +19,26 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
public class SocialOverlay : BrowseOverlay<SocialTab, SocialSortCriteria>
|
||||
{
|
||||
private readonly FillFlowContainer<UserPanel> panelFlow;
|
||||
|
||||
private IEnumerable<User> users;
|
||||
public IEnumerable<User> Users
|
||||
{
|
||||
get { return users; }
|
||||
set
|
||||
{
|
||||
if (users == value) return;
|
||||
users = value;
|
||||
|
||||
panelFlow.Children = users.Select(u =>
|
||||
{
|
||||
var p = new UserPanel(u) { Width = 300 };
|
||||
p.Status.BindTo(u.Status);
|
||||
return p;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected override Color4 BackgroundColour => OsuColour.FromHex(@"60284b");
|
||||
protected override Color4 TrianglesColourLight => OsuColour.FromHex(@"672b51");
|
||||
protected override Color4 TrianglesColourDark => OsuColour.FromHex(@"5c2648");
|
||||
@ -23,7 +48,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
public SocialOverlay()
|
||||
{
|
||||
ScrollFlow.Children = new[]
|
||||
ScrollFlow.Children = new Drawable[]
|
||||
{
|
||||
new Container
|
||||
{
|
||||
@ -39,6 +64,12 @@ namespace osu.Game.Overlays
|
||||
},
|
||||
},
|
||||
},
|
||||
panelFlow = new FillFlowContainer<UserPanel>
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Spacing = new Vector2(10f),
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user