mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 14:52:55 +08:00
Pull beatmap list from db and render simple list
This commit is contained in:
parent
2ef516a6fa
commit
a14edc06c8
@ -17,4 +17,4 @@ namespace osu.Game.Beatmaps
|
||||
public List<ControlPoint> ControlPoints { get; set; }
|
||||
public List<Color4> ComboColors { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -125,4 +125,4 @@ namespace osu.Game.Database
|
||||
connection.Update(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ namespace osu.Game.Database
|
||||
{
|
||||
public class BeatmapMetadata
|
||||
{
|
||||
[PrimaryKey]
|
||||
[PrimaryKey, AutoIncrement]
|
||||
public int ID { get; set; }
|
||||
|
||||
public int BeatmapSetID { get; set; }
|
||||
|
@ -4,21 +4,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using osu.Framework;
|
||||
|
||||
namespace osu.Game.GameModes.Play
|
||||
{
|
||||
class PlaySongSelect : GameModeWhiteBox
|
||||
class PlaySongSelect : OsuGameMode
|
||||
{
|
||||
private Bindable<PlayMode> playMode;
|
||||
|
||||
// TODO: use currently selected track as bg
|
||||
protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4");
|
||||
|
||||
protected override IEnumerable<Type> PossibleChildren => new[] {
|
||||
typeof(ModSelect),
|
||||
typeof(Player)
|
||||
};
|
||||
private FlowContainer setList;
|
||||
|
||||
private void addBeatmapSets()
|
||||
{
|
||||
var sets = (Game as OsuGame).Beatmaps.GetBeatmapSets();
|
||||
foreach (var beatmapSet in sets)
|
||||
{
|
||||
setList.Add(new SpriteText
|
||||
{
|
||||
Text = beatmapSet.Metadata.Title
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public override void Load(BaseGame game)
|
||||
{
|
||||
@ -28,6 +40,14 @@ namespace osu.Game.GameModes.Play
|
||||
|
||||
playMode = osu.PlayMode;
|
||||
playMode.ValueChanged += PlayMode_ValueChanged;
|
||||
|
||||
Add(setList = new FlowContainer
|
||||
{
|
||||
Direction = FlowDirection.VerticalOnly,
|
||||
Padding = new OpenTK.Vector2(0, osu.Toolbar.Height)
|
||||
});
|
||||
|
||||
addBeatmapSets();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
|
Loading…
Reference in New Issue
Block a user