mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 00:43:21 +08:00
Linkify more user links
This commit is contained in:
parent
b2fe9dd1a0
commit
77263bd56e
@ -15,6 +15,7 @@ using osu.Framework.Input.Events;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.Drawables;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays.Direct
|
||||
{
|
||||
@ -119,28 +120,16 @@ namespace osu.Game.Overlays.Direct
|
||||
},
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new FillFlowContainer
|
||||
new LinkFlowContainer(s =>
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Horizontal,
|
||||
Children = new[]
|
||||
s.Shadow = false;
|
||||
s.Font = OsuFont.GetFont(size: 14);
|
||||
}).With(d =>
|
||||
{
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = "mapped by ",
|
||||
Font = OsuFont.GetFont(size: 14),
|
||||
Shadow = false,
|
||||
Colour = colours.Gray5,
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = SetInfo.Metadata.Author.Username,
|
||||
Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold, italics: true),
|
||||
Shadow = false,
|
||||
Colour = colours.BlueDark,
|
||||
},
|
||||
},
|
||||
},
|
||||
d.AutoSizeAxes = Axes.Both;
|
||||
d.AddText("mapped by ", t => t.Colour = colours.Gray5);
|
||||
d.AddUserLink(SetInfo.Metadata.Author);
|
||||
}),
|
||||
new Container
|
||||
{
|
||||
AutoSizeAxes = Axes.X,
|
||||
|
@ -17,7 +17,6 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
|
||||
{
|
||||
private readonly BeatmapInfo beatmap;
|
||||
private readonly int playCount;
|
||||
private OsuHoverContainer mapperContainer;
|
||||
|
||||
public DrawableMostPlayedRow(BeatmapInfo beatmap, int playCount)
|
||||
{
|
||||
@ -34,36 +33,20 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
|
||||
CoverType = BeatmapSetCoverType.List,
|
||||
};
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(UserProfileOverlay profileOverlay)
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
LeftFlowContainer.Add(new BeatmapMetadataContainer(beatmap));
|
||||
LeftFlowContainer.Add(new FillFlowContainer
|
||||
LeftFlowContainer.Add(new LinkFlowContainer(t => t.Font = OsuFont.GetFont(size: 12))
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Direction = FillDirection.Horizontal,
|
||||
Children = new Drawable[]
|
||||
}.With(d =>
|
||||
{
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = @"mapped by ",
|
||||
Font = OsuFont.GetFont(size: 12)
|
||||
},
|
||||
mapperContainer = new OsuHoverContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = beatmap.Metadata.AuthorString,
|
||||
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Medium, italics: true)
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
d.AddText("mapped by ");
|
||||
d.AddUserLink(beatmap.Metadata.Author);
|
||||
}));
|
||||
|
||||
RightFlowContainer.Add(new FillFlowContainer
|
||||
{
|
||||
@ -89,9 +72,6 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
if (profileOverlay != null)
|
||||
mapperContainer.Action = () => profileOverlay.ShowUser(beatmap.BeatmapSet.Metadata.Author);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user