mirror of
https://github.com/osukey/osukey.git
synced 2025-08-01 21:58:46 +09:00
Move request inside the ScoresContainer again
This commit is contained in:
@ -11,7 +11,6 @@ using osu.Framework.Input.Events;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Overlays.BeatmapSet;
|
||||
using osu.Game.Overlays.BeatmapSet.Scores;
|
||||
@ -29,15 +28,8 @@ namespace osu.Game.Overlays
|
||||
|
||||
private RulesetStore rulesets;
|
||||
|
||||
private readonly ScoresContainer scoreContainer;
|
||||
|
||||
private GetScoresRequest getScoresRequest;
|
||||
|
||||
private readonly Bindable<BeatmapSetInfo> beatmapSet = new Bindable<BeatmapSetInfo>();
|
||||
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; }
|
||||
|
||||
// receive input outside our bounds so we can trigger a close event on ourselves.
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
|
||||
|
||||
@ -45,6 +37,8 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
OsuScrollContainer scroll;
|
||||
Info info;
|
||||
ScoresContainer scoreContainer;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
@ -77,34 +71,12 @@ namespace osu.Game.Overlays
|
||||
Header.Picker.Beatmap.ValueChanged += b =>
|
||||
{
|
||||
info.Beatmap = b.NewValue;
|
||||
getScores(b.NewValue);
|
||||
scoreContainer.Beatmap = b.NewValue;
|
||||
|
||||
scroll.ScrollToStart();
|
||||
};
|
||||
}
|
||||
|
||||
private void getScores(BeatmapInfo beatmap)
|
||||
{
|
||||
getScoresRequest?.Cancel();
|
||||
getScoresRequest = null;
|
||||
|
||||
if (beatmap?.OnlineBeatmapID.HasValue != true)
|
||||
{
|
||||
scoreContainer.Scores = null;
|
||||
return;
|
||||
}
|
||||
|
||||
scoreContainer.Loading = true;
|
||||
|
||||
getScoresRequest = new GetScoresRequest(beatmap, beatmap.Ruleset);
|
||||
getScoresRequest.Success += scores => Schedule(() =>
|
||||
{
|
||||
scoreContainer.Scores = scores;
|
||||
scoreContainer.Loading = false;
|
||||
});
|
||||
api.Queue(getScoresRequest);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(RulesetStore rulesets)
|
||||
{
|
||||
|
Reference in New Issue
Block a user