mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 17:37:23 +09:00
Fix empty selection via keyboard shortcuts crashing
This commit is contained in:
parent
001cd1194c
commit
2d9b0acabe
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework;
|
using osu.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -439,6 +440,9 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
protected void Copy()
|
protected void Copy()
|
||||||
{
|
{
|
||||||
|
if (editorBeatmap.SelectedHitObjects.Count == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
clipboard.Value = new ClipboardContent(editorBeatmap).Serialize();
|
clipboard.Value = new ClipboardContent(editorBeatmap).Serialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -448,6 +452,9 @@ namespace osu.Game.Screens.Edit
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var objects = clipboard.Value.Deserialize<ClipboardContent>().HitObjects;
|
var objects = clipboard.Value.Deserialize<ClipboardContent>().HitObjects;
|
||||||
|
|
||||||
|
Debug.Assert(objects.Any());
|
||||||
|
|
||||||
double timeOffset = clock.CurrentTime - objects.First().StartTime;
|
double timeOffset = clock.CurrentTime - objects.First().StartTime;
|
||||||
|
|
||||||
foreach (var h in objects)
|
foreach (var h in objects)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user