1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-07 20:44:47 +08:00

Fix several schedule-related issues arising from new column addition

This commit is contained in:
Bartłomiej Dach
2022-08-15 20:34:09 +02:00
Unverified
parent 5ff2e41a55
commit f860bc11ee
2 changed files with 18 additions and 2 deletions
+6 -1
View File
@@ -66,7 +66,10 @@ namespace osu.Game.Overlays.Mods
private IModHotkeyHandler hotkeyHandler = null!;
private Task? latestLoadTask;
internal bool ItemsLoaded => latestLoadTask?.IsCompleted == true;
private bool itemsLoaded;
internal bool ItemsLoaded => latestLoadTask?.IsCompleted == true && itemsLoaded;
public override bool IsPresent => base.IsPresent || Scheduler.HasPendingTasks;
public ModColumn(ModType modType, bool allowIncompatibleSelection)
{
@@ -132,10 +135,12 @@ namespace osu.Game.Overlays.Mods
var panels = availableMods.Select(mod => CreateModPanel(mod).With(panel => panel.Shear = Vector2.Zero));
itemsLoaded = false;
latestLoadTask = LoadComponentsAsync(panels, loaded =>
{
ItemsFlow.ChildrenEnumerable = loaded;
updateState();
itemsLoaded = true;
}, (cancellationTokenSource = new CancellationTokenSource()).Token);
}
+12 -1
View File
@@ -708,7 +708,18 @@ namespace osu.Game.Overlays.Mods
FinishTransforms();
}
protected override bool RequiresChildrenUpdate => base.RequiresChildrenUpdate || (Column as ModColumn)?.SelectionAnimationRunning == true;
protected override bool RequiresChildrenUpdate
{
get
{
bool result = base.RequiresChildrenUpdate;
if (Column is ModColumn modColumn)
result |= !modColumn.ItemsLoaded || modColumn.SelectionAnimationRunning;
return result;
}
}
private void updateState()
{