Merge branch 'master' into localisation-header

This commit is contained in:
Salman Ahmed
2021-08-03 05:16:02 +03:00
331 changed files with 6565 additions and 1975 deletions

View File

@ -10,6 +10,7 @@ using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Beatmaps;
using osu.Game.Extensions;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osuTK;
@ -62,7 +63,7 @@ namespace osu.Game.Overlays.BeatmapSet
}
else
{
length.Value = TimeSpan.FromMilliseconds(beatmap.Length).ToString(@"m\:ss");
length.Value = TimeSpan.FromMilliseconds(beatmap.Length).ToFormattedDuration();
circleCount.Value = beatmap.OnlineInfo.CircleCount.ToString();
sliderCount.Value = beatmap.OnlineInfo.SliderCount.ToString();
}

View File

@ -2,11 +2,13 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.BeatmapSet
{
@ -34,7 +36,7 @@ namespace osu.Game.Overlays.BeatmapSet
new OsuSpriteText
{
Margin = new MarginPadding { Horizontal = 10f, Vertical = 2f },
Text = "EXPLICIT",
Text = BeatmapsetsStrings.NsfwBadgeLabel.ToUpper(),
Font = OsuFont.GetFont(size: 10, weight: FontWeight.SemiBold),
Colour = OverlayColourProvider.Orange.Colour2,
}

View File

@ -26,12 +26,14 @@ namespace osu.Game.Overlays.BeatmapSet
public LeaderboardModSelector()
{
AutoSizeAxes = Axes.Both;
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
InternalChild = modsContainer = new FillFlowContainer<ModButton>
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
AutoSizeAxes = Axes.Both,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Full,
Spacing = new Vector2(4),
};
@ -54,7 +56,12 @@ namespace osu.Game.Overlays.BeatmapSet
modsContainer.Add(new ModButton(new ModNoMod()));
modsContainer.AddRange(ruleset.NewValue.CreateInstance().GetAllMods().Where(m => m.UserPlayable).Select(m => new ModButton(m)));
modsContainer.ForEach(button => button.OnSelectionChanged = selectionChanged);
modsContainer.ForEach(button =>
{
button.Anchor = Anchor.TopCentre;
button.Origin = Anchor.TopCentre;
button.OnSelectionChanged = selectionChanged;
});
}
protected override bool OnHover(HoverEvent e)

View File

@ -18,6 +18,8 @@ using osu.Game.Scoring;
using osu.Game.Users.Drawables;
using osuTK;
using osuTK.Graphics;
using osu.Framework.Localisation;
using osu.Framework.Extensions.LocalisationExtensions;
namespace osu.Game.Overlays.BeatmapSet.Scores
{
@ -211,11 +213,11 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
return content.ToArray();
}
protected override Drawable CreateHeader(int index, TableColumn column) => new HeaderText(column?.Header ?? string.Empty);
protected override Drawable CreateHeader(int index, TableColumn column) => new HeaderText(column?.Header ?? default);
private class HeaderText : OsuSpriteText
{
public HeaderText(string text)
public HeaderText(LocalisableString text)
{
Text = text.ToUpper();
Font = OsuFont.GetFont(size: 10, weight: FontWeight.Bold);

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
@ -204,7 +205,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
this.text = text;
}
public string Text
public LocalisableString Text
{
set => text.Text = value;
}