1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:07:23 +08:00

Small clean up

This commit is contained in:
Terochi 2023-02-22 07:48:43 +01:00
parent 82b07d19f8
commit e321536acc

View File

@ -626,17 +626,12 @@ namespace osu.Game
return;
}
//DeepCloning collection, because emptying SelectedMods resets all SettingSources Bindables to their default value
var previouslySelectedMods = SelectedMods.Value.Select(mod => mod.DeepClone()).ToArray();
if (!SelectedMods.Disabled)
SelectedMods.Value = Array.Empty<Mod>();
AvailableMods.Value = dict;
if (!SelectedMods.Disabled)
{
SelectedMods.Value = previouslySelectedMods.Select(oldMod =>
//converting mods from one ruleset to the other, while also keeping their shared settings unchanged
SelectedMods.Value = SelectedMods.Value.Select(oldMod =>
{
Mod newMod = instance.CreateModFromAcronym(oldMod.Acronym);