mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 13:37:25 +08:00
Add minimal viable implementation of BeatmapSetOver in game
This commit is contained in:
parent
5be11f539b
commit
c2bb3ea7bc
@ -47,6 +47,8 @@ namespace osu.Game
|
||||
|
||||
private UserProfileOverlay userProfile;
|
||||
|
||||
private BeatmapSetOverlay beatmapSetOverlay;
|
||||
|
||||
public virtual Storage GetStorageForStableInstall() => null;
|
||||
|
||||
private Intro intro
|
||||
@ -187,6 +189,7 @@ namespace osu.Game
|
||||
Depth = -1
|
||||
}, overlayContent.Add);
|
||||
LoadComponentAsync(userProfile = new UserProfileOverlay { Depth = -2 }, mainContent.Add);
|
||||
LoadComponentAsync(beatmapSetOverlay = new BeatmapSetOverlay { Depth = -2 }, mainContent.Add);
|
||||
LoadComponentAsync(musicController = new MusicController
|
||||
{
|
||||
Depth = -3,
|
||||
@ -223,6 +226,7 @@ namespace osu.Game
|
||||
dependencies.Cache(chat);
|
||||
dependencies.Cache(userProfile);
|
||||
dependencies.Cache(musicController);
|
||||
dependencies.Cache(beatmapSetOverlay);
|
||||
dependencies.Cache(notificationOverlay);
|
||||
dependencies.Cache(dialogOverlay);
|
||||
|
||||
|
@ -86,7 +86,6 @@ namespace osu.Game.Overlays
|
||||
public void ShowBeatmapSet(BeatmapSetInfo set)
|
||||
{
|
||||
header.BeatmapSet = info.BeatmapSet = set;
|
||||
|
||||
Show();
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Framework.Input;
|
||||
|
||||
namespace osu.Game.Overlays.Direct
|
||||
{
|
||||
@ -172,11 +171,5 @@ namespace osu.Game.Overlays.Direct
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
protected override bool OnClick(InputState state)
|
||||
{
|
||||
StartDownload();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ namespace osu.Game.Overlays.Direct
|
||||
private ProgressBar progressBar;
|
||||
private BeatmapManager beatmaps;
|
||||
private NotificationOverlay notifications;
|
||||
private BeatmapSetOverlay beatmapSetOverlay;
|
||||
|
||||
protected override Container<Drawable> Content => content;
|
||||
|
||||
@ -63,11 +64,12 @@ namespace osu.Game.Overlays.Direct
|
||||
|
||||
|
||||
[BackgroundDependencyLoader(permitNulls: true)]
|
||||
private void load(APIAccess api, BeatmapManager beatmaps, OsuColour colours, NotificationOverlay notifications)
|
||||
private void load(APIAccess api, BeatmapManager beatmaps, OsuColour colours, NotificationOverlay notifications, BeatmapSetOverlay beatmapSetOverlay)
|
||||
{
|
||||
this.api = api;
|
||||
this.beatmaps = beatmaps;
|
||||
this.notifications = notifications;
|
||||
this.beatmapSetOverlay = beatmapSetOverlay;
|
||||
|
||||
AddInternal(content = new Container
|
||||
{
|
||||
@ -118,6 +120,14 @@ namespace osu.Game.Overlays.Direct
|
||||
base.OnHoverLost(state);
|
||||
}
|
||||
|
||||
protected override bool OnClick(InputState state)
|
||||
{
|
||||
ShowInformation();
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void ShowInformation() => beatmapSetOverlay?.ShowBeatmapSet(SetInfo);
|
||||
|
||||
protected void StartDownload()
|
||||
{
|
||||
if (!api.LocalUser.Value.IsSupporter)
|
||||
|
Loading…
Reference in New Issue
Block a user