1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 06:07:25 +08:00

Move Mods reset code to OnlinePlaySongSelect

This commit is contained in:
smoogipoo 2021-02-02 18:56:57 +09:00
parent 8cc4de2396
commit a2e3b1c0e4
2 changed files with 10 additions and 10 deletions

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Logging;
using osu.Framework.Screens;
@ -27,13 +25,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
AddInternal(loadingLayer = new LoadingLayer(true));
}
protected override void LoadComplete()
{
base.LoadComplete();
Mods.Value = Playlist.FirstOrDefault()?.RequiredMods.Select(m => m.CreateCopy()).ToArray() ?? Array.Empty<Mod>();
}
protected override void SelectItem(PlaylistItem item)
{
// If the client is already in a room, update via the client.

View File

@ -58,8 +58,17 @@ namespace osu.Game.Screens.OnlinePlay
initialRuleset = Ruleset.Value;
initialMods = Mods.Value.ToList();
freeMods.Value = Playlist.FirstOrDefault()?.AllowedMods.Select(m => m.CreateCopy()).ToArray() ?? Array.Empty<Mod>();
FooterPanels.Add(freeModSelectOverlay);
}
protected override void LoadComplete()
{
base.LoadComplete();
// At this point, Mods contains both the required and allowed mods. For selection purposes, it should only contain the required mods.
// Similarly, freeMods is currently empty but should only contain the allowed mods.
Mods.Value = Playlist.FirstOrDefault()?.RequiredMods.Select(m => m.CreateCopy()).ToArray() ?? Array.Empty<Mod>();
freeMods.Value = Playlist.FirstOrDefault()?.AllowedMods.Select(m => m.CreateCopy()).ToArray() ?? Array.Empty<Mod>();
Ruleset.BindValueChanged(onRulesetChanged);
}