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:
commit
a4ceefdc9d
@ -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),
|
@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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 },
|
||||||
|
Loading…
Reference in New Issue
Block a user