mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 21:53:21 +08:00
Fix several schedule-related issues arising from new column addition
This commit is contained in:
parent
5ff2e41a55
commit
f860bc11ee
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user