mirror of
https://github.com/ppy/osu
synced 2024-12-26 17:02:59 +00:00
Fix iOS importing
This commit is contained in:
parent
fb4f6dd27c
commit
0fe6585975
@ -54,7 +54,7 @@ namespace osu.Game.Database
|
||||
|
||||
public virtual string[] HandledExtensions => new[] { ".zip" };
|
||||
|
||||
public virtual bool SupportsImportFromStable => RuntimeInfo.IsDesktop;
|
||||
public virtual bool SupportsImportFromStable => (RuntimeInfo.IsDesktop || RuntimeInfo.OS == RuntimeInfo.Platform.iOS);
|
||||
|
||||
protected readonly FileStore Files;
|
||||
|
||||
|
@ -91,8 +91,6 @@ namespace osu.Game
|
||||
|
||||
private IntroScreen introScreen;
|
||||
|
||||
private bool loaded;
|
||||
|
||||
private Bindable<int> configRuleset;
|
||||
|
||||
private Bindable<int> configSkin;
|
||||
@ -201,18 +199,15 @@ namespace osu.Game
|
||||
{
|
||||
Logger.Log($"Request to handle url: {url}");
|
||||
|
||||
if (loaded)
|
||||
Action showNotImplementedError = () => notifications?.Post(new SimpleNotification
|
||||
{
|
||||
Action showNotImplementedError = () => notifications?.Post(new SimpleNotification
|
||||
{
|
||||
Text = @"This link type is not yet supported!",
|
||||
Icon = FontAwesome.Solid.LifeRing,
|
||||
});
|
||||
LinkDetails linkDetails = GetLinkDetails(url);
|
||||
Schedule(() => LinkUtils.HandleLink(url, linkDetails.Action, linkDetails.Argument, this, channelManager, showNotImplementedError));
|
||||
}
|
||||
else
|
||||
Scheduler.AddDelayed(() => HandleUrl(url), 1000);
|
||||
Text = @"This link type is not yet supported!",
|
||||
Icon = FontAwesome.Solid.LifeRing,
|
||||
});
|
||||
|
||||
LinkDetails linkDetails = GetLinkDetails(url);
|
||||
|
||||
Schedule(() => LinkUtils.HandleLink(url, linkDetails.Action, linkDetails.Argument, this, channelManager, showNotImplementedError));
|
||||
}
|
||||
|
||||
public void OpenUrlExternally(string url)
|
||||
@ -403,8 +398,6 @@ namespace osu.Game
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
loaded = false;
|
||||
|
||||
base.LoadComplete();
|
||||
|
||||
// The next time this is updated is in UpdateAfterChildren, which occurs too late and results
|
||||
@ -600,7 +593,6 @@ namespace osu.Game
|
||||
|
||||
settings.State.ValueChanged += _ => updateScreenOffset();
|
||||
notifications.State.ValueChanged += _ => updateScreenOffset();
|
||||
loaded = true;
|
||||
}
|
||||
|
||||
public class GameIdleTracker : IdleTracker
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Threading.Tasks;
|
||||
using Foundation;
|
||||
using osu.Framework.iOS;
|
||||
using osu.Framework.Threading;
|
||||
@ -17,7 +18,10 @@ namespace osu.iOS
|
||||
|
||||
public override bool OpenUrl(UIApplication app, NSUrl url, NSDictionary options)
|
||||
{
|
||||
game.HandleUrl(url.AbsoluteString);
|
||||
if (url.IsFileUrl)
|
||||
Task.Run(() => game.Import(url.Path));
|
||||
else
|
||||
Task.Run(() => game.HandleUrl(url.AbsoluteString));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,8 @@
|
||||
<string>0.1.0</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>LSSupportsOpeningDocumentsInPlace</key>
|
||||
<true/>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>10.0</string>
|
||||
<key>UIDeviceFamily</key>
|
||||
|
@ -3,12 +3,14 @@
|
||||
|
||||
using System;
|
||||
using Foundation;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game;
|
||||
|
||||
namespace osu.iOS
|
||||
{
|
||||
public class OsuGameIOS : OsuGame
|
||||
{
|
||||
public override Storage GetStorageForStableInstall() => Storage;
|
||||
public override Version AssemblyVersion => new Version(NSBundle.MainBundle.InfoDictionary["CFBundleVersion"].ToString());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user