mirror of
https://github.com/osukey/osukey.git
synced 2025-05-20 21:17:32 +09:00
Pull beatmap list from db and render simple list
This commit is contained in:
parent
2ef516a6fa
commit
a14edc06c8
@ -8,7 +8,7 @@ namespace osu.Game.Database
|
|||||||
{
|
{
|
||||||
public class BeatmapMetadata
|
public class BeatmapMetadata
|
||||||
{
|
{
|
||||||
[PrimaryKey]
|
[PrimaryKey, AutoIncrement]
|
||||||
public int ID { get; set; }
|
public int ID { get; set; }
|
||||||
|
|
||||||
public int BeatmapSetID { get; set; }
|
public int BeatmapSetID { get; set; }
|
||||||
|
@ -4,21 +4,33 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Game.GameModes.Backgrounds;
|
using osu.Game.GameModes.Backgrounds;
|
||||||
using osu.Framework;
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.GameModes.Play
|
namespace osu.Game.GameModes.Play
|
||||||
{
|
{
|
||||||
class PlaySongSelect : GameModeWhiteBox
|
class PlaySongSelect : OsuGameMode
|
||||||
{
|
{
|
||||||
private Bindable<PlayMode> playMode;
|
private Bindable<PlayMode> playMode;
|
||||||
|
|
||||||
|
// TODO: use currently selected track as bg
|
||||||
protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4");
|
protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4");
|
||||||
|
|
||||||
protected override IEnumerable<Type> PossibleChildren => new[] {
|
private FlowContainer setList;
|
||||||
typeof(ModSelect),
|
|
||||||
typeof(Player)
|
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)
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
@ -28,6 +40,14 @@ namespace osu.Game.GameModes.Play
|
|||||||
|
|
||||||
playMode = osu.PlayMode;
|
playMode = osu.PlayMode;
|
||||||
playMode.ValueChanged += PlayMode_ValueChanged;
|
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)
|
protected override void Dispose(bool isDisposing)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user