1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 17:52:56 +08:00

Remove a few custom user link implementations (#4789)

Remove a few custom user link implementations

Co-authored-by: Dean Herbert <pe@ppy.sh>
This commit is contained in:
Dean Herbert 2019-05-16 15:27:30 +09:00 committed by GitHub
commit 20316cc0ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 67 deletions

View File

@ -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[]
{
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,
},
},
},
s.Shadow = false;
s.Font = OsuFont.GetFont(size: 14);
}).With(d =>
{
d.AutoSizeAxes = Axes.Both;
d.AddText("mapped by ", t => t.Colour = colours.Gray5);
d.AddUserLink(SetInfo.Metadata.Author);
}),
new Container
{
AutoSizeAxes = Axes.X,

View File

@ -15,6 +15,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Drawables;
using osu.Game.Graphics.Containers;
namespace osu.Game.Overlays.Direct
{
@ -86,8 +87,9 @@ namespace osu.Game.Overlays.Direct
{
Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft,
Size = new Vector2(height / 2),
Size = new Vector2(height / 3),
FillMode = FillMode.Fit,
Margin = new MarginPadding { Right = 10 },
},
new FillFlowContainer
{
@ -150,7 +152,7 @@ namespace osu.Game.Overlays.Direct
Child = new DownloadButton(SetInfo)
{
Size = new Vector2(height - vertical_padding * 3),
Margin = new MarginPadding { Left = vertical_padding, Right = vertical_padding },
Margin = new MarginPadding { Left = vertical_padding * 2, Right = vertical_padding },
},
},
new FillFlowContainer
@ -163,26 +165,21 @@ namespace osu.Game.Overlays.Direct
{
new Statistic(FontAwesome.Solid.PlayCircle, SetInfo.OnlineInfo?.PlayCount ?? 0),
new Statistic(FontAwesome.Solid.Heart, SetInfo.OnlineInfo?.FavouriteCount ?? 0),
new FillFlowContainer
new LinkFlowContainer(s =>
{
s.Shadow = false;
s.Font = OsuFont.GetFont(size: 14);
})
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Children = new[]
{
new OsuSpriteText
{
Text = "mapped by ",
Font = OsuFont.GetFont(size: 14)
},
new OsuSpriteText
{
Text = SetInfo.Metadata.Author.Username,
Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold, italics: true)
},
},
},
}.With(d =>
{
d.AutoSizeAxes = Axes.Both;
d.AddText("mapped by ");
d.AddUserLink(SetInfo.Metadata.Author);
}),
new OsuSpriteText
{
Text = SetInfo.Metadata.Source,

View File

@ -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[]
{
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)
}
}
},
}
});
}.With(d =>
{
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);
}
}
}