mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 01:47:30 +09: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()
|
private void load()
|
||||||
{
|
{
|
||||||
beatmaps.ItemAdded += beatmapAdded;
|
beatmaps.ItemAdded += beatmapAdded;
|
||||||
|
beatmaps.ItemRemoved += beatmapRemoved;
|
||||||
|
|
||||||
Beatmap.BindValueChanged(b => updateBeatmap(b.NewValue), true);
|
Beatmap.BindValueChanged(b => updateBeatmap(b.NewValue), true);
|
||||||
}
|
}
|
||||||
@ -62,6 +63,15 @@ namespace osu.Game.Screens.Multi.Match.Components
|
|||||||
Schedule(() => hasBeatmap = true);
|
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()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
@ -3,8 +3,11 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
using osu.Game.Screens.Multi;
|
using osu.Game.Screens.Multi;
|
||||||
|
|
||||||
@ -17,6 +20,12 @@ namespace osu.Game.Screens.Select
|
|||||||
public string ShortTitle => "song selection";
|
public string ShortTitle => "song selection";
|
||||||
public override string Title => ShortTitle.Humanize();
|
public override string Title => ShortTitle.Humanize();
|
||||||
|
|
||||||
|
[Resolved(typeof(Room))]
|
||||||
|
protected Bindable<PlaylistItem> CurrentItem { get; private set; }
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private BeatmapManager beatmaps { get; set; }
|
||||||
|
|
||||||
public MatchSongSelect()
|
public MatchSongSelect()
|
||||||
{
|
{
|
||||||
Padding = new MarginPadding { Horizontal = HORIZONTAL_OVERFLOW_PADDING };
|
Padding = new MarginPadding { Horizontal = HORIZONTAL_OVERFLOW_PADDING };
|
||||||
@ -43,10 +52,14 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
public override bool OnExiting(IScreen next)
|
public override bool OnExiting(IScreen next)
|
||||||
{
|
{
|
||||||
|
if (base.OnExiting(next))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
Beatmap.Value = beatmaps.GetWorkingBeatmap(CurrentItem.Value?.Beatmap);
|
||||||
Beatmap.Disabled = true;
|
Beatmap.Disabled = true;
|
||||||
Ruleset.Disabled = true;
|
Ruleset.Disabled = true;
|
||||||
|
|
||||||
return base.OnExiting(next);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnEntering(IScreen last)
|
public override void OnEntering(IScreen last)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user