mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Add the ability to click completed download notifications to select beatmap
Closes #2731.
This commit is contained in:
@ -23,6 +23,7 @@ using osu.Framework.Input;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
@ -33,6 +34,7 @@ using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Skinning;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Game.Overlays.Volume;
|
||||
using osu.Game.Screens.Select;
|
||||
|
||||
namespace osu.Game
|
||||
{
|
||||
@ -178,6 +180,30 @@ namespace osu.Game
|
||||
/// <param name="setId">The set to display.</param>
|
||||
public void ShowBeatmapSet(int setId) => beatmapSetOverlay.FetchAndShowBeatmapSet(setId);
|
||||
|
||||
/// <summary>
|
||||
/// Present a beatmap at song select.
|
||||
/// </summary>
|
||||
/// <param name="beatmap">The beatmap to select.</param>
|
||||
public void PresentBeatmap(BeatmapSetInfo beatmap)
|
||||
{
|
||||
CloseAllOverlays();
|
||||
|
||||
Beatmap.Value = BeatmapManager.GetWorkingBeatmap(beatmap.Beatmaps.First());
|
||||
|
||||
switch (currentScreen)
|
||||
{
|
||||
case SongSelect _:
|
||||
break;
|
||||
default:
|
||||
// navigate to song select if we are not already there.
|
||||
var menu = (MainMenu)intro.ChildScreen;
|
||||
|
||||
menu.MakeCurrent();
|
||||
menu.LoadToSolo();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show a user's profile as an overlay.
|
||||
/// </summary>
|
||||
@ -244,6 +270,7 @@ namespace osu.Game
|
||||
BeatmapManager.PostNotification = n => notifications?.Post(n);
|
||||
|
||||
BeatmapManager.GetStableStorage = GetStorageForStableInstall;
|
||||
BeatmapManager.PresentBeatmap = PresentBeatmap;
|
||||
|
||||
AddRange(new Drawable[]
|
||||
{
|
||||
|
Reference in New Issue
Block a user