mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 14:53:01 +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 IModHotkeyHandler hotkeyHandler = null!;
|
||||||
|
|
||||||
private Task? latestLoadTask;
|
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)
|
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));
|
var panels = availableMods.Select(mod => CreateModPanel(mod).With(panel => panel.Shear = Vector2.Zero));
|
||||||
|
|
||||||
|
itemsLoaded = false;
|
||||||
latestLoadTask = LoadComponentsAsync(panels, loaded =>
|
latestLoadTask = LoadComponentsAsync(panels, loaded =>
|
||||||
{
|
{
|
||||||
ItemsFlow.ChildrenEnumerable = loaded;
|
ItemsFlow.ChildrenEnumerable = loaded;
|
||||||
updateState();
|
updateState();
|
||||||
|
itemsLoaded = true;
|
||||||
}, (cancellationTokenSource = new CancellationTokenSource()).Token);
|
}, (cancellationTokenSource = new CancellationTokenSource()).Token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -708,7 +708,18 @@ namespace osu.Game.Overlays.Mods
|
|||||||
FinishTransforms();
|
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()
|
private void updateState()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user