mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 17:47:29 +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:
commit
a4ceefdc9d
@ -24,11 +24,10 @@ using osuTK.Graphics;
|
||||
namespace osu.Game.Tests.Visual.UserInterface
|
||||
{
|
||||
[Description("mod select and icon display")]
|
||||
public class TestSceneMods : OsuTestScene
|
||||
public class TestSceneModSelectOverlay : OsuTestScene
|
||||
{
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||
{
|
||||
typeof(ModSelectOverlay),
|
||||
typeof(ModDisplay),
|
||||
typeof(ModSection),
|
||||
typeof(ModIcon),
|
@ -50,6 +50,18 @@ namespace osu.Game.Overlays.Mods
|
||||
|
||||
ButtonsContainer.Children = modContainers;
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -172,6 +172,8 @@ namespace osu.Game.Overlays.Mods
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Spacing = new Vector2(0f, 10f),
|
||||
Width = content_width,
|
||||
LayoutDuration = 200,
|
||||
LayoutEasing = Easing.OutQuint,
|
||||
Children = new ModSection[]
|
||||
{
|
||||
new DifficultyReductionSection { Action = modButtonPressed },
|
||||
|
Loading…
Reference in New Issue
Block a user