mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 17:52:56 +08:00
Fix up wrt upstream development
This commit is contained in:
parent
8e31965fb4
commit
c41b3d92c6
@ -17,7 +17,7 @@ namespace osu.Game.Database
|
||||
|
||||
[PrimaryKey]
|
||||
public int BeatmapID { get; set; }
|
||||
[NotNull, Indexed]
|
||||
[ForeignKey(typeof(BeatmapSetInfo)), NotNull]
|
||||
public int BeatmapSetID { get; set; }
|
||||
[ForeignKey(typeof(BeatmapMetadata))]
|
||||
public int BeatmapMetadataID { get; set; }
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using SQLite.Net.Attributes;
|
||||
using System.Collections.Generic;
|
||||
using SQLite.Net.Attributes;
|
||||
using SQLiteNetExtensions.Attributes;
|
||||
|
||||
namespace osu.Game.Database
|
||||
@ -12,6 +13,8 @@ namespace osu.Game.Database
|
||||
public BeatmapMetadata Metadata { get; set; }
|
||||
[NotNull, ForeignKey(typeof(BeatmapMetadata))]
|
||||
public int BeatmapMetadataID { get; set; }
|
||||
[OneToMany]
|
||||
public List<BeatmapInfo> Beatmaps { get; set; }
|
||||
public string Hash { get; set; }
|
||||
public string Path { get; set; }
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ using osu.Game.GameModes.Backgrounds;
|
||||
using osu.Framework;
|
||||
using osu.Game.Database;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Graphics.Drawables;
|
||||
using OpenTK.Graphics;
|
||||
using OpenTK;
|
||||
using osu.Game.Graphics;
|
||||
@ -21,10 +20,10 @@ namespace osu.Game.GameModes.Play
|
||||
{
|
||||
class BeatmapButton : AutoSizeContainer
|
||||
{
|
||||
private BeatmapSet beatmapSet;
|
||||
private Beatmap beatmap;
|
||||
private BeatmapSetInfo beatmapSet;
|
||||
private BeatmapInfo beatmap;
|
||||
|
||||
public BeatmapButton(BeatmapSet set, Beatmap beatmap)
|
||||
public BeatmapButton(BeatmapSetInfo set, BeatmapInfo beatmap)
|
||||
{
|
||||
this.beatmapSet = set;
|
||||
this.beatmap = beatmap;
|
||||
|
@ -7,10 +7,10 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using OpenTK;
|
||||
using System.Linq;
|
||||
using osu.Framework.Graphics.Drawables;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Framework.Input;
|
||||
using OpenTK.Graphics;
|
||||
@ -21,9 +21,9 @@ namespace osu.Game.GameModes.Play
|
||||
{
|
||||
private const float collapsedAlpha = 0.3f;
|
||||
|
||||
public event Action<BeatmapSet> SetSelected;
|
||||
public event Action<BeatmapSet, Beatmap> BeatmapSelected;
|
||||
public BeatmapSet BeatmapSet;
|
||||
public event Action<BeatmapSetInfo> SetSelected;
|
||||
public event Action<BeatmapSetInfo, BeatmapInfo> BeatmapSelected;
|
||||
public BeatmapSetInfo BeatmapSet;
|
||||
private FlowContainer topContainer;
|
||||
private FlowContainer difficulties;
|
||||
private bool collapsed;
|
||||
@ -51,7 +51,7 @@ namespace osu.Game.GameModes.Play
|
||||
}
|
||||
}
|
||||
|
||||
public BeatmapGroup(BeatmapSet beatmapSet)
|
||||
public BeatmapGroup(BeatmapSetInfo beatmapSet)
|
||||
{
|
||||
BeatmapSet = beatmapSet;
|
||||
Alpha = collapsedAlpha;
|
||||
@ -89,9 +89,9 @@ namespace osu.Game.GameModes.Play
|
||||
|
||||
class BeatmapSetBox : AutoSizeContainer
|
||||
{
|
||||
private BeatmapSet beatmapSet;
|
||||
private BeatmapSetInfo beatmapSet;
|
||||
|
||||
public BeatmapSetBox(BeatmapSet beatmapSet)
|
||||
public BeatmapSetBox(BeatmapSetInfo beatmapSet)
|
||||
{
|
||||
this.beatmapSet = beatmapSet;
|
||||
RelativeSizeAxes = Axes.X;
|
||||
|
@ -12,7 +12,6 @@ using osu.Game.GameModes.Backgrounds;
|
||||
using osu.Framework;
|
||||
using osu.Game.Database;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Graphics.Drawables;
|
||||
using System.Linq;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
@ -23,7 +22,7 @@ namespace osu.Game.GameModes.Play
|
||||
{
|
||||
private Bindable<PlayMode> playMode;
|
||||
private BeatmapDatabase beatmaps;
|
||||
private BeatmapSet selectedBeatmapSet;
|
||||
private BeatmapSetInfo selectedBeatmapSet;
|
||||
|
||||
// TODO: use currently selected track as bg
|
||||
protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4");
|
||||
@ -31,7 +30,7 @@ namespace osu.Game.GameModes.Play
|
||||
private ScrollContainer scrollContainer;
|
||||
private FlowContainer setList;
|
||||
|
||||
private void selectBeatmapSet(BeatmapSet beatmapSet)
|
||||
private void selectBeatmapSet(BeatmapSetInfo beatmapSet)
|
||||
{
|
||||
selectedBeatmapSet = beatmapSet;
|
||||
foreach (var child in setList.Children)
|
||||
@ -41,7 +40,7 @@ namespace osu.Game.GameModes.Play
|
||||
}
|
||||
}
|
||||
|
||||
private void addBeatmapSet(BeatmapSet beatmapSet)
|
||||
private void addBeatmapSet(BeatmapSetInfo beatmapSet)
|
||||
{
|
||||
var group = new BeatmapGroup(beatmapSet);
|
||||
group.SetSelected += (selectedSet) => selectBeatmapSet(selectedSet);
|
||||
@ -50,11 +49,7 @@ namespace osu.Game.GameModes.Play
|
||||
|
||||
private void addBeatmapSets()
|
||||
{
|
||||
var sets = beatmaps.GetBeatmapSets();
|
||||
|
||||
if (sets.Length == 0) return;
|
||||
|
||||
foreach (var beatmapSet in sets)
|
||||
foreach (var beatmapSet in beatmaps.Query<BeatmapSetInfo>())
|
||||
addBeatmapSet(beatmapSet);
|
||||
}
|
||||
|
||||
@ -64,13 +59,13 @@ namespace osu.Game.GameModes.Play
|
||||
const float backgroundSlant = 25;
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new BackgroundBox(backgroundSlant)
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Size = new Vector2(backgroundWidth, 0.5f),
|
||||
Colour = new Color4(0, 0, 0, 0.5f),
|
||||
},
|
||||
new BackgroundBox(-backgroundSlant)
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
RelativePositionAxes = Axes.Y,
|
||||
@ -133,27 +128,5 @@ namespace osu.Game.GameModes.Play
|
||||
private void PlayMode_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
class BackgroundBox : Box
|
||||
{
|
||||
private float wedgeWidth;
|
||||
|
||||
public BackgroundBox(float wedgeWidth)
|
||||
{
|
||||
this.wedgeWidth = wedgeWidth;
|
||||
}
|
||||
|
||||
protected override Quad DrawQuad
|
||||
{
|
||||
get
|
||||
{
|
||||
Quad q = base.DrawQuad;
|
||||
q.TopRight.X += wedgeWidth;
|
||||
q.BottomRight.X -= wedgeWidth;
|
||||
return q;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user