Merge branch 'master' into warning-fixes

This commit is contained in:
Dean Herbert 2017-11-14 20:43:23 +09:00 committed by GitHub
commit fa4ae72a06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 22 deletions

View File

@ -26,6 +26,8 @@ namespace osu.Game.Online.API.Requests
{ {
MostPlayed, MostPlayed,
Favourite, Favourite,
RankedAndApproved RankedAndApproved,
Unranked,
Graveyard
} }
} }

View File

@ -29,6 +29,7 @@ namespace osu.Game.Overlays.Direct
public DirectGridPanel(BeatmapSetInfo beatmap) : base(beatmap) 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) 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) switch (displayStyle)
{ {
case PanelDisplayStyle.Grid: case PanelDisplayStyle.Grid:
return new DirectGridPanel(b) { Width = 400 }; return new DirectGridPanel(b);
default: default:
return new DirectListPanel(b); return new DirectListPanel(b);
} }

View File

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

View File

@ -16,8 +16,10 @@ namespace osu.Game.Overlays.Profile.Sections
{ {
Children = new[] Children = new[]
{ {
new PaginatedBeatmapContainer(BeatmapSetType.Favourite, User, "Favourite Beatmaps", "None... yet."), new PaginatedBeatmapContainer(BeatmapSetType.Favourite, User, "Favourite Beatmaps"),
new PaginatedBeatmapContainer(BeatmapSetType.RankedAndApproved, User, "Ranked & Approved Beatmaps", "None... yet."), new PaginatedBeatmapContainer(BeatmapSetType.RankedAndApproved, User, "Ranked & Approved Beatmaps"),
new PaginatedBeatmapContainer(BeatmapSetType.Unranked, User, "Pending Beatmaps"),
new PaginatedBeatmapContainer(BeatmapSetType.Graveyard, User, "Graveyarded Beatmaps"),
}; };
} }
} }

View File

@ -51,6 +51,7 @@ namespace osu.Game.Overlays.Profile.Sections
{ {
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Margin = new MarginPadding { Bottom = 10 }
}, },
ShowMoreButton = new OsuHoverContainer ShowMoreButton = new OsuHoverContainer
{ {