mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Create drawable and add response to profile.
- Add missing JSON fields to response model - Add missing enum value
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Overlays.Profile.Sections.Recent;
|
||||
using osu.Game.Users;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -17,47 +19,32 @@ namespace osu.Game.Overlays.Profile.Sections
|
||||
ItemsPerPage = 5;
|
||||
}
|
||||
|
||||
//protected override void ShowMore()
|
||||
//{
|
||||
// base.ShowMore();
|
||||
protected override void ShowMore()
|
||||
{
|
||||
base.ShowMore();
|
||||
|
||||
// var req = new GetUserRecentActivitiesRequest(User.Value.Id, VisiblePages++ * ItemsPerPage);
|
||||
var req = new GetUserRecentActivitiesRequest(User.Value.Id, VisiblePages++ * ItemsPerPage);
|
||||
|
||||
// req.Success += scores =>
|
||||
// {
|
||||
// foreach (var s in scores)
|
||||
// s.ApplyRuleset(Rulesets.GetRuleset(s.OnlineRulesetID));
|
||||
req.Success += activities =>
|
||||
{
|
||||
ShowMoreButton.FadeTo(activities.Count == ItemsPerPage ? 1 : 0);
|
||||
ShowMoreLoading.Hide();
|
||||
|
||||
// ShowMoreButton.FadeTo(scores.Count == ItemsPerPage ? 1 : 0);
|
||||
// ShowMoreLoading.Hide();
|
||||
if (!activities.Any() && VisiblePages == 1)
|
||||
{
|
||||
MissingText.Show();
|
||||
return;
|
||||
}
|
||||
|
||||
// if (!scores.Any() && VisiblePages == 1)
|
||||
// {
|
||||
// MissingText.Show();
|
||||
// return;
|
||||
// }
|
||||
MissingText.Hide();
|
||||
|
||||
// MissingText.Hide();
|
||||
foreach (RecentActivity activity in activities)
|
||||
{
|
||||
ItemsContainer.Add(new DrawableRecentActivity(activity, User));
|
||||
}
|
||||
};
|
||||
|
||||
// foreach (OnlineScore score in scores)
|
||||
// {
|
||||
// DrawableProfileScore drawableScore;
|
||||
|
||||
// switch (type)
|
||||
// {
|
||||
// default:
|
||||
// drawableScore = new DrawablePerformanceScore(score, includeWeight ? Math.Pow(0.95, ItemsContainer.Count) : (double?)null);
|
||||
// break;
|
||||
// case ScoreType.Recent:
|
||||
// drawableScore = new DrawableTotalScore(score);
|
||||
// break;
|
||||
// }
|
||||
|
||||
// ItemsContainer.Add(drawableScore);
|
||||
// }
|
||||
// };
|
||||
|
||||
// Api.Queue(req);
|
||||
//}
|
||||
Api.Queue(req);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user