mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Make LinkFlowContainer handle beatmap id lookup in game.
This commit is contained in:
@ -17,6 +17,7 @@ using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Overlays.BeatmapSet;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Overlays.BeatmapSet.Scores;
|
||||
using System.Linq;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
@ -139,6 +140,23 @@ namespace osu.Game.Overlays
|
||||
return true;
|
||||
}
|
||||
|
||||
public void ShowBeatmap(int beatmapId)
|
||||
{
|
||||
var req = new GetBeatmapSetRequest(beatmapId, BeatmapSetLookupType.BeatmapId);
|
||||
req.Success += res =>
|
||||
{
|
||||
ShowBeatmapSet(res.ToBeatmapSet(rulesets));
|
||||
header.Picker.Beatmap.Value = header.BeatmapSet.Beatmaps.First(b => b.OnlineBeatmapID == beatmapId);
|
||||
};
|
||||
api.Queue(req);
|
||||
}
|
||||
|
||||
public void ShowBeatmap(BeatmapInfo beatmap)
|
||||
{
|
||||
ShowBeatmapSet(beatmap.BeatmapSet);
|
||||
header.Picker.Beatmap.Value = beatmap;
|
||||
}
|
||||
|
||||
public void ShowBeatmapSet(int beatmapSetId)
|
||||
{
|
||||
// todo: display the overlay while we are loading here. we need to support setting BeatmapSet to null for this to work.
|
||||
|
Reference in New Issue
Block a user