1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-04 02:13:39 +08:00

Fail on drag drop operations with mixed files.

This commit is contained in:
Dean Herbert
2017-03-06 15:03:58 +09:00
Unverified
parent 76ef8c1a6c
commit ff51af94ec
+3 -3
View File
@@ -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;
}
}
}