diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneFooterButtonMods.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneFooterButtonMods.cs index 6eb621ca3b..63197ed26a 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneFooterButtonMods.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneFooterButtonMods.cs @@ -16,7 +16,8 @@ namespace osu.Game.Tests.Visual.UserInterface { public override IReadOnlyList RequiredTypes => new[] { - typeof(FooterButtonMods) + typeof(FooterButtonMods), + typeof(FooterButton) }; private readonly TestFooterButtonMods footerButtonMods; diff --git a/osu.Game/Screens/Select/FooterButton.cs b/osu.Game/Screens/Select/FooterButton.cs index b77da36748..18c9d1091c 100644 --- a/osu.Game/Screens/Select/FooterButton.cs +++ b/osu.Game/Screens/Select/FooterButton.cs @@ -56,7 +56,7 @@ namespace osu.Game.Screens.Select } } - protected readonly Container TextContainer; + protected FillFlowContainer TextContainer; protected readonly SpriteText SpriteText; private readonly Box box; private readonly Box light; @@ -80,15 +80,24 @@ namespace osu.Game.Screens.Select EdgeSmoothness = new Vector2(2, 0), RelativeSizeAxes = Axes.X, }, - TextContainer = new Container + TextContainer = new FillFlowContainer { - Size = new Vector2(100 - SHEAR_WIDTH, 50), + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Direction = FillDirection.Horizontal, Shear = -SHEAR, - Child = SpriteText = new OsuSpriteText + Children = new Drawable[] { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - } + SpriteText = new OsuSpriteText + { + Size = new Vector2(100 - SHEAR_WIDTH, 50), + Shear = -SHEAR, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + } + }, + AutoSizeAxes = Axes.Both, + // Margin = new MarginPadding { Left = 70, Right = 14 } }, }; } diff --git a/osu.Game/Screens/Select/FooterButtonMods.cs b/osu.Game/Screens/Select/FooterButtonMods.cs index a0e34a7f87..2141c04cd6 100644 --- a/osu.Game/Screens/Select/FooterButtonMods.cs +++ b/osu.Game/Screens/Select/FooterButtonMods.cs @@ -3,7 +3,7 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; +// using osu.Framework.Graphics.Containers; using osu.Game.Screens.Play.HUD; using osu.Game.Rulesets.Mods; using System.Collections.Generic; @@ -34,31 +34,19 @@ namespace osu.Game.Screens.Select public FooterButtonMods() { - Add(new FillFlowContainer + TextContainer.Add(modDisplay = new FooterModDisplay { - Anchor = Anchor.CentreLeft, - Origin = Anchor.CentreLeft, - Direction = FillDirection.Horizontal, - Shear = -SHEAR, - Children = new Drawable[] - { - modDisplay = new FooterModDisplay - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - DisplayUnrankedText = false, - Scale = new Vector2(0.8f) - }, - MultiplierText = new OsuSpriteText - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Font = OsuFont.GetFont(weight: FontWeight.Bold), - Margin = new MarginPadding { Right = 6 } - } - }, - AutoSizeAxes = Axes.Both, - Margin = new MarginPadding { Left = 70, Right = 14 } + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + DisplayUnrankedText = false, + Scale = new Vector2(0.8f) + }); + TextContainer.Add(MultiplierText = new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Font = OsuFont.GetFont(weight: FontWeight.Bold), + Margin = new MarginPadding { Right = 6 } }); }