move scrollContent update logic to updateActiveState()

This commit is contained in:
cdwcgt 2023-05-03 23:24:14 +09:00
parent f4b1264cc9
commit debbd376bd
No known key found for this signature in database
GPG Key ID: 144396D01095C3A2

View File

@ -129,8 +129,6 @@ namespace osu.Game.Overlays.Mods
selectedMods.BindValueChanged(_ => updateActiveState(), true); selectedMods.BindValueChanged(_ => updateActiveState(), true);
scrollContent.ChildrenEnumerable = preset.Mods.Select(mod => new ModPresetRow(mod));
nameTextBox.Current.BindValueChanged(s => nameTextBox.Current.BindValueChanged(s =>
{ {
editButton.Enabled.Value = !string.IsNullOrWhiteSpace(s.NewValue); editButton.Enabled.Value = !string.IsNullOrWhiteSpace(s.NewValue);
@ -141,12 +139,12 @@ namespace osu.Game.Overlays.Mods
{ {
saveModAfterClosed = selectedMods.Value.ToList(); saveModAfterClosed = selectedMods.Value.ToList();
scrollContent.Clear(); scrollContent.Clear();
scrollContent.ChildrenEnumerable = saveModAfterClosed.Select(mod => new ModPresetRow(mod));
updateActiveState(); updateActiveState();
} }
private void updateActiveState() private void updateActiveState()
{ {
scrollContent.ChildrenEnumerable = preset.Mods.Select(mod => new ModPresetRow(mod));
useCurrentModButton.Enabled.Value = checkCanBeSave(); useCurrentModButton.Enabled.Value = checkCanBeSave();
} }