Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust minor BeatmapSetOverlay details to better match osu-web #7730

Merged
merged 42 commits into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
b28a1d3
Simplify GradientLine and fix colour changing
thewildtree Feb 4, 2020
9bc45d2
Recolour LeaderboardScopeSelector
thewildtree Feb 4, 2020
5eb1619
Adjust title / artist font weight
thewildtree Feb 4, 2020
5b88156
Adjust header gradient colours
thewildtree Feb 4, 2020
b6301f6
Adjust PreviewButton alpha and animation
thewildtree Feb 4, 2020
a366a92
Use alpha instead of colour opacity
thewildtree Feb 4, 2020
86283cc
Recolour SuccessRate background
thewildtree Feb 4, 2020
d0eb4e4
Add necessary variable
thewildtree Feb 4, 2020
2cc1255
Adjust online status pill font and padding
thewildtree Feb 4, 2020
268bb73
Adjust header padding
thewildtree Feb 4, 2020
cbfb909
Rename variable
thewildtree Feb 4, 2020
85fb4b4
Recolour DetailBox
thewildtree Feb 4, 2020
88e79df
Hide ratings if beatmap has no leaderboard
thewildtree Feb 4, 2020
48beb9f
Recolour PreviewButton
thewildtree Feb 4, 2020
3ef6027
Show placeholder instead of success rate when beatmap unranked
thewildtree Feb 4, 2020
5458085
Adjust TopScoreUserSection font and spacing
thewildtree Feb 4, 2020
d23e4a1
Change scoreboard text size
thewildtree Feb 4, 2020
9795897
Enforce correct column order in ScoreTable
thewildtree Feb 4, 2020
82914b5
Adjust ScoreTable spacing
thewildtree Feb 4, 2020
d7af96a
Adjust corner radius
thewildtree Feb 4, 2020
86c0b50
Adjust font once again for readibility
thewildtree Feb 4, 2020
c1b8445
Add spacing to match osu-web
thewildtree Feb 4, 2020
ae46753
Fix tests
thewildtree Feb 4, 2020
b606408
Remove space
thewildtree Feb 4, 2020
23d1d3f
Convert field to local variable
thewildtree Feb 4, 2020
c2a8011
Remove using directives
thewildtree Feb 4, 2020
447f31c
Remove using directive
thewildtree Feb 4, 2020
f4ee281
Add optional decimal place
thewildtree Feb 5, 2020
76037e4
Recolour ranked status pill
thewildtree Feb 5, 2020
e1e1c1a
Match osu-web display accuracy
thewildtree Feb 5, 2020
fa3934d
Match osu-web button description
thewildtree Feb 5, 2020
e79ba9a
Add alwaysShowDecimals param to FormatAccuracy
thewildtree Feb 5, 2020
63df6b8
Change accuracy formatting method
thewildtree Feb 5, 2020
c93d2c7
Adjust loading container corner radius
thewildtree Feb 5, 2020
c09af00
Revert accuracy display and column sorting changes
thewildtree Feb 6, 2020
7395f01
Use osu-web font sizes
thewildtree Feb 7, 2020
e2950d7
Extract method to avoid nested ternaries
bdach Feb 10, 2020
811553c
Remove unnecessary coercions
bdach Feb 10, 2020
35d5237
Adjust font sizes
bdach Feb 10, 2020
e072042
Match osu-web font size
thewildtree Feb 10, 2020
b694b0c
Merge branch 'master' into adjust-beatmap-overlay
thewildtree Feb 11, 2020
9a9349a
Merge branch 'master' into adjust-beatmap-overlay
smoogipoo Feb 12, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Utils;
using osu.Game.Beatmaps;
using osu.Game.Overlays;
using osu.Game.Overlays.BeatmapSet;
using osu.Game.Screens.Select.Details;

Expand All @@ -22,6 +24,9 @@ public class TestSceneBeatmapSetOverlayDetails : OsuTestScene

private RatingsExposingDetails details;

[Cached]
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);

[SetUp]
public void Setup() => Schedule(() =>
{
Expand Down Expand Up @@ -55,8 +60,12 @@ public void TestMetrics()
{
Fails = Enumerable.Range(1, 100).Select(_ => RNG.Next(10)).ToArray(),
Retries = Enumerable.Range(-2, 100).Select(_ => RNG.Next(10)).ToArray(),
}
},
}
},
OnlineInfo = new BeatmapSetOnlineInfo
{
Status = BeatmapSetOnlineStatus.Ranked
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Utils;
using osu.Game.Beatmaps;
using osu.Game.Overlays;
using osu.Game.Overlays.BeatmapSet;
using osu.Game.Screens.Select.Details;
using osuTK;
Expand All @@ -26,6 +28,9 @@ public class TestSceneBeatmapSetOverlaySuccessRate : OsuTestScene

private GraphExposingSuccessRate successRate;

[Cached]
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);

[SetUp]
public void Setup() => Schedule(() =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@
using osu.Framework.Graphics;
using osu.Framework.Bindables;
using osu.Game.Screens.Select.Leaderboards;
using osu.Framework.Allocation;
using osu.Game.Overlays;

namespace osu.Game.Tests.Visual.Online
{
public class TestSceneLeaderboardScopeSelector : OsuTestScene
{
[Cached]
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);

public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(LeaderboardScopeSelector),
Expand Down
9 changes: 8 additions & 1 deletion osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace osu.Game.Beatmaps.Drawables
public class BeatmapSetOnlineStatusPill : CircularContainer
{
private readonly OsuSpriteText statusText;
private readonly Box background;

private BeatmapSetOnlineStatus status;

Expand Down Expand Up @@ -43,14 +44,20 @@ public MarginPadding TextPadding
set => statusText.Padding = value;
}

public Color4 BackgroundColour
{
get => background.Colour;
set => background.Colour = value;
}

public BeatmapSetOnlineStatusPill()
{
AutoSizeAxes = Axes.Both;
Masking = true;

Children = new Drawable[]
{
new Box
background = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
Expand Down
17 changes: 3 additions & 14 deletions osu.Game/Graphics/UserInterface/GradientLineTabControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,7 @@ private class GradientLine : GridContainer
public GradientLine()
{
RelativeSizeAxes = Axes.X;
Size = new Vector2(0.8f, 1.5f);

ColumnDimensions = new[]
{
new Dimension(),
new Dimension(mode: GridSizeMode.Relative, size: 0.4f),
new Dimension(),
};
Size = new Vector2(0.8f, 1f);

Content = new[]
{
Expand All @@ -65,16 +58,12 @@ public GradientLine()
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = ColourInfo.GradientHorizontal(Color4.Transparent, Color4.White)
},
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = ColourInfo.GradientHorizontal(Color4.Transparent, Colour)
},
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = ColourInfo.GradientHorizontal(Color4.White, Color4.Transparent)
Colour = ColourInfo.GradientHorizontal(Colour, Color4.Transparent)
},
}
};
Expand Down
10 changes: 9 additions & 1 deletion osu.Game/Overlays/BeatmapSet/Buttons/HeaderDownloadButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private void load(IAPIProvider api, BeatmapManager beatmaps)
},
new OsuSpriteText
{
Text = BeatmapSet.Value.OnlineInfo.HasVideo && noVideo ? "without Video" : string.Empty,
Text = getVideoSuffixText(),
Font = OsuFont.GetFont(size: 11, weight: FontWeight.Bold)
},
};
Expand All @@ -163,5 +163,13 @@ private void load(IAPIProvider api, BeatmapManager beatmaps)
private void userChanged(ValueChangedEvent<User> e) => button.Enabled.Value = !(e.NewValue is GuestUser);

private void enabledChanged(ValueChangedEvent<bool> e) => this.FadeColour(e.NewValue ? Color4.White : Color4.Gray, 200, Easing.OutQuint);

private string getVideoSuffixText()
{
if (!BeatmapSet.Value.OnlineInfo.HasVideo)
return string.Empty;

return noVideo ? "without Video" : "with Video";
}
}
}
15 changes: 7 additions & 8 deletions osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
Expand All @@ -14,15 +13,14 @@
using osu.Game.Graphics.Containers;
using osu.Game.Overlays.Direct;
using osuTK;
using osuTK.Graphics;

namespace osu.Game.Overlays.BeatmapSet.Buttons
{
public class PreviewButton : OsuClickableContainer
{
private const float transition_duration = 500;

private readonly Box bg, progress;
private readonly Box background, progress;
private readonly PlayButton playButton;

private PreviewTrack preview => playButton.Preview;
Expand All @@ -40,10 +38,10 @@ public PreviewButton()

Children = new Drawable[]
{
bg = new Box
background = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black.Opacity(0.25f),
Alpha = 0.5f
},
new Container
{
Expand Down Expand Up @@ -71,9 +69,10 @@ public PreviewButton()
}

[BackgroundDependencyLoader]
private void load(OsuColour colours)
private void load(OsuColour colours, OverlayColourProvider colourProvider)
{
progress.Colour = colours.Yellow;
background.Colour = colourProvider.Background6;
}

protected override void Update()
Expand All @@ -91,13 +90,13 @@ protected override void Update()

protected override bool OnHover(HoverEvent e)
{
bg.FadeColour(Color4.Black.Opacity(0.5f), 100);
background.FadeTo(0.75f, 80);
return base.OnHover(e);
}

protected override void OnHoverLost(HoverLostEvent e)
{
bg.FadeColour(Color4.Black.Opacity(0.25f), 100);
background.FadeTo(0.5f, 80);
base.OnHoverLost(e);
}
}
Expand Down
18 changes: 13 additions & 5 deletions osu.Game/Overlays/BeatmapSet/Details.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps;
using osu.Game.Overlays.BeatmapSet.Buttons;
using osu.Game.Screens.Select.Details;
using osuTK;
using osuTK.Graphics;

namespace osu.Game.Overlays.BeatmapSet
{
Expand All @@ -21,6 +19,7 @@ public class Details : FillFlowContainer
private readonly PreviewButton preview;
private readonly BasicStats basic;
private readonly AdvancedStats advanced;
private readonly DetailBox ratingBox;

private BeatmapSetInfo beatmapSet;

Expand Down Expand Up @@ -54,6 +53,7 @@ public BeatmapInfo Beatmap
private void updateDisplay()
{
Ratings.Metrics = BeatmapSet?.Metrics;
ratingBox.Alpha = BeatmapSet?.OnlineInfo?.Status > 0 ? 1 : 0;
}

public Details()
Expand Down Expand Up @@ -86,7 +86,7 @@ public Details()
Margin = new MarginPadding { Vertical = 7.5f },
},
},
new DetailBox
ratingBox = new DetailBox
{
Child = Ratings = new UserRatings
{
Expand All @@ -107,6 +107,8 @@ private void load()
private class DetailBox : Container
{
private readonly Container content;
private readonly Box background;

protected override Container<Drawable> Content => content;

public DetailBox()
Expand All @@ -116,10 +118,10 @@ public DetailBox()

InternalChildren = new Drawable[]
{
new Box
background = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black.Opacity(0.5f),
Alpha = 0.5f
},
content = new Container
{
Expand All @@ -129,6 +131,12 @@ public DetailBox()
},
};
}

[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
background.Colour = colourProvider.Background6;
}
}
}
}
25 changes: 14 additions & 11 deletions osu.Game/Overlays/BeatmapSet/Header.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 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.

using System.Linq;
Expand Down Expand Up @@ -30,6 +30,7 @@ public class Header : BeatmapDownloadTrackingComposite
private const float buttons_spacing = 5;

private readonly UpdateableBeatmapSetCover cover;
private readonly Box coverGradient;
private readonly OsuSpriteText title, artist;
private readonly AuthorInfo author;
private readonly FillFlowContainer downloadButtonsContainer;
Expand Down Expand Up @@ -93,10 +94,9 @@ public Header()
RelativeSizeAxes = Axes.Both,
Masking = true,
},
new Box
coverGradient = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = ColourInfo.GradientVertical(Color4.Black.Opacity(0.3f), Color4.Black.Opacity(0.8f)),
RelativeSizeAxes = Axes.Both
},
},
},
Expand All @@ -106,8 +106,7 @@ public Header()
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding
{
Top = 20,
Bottom = 30,
Vertical = BeatmapSetOverlay.Y_PADDING,
Left = BeatmapSetOverlay.X_PADDING,
Right = BeatmapSetOverlay.X_PADDING + BeatmapSetOverlay.RIGHT_WIDTH,
},
Expand All @@ -130,11 +129,12 @@ public Header()
{
Direction = FillDirection.Horizontal,
AutoSizeAxes = Axes.Both,
Margin = new MarginPadding { Top = 15 },
Children = new Drawable[]
{
title = new OsuSpriteText
{
Font = OsuFont.GetFont(size: 37, weight: FontWeight.Bold, italics: true)
Font = OsuFont.GetFont(size: 30, weight: FontWeight.SemiBold, italics: true)
},
externalLink = new ExternalLinkButton
{
Expand All @@ -144,7 +144,7 @@ public Header()
},
}
},
artist = new OsuSpriteText { Font = OsuFont.GetFont(size: 25, weight: FontWeight.SemiBold, italics: true) },
artist = new OsuSpriteText { Font = OsuFont.GetFont(size: 20, weight: FontWeight.Medium, italics: true) },
new Container
{
RelativeSizeAxes = Axes.X,
Expand Down Expand Up @@ -187,7 +187,7 @@ public Header()
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
AutoSizeAxes = Axes.Both,
Margin = new MarginPadding { Top = BeatmapSetOverlay.TOP_PADDING, Right = BeatmapSetOverlay.X_PADDING },
Margin = new MarginPadding { Top = BeatmapSetOverlay.Y_PADDING, Right = BeatmapSetOverlay.X_PADDING },
Direction = FillDirection.Vertical,
Spacing = new Vector2(10),
Children = new Drawable[]
Expand All @@ -197,7 +197,7 @@ public Header()
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
TextSize = 14,
TextPadding = new MarginPadding { Horizontal = 25, Vertical = 8 }
TextPadding = new MarginPadding { Horizontal = 35, Vertical = 10 }
},
Details = new Details(),
},
Expand All @@ -215,8 +215,11 @@ public Header()
}

[BackgroundDependencyLoader]
private void load(OsuColour colours)
private void load(OverlayColourProvider colourProvider)
{
coverGradient.Colour = ColourInfo.GradientVertical(colourProvider.Background6.Opacity(0.3f), colourProvider.Background6.Opacity(0.8f));
onlineStatusPill.BackgroundColour = colourProvider.Background6;

State.BindValueChanged(_ => updateDownloadButtons());

BeatmapSet.BindValueChanged(setInfo =>
Expand Down
Loading