mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 23:42:55 +08:00
Fail on drag drop operations with mixed files.
This commit is contained in:
parent
76ef8c1a6c
commit
ff51af94ec
@ -78,10 +78,10 @@ namespace osu.Desktop
|
||||
if (isFile)
|
||||
{
|
||||
var paths = ((object[])e.Data.GetData(DataFormats.FileDrop)).Select(f => f.ToString()).ToArray();
|
||||
if (paths.Any(p => !allowed_extensions.Any(ext => p.EndsWith(ext))))
|
||||
e.Effect = DragDropEffects.None;
|
||||
else
|
||||
if (allowed_extensions.Any(ext => paths.All(p => p.EndsWith(ext))))
|
||||
e.Effect = DragDropEffects.Copy;
|
||||
else
|
||||
e.Effect = DragDropEffects.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user