Merge branch 'master' into osu-fontusage

This commit is contained in:
Dean Herbert
2019-02-22 18:09:23 +09:00
committed by GitHub
286 changed files with 837 additions and 876 deletions

View File

@ -4,7 +4,6 @@
using osuTK;
using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -17,6 +16,7 @@ using System.Collections.Generic;
using System.Linq;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.Containers;
using osu.Game.Rulesets;
@ -74,28 +74,28 @@ namespace osu.Game.Overlays.Mods
SelectedMods.UnbindAll();
}
private void rulesetChanged(RulesetInfo newRuleset)
private void rulesetChanged(ValueChangedEvent<RulesetInfo> e)
{
if (newRuleset == null) return;
if (e.NewValue == null) return;
var instance = newRuleset.CreateInstance();
var instance = e.NewValue.CreateInstance();
foreach (ModSection section in ModSectionsContainer.Children)
section.Mods = instance.GetModsFor(section.ModType);
// attempt to re-select any already selected mods.
// this may be the first time we are receiving the ruleset, in which case they will still match.
selectedModsChanged(SelectedMods.Value);
selectedModsChanged(new ValueChangedEvent<IEnumerable<Mod>>(SelectedMods.Value, SelectedMods.Value));
// write the mods back to the SelectedMods bindable in the case a change was not applicable.
// this generally isn't required as the previous line will perform deselection; just here for safety.
refreshSelectedMods();
}
private void selectedModsChanged(IEnumerable<Mod> obj)
private void selectedModsChanged(ValueChangedEvent<IEnumerable<Mod>> e)
{
foreach (ModSection section in ModSectionsContainer.Children)
section.SelectTypes(obj.Select(m => m.GetType()).ToList());
section.SelectTypes(e.NewValue.Select(m => m.GetType()).ToList());
updateMods();
}