From bdb130fabcc678cb592fcad2bbcc3cb6715b5ba4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 3 Mar 2017 16:54:59 +0900 Subject: [PATCH] Avoid using right-to-left fill direction for now. --- .../Select/Options/BeatmapOptionsOverlay.cs | 44 ++++++++++++------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs b/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs index 18fccb708f..47152dc165 100644 --- a/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs +++ b/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs @@ -2,6 +2,8 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Collections.Generic; +using System.Linq; using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics; @@ -18,6 +20,8 @@ namespace osu.Game.Screens.Select.Options private const float transition_duration = 500; private const float x_position = 290; + private const float height = 100; + private Box holder; private FillFlowContainer buttonsContainer; @@ -76,29 +80,20 @@ namespace osu.Game.Screens.Select.Options Scale = new Vector2(1, 0), Colour = Color4.Black.Opacity(0.5f), }, - buttonsContainer = new FillFlowContainer + buttonsContainer = new ButtonFlow { + Height = height, AutoSizeAxes = Axes.X, - Height = 100, Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, - Direction = FillDirection.Left, Children = new BeatmapOptionsButton[] { - new BeatmapOptionsDeleteButton + new BeatmapOptionsRemoveFromUnplayedButton { Action = () => { Hide(); - OnDelete?.Invoke(); - }, - }, - new BeatmapOptionsEditButton - { - Action = () => - { - Hide(); - OnEdit?.Invoke(); + OnRemoveFromUnplayed?.Invoke(); }, }, new BeatmapOptionsClearLocalScoresButton @@ -109,17 +104,36 @@ namespace osu.Game.Screens.Select.Options OnClearLocalScores?.Invoke(); }, }, - new BeatmapOptionsRemoveFromUnplayedButton + new BeatmapOptionsEditButton { Action = () => { Hide(); - OnRemoveFromUnplayed?.Invoke(); + OnEdit?.Invoke(); + }, + }, + new BeatmapOptionsDeleteButton + { + Action = () => + { + Hide(); + OnDelete?.Invoke(); }, }, }, }, }; } + + class ButtonFlow : FillFlowContainer + { + protected override IComparer DepthComparer => new ReverseCreationOrderDepthComparer(); + protected override IEnumerable FlowingChildren => base.FlowingChildren.Reverse(); + + public ButtonFlow() + { + Direction = FillDirection.Right; + } + } } }