diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs
new file mode 100644
index 0000000000..e5abb763a7
--- /dev/null
+++ b/osu.Desktop/OsuGameDesktop.cs
@@ -0,0 +1,55 @@
+using osu.Game;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using osu.Framework.Platform;
+using osu.Framework.Desktop.Platform;
+using osu.Game.Database;
+
+namespace osu.Desktop
+{
+ class OsuGameDesktop : OsuGame
+ {
+ public OsuGameDesktop(string[] args = null)
+ : base(args)
+ {
+
+ }
+
+ public override void SetHost(BasicGameHost host)
+ {
+ base.SetHost(host);
+ var desktopWindow = host.Window as DesktopGameWindow;
+ if (desktopWindow != null)
+ {
+ desktopWindow.DragEnter += dragEnter;
+ desktopWindow.DragDrop += dragDrop;
+ }
+ }
+
+ private void dragDrop(DragEventArgs e)
+ {
+ // this method will only be executed if e.Effect in dragEnter gets set to something other that None.
+ var dropData = e.Data.GetData(DataFormats.FileDrop) as object[];
+ var filePaths = dropData.Select(f => f.ToString()).ToArray();
+ ImportBeatmaps(filePaths);
+ }
+
+ private void dragEnter(DragEventArgs e)
+ {
+ // dragDrop will only be executed if e.Effect gets set to something other that None in this method.
+ bool isFile = e.Data.GetDataPresent(DataFormats.FileDrop);
+ if (isFile)
+ {
+ var paths = (e.Data.GetData(DataFormats.FileDrop) as object[]).Select(f => f.ToString()).ToArray();
+ if (paths.Any(p => !p.EndsWith(".osz")))
+ e.Effect = DragDropEffects.None;
+ else
+ e.Effect = DragDropEffects.Copy;
+ }
+ }
+ }
+}
diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs
index ef2a4b8ba1..62100f9b36 100644
--- a/osu.Desktop/Program.cs
+++ b/osu.Desktop/Program.cs
@@ -51,7 +51,7 @@ namespace osu.Desktop
Ruleset.Register(new ManiaRuleset());
Ruleset.Register(new CatchRuleset());
- BaseGame osu = new OsuGame(args);
+ BaseGame osu = new OsuGameDesktop(args);
host.Add(osu);
host.Run();
}
diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj
index ce0e39b6d9..9df4148ac0 100644
--- a/osu.Desktop/osu.Desktop.csproj
+++ b/osu.Desktop/osu.Desktop.csproj
@@ -81,7 +81,9 @@
+
+
@@ -152,6 +154,7 @@
+
diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs
index ede86db1db..7bbdc1e952 100644
--- a/osu.Game/OsuGame.cs
+++ b/osu.Game/OsuGame.cs
@@ -22,6 +22,7 @@ using osu.Game.Overlays.Toolbar;
using osu.Game.Screens;
using osu.Game.Screens.Menu;
using OpenTK;
+using System.Linq;
namespace osu.Game
{
@@ -63,13 +64,18 @@ namespace osu.Game
}
if (args?.Length > 0)
- Schedule(delegate { Dependencies.Get().Import(args); });
+ ImportBeatmaps(args);
Dependencies.Cache(this);
PlayMode = LocalConfig.GetBindable(OsuConfig.PlayMode);
}
+ public void ImportBeatmaps(params string[] paths)
+ {
+ Schedule(delegate { Dependencies.Get().Import(paths); });
+ }
+
protected override void LoadComplete()
{
base.LoadComplete();
diff --git a/osu.Game/Overlays/Pause/PauseButton.cs b/osu.Game/Overlays/Pause/PauseButton.cs
index 80e0fb06a5..bb707a70b1 100644
--- a/osu.Game/Overlays/Pause/PauseButton.cs
+++ b/osu.Game/Overlays/Pause/PauseButton.cs
@@ -205,10 +205,9 @@ namespace osu.Game.Overlays.Pause
},
new Triangles
{
- BlendingMode = BlendingMode.Additive,
RelativeSizeAxes = Axes.Both,
TriangleScale = 4,
- Alpha = 0.05f,
+ ColourDark = OsuColour.Gray(0.88f),
Shear = new Vector2(-0.2f, 0)
}
}