Fix additional bugs, tweak L+F

This commit is contained in:
Drew DeVault 2016-10-19 14:02:03 -04:00
parent 8d4a211419
commit 6da092ab30
4 changed files with 45 additions and 23 deletions

View File

@ -56,13 +56,13 @@ namespace osu.Game.Database
var beatmapSet = new BeatmapSetInfo var beatmapSet = new BeatmapSetInfo
{ {
BeatmapSetID = metadata.BeatmapSetID, BeatmapSetID = metadata.BeatmapSetID,
Beatmaps = new List<BeatmapInfo>(),
Path = path, Path = path,
Hash = hash, Hash = hash,
}; };
connection.Insert(metadata);
beatmapSet.Metadata = metadata; beatmapSet.Metadata = metadata;
connection.Insert(beatmapSet); connection.Insert(beatmapSet);
connection.Insert(metadata);
var maps = new List<BeatmapInfo>();
using (var reader = ArchiveReader.GetReader(storage, path)) using (var reader = ArchiveReader.GetReader(storage, path))
{ {
string[] mapNames = reader.ReadBeatmaps(); string[] mapNames = reader.ReadBeatmaps();
@ -73,9 +73,10 @@ namespace osu.Game.Database
var decoder = BeatmapDecoder.GetDecoder(stream); var decoder = BeatmapDecoder.GetDecoder(stream);
Beatmap beatmap = decoder.Decode(stream); Beatmap beatmap = decoder.Decode(stream);
beatmap.BeatmapInfo.Path = name; beatmap.BeatmapInfo.Path = name;
beatmap.BeatmapInfo.BeatmapSetID = beatmapSet.BeatmapSetID;
// TODO: Diff beatmap metadata with set metadata and leave it here if necessary // TODO: Diff beatmap metadata with set metadata and leave it here if necessary
beatmap.BeatmapInfo.Metadata = null; beatmap.BeatmapInfo.Metadata = null;
maps.Add(beatmap.BeatmapInfo); beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo);
connection.Insert(beatmap.BeatmapInfo); connection.Insert(beatmap.BeatmapInfo);
} }
} }

View File

@ -11,7 +11,7 @@ namespace osu.Game.Database
{ {
[PrimaryKey] [PrimaryKey]
public int BeatmapID { get; set; } public int BeatmapID { get; set; }
[ForeignKey(typeof(BeatmapSetInfo)), NotNull] [ForeignKey(typeof(BeatmapSetInfo))]
public int BeatmapSetID { get; set; } public int BeatmapSetID { get; set; }
[ManyToOne] [ManyToOne]
public BeatmapSetInfo BeatmapSet { get; set; } public BeatmapSetInfo BeatmapSet { get; set; }

View File

@ -24,6 +24,7 @@ namespace osu.Game.GameModes.Play
public event Action<BeatmapSetInfo> SetSelected; public event Action<BeatmapSetInfo> SetSelected;
public event Action<BeatmapSetInfo, BeatmapInfo> BeatmapSelected; public event Action<BeatmapSetInfo, BeatmapInfo> BeatmapSelected;
public BeatmapSetInfo BeatmapSet; public BeatmapSetInfo BeatmapSet;
private BeatmapSetBox setBox;
private FlowContainer topContainer; private FlowContainer topContainer;
private FlowContainer difficulties; private FlowContainer difficulties;
private bool collapsed; private bool collapsed;
@ -48,6 +49,11 @@ namespace osu.Game.GameModes.Play
topContainer.Remove(difficulties); topContainer.Remove(difficulties);
else else
topContainer.Add(difficulties); topContainer.Add(difficulties);
setBox.BorderColour = new Color4(
setBox.BorderColour.R,
setBox.BorderColour.G,
setBox.BorderColour.B,
collapsed ? 0 : 255);
} }
} }
@ -64,7 +70,7 @@ namespace osu.Game.GameModes.Play
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Size = new Vector2(1, 0), Size = new Vector2(1, 0),
Direction = FlowDirection.VerticalOnly, Direction = FlowDirection.VerticalOnly,
Children = new[] { new BeatmapSetBox(beatmapSet) } Children = new[] { setBox = new BeatmapSetBox(beatmapSet) }
} }
}; };
difficulties = new FlowContainer // Deliberately not added to children difficulties = new FlowContainer // Deliberately not added to children
@ -96,6 +102,10 @@ namespace osu.Game.GameModes.Play
this.beatmapSet = beatmapSet; this.beatmapSet = beatmapSet;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Size = new Vector2(1, 0); Size = new Vector2(1, 0);
Masking = true;
CornerRadius = 5;
BorderThickness = 2;
BorderColour = new Color4(221, 255, 255, 0);
Children = new Drawable[] Children = new Drawable[]
{ {
new Box new Box

View File

@ -56,30 +56,41 @@ namespace osu.Game.GameModes.Play
public PlaySongSelect() public PlaySongSelect()
{ {
const float backgroundWidth = 0.6f; const float scrollWidth = 500;
const float backgroundSlant = 25;
Children = new Drawable[] Children = new Drawable[]
{ {
new Box new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Size = new Vector2(backgroundWidth, 0.5f), Size = new Vector2(1),
Colour = new Color4(0, 0, 0, 0.5f), Padding = new MarginPadding { Right = scrollWidth - 100 },
}, Children = new[]
new Box {
{ new Box
RelativeSizeAxes = Axes.Both, {
RelativePositionAxes = Axes.Y, RelativeSizeAxes = Axes.Both,
Size = new Vector2(backgroundWidth, 0.5f), Size = new Vector2(1, 0.5f),
Position = new Vector2(0, 0.5f), Colour = new Color4(0, 0, 0, 0.5f),
Colour = new Color4(0, 0, 0, 0.5f), Shear = new Vector2(0.15f, 0),
},
new Box
{
RelativeSizeAxes = Axes.Both,
RelativePositionAxes = Axes.Both,
Size = new Vector2(1, 0.5f),
Position = new Vector2(0, 0.5f),
Colour = new Color4(0, 0, 0, 0.5f),
// TODO: Figure out the inverse shear problem
//Shear = new Vector2(-0.15f, 0),
},
}
}, },
scrollContainer = new ScrollContainer scrollContainer = new ScrollContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Y,
RelativePositionAxes = Axes.Both, Size = new Vector2(scrollWidth, 1),
Size = new Vector2(0.5f, 1), Anchor = Anchor.CentreRight,
Position = new Vector2(0.5f, 0), Origin = Anchor.CentreRight,
Children = new Drawable[] Children = new Drawable[]
{ {
setList = new FlowContainer setList = new FlowContainer