From 2d42a83bb9bd718bac9e6ce5c5dce41632f6f455 Mon Sep 17 00:00:00 2001 From: Joehu Date: Sat, 1 Feb 2020 11:24:29 -0800 Subject: [PATCH 1/4] Fix mod select overlay overflowing toolbar at max ui scale --- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 4 +-- osu.Game/Screens/Select/SongSelect.cs | 41 +++++++++++++++------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 38f5d54714..af772bc2fa 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -66,7 +66,6 @@ namespace osu.Game.Overlays.Mods Waves.ThirdWaveColour = OsuColour.FromHex(@"005774"); Waves.FourthWaveColour = OsuColour.FromHex(@"003a4e"); - Height = 510; Padding = new MarginPadding { Horizontal = -OsuScreen.HORIZONTAL_OVERFLOW_PADDING }; Children = new Drawable[] @@ -85,8 +84,7 @@ namespace osu.Game.Overlays.Mods new Triangles { TriangleScale = 5, - RelativeSizeAxes = Axes.X, - Height = Height, //set the height from the start to ensure correct triangle density. + RelativeSizeAxes = Axes.Both, ColourLight = new Color4(53, 66, 82, 255), ColourDark = new Color4(41, 54, 70, 255), }, diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index f9f015643d..8647012ee7 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -221,23 +221,38 @@ namespace osu.Game.Screens.Select if (ShowFooter) { - AddRangeInternal(new[] + AddRangeInternal(new Drawable[] { - FooterPanels = new Container + new GridContainer // used for max width implementation { - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft, - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Margin = new MarginPadding { Bottom = Footer.HEIGHT }, - Children = new Drawable[] + RelativeSizeAxes = Axes.Both, + RowDimensions = new[] { - BeatmapOptions = new BeatmapOptionsOverlay(), - ModSelect = new ModSelectOverlay + new Dimension(), + new Dimension(GridSizeMode.Relative, 1f, maxSize: 560), + }, + Content = new[] + { + null, + new Drawable[] { - RelativeSizeAxes = Axes.X, - Origin = Anchor.BottomCentre, - Anchor = Anchor.BottomCentre, + FooterPanels = new Container + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Bottom = Footer.HEIGHT }, + Children = new Drawable[] + { + BeatmapOptions = new BeatmapOptionsOverlay(), + ModSelect = new ModSelectOverlay + { + RelativeSizeAxes = Axes.Both, + Origin = Anchor.BottomCentre, + Anchor = Anchor.BottomCentre, + } + } + } } } }, From 609ee260302563751370d7e47ad5939cb887e673 Mon Sep 17 00:00:00 2001 From: Joehu Date: Sat, 1 Feb 2020 11:41:41 -0800 Subject: [PATCH 2/4] Fix mod select overlay not showing up in test --- .../Visual/UserInterface/TestSceneModSelectOverlay.cs | 1 - osu.Game/Overlays/Mods/ModSelectOverlay.cs | 2 ++ osu.Game/Screens/Select/SongSelect.cs | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs index 12ee4ceb2e..dfc684d376 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs @@ -60,7 +60,6 @@ namespace osu.Game.Tests.Visual.UserInterface { modSelect = new TestModSelectOverlay { - RelativeSizeAxes = Axes.X, Origin = Anchor.BottomCentre, Anchor = Anchor.BottomCentre, }, diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index af772bc2fa..2868fe1d79 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -66,6 +66,8 @@ namespace osu.Game.Overlays.Mods Waves.ThirdWaveColour = OsuColour.FromHex(@"005774"); Waves.FourthWaveColour = OsuColour.FromHex(@"003a4e"); + RelativeSizeAxes = Axes.Both; + Padding = new MarginPadding { Horizontal = -OsuScreen.HORIZONTAL_OVERFLOW_PADDING }; Children = new Drawable[] diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 8647012ee7..3f80c90b9d 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -247,7 +247,6 @@ namespace osu.Game.Screens.Select BeatmapOptions = new BeatmapOptionsOverlay(), ModSelect = new ModSelectOverlay { - RelativeSizeAxes = Axes.Both, Origin = Anchor.BottomCentre, Anchor = Anchor.BottomCentre, } From 583fee074fa2ef266f5595501646c7b383b1a0fa Mon Sep 17 00:00:00 2001 From: Joehu Date: Sat, 1 Feb 2020 11:50:24 -0800 Subject: [PATCH 3/4] Fix mod select not showing up in mod settings test --- osu.Game.Tests/Visual/UserInterface/TestSceneModSettings.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneModSettings.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneModSettings.cs index e2ce2341e5..ba0970e123 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneModSettings.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneModSettings.cs @@ -74,7 +74,6 @@ namespace osu.Game.Tests.Visual.UserInterface Child = modSelect = new TestModSelectOverlay { - RelativeSizeAxes = Axes.X, Origin = Anchor.BottomCentre, Anchor = Anchor.BottomCentre, }; From 22e3150f685a6916f0ddc2d689023cb32361598e Mon Sep 17 00:00:00 2001 From: Joehu Date: Mon, 3 Feb 2020 17:21:06 -0800 Subject: [PATCH 4/4] Fix comment and remove magic numbers --- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 2 ++ osu.Game/Screens/Select/SongSelect.cs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 2868fe1d79..0813e57dae 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -30,6 +30,8 @@ namespace osu.Game.Overlays.Mods { public class ModSelectOverlay : WaveOverlayContainer { + public const float HEIGHT = 510; + protected readonly TriangleButton DeselectAllButton; protected readonly TriangleButton CustomiseButton; protected readonly TriangleButton CloseButton; diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 3f80c90b9d..a5dce9a065 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -223,13 +223,13 @@ namespace osu.Game.Screens.Select { AddRangeInternal(new Drawable[] { - new GridContainer // used for max width implementation + new GridContainer // used for max height implementation { RelativeSizeAxes = Axes.Both, RowDimensions = new[] { new Dimension(), - new Dimension(GridSizeMode.Relative, 1f, maxSize: 560), + new Dimension(GridSizeMode.Relative, 1f, maxSize: ModSelectOverlay.HEIGHT + Footer.HEIGHT), }, Content = new[] {