mirror of
https://github.com/ppy/osu.git
synced 2025-03-14 04:27:19 +08:00
Add StatusIcon
This commit is contained in:
parent
ad2582a3ab
commit
2e28f5ed33
26
osu.Game/Users/Drawables/StatusIcon.cs
Normal file
26
osu.Game/Users/Drawables/StatusIcon.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.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Users.Drawables
|
||||||
|
{
|
||||||
|
public partial class StatusIcon : CircularContainer
|
||||||
|
{
|
||||||
|
public StatusIcon()
|
||||||
|
{
|
||||||
|
Size = new Vector2(25);
|
||||||
|
BorderThickness = 4;
|
||||||
|
BorderColour = Colour;
|
||||||
|
Masking = true;
|
||||||
|
Child = new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Colour = Colour4.White.Opacity(0)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -10,7 +10,6 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Game.Users.Drawables;
|
using osu.Game.Users.Drawables;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
@ -25,7 +24,7 @@ namespace osu.Game.Users
|
|||||||
|
|
||||||
protected TextFlowContainer LastVisitMessage { get; private set; }
|
protected TextFlowContainer LastVisitMessage { get; private set; }
|
||||||
|
|
||||||
private SpriteIcon statusIcon;
|
private StatusIcon statusIcon;
|
||||||
private OsuSpriteText statusMessage;
|
private OsuSpriteText statusMessage;
|
||||||
|
|
||||||
protected ExtendedUserPanel(APIUser user)
|
protected ExtendedUserPanel(APIUser user)
|
||||||
@ -59,11 +58,7 @@ namespace osu.Game.Users
|
|||||||
Action = Action,
|
Action = Action,
|
||||||
};
|
};
|
||||||
|
|
||||||
protected SpriteIcon CreateStatusIcon() => statusIcon = new SpriteIcon
|
protected Container CreateStatusIcon() => statusIcon = new StatusIcon();
|
||||||
{
|
|
||||||
Icon = FontAwesome.Regular.Circle,
|
|
||||||
Size = new Vector2(25)
|
|
||||||
};
|
|
||||||
|
|
||||||
protected FillFlowContainer CreateStatusMessage(bool rightAlignedChildren)
|
protected FillFlowContainer CreateStatusMessage(bool rightAlignedChildren)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user