mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 14:03:21 +08:00
Fix MatchSongSelect not handling beatmapset deletions
This commit is contained in:
parent
109abf4d28
commit
7c2ffb1826
@ -39,6 +39,7 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
private void load()
|
||||
{
|
||||
beatmaps.ItemAdded += beatmapAdded;
|
||||
beatmaps.ItemRemoved += beatmapRemoved;
|
||||
|
||||
Beatmap.BindValueChanged(b => updateBeatmap(b.NewValue), true);
|
||||
}
|
||||
@ -62,6 +63,15 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
Schedule(() => hasBeatmap = true);
|
||||
}
|
||||
|
||||
private void beatmapRemoved(BeatmapSetInfo model)
|
||||
{
|
||||
if (Beatmap.Value == null)
|
||||
return;
|
||||
|
||||
if (model.OnlineBeatmapSetID == Beatmap.Value.BeatmapSet.OnlineBeatmapSetID)
|
||||
Schedule(() => hasBeatmap = false);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
@ -3,8 +3,11 @@
|
||||
|
||||
using System;
|
||||
using Humanizer;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
using osu.Game.Screens.Multi;
|
||||
|
||||
@ -17,6 +20,12 @@ namespace osu.Game.Screens.Select
|
||||
public string ShortTitle => "song selection";
|
||||
public override string Title => ShortTitle.Humanize();
|
||||
|
||||
[Resolved(typeof(Room))]
|
||||
protected Bindable<PlaylistItem> CurrentItem { get; private set; }
|
||||
|
||||
[Resolved]
|
||||
private BeatmapManager beatmaps { get; set; }
|
||||
|
||||
public MatchSongSelect()
|
||||
{
|
||||
Padding = new MarginPadding { Horizontal = HORIZONTAL_OVERFLOW_PADDING };
|
||||
@ -43,10 +52,14 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
public override bool OnExiting(IScreen next)
|
||||
{
|
||||
if (base.OnExiting(next))
|
||||
return true;
|
||||
|
||||
Beatmap.Value = beatmaps.GetWorkingBeatmap(CurrentItem.Value?.Beatmap);
|
||||
Beatmap.Disabled = true;
|
||||
Ruleset.Disabled = true;
|
||||
|
||||
return base.OnExiting(next);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnEntering(IScreen last)
|
||||
|
Loading…
Reference in New Issue
Block a user