diff --git a/osu.Game/Graphics/Containers/ReverseDepthFillFlowContainer.cs b/osu.Game/Graphics/Containers/ReverseDepthFillFlowContainer.cs new file mode 100644 index 0000000000..2b52b06abc --- /dev/null +++ b/osu.Game/Graphics/Containers/ReverseDepthFillFlowContainer.cs @@ -0,0 +1,16 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using System.Linq; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; + +namespace osu.Game.Graphics.Containers +{ + public class ReverseDepthFillFlowContainer : FillFlowContainer where T : Drawable + { + protected override IComparer DepthComparer => new ReverseCreationOrderDepthComparer(); + protected override IEnumerable FlowingChildren => base.FlowingChildren.Reverse(); + } +} diff --git a/osu.Game/Overlays/DirectOverlay.cs b/osu.Game/Overlays/DirectOverlay.cs index ea56d656aa..8c38dffb14 100644 --- a/osu.Game/Overlays/DirectOverlay.cs +++ b/osu.Game/Overlays/DirectOverlay.cs @@ -10,6 +10,7 @@ using osu.Framework.Graphics.Sprites; using osu.Game.Database; using osu.Game.Graphics; using osu.Game.Graphics.Backgrounds; +using osu.Game.Graphics.Containers; using osu.Game.Overlays.Direct; namespace osu.Game.Overlays @@ -82,7 +83,7 @@ namespace osu.Game.Overlays Padding = new MarginPadding { Top = Header.HEIGHT }, Children = new Drawable[] { - new ContentFlow + new ReverseDepthFillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, @@ -136,16 +137,5 @@ namespace osu.Game.Overlays filter.Search.HoldFocus = false; } - - private class ContentFlow : FillFlowContainer - { - protected override IComparer DepthComparer => new ReverseCreationOrderDepthComparer(); - protected override IEnumerable FlowingChildren => base.FlowingChildren.Reverse(); - - public ContentFlow() - { - Direction = FillDirection.Vertical; - } - } } } diff --git a/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs b/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs index c064a0272e..be2f5196ef 100644 --- a/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs +++ b/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs @@ -2,8 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using System.Collections.Generic; -using System.Linq; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -12,6 +10,7 @@ using osu.Game.Graphics; using OpenTK; using OpenTK.Graphics; using OpenTK.Input; +using osu.Game.Graphics.Containers; namespace osu.Game.Screens.Select.Options { @@ -71,7 +70,7 @@ namespace osu.Game.Screens.Select.Options Scale = new Vector2(1, 0), Colour = Color4.Black.Opacity(0.5f), }, - buttonsContainer = new ButtonFlow + buttonsContainer = new ReverseDepthFillFlowContainer { Height = height, RelativePositionAxes = Axes.X, @@ -109,16 +108,5 @@ namespace osu.Game.Screens.Select.Options HotKey = hotkey }); } - - private class ButtonFlow : FillFlowContainer - { - protected override IComparer DepthComparer => new ReverseCreationOrderDepthComparer(); - protected override IEnumerable FlowingChildren => base.FlowingChildren.Reverse(); - - public ButtonFlow() - { - Direction = FillDirection.Horizontal; - } - } } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index a362306938..fcf22ba053 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -439,6 +439,7 @@ +