mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 15:03:13 +08:00
Refactor to remove resolved dependency
This commit is contained in:
parent
956c1cc216
commit
de0de451fe
@ -52,7 +52,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
||||
Action = () =>
|
||||
{
|
||||
if (matchSubScreen.IsCurrentScreen())
|
||||
matchSubScreen.Push(new MultiplayerMatchSongSelect());
|
||||
matchSubScreen.Push(new MultiplayerMatchSongSelect(matchSubScreen.Room));
|
||||
},
|
||||
Alpha = 0
|
||||
}
|
||||
|
@ -24,9 +24,11 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
/// <summary>
|
||||
/// Construct a new instance of multiplayer song select.
|
||||
/// </summary>
|
||||
/// <param name="room">The room.</param>
|
||||
/// <param name="beatmap">An optional initial beatmap selection to perform.</param>
|
||||
/// <param name="ruleset">An optional initial ruleset selection to perform.</param>
|
||||
public MultiplayerMatchSongSelect(WorkingBeatmap beatmap = null, RulesetInfo ruleset = null)
|
||||
public MultiplayerMatchSongSelect(Room room, WorkingBeatmap beatmap = null, RulesetInfo ruleset = null)
|
||||
: base(room)
|
||||
{
|
||||
if (beatmap != null || ruleset != null)
|
||||
{
|
||||
|
@ -412,7 +412,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
return;
|
||||
}
|
||||
|
||||
this.Push(new MultiplayerMatchSongSelect(beatmap, ruleset));
|
||||
this.Push(new MultiplayerMatchSongSelect(Room, beatmap, ruleset));
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
|
@ -33,9 +33,6 @@ namespace osu.Game.Screens.OnlinePlay
|
||||
[Resolved(typeof(Room), nameof(Room.Playlist))]
|
||||
protected BindableList<PlaylistItem> Playlist { get; private set; }
|
||||
|
||||
[Resolved]
|
||||
private Room room { get; set; }
|
||||
|
||||
protected override UserActivity InitialActivity => new UserActivity.InLobby(room);
|
||||
|
||||
protected readonly Bindable<IReadOnlyList<Mod>> FreeMods = new Bindable<IReadOnlyList<Mod>>(Array.Empty<Mod>());
|
||||
@ -45,14 +42,17 @@ namespace osu.Game.Screens.OnlinePlay
|
||||
private IBindable<PlaylistItem> selectedItem { get; set; }
|
||||
|
||||
private readonly FreeModSelectOverlay freeModSelectOverlay;
|
||||
private readonly Room room;
|
||||
|
||||
private WorkingBeatmap initialBeatmap;
|
||||
private RulesetInfo initialRuleset;
|
||||
private IReadOnlyList<Mod> initialMods;
|
||||
private bool itemSelected;
|
||||
|
||||
protected OnlinePlaySongSelect()
|
||||
protected OnlinePlaySongSelect(Room room)
|
||||
{
|
||||
this.room = room;
|
||||
|
||||
Padding = new MarginPadding { Horizontal = HORIZONTAL_OVERFLOW_PADDING };
|
||||
|
||||
freeModSelectOverlay = new FreeModSelectOverlay
|
||||
|
@ -189,7 +189,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
||||
EditPlaylist = () =>
|
||||
{
|
||||
if (this.IsCurrentScreen())
|
||||
this.Push(new PlaylistsSongSelect());
|
||||
this.Push(new PlaylistsSongSelect(Room));
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -16,6 +16,11 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
||||
[Resolved]
|
||||
private BeatmapManager beatmaps { get; set; }
|
||||
|
||||
public PlaylistsSongSelect(Room room)
|
||||
: base(room)
|
||||
{
|
||||
}
|
||||
|
||||
protected override BeatmapDetailArea CreateBeatmapDetailArea() => new MatchBeatmapDetailArea
|
||||
{
|
||||
CreateNewItem = createNewItem
|
||||
|
Loading…
Reference in New Issue
Block a user