1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 08:52:55 +08:00

Merge pull request #27972 from bdach/fix-mod-column-stupidity-rfc

Fix mod select overlay columns not displaying properly sometimes
This commit is contained in:
Dean Herbert 2024-04-23 21:59:29 +08:00 committed by GitHub
commit a7327a2998
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -69,6 +69,7 @@ namespace osu.Game.Overlays.Mods
private Task? latestLoadTask;
private ModPanel[]? latestLoadedPanels;
internal bool ItemsLoaded => latestLoadTask?.IsCompleted == true && allPanelsLoaded;
private bool? wasPresent;
private bool allPanelsLoaded
{
@ -192,6 +193,15 @@ namespace osu.Game.Overlays.Mods
{
base.Update();
// we override `IsPresent` to include the scheduler's pending task state to make async loads work correctly when columns are masked away
// (see description of https://github.com/ppy/osu/pull/19783).
// however, because of that we must also ensure that we signal correct invalidations (https://github.com/ppy/osu-framework/issues/5129).
// failing to do so causes columns to be stuck in "present" mode despite actually not being present themselves.
// this works because `Update()` will always run after a scheduler update, which is what causes the presence state change responsible for the failure.
if (wasPresent != null && wasPresent != IsPresent)
Invalidate(Invalidation.Presence);
wasPresent = IsPresent;
if (selectionDelay == initial_multiple_selection_delay || Time.Current - lastSelection >= selectionDelay)
{
if (pendingSelectionOperations.TryDequeue(out var dequeuedAction))