mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Add opsu migration, fix font not rendering
This commit is contained in:
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using Android.Content;
|
using Android.Content;
|
||||||
using Android.Util;
|
using Android.Util;
|
||||||
using osu.Framework;
|
|
||||||
using osu.Framework.Android;
|
using osu.Framework.Android;
|
||||||
using osu.Game;
|
using osu.Game;
|
||||||
|
|
||||||
@ -21,6 +20,6 @@ namespace osu.Android
|
|||||||
{
|
{
|
||||||
CreateGame();
|
CreateGame();
|
||||||
}
|
}
|
||||||
public override Framework.Game CreateGame() => new OsuGame();
|
public override Framework.Game CreateGame() => new OsuGameAndroid();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ using Android.App;
|
|||||||
using Android.OS;
|
using Android.OS;
|
||||||
using Android.Runtime;
|
using Android.Runtime;
|
||||||
using Android.Widget;
|
using Android.Widget;
|
||||||
|
using Android.Views;
|
||||||
using Android.Content.PM;
|
using Android.Content.PM;
|
||||||
|
|
||||||
namespace osu.Android
|
namespace osu.Android
|
||||||
@ -17,6 +18,7 @@ namespace osu.Android
|
|||||||
base.OnCreate(savedInstanceState);
|
base.OnCreate(savedInstanceState);
|
||||||
// Set our view from the "main" layout resource
|
// Set our view from the "main" layout resource
|
||||||
SetContentView(Resource.Layout.activity_main);
|
SetContentView(Resource.Layout.activity_main);
|
||||||
|
Window.AddFlags(WindowManagerFlags.KeepScreenOn);
|
||||||
}
|
}
|
||||||
public override void OnBackPressed()
|
public override void OnBackPressed()
|
||||||
{
|
{
|
||||||
|
44
osu.Android/OsuGameAndroid.cs
Normal file
44
osu.Android/OsuGameAndroid.cs
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Framework.Android;
|
||||||
|
using osu.Framework.Platform;
|
||||||
|
using osu.Game;
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace osu.Android
|
||||||
|
{
|
||||||
|
internal class OsuGameAndroid : OsuGame
|
||||||
|
{
|
||||||
|
public OsuGameAndroid() : base()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public override Storage GetStorageForStableInstall()
|
||||||
|
{
|
||||||
|
return new OpsuStorage();
|
||||||
|
}
|
||||||
|
|
||||||
|
// For better migration from opsu! to osu!lazer (WIP)
|
||||||
|
private class OpsuStorage : AndroidStorage
|
||||||
|
{
|
||||||
|
bool checkExists(string p) => Directory.Exists(Path.Combine(p, "Songs"));
|
||||||
|
|
||||||
|
protected override string LocateBasePath()
|
||||||
|
{
|
||||||
|
BasePath = base.LocateBasePath();
|
||||||
|
string opsuInstallPath = Path.Combine(BasePath, "opsu");
|
||||||
|
Console.WriteLine(opsuInstallPath);
|
||||||
|
if (checkExists(opsuInstallPath))
|
||||||
|
return opsuInstallPath;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OpsuStorage() : base(string.Empty, null)
|
||||||
|
{
|
||||||
|
BasePath = LocateBasePath();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -63,6 +63,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="GameView.cs" />
|
<Compile Include="GameView.cs" />
|
||||||
<Compile Include="MainActivity.cs" />
|
<Compile Include="MainActivity.cs" />
|
||||||
|
<Compile Include="OsuGameAndroid.cs" />
|
||||||
<Compile Include="Resources\Resource.designer.cs" />
|
<Compile Include="Resources\Resource.designer.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@ -120,10 +121,10 @@
|
|||||||
<Version>1.1.0</Version>
|
<Version>1.1.0</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="SixLabors.Core">
|
<PackageReference Include="SixLabors.Core">
|
||||||
<Version>1.0.0-beta0006</Version>
|
<Version>1.0.0-dev000094</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="SixLabors.ImageSharp">
|
<PackageReference Include="SixLabors.ImageSharp">
|
||||||
<Version>1.0.0-beta0005</Version>
|
<Version>1.0.0-dev002278</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Xamarin.Android.Support.Design" Version="27.0.2.1" />
|
<PackageReference Include="Xamarin.Android.Support.Design" Version="27.0.2.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
Reference in New Issue
Block a user