mirror of
https://github.com/ppy/osu
synced 2025-03-25 04:18:03 +00:00
Make user links clickable
This commit is contained in:
parent
1701af61d6
commit
8db3ac0a9f
@ -9,7 +9,9 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osu.Game.Online.Chat;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
@ -17,7 +19,6 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
{
|
{
|
||||||
public class ParticipantInfo : Container
|
public class ParticipantInfo : Container
|
||||||
{
|
{
|
||||||
private readonly OsuSpriteText host;
|
|
||||||
private readonly FillFlowContainer levelRangeContainer;
|
private readonly FillFlowContainer levelRangeContainer;
|
||||||
|
|
||||||
public readonly Bindable<User> Host = new Bindable<User>();
|
public readonly Bindable<User> Host = new Bindable<User>();
|
||||||
@ -31,6 +32,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
OsuSpriteText levelRangeHigher;
|
OsuSpriteText levelRangeHigher;
|
||||||
OsuSpriteText levelRangeLower;
|
OsuSpriteText levelRangeLower;
|
||||||
Container flagContainer;
|
Container flagContainer;
|
||||||
|
LinkFlowContainer hostText;
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
@ -62,20 +64,12 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
new OsuSpriteText
|
hostText = new LinkFlowContainer
|
||||||
{
|
|
||||||
Text = "hosted by",
|
|
||||||
Anchor = Anchor.CentreLeft,
|
|
||||||
Origin = Anchor.CentreLeft,
|
|
||||||
TextSize = 14,
|
|
||||||
},
|
|
||||||
host = new OsuSpriteText
|
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
TextSize = 14,
|
AutoSizeAxes = Axes.Both
|
||||||
Font = @"Exo2.0-BoldItalic",
|
}
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
levelRangeContainer = new FillFlowContainer
|
levelRangeContainer = new FillFlowContainer
|
||||||
@ -122,7 +116,10 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
|
|
||||||
Host.BindValueChanged(v =>
|
Host.BindValueChanged(v =>
|
||||||
{
|
{
|
||||||
host.Text = v.Username;
|
hostText.Clear();
|
||||||
|
hostText.AddText("hosted by ");
|
||||||
|
hostText.AddLink(v.Username, null, LinkAction.OpenUserProfile, v.Id.ToString(), "Open profile", s => s.Font = "Exo2.0-BoldItalic");
|
||||||
|
|
||||||
flagContainer.Child = new DrawableFlag(v.Country) { RelativeSizeAxes = Axes.Both };
|
flagContainer.Child = new DrawableFlag(v.Country) { RelativeSizeAxes = Axes.Both };
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -138,7 +135,6 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
levelRangeContainer.Colour = colours.Gray9;
|
levelRangeContainer.Colour = colours.Gray9;
|
||||||
host.Colour = colours.Blue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user