1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-07 05:07:21 +08:00
osu-lazer/osu.iOS/AppDelegate.cs

28 lines
772 B
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
2019-01-25 18:55:05 +09:00
// See the LICENCE file in the repository root for full licence text.
2018-12-29 20:05:37 +10:30
2019-08-05 22:30:35 +08:00
using System.Threading.Tasks;
2018-12-29 20:05:37 +10:30
using Foundation;
2018-12-06 21:30:23 +10:30
using osu.Framework.iOS;
2019-07-24 20:49:35 +08:00
using UIKit;
2018-12-06 17:49:09 +10:30
namespace osu.iOS
{
[Register("AppDelegate")]
2018-12-06 21:30:23 +10:30
public class AppDelegate : GameAppDelegate
2018-12-06 17:49:09 +10:30
{
2019-07-26 13:27:37 +09:00
private OsuGameIOS game;
2019-07-24 20:49:35 +08:00
2019-07-26 13:27:37 +09:00
protected override Framework.Game CreateGame() => game = new OsuGameIOS();
2019-07-24 20:49:35 +08:00
2019-08-02 23:34:25 +08:00
public override bool OpenUrl(UIApplication app, NSUrl url, NSDictionary options)
2019-07-24 20:49:35 +08:00
{
2019-08-05 22:30:35 +08:00
if (url.IsFileUrl)
Task.Run(() => game.Import(url.Path));
else
2019-10-31 18:34:41 +09:00
Task.Run(() => game.HandleLink(url.AbsoluteString));
2019-07-24 20:49:35 +08:00
return true;
}
2018-12-06 17:49:09 +10:30
}
}