mirror of
https://github.com/ppy/osu
synced 2025-01-10 08:09:40 +00:00
Fix being able to paste objects while composer is loading
Would lead to exceptions due to modification of `Beatmap.HitObjects` during its enumeration by `DrawableRuleset`, which was happening as an async load via `EditorScreenWithTimeline.CreateMainContent()`.
This commit is contained in:
parent
74db8da11b
commit
10dd64e07c
@ -83,7 +83,9 @@ namespace osu.Game.Screens.Edit.Compose
|
||||
{
|
||||
base.LoadComplete();
|
||||
EditorBeatmap.SelectedHitObjects.BindCollectionChanged((_, __) => updateClipboardActionAvailability());
|
||||
clipboard.BindValueChanged(_ => updateClipboardActionAvailability(), true);
|
||||
clipboard.BindValueChanged(_ => updateClipboardActionAvailability());
|
||||
composer.OnLoadComplete += _ => updateClipboardActionAvailability();
|
||||
updateClipboardActionAvailability();
|
||||
}
|
||||
|
||||
#region Clipboard operations
|
||||
@ -131,7 +133,7 @@ namespace osu.Game.Screens.Edit.Compose
|
||||
private void updateClipboardActionAvailability()
|
||||
{
|
||||
CanCut.Value = CanCopy.Value = EditorBeatmap.SelectedHitObjects.Any();
|
||||
CanPaste.Value = !string.IsNullOrEmpty(clipboard.Value);
|
||||
CanPaste.Value = composer.IsLoaded && !string.IsNullOrEmpty(clipboard.Value);
|
||||
}
|
||||
|
||||
private string formatSelectionAsString()
|
||||
|
Loading…
Reference in New Issue
Block a user