1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 00:47:24 +08:00

Merge branch 'master' into profile_beatmaps

This commit is contained in:
Dean Herbert 2017-11-14 20:27:17 +09:00 committed by GitHub
commit 4b9edc4645
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 17 deletions

View File

@ -29,6 +29,7 @@ namespace osu.Game.Overlays.Direct
public DirectGridPanel(BeatmapSetInfo beatmap) : base(beatmap)
{
Width = 400;
Height = 140 + vertical_padding; //full height of all the elements plus vertical padding (autosize uses the image)
}

View File

@ -222,7 +222,7 @@ namespace osu.Game.Overlays
switch (displayStyle)
{
case PanelDisplayStyle.Grid:
return new DirectGridPanel(b) { Width = 400 };
return new DirectGridPanel(b);
default:
return new DirectListPanel(b);
}

View File

@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps
private readonly BeatmapSetType type;
private DirectPanel playing;
private DirectPanel currentlyPlaying;
public PaginatedBeatmapContainer(BeatmapSetType type, Bindable<User> user, string header, string missing = "None... yet.")
: base(user, header, missing)
@ -51,24 +51,18 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps
if (!s.OnlineBeatmapSetID.HasValue)
continue;
var subReq = new GetBeatmapSetRequest(s.OnlineBeatmapSetID.Value);
subReq.Success += b =>
{
var panel = new DirectGridPanel(b.ToBeatmapSet(Rulesets)) { Width = 400 };
var panel = new DirectGridPanel(s.ToBeatmapSet(Rulesets));
ItemsContainer.Add(panel);
panel.PreviewPlaying.ValueChanged += newValue =>
panel.PreviewPlaying.ValueChanged += isPlaying =>
{
if (newValue)
{
if (playing != null && playing != panel)
playing.PreviewPlaying.Value = false;
playing = panel;
}
};
};
if (!isPlaying) return;
Api.Queue(subReq);
if (currentlyPlaying != null && currentlyPlaying != panel)
currentlyPlaying.PreviewPlaying.Value = false;
currentlyPlaying = panel;
};
}
};