mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 08:22:56 +08:00
Merge pull request #7667 from peppy/editor-match-accessibility
Fix editor being accessible for multiplayer song select
This commit is contained in:
commit
fb51ffc169
@ -24,6 +24,8 @@ namespace osu.Game.Screens.Select
|
||||
[Resolved(typeof(Room))]
|
||||
protected Bindable<PlaylistItem> CurrentItem { get; private set; }
|
||||
|
||||
public override bool AllowEditing => false;
|
||||
|
||||
[Resolved]
|
||||
private BeatmapManager beatmaps { get; set; }
|
||||
|
||||
|
@ -35,6 +35,7 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
using osu.Game.Scoring;
|
||||
|
||||
namespace osu.Game.Screens.Select
|
||||
@ -66,6 +67,14 @@ namespace osu.Game.Screens.Select
|
||||
/// </summary>
|
||||
protected Container FooterPanels { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether entering editor mode should be allowed.
|
||||
/// </summary>
|
||||
public virtual bool AllowEditing => true;
|
||||
|
||||
[Resolved(canBeNull: true)]
|
||||
private NotificationOverlay notificationOverlay { get; set; }
|
||||
|
||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap.Value);
|
||||
|
||||
protected BeatmapCarousel Carousel { get; private set; }
|
||||
@ -295,6 +304,12 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
public void Edit(BeatmapInfo beatmap = null)
|
||||
{
|
||||
if (!AllowEditing)
|
||||
{
|
||||
notificationOverlay?.Post(new SimpleNotification { Text = "Editing is not available from the current mode." });
|
||||
return;
|
||||
}
|
||||
|
||||
Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmap ?? beatmapNoDebounce);
|
||||
this.Push(new Editor());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user