1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-19 13:12:54 +08:00

Hide empty categories in mod selector overlay (#5021)

Hide empty categories in mod selector overlay

Co-authored-by: Dean Herbert <pe@ppy.sh>
This commit is contained in:
Dean Herbert 2019-06-20 01:59:30 +09:00 committed by GitHub
commit a4ceefdc9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 2 deletions

View File

@ -24,11 +24,10 @@ using osuTK.Graphics;
namespace osu.Game.Tests.Visual.UserInterface namespace osu.Game.Tests.Visual.UserInterface
{ {
[Description("mod select and icon display")] [Description("mod select and icon display")]
public class TestSceneMods : OsuTestScene public class TestSceneModSelectOverlay : OsuTestScene
{ {
public override IReadOnlyList<Type> RequiredTypes => new[] public override IReadOnlyList<Type> RequiredTypes => new[]
{ {
typeof(ModSelectOverlay),
typeof(ModDisplay), typeof(ModDisplay),
typeof(ModSection), typeof(ModSection),
typeof(ModIcon), typeof(ModIcon),

View File

@ -50,6 +50,18 @@ namespace osu.Game.Overlays.Mods
ButtonsContainer.Children = modContainers; ButtonsContainer.Children = modContainers;
buttons = modContainers.OfType<ModButton>().ToArray(); buttons = modContainers.OfType<ModButton>().ToArray();
if (value.Any())
{
headerLabel.FadeIn(200);
this.FadeIn(200);
}
else
{
// transition here looks weird as mods instantly disappear.
headerLabel.Hide();
Hide();
}
} }
} }

View File

@ -172,6 +172,8 @@ namespace osu.Game.Overlays.Mods
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Spacing = new Vector2(0f, 10f), Spacing = new Vector2(0f, 10f),
Width = content_width, Width = content_width,
LayoutDuration = 200,
LayoutEasing = Easing.OutQuint,
Children = new ModSection[] Children = new ModSection[]
{ {
new DifficultyReductionSection { Action = modButtonPressed }, new DifficultyReductionSection { Action = modButtonPressed },