Merge pull request #546 from peppy/song-select-improvements

Song select improvements
This commit is contained in:
Dan Balasescu 2017-03-24 09:26:51 +09:00 committed by GitHub
commit dace1e15c9
3 changed files with 30 additions and 7 deletions

View File

@ -22,6 +22,8 @@ namespace osu.Game.Screens.Select
private const float play_song_select_button_width = 100;
private const float play_song_select_button_height = 50;
public const float HEIGHT = 50;
public const int TRANSITION_LENGTH = 300;
private const float padding = 80;
@ -69,10 +71,8 @@ namespace osu.Game.Screens.Select
{
AlwaysReceiveInput = true;
const float bottom_tool_height = 50;
RelativeSizeAxes = Axes.X;
Height = bottom_tool_height;
Height = HEIGHT;
Anchor = Anchor.BottomCentre;
Origin = Anchor.BottomCentre;
Children = new Drawable[]

View File

@ -4,6 +4,7 @@
using OpenTK.Input;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Screens;
using osu.Game.Beatmaps;
@ -22,12 +23,11 @@ namespace osu.Game.Screens.Select
public PlaySongSelect()
{
Add(modSelect = new ModSelectOverlay
FooterPanels.Add(modSelect = new ModSelectOverlay
{
RelativeSizeAxes = Axes.X,
Origin = Anchor.BottomCentre,
Anchor = Anchor.BottomCentre,
Margin = new MarginPadding { Bottom = 50 }
});
LeftContent.Add(beatmapDetails = new BeatmapDetailArea
@ -66,6 +66,17 @@ namespace osu.Game.Screens.Select
base.OnResuming(last);
}
protected override bool OnExiting(Screen next)
{
if (modSelect.State == Visibility.Visible)
{
modSelect.Hide();
return true;
}
return base.OnExiting(next);
}
protected override void OnSelected()
{
if (player != null) return;

View File

@ -65,6 +65,12 @@ namespace osu.Game.Screens.Select
/// </summary>
protected readonly Footer Footer;
/// <summary>
/// Contains any panel which is triggered by a footer button.
/// Helps keep them located beneath the footer itself.
/// </summary>
protected readonly Container FooterPanels;
public readonly FilterControl FilterControl;
protected SongSelect()
@ -131,11 +137,15 @@ namespace osu.Game.Screens.Select
if (ShowFooter)
{
Add(BeatmapOptions = new BeatmapOptionsOverlay
Add(FooterPanels = new Container
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Margin = new MarginPadding
{
Bottom = 50,
Bottom = Footer.HEIGHT,
},
});
Add(Footer = new Footer
@ -143,6 +153,8 @@ namespace osu.Game.Screens.Select
OnBack = Exit,
OnStart = raiseSelect,
});
FooterPanels.Add(BeatmapOptions = new BeatmapOptionsOverlay());
}
}