Update with framework bindable changes

This commit is contained in:
smoogipoo
2019-02-21 18:56:34 +09:00
parent d637b184e4
commit bca347427f
195 changed files with 567 additions and 555 deletions

View File

@ -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();
}