Replace schedule with SequenceEqual()

This commit is contained in:
Dan Balasescu 2024-04-01 17:02:02 +09:00
parent 6e746a0fa0
commit d12a2e7df7
No known key found for this signature in database
1 changed files with 9 additions and 4 deletions

View File

@ -6,6 +6,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@ -218,12 +219,16 @@ private void load(OsuColour colours, OsuConfigManager config)
maximumStars.ValueChanged += _ => updateCriteria();
ruleset.BindValueChanged(_ => updateCriteria());
mods.BindValueChanged(_ =>
mods.BindValueChanged(m =>
{
// Mods are updated once by the mod select overlay when song select is entered, regardless of if there are any mods.
// Mods are updated once by the mod select overlay when song select is entered,
// regardless of if there are any mods or any changes have taken place.
// Updating the criteria here so early triggers a re-ordering of panels on song select, via... some mechanism.
// Todo: Investigate/fix the above and remove this schedule.
Scheduler.AddOnce(updateCriteria);
// Todo: Investigate/fix and potentially remove this.
if (m.NewValue.SequenceEqual(m.OldValue))
return;
updateCriteria();
});
groupMode.BindValueChanged(_ => updateCriteria());