1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 17:47:29 +08:00

Use new user mod select design in multiplayer lobby

This commit is contained in:
Bartłomiej Dach 2022-05-04 22:30:20 +02:00
parent 4eefbd5bc2
commit 66473972da
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using JetBrains.Annotations;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio; using osu.Framework.Audio;
using osu.Framework.Audio.Sample; using osu.Framework.Audio.Sample;
@ -57,6 +58,9 @@ namespace osu.Game.Screens.OnlinePlay.Match
protected readonly IBindable<long?> RoomId = new Bindable<long?>(); protected readonly IBindable<long?> RoomId = new Bindable<long?>();
[Resolved]
private OsuGame game { get; set; }
[Resolved] [Resolved]
private MusicController music { get; set; } private MusicController music { get; set; }
@ -77,7 +81,11 @@ namespace osu.Game.Screens.OnlinePlay.Match
public readonly Room Room; public readonly Room Room;
private readonly bool allowEdit; private readonly bool allowEdit;
private ModSelectOverlay userModsSelectOverlay; private ModSelectScreen userModsSelectOverlay;
[CanBeNull]
private IDisposable userModsSelectOverlayRegistration;
private RoomSettingsOverlay settingsOverlay; private RoomSettingsOverlay settingsOverlay;
private Drawable mainContent; private Drawable mainContent;
@ -180,11 +188,6 @@ namespace osu.Game.Screens.OnlinePlay.Match
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Child = userModsSelectOverlay = new UserModSelectOverlay
{
SelectedMods = { BindTarget = UserMods },
IsValidMod = _ => false
}
}, },
} }
} }
@ -227,6 +230,12 @@ namespace osu.Game.Screens.OnlinePlay.Match
} }
} }
}; };
LoadComponent(userModsSelectOverlay = new UserModSelectScreen(OverlayColourScheme.Plum)
{
SelectedMods = { BindTarget = UserMods },
IsValidMod = _ => false
});
} }
protected override void LoadComplete() protected override void LoadComplete()
@ -254,6 +263,8 @@ namespace osu.Game.Screens.OnlinePlay.Match
beatmapAvailabilityTracker.SelectedItem.BindTo(SelectedItem); beatmapAvailabilityTracker.SelectedItem.BindTo(SelectedItem);
beatmapAvailabilityTracker.Availability.BindValueChanged(_ => updateWorkingBeatmap()); beatmapAvailabilityTracker.Availability.BindValueChanged(_ => updateWorkingBeatmap());
userModsSelectOverlayRegistration = game?.RegisterBlockingOverlay(userModsSelectOverlay);
} }
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
@ -459,5 +470,12 @@ namespace osu.Game.Screens.OnlinePlay.Match
public class UserModSelectButton : PurpleTriangleButton public class UserModSelectButton : PurpleTriangleButton
{ {
} }
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
userModsSelectOverlayRegistration?.Dispose();
}
} }
} }