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

Applied suggested changes

This commit is contained in:
EVAST9919 2019-05-28 19:39:31 +03:00
parent 857eb9b83a
commit 19fbab6892
5 changed files with 6 additions and 12 deletions

View File

@ -29,8 +29,6 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps
protected override void ShowMore() protected override void ShowMore()
{ {
base.ShowMore();
request = new GetUserBeatmapsRequest(User.Value.Id, type, VisiblePages++ * ItemsPerPage); request = new GetUserBeatmapsRequest(User.Value.Id, type, VisiblePages++ * ItemsPerPage);
request.Success += sets => Schedule(() => request.Success += sets => Schedule(() =>
{ {

View File

@ -24,8 +24,6 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
protected override void ShowMore() protected override void ShowMore()
{ {
base.ShowMore();
request = new GetUserMostPlayedBeatmapsRequest(User.Value.Id, VisiblePages++ * ItemsPerPage); request = new GetUserMostPlayedBeatmapsRequest(User.Value.Id, VisiblePages++ * ItemsPerPage);
request.Success += beatmaps => Schedule(() => request.Success += beatmaps => Schedule(() =>
{ {

View File

@ -20,7 +20,7 @@ using osu.Game.Users;
namespace osu.Game.Overlays.Profile.Sections namespace osu.Game.Overlays.Profile.Sections
{ {
public class PaginatedContainer : FillFlowContainer public abstract class PaginatedContainer : FillFlowContainer
{ {
protected readonly FillFlowContainer ItemsContainer; protected readonly FillFlowContainer ItemsContainer;
protected readonly ShowMoreButton MoreButton; protected readonly ShowMoreButton MoreButton;
@ -92,7 +92,7 @@ namespace osu.Game.Overlays.Profile.Sections
ShowMore(); ShowMore();
} }
protected virtual void ShowMore() => MoreButton.IsLoading = true; protected abstract void ShowMore();
protected class ShowMoreButton : CircularContainer protected class ShowMoreButton : CircularContainer
{ {
@ -109,8 +109,11 @@ namespace osu.Game.Overlays.Profile.Sections
public bool IsLoading public bool IsLoading
{ {
get => isLoading;
set set
{ {
if (isLoading == value)
return;
isLoading = value; isLoading = value;
if (value) if (value)
@ -124,7 +127,6 @@ namespace osu.Game.Overlays.Profile.Sections
content.FadeIn(duration, Easing.OutQuint); content.FadeIn(duration, Easing.OutQuint);
} }
} }
get => isLoading;
} }
public ShowMoreButton() public ShowMoreButton()
@ -141,7 +143,6 @@ namespace osu.Game.Overlays.Profile.Sections
}, },
content = new FillFlowContainer content = new FillFlowContainer
{ {
Alpha = 0,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
@ -190,6 +191,7 @@ namespace osu.Game.Overlays.Profile.Sections
protected override bool OnClick(ClickEvent e) protected override bool OnClick(ClickEvent e)
{ {
IsLoading = true;
Action.Invoke(); Action.Invoke();
return base.OnClick(e); return base.OnClick(e);
} }

View File

@ -31,8 +31,6 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
protected override void ShowMore() protected override void ShowMore()
{ {
base.ShowMore();
request = new GetUserScoresRequest(User.Value.Id, type, VisiblePages++ * ItemsPerPage); request = new GetUserScoresRequest(User.Value.Id, type, VisiblePages++ * ItemsPerPage);
request.Success += scores => Schedule(() => request.Success += scores => Schedule(() =>
{ {

View File

@ -22,8 +22,6 @@ namespace osu.Game.Overlays.Profile.Sections.Recent
protected override void ShowMore() protected override void ShowMore()
{ {
base.ShowMore();
request = new GetUserRecentActivitiesRequest(User.Value.Id, VisiblePages++ * ItemsPerPage); request = new GetUserRecentActivitiesRequest(User.Value.Id, VisiblePages++ * ItemsPerPage);
request.Success += activities => Schedule(() => request.Success += activities => Schedule(() =>
{ {