1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 06:52:56 +08:00

Merge pull request #7863 from TheWildTree/adjust-beatmap-overlay

Adjust font sizes and spacing in BeatmapSetOverlay to match osu-web values
This commit is contained in:
Dean Herbert 2020-02-21 10:20:22 +09:00 committed by GitHub
commit ab49f88fd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 111 additions and 108 deletions

View File

@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
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;
@ -50,7 +49,7 @@ namespace osu.Game.Beatmaps.Drawables
Child = new Box Child = new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = ColourInfo.GradientVertical(OsuColour.Gray(0.2f), OsuColour.Gray(0.1f)), Colour = OsuColour.Gray(0.2f),
}; };
} }

View File

@ -77,7 +77,7 @@ namespace osu.Game.Overlays.BeatmapSet
new Container new Container
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
CornerRadius = 3, CornerRadius = 4,
Masking = true, Masking = true,
Child = avatar = new UpdateableAvatar Child = avatar = new UpdateableAvatar
{ {
@ -88,7 +88,7 @@ namespace osu.Game.Overlays.BeatmapSet
{ {
Colour = Color4.Black.Opacity(0.25f), Colour = Color4.Black.Opacity(0.25f),
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Radius = 3, Radius = 4,
Offset = new Vector2(0f, 1f), Offset = new Vector2(0f, 1f),
}, },
}, },
@ -118,12 +118,12 @@ namespace osu.Game.Overlays.BeatmapSet
new OsuSpriteText new OsuSpriteText
{ {
Text = $"{first} ", Text = $"{first} ",
Font = OsuFont.GetFont(size: 13) Font = OsuFont.GetFont(size: 11)
}, },
new OsuSpriteText new OsuSpriteText
{ {
Text = second, Text = second,
Font = secondFont.With(size: 13) Font = secondFont.With(size: 11)
}, },
}; };
} }

View File

@ -105,7 +105,7 @@ namespace osu.Game.Overlays.BeatmapSet
{ {
TooltipText = name; TooltipText = name;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; Height = 24f;
Children = new Drawable[] Children = new Drawable[]
{ {
@ -113,7 +113,8 @@ namespace osu.Game.Overlays.BeatmapSet
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.X,
RelativeSizeAxes = Axes.Y,
Children = new Drawable[] Children = new Drawable[]
{ {
new SpriteIcon new SpriteIcon
@ -121,7 +122,7 @@ namespace osu.Game.Overlays.BeatmapSet
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Icon = FontAwesome.Solid.Square, Icon = FontAwesome.Solid.Square,
Size = new Vector2(13), Size = new Vector2(12),
Rotation = 45, Rotation = 45,
Colour = OsuColour.FromHex(@"441288"), Colour = OsuColour.FromHex(@"441288"),
}, },
@ -130,7 +131,7 @@ namespace osu.Game.Overlays.BeatmapSet
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Icon = icon, Icon = icon,
Size = new Vector2(13), Size = new Vector2(12),
Colour = OsuColour.FromHex(@"f7dd55"), Colour = OsuColour.FromHex(@"f7dd55"),
Scale = new Vector2(0.8f), Scale = new Vector2(0.8f),
}, },
@ -139,7 +140,7 @@ namespace osu.Game.Overlays.BeatmapSet
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Margin = new MarginPadding { Left = 10 }, Margin = new MarginPadding { Left = 10 },
Font = OsuFont.GetFont(size: 13, weight: FontWeight.Bold), Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold),
}, },
}, },
}, },

View File

@ -6,7 +6,6 @@ using System.Linq;
using osu.Framework; using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
@ -19,7 +18,6 @@ using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osuTK; using osuTK;
using osuTK.Graphics;
namespace osu.Game.Overlays.BeatmapSet namespace osu.Game.Overlays.BeatmapSet
{ {
@ -34,7 +32,6 @@ namespace osu.Game.Overlays.BeatmapSet
public readonly DifficultiesContainer Difficulties; public readonly DifficultiesContainer Difficulties;
public readonly Bindable<BeatmapInfo> Beatmap = new Bindable<BeatmapInfo>(); public readonly Bindable<BeatmapInfo> Beatmap = new Bindable<BeatmapInfo>();
private BeatmapSetInfo beatmapSet; private BeatmapSetInfo beatmapSet;
public BeatmapSetInfo BeatmapSet public BeatmapSetInfo BeatmapSet
@ -67,7 +64,7 @@ namespace osu.Game.Overlays.BeatmapSet
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Margin = new MarginPadding { Left = -(tile_icon_padding + tile_spacing / 2) }, Margin = new MarginPadding { Left = -(tile_icon_padding + tile_spacing / 2), Bottom = 10 },
OnLostHover = () => OnLostHover = () =>
{ {
showBeatmap(Beatmap.Value); showBeatmap(Beatmap.Value);
@ -77,7 +74,6 @@ namespace osu.Game.Overlays.BeatmapSet
new FillFlowContainer new FillFlowContainer
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Margin = new MarginPadding { Top = 10 },
Spacing = new Vector2(5f), Spacing = new Vector2(5f),
Children = new[] Children = new[]
{ {
@ -85,13 +81,13 @@ namespace osu.Game.Overlays.BeatmapSet
{ {
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
Font = OsuFont.GetFont(size: 20, weight: FontWeight.Bold) Font = OsuFont.GetFont(size: 17, weight: FontWeight.Bold)
}, },
starRating = new OsuSpriteText starRating = new OsuSpriteText
{ {
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
Font = OsuFont.GetFont(size: 13, weight: FontWeight.Bold), Font = OsuFont.GetFont(size: 11, weight: FontWeight.Bold),
Text = "Star Difficulty", Text = "Star Difficulty",
Alpha = 0, Alpha = 0,
Margin = new MarginPadding { Bottom = 1 }, Margin = new MarginPadding { Bottom = 1 },
@ -192,9 +188,11 @@ namespace osu.Game.Overlays.BeatmapSet
public class DifficultySelectorButton : OsuClickableContainer, IStateful<DifficultySelectorState> public class DifficultySelectorButton : OsuClickableContainer, IStateful<DifficultySelectorState>
{ {
private const float transition_duration = 100; private const float transition_duration = 100;
private const float size = 52; private const float size = 54;
private const float background_size = size - 2;
private readonly Container bg; private readonly Container background;
private readonly Box backgroundBox;
private readonly DifficultyIcon icon; private readonly DifficultyIcon icon;
public readonly BeatmapInfo Beatmap; public readonly BeatmapInfo Beatmap;
@ -230,16 +228,16 @@ namespace osu.Game.Overlays.BeatmapSet
Children = new Drawable[] Children = new Drawable[]
{ {
bg = new Container background = new Container
{ {
RelativeSizeAxes = Axes.Both, Size = new Vector2(background_size),
Masking = true, Masking = true,
CornerRadius = 4, CornerRadius = 4,
Child = new Box Child = backgroundBox = new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = Color4.Black.Opacity(0.5f), Alpha = 0.5f
}, }
}, },
icon = new DifficultyIcon(beatmap, shouldShowTooltip: false) icon = new DifficultyIcon(beatmap, shouldShowTooltip: false)
{ {
@ -273,15 +271,21 @@ namespace osu.Game.Overlays.BeatmapSet
private void fadeIn() private void fadeIn()
{ {
bg.FadeIn(transition_duration); background.FadeIn(transition_duration);
icon.FadeIn(transition_duration); icon.FadeIn(transition_duration);
} }
private void fadeOut() private void fadeOut()
{ {
bg.FadeOut(); background.FadeOut();
icon.FadeTo(0.7f, transition_duration); icon.FadeTo(0.7f, transition_duration);
} }
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
backgroundBox.Colour = colourProvider.Background6;
}
} }
private class Statistic : FillFlowContainer private class Statistic : FillFlowContainer
@ -314,13 +318,13 @@ namespace osu.Game.Overlays.BeatmapSet
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Icon = icon, Icon = icon,
Shadow = true, Shadow = true,
Size = new Vector2(13), Size = new Vector2(12),
}, },
text = new OsuSpriteText text = new OsuSpriteText
{ {
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold, italics: true) Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold, italics: true),
}, },
}; };
} }

View File

@ -22,6 +22,8 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
{ {
public class HeaderDownloadButton : BeatmapDownloadTrackingComposite, IHasTooltip public class HeaderDownloadButton : BeatmapDownloadTrackingComposite, IHasTooltip
{ {
private const int text_size = 12;
private readonly bool noVideo; private readonly bool noVideo;
public string TooltipText => button.Enabled.Value ? "download this beatmap" : "login to download"; public string TooltipText => button.Enabled.Value ? "download this beatmap" : "login to download";
@ -80,8 +82,7 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
Icon = FontAwesome.Solid.Download, Icon = FontAwesome.Solid.Download,
Size = new Vector2(16), Size = new Vector2(18),
Margin = new MarginPadding { Right = 5 },
}, },
} }
}, },
@ -120,7 +121,7 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
new OsuSpriteText new OsuSpriteText
{ {
Text = "Downloading...", Text = "Downloading...",
Font = OsuFont.GetFont(size: 13, weight: FontWeight.Bold) Font = OsuFont.GetFont(size: text_size, weight: FontWeight.Bold)
}, },
}; };
break; break;
@ -131,7 +132,7 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
new OsuSpriteText new OsuSpriteText
{ {
Text = "Importing...", Text = "Importing...",
Font = OsuFont.GetFont(size: 13, weight: FontWeight.Bold) Font = OsuFont.GetFont(size: text_size, weight: FontWeight.Bold)
}, },
}; };
break; break;
@ -146,12 +147,12 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
new OsuSpriteText new OsuSpriteText
{ {
Text = "Download", Text = "Download",
Font = OsuFont.GetFont(size: 13, weight: FontWeight.Bold) Font = OsuFont.GetFont(size: text_size, weight: FontWeight.Bold)
}, },
new OsuSpriteText new OsuSpriteText
{ {
Text = getVideoSuffixText(), Text = getVideoSuffixText(),
Font = OsuFont.GetFont(size: 11, weight: FontWeight.Bold) Font = OsuFont.GetFont(size: text_size - 2, weight: FontWeight.Bold)
}, },
}; };
this.FadeIn(200); this.FadeIn(200);

View File

@ -74,7 +74,7 @@ namespace osu.Game.Overlays.BeatmapSet
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Margin = new MarginPadding { Vertical = 10 }, Padding = new MarginPadding { Vertical = 10 }
}, },
}, },
new DetailBox new DetailBox

View File

@ -144,12 +144,15 @@ namespace osu.Game.Overlays.BeatmapSet
}, },
} }
}, },
artist = new OsuSpriteText { Font = OsuFont.GetFont(size: 20, weight: FontWeight.Medium, italics: true) }, artist = new OsuSpriteText
{
Font = OsuFont.GetFont(size: 20, weight: FontWeight.Medium, italics: true),
Margin = new MarginPadding { Bottom = 20 }
},
new Container new Container
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Margin = new MarginPadding { Top = 20 },
Child = author = new AuthorInfo(), Child = author = new AuthorInfo(),
}, },
beatmapAvailability = new BeatmapAvailability(), beatmapAvailability = new BeatmapAvailability(),

View File

@ -20,8 +20,9 @@ namespace osu.Game.Overlays.BeatmapSet
public class Info : Container public class Info : Container
{ {
private const float transition_duration = 250; private const float transition_duration = 250;
private const float metadata_width = 225; private const float metadata_width = 175;
private const float spacing = 20; private const float spacing = 20;
private const float base_height = 220;
private readonly Box successRateBackground; private readonly Box successRateBackground;
private readonly Box background; private readonly Box background;
@ -41,7 +42,7 @@ namespace osu.Game.Overlays.BeatmapSet
OsuSpriteText unrankedPlaceholder; OsuSpriteText unrankedPlaceholder;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Height = 220; Height = base_height;
Masking = true; Masking = true;
EdgeEffect = new EdgeEffectParameters EdgeEffect = new EdgeEffectParameters
{ {
@ -135,6 +136,7 @@ namespace osu.Game.Overlays.BeatmapSet
var setHasLeaderboard = b.NewValue?.OnlineInfo?.Status > 0; var setHasLeaderboard = b.NewValue?.OnlineInfo?.Status > 0;
successRate.Alpha = setHasLeaderboard ? 1 : 0; successRate.Alpha = setHasLeaderboard ? 1 : 0;
unrankedPlaceholder.Alpha = setHasLeaderboard ? 0 : 1; unrankedPlaceholder.Alpha = setHasLeaderboard ? 0 : 1;
Height = setHasLeaderboard ? 270 : base_height;
}; };
} }
@ -176,8 +178,8 @@ namespace osu.Game.Overlays.BeatmapSet
new OsuSpriteText new OsuSpriteText
{ {
Text = title, Text = title,
Font = OsuFont.GetFont(size: 14, weight: FontWeight.Black), Font = OsuFont.GetFont(size: 14, weight: FontWeight.Bold),
Margin = new MarginPadding { Top = 20 }, Margin = new MarginPadding { Top = 15 },
}, },
textFlow = new OsuTextFlowContainer textFlow = new OsuTextFlowContainer
{ {

View File

@ -3,7 +3,6 @@
using osu.Game.Screens.Select.Leaderboards; using osu.Game.Screens.Select.Leaderboards;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Graphics;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osuTK.Graphics; using osuTK.Graphics;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
@ -37,7 +36,6 @@ namespace osu.Game.Overlays.BeatmapSet
public ScopeSelectorTabItem(BeatmapLeaderboardScope value) public ScopeSelectorTabItem(BeatmapLeaderboardScope value)
: base(value) : base(value)
{ {
Text.Font = OsuFont.GetFont(size: 16);
} }
protected override bool OnHover(HoverEvent e) protected override bool OnHover(HoverEvent e)

View File

@ -23,7 +23,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
Masking = true; Masking = true;
CornerRadius = 5; CornerRadius = 4;
EdgeEffect = new EdgeEffectParameters EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
@ -46,7 +46,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
{ {
Vertical = 10, Vertical = 10,
Left = 10, Left = 10,
Right = 25, Right = 30,
}, },
Children = new Drawable[] Children = new Drawable[]
{ {

View File

@ -21,7 +21,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 10), Spacing = new Vector2(0, 20),
Children = new Drawable[] Children = new Drawable[]
{ {
new OsuSpriteText new OsuSpriteText
@ -29,9 +29,9 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
Text = @"You need to be an osu!supporter to access the friend and country rankings!", Text = @"You need to be an osu!supporter to access the friend and country rankings!",
Font = OsuFont.GetFont(weight: FontWeight.Bold), Font = OsuFont.GetFont(size: 14, weight: FontWeight.Bold),
}, },
text = new LinkFlowContainer(t => t.Font = t.Font.With(size: 12)) text = new LinkFlowContainer(t => t.Font = t.Font.With(size: 11))
{ {
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,

View File

@ -22,7 +22,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
public class ScoreTable : TableContainer public class ScoreTable : TableContainer
{ {
private const float horizontal_inset = 20; private const float horizontal_inset = 20;
private const float row_height = 25; private const float row_height = 22;
private const int text_size = 12; private const int text_size = 12;
private readonly FillFlowContainer backgroundFlow; private readonly FillFlowContainer backgroundFlow;
@ -63,7 +63,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
return; return;
for (int i = 0; i < value.Count; i++) for (int i = 0; i < value.Count; i++)
backgroundFlow.Add(new ScoreTableRowBackground(i, value[i])); backgroundFlow.Add(new ScoreTableRowBackground(i, value[i], row_height));
Columns = createHeaders(value[0]); Columns = createHeaders(value[0]);
Content = value.Select((s, i) => createContent(i, s)).ToArray().ToRectangular(); Content = value.Select((s, i) => createContent(i, s)).ToArray().ToRectangular();
@ -77,17 +77,20 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
new TableColumn("rank", Anchor.CentreRight, new Dimension(GridSizeMode.AutoSize)), new TableColumn("rank", Anchor.CentreRight, new Dimension(GridSizeMode.AutoSize)),
new TableColumn("", Anchor.Centre, new Dimension(GridSizeMode.Absolute, 70)), // grade new TableColumn("", Anchor.Centre, new Dimension(GridSizeMode.Absolute, 70)), // grade
new TableColumn("score", Anchor.CentreLeft, new Dimension(GridSizeMode.AutoSize)), new TableColumn("score", Anchor.CentreLeft, new Dimension(GridSizeMode.AutoSize)),
new TableColumn("accuracy", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 60, maxSize: 70)), new TableColumn("accuracy", Anchor.CentreLeft, new Dimension(GridSizeMode.Absolute, minSize: 60, maxSize: 70)),
new TableColumn("player", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 150)), new TableColumn("", Anchor.CentreLeft, new Dimension(GridSizeMode.Absolute, 25)), // flag
new TableColumn("max combo", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 70, maxSize: 110)) new TableColumn("player", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 125)),
new TableColumn("max combo", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 70, maxSize: 120))
}; };
foreach (var statistic in score.SortedStatistics) foreach (var statistic in score.SortedStatistics.Take(score.SortedStatistics.Count() - 1))
columns.Add(new TableColumn(statistic.Key.GetDescription(), Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 50, maxSize: 70))); columns.Add(new TableColumn(statistic.Key.GetDescription(), Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 35, maxSize: 60)));
columns.Add(new TableColumn(score.SortedStatistics.LastOrDefault().Key.GetDescription(), Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 45, maxSize: 95)));
columns.AddRange(new[] columns.AddRange(new[]
{ {
new TableColumn("pp", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 40, maxSize: 70)), new TableColumn("pp", Anchor.CentreLeft, new Dimension(GridSizeMode.Absolute, 30)),
new TableColumn("mods", Anchor.CentreLeft, new Dimension(GridSizeMode.AutoSize)), new TableColumn("mods", Anchor.CentreLeft, new Dimension(GridSizeMode.AutoSize)),
}); });
@ -96,6 +99,9 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
private Drawable[] createContent(int index, ScoreInfo score) private Drawable[] createContent(int index, ScoreInfo score)
{ {
var username = new LinkFlowContainer(t => t.Font = OsuFont.GetFont(size: text_size)) { AutoSizeAxes = Axes.Both };
username.AddUserLink(score.User);
var content = new List<Drawable> var content = new List<Drawable>
{ {
new OsuSpriteText new OsuSpriteText
@ -105,7 +111,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
}, },
new UpdateableRank(score.Rank) new UpdateableRank(score.Rank)
{ {
Size = new Vector2(30, 20) Size = new Vector2(28, 14)
}, },
new OsuSpriteText new OsuSpriteText
{ {
@ -120,36 +126,19 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
Font = OsuFont.GetFont(size: text_size), Font = OsuFont.GetFont(size: text_size),
Colour = score.Accuracy == 1 ? highAccuracyColour : Color4.White Colour = score.Accuracy == 1 ? highAccuracyColour : Color4.White
}, },
};
var username = new LinkFlowContainer(t => t.Font = OsuFont.GetFont(size: text_size)) { AutoSizeAxes = Axes.Both };
username.AddUserLink(score.User);
content.AddRange(new Drawable[]
{
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Margin = new MarginPadding { Right = horizontal_inset },
Spacing = new Vector2(5, 0),
Children = new Drawable[]
{
new UpdateableFlag(score.User.Country) new UpdateableFlag(score.User.Country)
{ {
Size = new Vector2(20, 13), Size = new Vector2(19, 13),
ShowPlaceholderOnNull = false, ShowPlaceholderOnNull = false,
}, },
username username,
}
},
new OsuSpriteText new OsuSpriteText
{ {
Text = $@"{score.MaxCombo:N0}x", Text = $@"{score.MaxCombo:N0}x",
Font = OsuFont.GetFont(size: text_size), Font = OsuFont.GetFont(size: text_size),
Colour = score.MaxCombo == score.Beatmap?.MaxCombo ? highAccuracyColour : Color4.White Colour = score.MaxCombo == score.Beatmap?.MaxCombo ? highAccuracyColour : Color4.White
} }
}); };
foreach (var kvp in score.SortedStatistics) foreach (var kvp in score.SortedStatistics)
{ {

View File

@ -22,13 +22,13 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
private readonly int index; private readonly int index;
private readonly ScoreInfo score; private readonly ScoreInfo score;
public ScoreTableRowBackground(int index, ScoreInfo score) public ScoreTableRowBackground(int index, ScoreInfo score, float height)
{ {
this.index = index; this.index = index;
this.score = score; this.score = score;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Height = 25; Height = height;
CornerRadius = 5; CornerRadius = 5;
Masking = true; Masking = true;

View File

@ -90,9 +90,9 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Width = 0.95f,
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Margin = new MarginPadding { Vertical = spacing }, Padding = new MarginPadding { Horizontal = 50 },
Margin = new MarginPadding { Vertical = 20 },
Children = new Drawable[] Children = new Drawable[]
{ {
new FillFlowContainer new FillFlowContainer
@ -121,7 +121,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
{ {
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Margin = new MarginPadding { Vertical = spacing }, Margin = new MarginPadding { Top = spacing },
Children = new Drawable[] Children = new Drawable[]
{ {
noScoresPlaceholder = new NoScoresPlaceholder noScoresPlaceholder = new NoScoresPlaceholder

View File

@ -27,7 +27,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
private const float bottom_columns_min_width = 45; private const float bottom_columns_min_width = 45;
private readonly FontUsage smallFont = OsuFont.GetFont(size: 16); private readonly FontUsage smallFont = OsuFont.GetFont(size: 16);
private readonly FontUsage largeFont = OsuFont.GetFont(size: 22); private readonly FontUsage largeFont = OsuFont.GetFont(size: 22, weight: FontWeight.Light);
private readonly TextColumn totalScoreColumn; private readonly TextColumn totalScoreColumn;
private readonly TextColumn accuracyColumn; private readonly TextColumn accuracyColumn;
@ -47,7 +47,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Spacing = new Vector2(10, 8),
Children = new Drawable[] Children = new Drawable[]
{ {
new FillFlowContainer new FillFlowContainer
@ -117,6 +116,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
public InfoColumn(string title, Drawable content, float? minWidth = null) public InfoColumn(string title, Drawable content, float? minWidth = null)
{ {
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
Margin = new MarginPadding { Vertical = 5 };
InternalChild = new GridContainer InternalChild = new GridContainer
{ {
@ -128,7 +128,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
RowDimensions = new[] RowDimensions = new[]
{ {
new Dimension(GridSizeMode.AutoSize), new Dimension(GridSizeMode.AutoSize),
new Dimension(GridSizeMode.Absolute, 4), new Dimension(GridSizeMode.Absolute, 2),
new Dimension(GridSizeMode.AutoSize) new Dimension(GridSizeMode.AutoSize)
}, },
Content = new[] Content = new[]
@ -138,21 +138,24 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
text = new OsuSpriteText text = new OsuSpriteText
{ {
Font = OsuFont.GetFont(size: 10, weight: FontWeight.Bold), Font = OsuFont.GetFont(size: 10, weight: FontWeight.Bold),
Text = title.ToUpper() Text = title.ToUpper(),
// 2px padding bottom + 1px vertical to compensate for the additional spacing because of 1.25 line-height in osu-web
Padding = new MarginPadding { Top = 1, Bottom = 3 }
} }
}, },
new Drawable[] new Drawable[]
{ {
separator = new Box separator = new Box
{ {
Anchor = Anchor.CentreLeft, Anchor = Anchor.TopLeft,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Height = 2 Height = 2,
} },
}, },
new[] new[]
{ {
content // osu-web has 4px margin here but also uses 0.9 line-height, reducing margin to 2px seems like a good alternative to that
content.With(c => c.Margin = new MarginPadding { Top = 2 })
} }
} }
}; };
@ -194,9 +197,10 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
public ModsInfoColumn() public ModsInfoColumn()
: this(new FillFlowContainer : this(new FillFlowContainer
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.X,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
Spacing = new Vector2(1), Spacing = new Vector2(1),
Height = 18f
}) })
{ {
} }

View File

@ -67,7 +67,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
Origin = Anchor.Centre, Origin = Anchor.Centre,
Size = new Vector2(70), Size = new Vector2(70),
Masking = true, Masking = true,
CornerRadius = 5, CornerRadius = 4,
EdgeEffect = new EdgeEffectParameters EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,

View File

@ -65,7 +65,7 @@ namespace osu.Game.Overlays.BeatmapSet
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
Text = "Success Rate", Text = "Success Rate",
Font = OsuFont.GetFont(size: 13) Font = OsuFont.GetFont(size: 12)
}, },
successRate = new Bar successRate = new Bar
{ {
@ -82,7 +82,7 @@ namespace osu.Game.Overlays.BeatmapSet
{ {
Anchor = Anchor.TopRight, Anchor = Anchor.TopRight,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
Font = OsuFont.GetFont(size: 13), Font = OsuFont.GetFont(size: 12),
}, },
}, },
new OsuSpriteText new OsuSpriteText
@ -90,7 +90,7 @@ namespace osu.Game.Overlays.BeatmapSet
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
Text = "Points of Failure", Text = "Points of Failure",
Font = OsuFont.GetFont(size: 13), Font = OsuFont.GetFont(size: 12),
Margin = new MarginPadding { Vertical = 20 }, Margin = new MarginPadding { Vertical = 20 },
}, },
}, },

View File

@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
@ -51,7 +50,6 @@ namespace osu.Game.Screens.Select.Details
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Spacing = new Vector2(4f),
Children = new[] Children = new[]
{ {
FirstValue = new StatisticRow(), //circle size/key amount FirstValue = new StatisticRow(), //circle size/key amount
@ -199,6 +197,7 @@ namespace osu.Game.Screens.Select.Details
this.forceDecimalPlaces = forceDecimalPlaces; this.forceDecimalPlaces = forceDecimalPlaces;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
Padding = new MarginPadding { Vertical = 2.5f };
Children = new Drawable[] Children = new Drawable[]
{ {
@ -206,9 +205,11 @@ namespace osu.Game.Screens.Select.Details
{ {
Width = name_width, Width = name_width,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
// osu-web uses 1.25 line-height, which at 12px font size makes the element 14px tall - this compentates that difference
Padding = new MarginPadding { Vertical = 1 },
Child = name = new OsuSpriteText Child = name = new OsuSpriteText
{ {
Font = OsuFont.GetFont(size: 13) Font = OsuFont.GetFont(size: 12)
}, },
}, },
bar = new Bar bar = new Bar
@ -239,7 +240,7 @@ namespace osu.Game.Screens.Select.Details
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Font = OsuFont.GetFont(size: 13) Font = OsuFont.GetFont(size: 12)
}, },
}, },
}; };

View File

@ -71,31 +71,32 @@ namespace osu.Game.Screens.Select.Details
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
Text = "User Rating", Text = "User Rating",
Font = OsuFont.GetFont(size: 13) Font = OsuFont.GetFont(size: 12),
Margin = new MarginPadding { Bottom = 5 },
}, },
ratingsBar = new Bar ratingsBar = new Bar
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Height = 5, Height = 5,
Margin = new MarginPadding { Top = 5 },
}, },
new Container new Container
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Margin = new MarginPadding { Bottom = 10 },
Children = new[] Children = new[]
{ {
negativeRatings = new OsuSpriteText negativeRatings = new OsuSpriteText
{ {
Text = "0", Text = "0",
Font = OsuFont.GetFont(size: 13) Font = OsuFont.GetFont(size: 12)
}, },
positiveRatings = new OsuSpriteText positiveRatings = new OsuSpriteText
{ {
Anchor = Anchor.TopRight, Anchor = Anchor.TopRight,
Origin = Anchor.TopRight, Origin = Anchor.TopRight,
Text = @"0", Text = @"0",
Font = OsuFont.GetFont(size: 13) Font = OsuFont.GetFont(size: 12)
}, },
}, },
}, },
@ -104,8 +105,8 @@ namespace osu.Game.Screens.Select.Details
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
Text = "Rating Spread", Text = "Rating Spread",
Font = OsuFont.GetFont(size: 13), Font = OsuFont.GetFont(size: 12),
Margin = new MarginPadding { Top = 10, Bottom = 5 }, Margin = new MarginPadding { Bottom = 5 },
}, },
}, },
}, },