1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 21:02:55 +08:00

Control footer by virtual property.

This commit is contained in:
Huo Yaoyuan 2017-03-15 10:10:59 +08:00
parent 8c991eae01
commit 37ff1f3971
4 changed files with 15 additions and 11 deletions

View File

@ -3,9 +3,10 @@
namespace osu.Game.Screens.Select
{
internal class EditSongSelect : SongSelect
public class EditSongSelect : SongSelect
{
public EditSongSelect() : base(false) { }
protected override bool ShowFooter => false;
protected override void OnSelected() => Exit();
}
}

View File

@ -3,9 +3,8 @@
namespace osu.Game.Screens.Select
{
internal class MatchSongSelect : SongSelect
public class MatchSongSelect : SongSelect
{
public MatchSongSelect() : base(true) { }
protected override void OnSelected() => Exit();
}
}

View File

@ -19,7 +19,7 @@ namespace osu.Game.Screens.Select
private OsuScreen player;
private ModSelectOverlay modSelect;
public PlaySongSelect() : base(true)
public PlaySongSelect()
{
Add(modSelect = new ModSelectOverlay
{

View File

@ -53,14 +53,17 @@ namespace osu.Game.Screens.Select
private List<BeatmapGroup> beatmapGroups;
protected virtual bool ShowFooter => true;
/// <summary>
/// Can be null if hasFooter:false in constructor
/// Can be null if <see cref="ShowFooter"/> == false
/// </summary>
protected BeatmapOptionsOverlay BeatmapOptions { get; private set; }
protected readonly BeatmapOptionsOverlay BeatmapOptions;
/// <summary>
/// Can be null if hasFooter:false in constructor
/// Can be null if <see cref="ShowFooter"/> == false
/// </summary>
protected Footer Footer { get; private set; }
protected readonly Footer Footer;
private FilterControl filter;
public FilterControl Filter
@ -79,7 +82,7 @@ namespace osu.Game.Screens.Select
}
}
protected SongSelect(bool hasFooter)
protected SongSelect()
{
const float carousel_width = 640;
const float filter_height = 100;
@ -125,7 +128,8 @@ namespace osu.Game.Screens.Select
},
X = -50,
});
if (hasFooter)
if (ShowFooter)
{
Add(BeatmapOptions = new BeatmapOptionsOverlay
{