1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-18 04:59:52 +08:00

Pull beatmap list from db and render simple list

This commit is contained in:
Drew DeVault
2016-10-19 10:31:10 -04:00
Unverified
parent 2ef516a6fa
commit a14edc06c8
4 changed files with 28 additions and 8 deletions
+1 -1
View File
@@ -17,4 +17,4 @@ namespace osu.Game.Beatmaps
public List<ControlPoint> ControlPoints { get; set; }
public List<Color4> ComboColors { get; set; }
}
}
}
+1 -1
View File
@@ -125,4 +125,4 @@ namespace osu.Game.Database
connection.Update(record);
}
}
}
}
+1 -1
View File
@@ -8,7 +8,7 @@ namespace osu.Game.Database
{
public class BeatmapMetadata
{
[PrimaryKey]
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
public int BeatmapSetID { get; set; }
+25 -5
View File
@@ -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)