mirror of
https://github.com/osukey/osukey.git
synced 2025-04-29 02:37:25 +09:00
Merge pull request #21629 from peppy/guard-url-protocols
Update framework
This commit is contained in:
commit
1262c44dfb
29
.github/workflows/ci.yml
vendored
29
.github/workflows/ci.yml
vendored
@ -31,7 +31,7 @@ jobs:
|
|||||||
run: dotnet tool restore
|
run: dotnet tool restore
|
||||||
|
|
||||||
- name: Restore Packages
|
- name: Restore Packages
|
||||||
run: dotnet restore
|
run: dotnet restore osu.Desktop.slnf
|
||||||
|
|
||||||
- name: Restore inspectcode cache
|
- name: Restore inspectcode cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -113,27 +113,36 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
dotnet-version: "6.0.x"
|
dotnet-version: "6.0.x"
|
||||||
|
|
||||||
- name: Setup MSBuild
|
- name: Install .NET workloads
|
||||||
uses: microsoft/setup-msbuild@v1
|
run: dotnet workload install maui-android
|
||||||
|
|
||||||
- name: Build
|
- name: Compile
|
||||||
run: msbuild osu.Android/osu.Android.csproj /restore /p:Configuration=Debug
|
run: dotnet build -c Debug osu.Android.slnf
|
||||||
|
|
||||||
build-only-ios:
|
build-only-ios:
|
||||||
name: Build only (iOS)
|
name: Build only (iOS)
|
||||||
runs-on: macos-latest
|
# change to macos-latest once GitHub finishes migrating all repositories to macOS 12.
|
||||||
|
runs-on: macos-12
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# see https://github.com/actions/runner-images/issues/6771#issuecomment-1354713617
|
||||||
|
# remove once all workflow VMs use Xcode 14.1
|
||||||
|
- name: Set Xcode Version
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo xcode-select -s "/Applications/Xcode_14.1.app"
|
||||||
|
echo "MD_APPLE_SDK_ROOT=/Applications/Xcode_14.1.app" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Install .NET 6.0.x
|
- name: Install .NET 6.0.x
|
||||||
uses: actions/setup-dotnet@v1
|
uses: actions/setup-dotnet@v1
|
||||||
with:
|
with:
|
||||||
dotnet-version: "6.0.x"
|
dotnet-version: "6.0.x"
|
||||||
|
|
||||||
# Contrary to seemingly any other msbuild, msbuild running on macOS/Mono
|
- name: Install .NET Workloads
|
||||||
# cannot accept .sln(f) files as arguments.
|
run: dotnet workload install maui-ios
|
||||||
# Build just the main game for now.
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: msbuild osu.iOS/osu.iOS.csproj /restore /p:Configuration=Debug
|
run: dotnet build -c Debug osu.iOS
|
||||||
|
@ -32,7 +32,7 @@ If you are looking to install or test osu! without setting up a development envi
|
|||||||
|
|
||||||
**Latest build:**
|
**Latest build:**
|
||||||
|
|
||||||
| [Windows 8.1+ (x64)](https://github.com/ppy/osu/releases/latest/download/install.exe) | macOS 10.15+ ([Intel](https://github.com/ppy/osu/releases/latest/download/osu.app.Intel.zip), [Apple Silicon](https://github.com/ppy/osu/releases/latest/download/osu.app.Apple.Silicon.zip)) | [Linux (x64)](https://github.com/ppy/osu/releases/latest/download/osu.AppImage) | [iOS 10+](https://osu.ppy.sh/home/testflight) | [Android 5+](https://github.com/ppy/osu/releases/latest/download/sh.ppy.osulazer.apk) |
|
| [Windows 8.1+ (x64)](https://github.com/ppy/osu/releases/latest/download/install.exe) | macOS 10.15+ ([Intel](https://github.com/ppy/osu/releases/latest/download/osu.app.Intel.zip), [Apple Silicon](https://github.com/ppy/osu/releases/latest/download/osu.app.Apple.Silicon.zip)) | [Linux (x64)](https://github.com/ppy/osu/releases/latest/download/osu.AppImage) | [iOS 13.4+](https://osu.ppy.sh/home/testflight) | [Android 5+](https://github.com/ppy/osu/releases/latest/download/sh.ppy.osulazer.apk) |
|
||||||
| ------------- | ------------- | ------------- | ------------- | ------------- |
|
| ------------- | ------------- | ------------- | ------------- | ------------- |
|
||||||
|
|
||||||
- The iOS testflight link may fill up (Apple has a hard limit of 10,000 users). We reset it occasionally when this happens. Please do not ask about this. Check back regularly for link resets or follow [peppy](https://twitter.com/ppy) on twitter for announcements of link resets.
|
- The iOS testflight link may fill up (Apple has a hard limit of 10,000 users). We reset it occasionally when this happens. Please do not ask about this. Check back regularly for link resets or follow [peppy](https://twitter.com/ppy) on twitter for announcements of link resets.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup Label="Project">
|
<PropertyGroup Label="Project">
|
||||||
<TargetFramework>netstandard2.1</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<AssemblyTitle>osu.Game.Rulesets.EmptyFreeform</AssemblyTitle>
|
<AssemblyTitle>osu.Game.Rulesets.EmptyFreeform</AssemblyTitle>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
@ -12,4 +12,4 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\..\..\osu.Game\osu.Game.csproj" />
|
<ProjectReference Include="..\..\..\..\osu.Game\osu.Game.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup Label="Project">
|
<PropertyGroup Label="Project">
|
||||||
<TargetFramework>netstandard2.1</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<AssemblyTitle>osu.Game.Rulesets.Pippidon</AssemblyTitle>
|
<AssemblyTitle>osu.Game.Rulesets.Pippidon</AssemblyTitle>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
@ -12,4 +12,4 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\..\..\osu.Game\osu.Game.csproj" />
|
<ProjectReference Include="..\..\..\..\osu.Game\osu.Game.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup Label="Project">
|
<PropertyGroup Label="Project">
|
||||||
<TargetFramework>netstandard2.1</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<AssemblyTitle>osu.Game.Rulesets.EmptyScrolling</AssemblyTitle>
|
<AssemblyTitle>osu.Game.Rulesets.EmptyScrolling</AssemblyTitle>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
@ -12,4 +12,4 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\..\..\osu.Game\osu.Game.csproj" />
|
<ProjectReference Include="..\..\..\..\osu.Game\osu.Game.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup Label="Project">
|
<PropertyGroup Label="Project">
|
||||||
<TargetFramework>netstandard2.1</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<AssemblyTitle>osu.Game.Rulesets.Pippidon</AssemblyTitle>
|
<AssemblyTitle>osu.Game.Rulesets.Pippidon</AssemblyTitle>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
@ -12,4 +12,4 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\..\..\osu.Game\osu.Game.csproj" />
|
<ProjectReference Include="..\..\..\..\osu.Game\osu.Game.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
clone_depth: 1
|
clone_depth: 1
|
||||||
version: '{branch}-{build}'
|
version: '{branch}-{build}'
|
||||||
image: Visual Studio 2019
|
image: Visual Studio 2022
|
||||||
cache:
|
cache:
|
||||||
- '%LOCALAPPDATA%\NuGet\v3-cache -> appveyor.yml'
|
- '%LOCALAPPDATA%\NuGet\v3-cache -> appveyor.yml'
|
||||||
|
|
||||||
@ -11,6 +11,8 @@ dotnet_csproj:
|
|||||||
|
|
||||||
before_build:
|
before_build:
|
||||||
- cmd: dotnet --info # Useful when version mismatch between CI and local
|
- cmd: dotnet --info # Useful when version mismatch between CI and local
|
||||||
|
- cmd: dotnet workload install maui-android # Change to `dotnet workload restore` once there's no old projects
|
||||||
|
- cmd: dotnet workload install maui-ios # Change to `dotnet workload restore` once there's no old projects
|
||||||
- cmd: nuget restore -verbosity quiet # Only nuget.exe knows both new (.NET Core) and old (Xamarin) projects
|
- cmd: nuget restore -verbosity quiet # Only nuget.exe knows both new (.NET Core) and old (Xamarin) projects
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
6
global.json
Normal file
6
global.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"sdk": {
|
||||||
|
"version": "6.0.300",
|
||||||
|
"rollForward": "major"
|
||||||
|
}
|
||||||
|
}
|
@ -1,58 +1,16 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<LangVersion>8.0</LangVersion>
|
<SupportedOSPlatformVersion>21.0</SupportedOSPlatformVersion>
|
||||||
<OutputPath>bin\$(Configuration)</OutputPath>
|
<RuntimeIdentifiers>android-x86;android-arm;android-arm64</RuntimeIdentifiers>
|
||||||
<WarningLevel>4</WarningLevel>
|
<AndroidPackageFormat>apk</AndroidPackageFormat>
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
<MandroidI18n>CJK;Mideast;Rare;West;Other;</MandroidI18n>
|
||||||
<BundleAssemblies>false</BundleAssemblies>
|
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidMessageHandler</AndroidHttpClientHandlerType>
|
||||||
<AotAssemblies>false</AotAssemblies>
|
<!-- NullabilityInfoContextSupport is disabled by default for Android -->
|
||||||
<OutputType>Library</OutputType>
|
<NullabilityInfoContextSupport>true</NullabilityInfoContextSupport>
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
|
||||||
<AndroidApplication>True</AndroidApplication>
|
|
||||||
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
|
|
||||||
<TargetFrameworkVersion>v10.0</TargetFrameworkVersion>
|
|
||||||
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
<AndroidSupportedAbis>armeabi-v7a;x86;arm64-v8a</AndroidSupportedAbis>
|
|
||||||
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
|
|
||||||
<MandroidI18n>cjk,mideast,other,rare,west</MandroidI18n>
|
|
||||||
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
|
|
||||||
<DebugSymbols>True</DebugSymbols>
|
|
||||||
<DebugType>portable</DebugType>
|
|
||||||
<Optimize>False</Optimize>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<AndroidManagedSymbols>false</AndroidManagedSymbols>
|
|
||||||
<AndroidUseSharedRuntime>true</AndroidUseSharedRuntime>
|
|
||||||
<EmbedAssembliesIntoApk>false</EmbedAssembliesIntoApk>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
|
|
||||||
<DebugSymbols>false</DebugSymbols>
|
|
||||||
<DebugType>None</DebugType>
|
|
||||||
<Optimize>True</Optimize>
|
|
||||||
<AndroidManagedSymbols>false</AndroidManagedSymbols>
|
|
||||||
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
|
|
||||||
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="$(MSBuildThisFileDirectory)\osu.licenseheader">
|
<PackageReference Include="ppy.osu.Framework.Android" Version="2022.1216.1" />
|
||||||
<Link>osu.licenseheader</Link>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="Mono.Android" />
|
|
||||||
<Reference Include="Java.Interop" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.1207.0" />
|
|
||||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2022.1208.0" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Transitive Dependencies">
|
<ItemGroup Label="Transitive Dependencies">
|
||||||
<!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. -->
|
<!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. -->
|
||||||
@ -61,4 +19,9 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<LinkDescription Include="$(MSBuildThisFileDirectory)\osu.Android\Linker.xml"/>
|
<LinkDescription Include="$(MSBuildThisFileDirectory)\osu.Android\Linker.xml"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<!-- Fody does not handle Android build well, and warns when unchanged.
|
||||||
|
Since Realm objects are not declared directly in Android projects, simply disable Fody. -->
|
||||||
|
<DisableFody>true</DisableFody>
|
||||||
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" package="sh.ppy.osulazer" android:installLocation="auto" android:versionName="0.1.0">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" package="sh.ppy.osulazer" android:installLocation="auto" android:versionName="0.1.0">
|
||||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29" />
|
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" />
|
||||||
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!" android:icon="@drawable/lazer" />
|
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!" android:icon="@drawable/lazer" />
|
||||||
</manifest>
|
</manifest>
|
@ -7,6 +7,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Android.App;
|
using Android.App;
|
||||||
using Android.Content;
|
using Android.Content;
|
||||||
@ -74,11 +75,23 @@ namespace osu.Android
|
|||||||
Debug.Assert(Resources?.DisplayMetrics != null);
|
Debug.Assert(Resources?.DisplayMetrics != null);
|
||||||
|
|
||||||
Point displaySize = new Point();
|
Point displaySize = new Point();
|
||||||
|
#pragma warning disable 618 // GetSize is deprecated
|
||||||
WindowManager.DefaultDisplay.GetSize(displaySize);
|
WindowManager.DefaultDisplay.GetSize(displaySize);
|
||||||
|
#pragma warning restore 618
|
||||||
float smallestWidthDp = Math.Min(displaySize.X, displaySize.Y) / Resources.DisplayMetrics.Density;
|
float smallestWidthDp = Math.Min(displaySize.X, displaySize.Y) / Resources.DisplayMetrics.Density;
|
||||||
bool isTablet = smallestWidthDp >= 600f;
|
bool isTablet = smallestWidthDp >= 600f;
|
||||||
|
|
||||||
RequestedOrientation = DefaultOrientation = isTablet ? ScreenOrientation.FullUser : ScreenOrientation.SensorLandscape;
|
RequestedOrientation = DefaultOrientation = isTablet ? ScreenOrientation.FullUser : ScreenOrientation.SensorLandscape;
|
||||||
|
|
||||||
|
// Currently (SDK 6.0.200), BundleAssemblies is not runnable for net6-android.
|
||||||
|
// The assembly files are not available as files either after native AOT.
|
||||||
|
// Manually load them so that they can be loaded by RulesetStore.loadFromAppDomain.
|
||||||
|
// REMEMBER to fully uninstall previous version every time when investigating this!
|
||||||
|
// Don't forget osu.Game.Tests.Android too.
|
||||||
|
Assembly.Load("osu.Game.Rulesets.Osu");
|
||||||
|
Assembly.Load("osu.Game.Rulesets.Taiko");
|
||||||
|
Assembly.Load("osu.Game.Rulesets.Catch");
|
||||||
|
Assembly.Load("osu.Game.Rulesets.Mania");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnNewIntent(Intent intent) => handleIntent(intent);
|
protected override void OnNewIntent(Intent intent) => handleIntent(intent);
|
||||||
@ -127,7 +140,7 @@ namespace osu.Android
|
|||||||
|
|
||||||
cursor.MoveToFirst();
|
cursor.MoveToFirst();
|
||||||
|
|
||||||
int filenameColumn = cursor.GetColumnIndex(OpenableColumns.DisplayName);
|
int filenameColumn = cursor.GetColumnIndex(IOpenableColumns.DisplayName);
|
||||||
string filename = cursor.GetString(filenameColumn);
|
string filename = cursor.GetString(filenameColumn);
|
||||||
|
|
||||||
// SharpCompress requires archive streams to be seekable, which the stream opened by
|
// SharpCompress requires archive streams to be seekable, which the stream opened by
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using Android.App;
|
using Android.App;
|
||||||
using Android.OS;
|
using Microsoft.Maui.Devices;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Android.Input;
|
using osu.Framework.Android.Input;
|
||||||
using osu.Framework.Input.Handlers;
|
using osu.Framework.Input.Handlers;
|
||||||
@ -14,7 +14,6 @@ using osu.Game;
|
|||||||
using osu.Game.Overlays.Settings;
|
using osu.Game.Overlays.Settings;
|
||||||
using osu.Game.Updater;
|
using osu.Game.Updater;
|
||||||
using osu.Game.Utils;
|
using osu.Game.Utils;
|
||||||
using Xamarin.Essentials;
|
|
||||||
|
|
||||||
namespace osu.Android
|
namespace osu.Android
|
||||||
{
|
{
|
||||||
@ -48,7 +47,7 @@ namespace osu.Android
|
|||||||
// https://stackoverflow.com/questions/52977079/android-sdk-28-versioncode-in-packageinfo-has-been-deprecated
|
// https://stackoverflow.com/questions/52977079/android-sdk-28-versioncode-in-packageinfo-has-been-deprecated
|
||||||
string versionName = string.Empty;
|
string versionName = string.Empty;
|
||||||
|
|
||||||
if (Build.VERSION.SdkInt >= BuildVersionCodes.P)
|
if (OperatingSystem.IsAndroidVersionAtLeast(28))
|
||||||
{
|
{
|
||||||
versionName = packageInfo.LongVersionCode.ToString();
|
versionName = packageInfo.LongVersionCode.ToString();
|
||||||
// ensure we only read the trailing portion of long (the part we are interested in).
|
// ensure we only read the trailing portion of long (the part we are interested in).
|
||||||
|
@ -1,73 +1,19 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\osu.Android.props" />
|
<Import Project="..\osu.Android.props" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<TargetFramework>net6.0-android</TargetFramework>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<OutputType>Exe</OutputType>
|
||||||
<ProductVersion>8.0.30703</ProductVersion>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
<ProjectGuid>{D1D5F9A8-B40B-40E6-B02F-482D03346D3D}</ProjectGuid>
|
|
||||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<TemplateGuid>{122416d6-6b49-4ee2-a1e8-b825f31c79fe}</TemplateGuid>
|
|
||||||
<RootNamespace>osu.Android</RootNamespace>
|
<RootNamespace>osu.Android</RootNamespace>
|
||||||
<AssemblyName>osu.Android</AssemblyName>
|
<AssemblyName>osu.Android</AssemblyName>
|
||||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
<UseMauiEssentials>true</UseMauiEssentials>
|
||||||
<AndroidSupportedAbis>armeabi-v7a;x86;arm64-v8a</AndroidSupportedAbis>
|
<!-- This currently causes random lockups during gameplay. https://github.com/mono/mono/issues/18973 -->
|
||||||
<EnableLLVM>false</EnableLLVM> <!-- This currently causes random lockups during gameplay. https://github.com/mono/mono/issues/18973 -->
|
<EnableLLVM>false</EnableLLVM>
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<MandroidI18n>cjk;mideast;other;rare;west</MandroidI18n>
|
|
||||||
<AndroidDexTool>d8</AndroidDexTool>
|
|
||||||
<AndroidLinkTool>r8</AndroidLinkTool>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<AndroidLinkMode>None</AndroidLinkMode>
|
|
||||||
<MandroidI18n>cjk;mideast;other;rare;west</MandroidI18n>
|
|
||||||
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="AndroidJoystickSettings.cs" />
|
<ProjectReference Include="..\osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj" />
|
||||||
<Compile Include="AndroidMouseSettings.cs" />
|
<ProjectReference Include="..\osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj" />
|
||||||
<Compile Include="GameplayScreenRotationLocker.cs" />
|
<ProjectReference Include="..\osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj" />
|
||||||
<Compile Include="OsuGameActivity.cs" />
|
<ProjectReference Include="..\osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj" />
|
||||||
<Compile Include="OsuGameAndroid.cs" />
|
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
</Project>
|
||||||
<None Include="Properties\AndroidManifest.xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj">
|
|
||||||
<Project>{58f6c80c-1253-4a0e-a465-b8c85ebeadf3}</Project>
|
|
||||||
<Name>osu.Game.Rulesets.Catch</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj">
|
|
||||||
<Project>{48f4582b-7687-4621-9cbe-5c24197cb536}</Project>
|
|
||||||
<Name>osu.Game.Rulesets.Mania</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj">
|
|
||||||
<Project>{c92a607b-1fdd-4954-9f92-03ff547d9080}</Project>
|
|
||||||
<Name>osu.Game.Rulesets.Osu</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj">
|
|
||||||
<Project>{f167e17a-7de6-4af5-b920-a5112296c695}</Project>
|
|
||||||
<Name>osu.Game.Rulesets.Taiko</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj">
|
|
||||||
<Project>{2a66dd92-adb1-4994-89e2-c94e04acda0d}</Project>
|
|
||||||
<Name>osu.Game</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<AndroidResource Include="Resources\drawable\lazer.png" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="System.Formats.Asn1">
|
|
||||||
<Version>5.0.0</Version>
|
|
||||||
</PackageReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
|
||||||
</Project>
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- using a different name because package name cannot contain 'catch' -->
|
<!-- using a different name because package name cannot contain 'catch' -->
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Catch_Tests.Android" android:installLocation="auto">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Catch_Tests.Android" android:installLocation="auto">
|
||||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29" />
|
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" />
|
||||||
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!catch Test" />
|
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!catch Test" />
|
||||||
</manifest>
|
</manifest>
|
@ -1,49 +1,24 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\osu.Android.props" />
|
<Import Project="..\osu.Android.props" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<TargetFramework>net6.0-android</TargetFramework>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<OutputType>Exe</OutputType>
|
||||||
<ProductVersion>8.0.30703</ProductVersion>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
<ProjectGuid>{C5379ECB-3A94-4D2F-AC3B-2615AC23EB0D}</ProjectGuid>
|
|
||||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<TemplateGuid>{122416d6-6b49-4ee2-a1e8-b825f31c79fe}</TemplateGuid>
|
|
||||||
<RootNamespace>osu.Game.Rulesets.Catch.Tests</RootNamespace>
|
<RootNamespace>osu.Game.Rulesets.Catch.Tests</RootNamespace>
|
||||||
<AssemblyName>osu.Game.Rulesets.Catch.Tests.Android</AssemblyName>
|
<AssemblyName>osu.Game.Rulesets.Catch.Tests.Android</AssemblyName>
|
||||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
|
||||||
<AndroidSupportedAbis>armeabi-v7a;x86;arm64-v8a</AndroidSupportedAbis>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<AndroidLinkMode>None</AndroidLinkMode>
|
|
||||||
<MandroidI18n>cjk;mideast;other;rare;west</MandroidI18n>
|
|
||||||
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="MainActivity.cs" />
|
<Compile Include="..\osu.Game.Rulesets.Catch.Tests\**\*.cs" Exclude="**\obj\**">
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="Properties\AndroidManifest.xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="..\osu.Game.Rulesets.Catch.Tests\*.cs">
|
|
||||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<!-- TargetPath is relative to RootNamespace,
|
||||||
|
and DllResourceStore is relative to AssemblyName. -->
|
||||||
|
<EmbeddedResource Include="..\osu.Game.Rulesets.Catch.Tests\**\Resources\**\*">
|
||||||
|
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||||
|
<TargetPath>Android\%(RecursiveDir)%(Filename)%(Extension)</TargetPath>
|
||||||
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj">
|
<ProjectReference Include="..\osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj" />
|
||||||
<Project>{58f6c80c-1253-4a0e-a465-b8c85ebeadf3}</Project>
|
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||||
<Name>osu.Game.Rulesets.Catch</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj">
|
|
||||||
<Project>{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}</Project>
|
|
||||||
<Name>osu.Game</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="System.Formats.Asn1">
|
|
||||||
<Version>5.0.0</Version>
|
|
||||||
</PackageReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
|
||||||
</Project>
|
</Project>
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
using osu.Framework.iOS;
|
|
||||||
using UIKit;
|
using UIKit;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Tests.iOS
|
namespace osu.Game.Rulesets.Catch.Tests.iOS
|
||||||
@ -12,7 +11,7 @@ namespace osu.Game.Rulesets.Catch.Tests.iOS
|
|||||||
{
|
{
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
UIApplication.Main(args, typeof(GameUIApplication), typeof(AppDelegate));
|
UIApplication.Main(args, null, typeof(AppDelegate));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>MinimumOSVersion</key>
|
<key>MinimumOSVersion</key>
|
||||||
<string>10.0</string>
|
<string>13.4</string>
|
||||||
<key>UIDeviceFamily</key>
|
<key>UIDeviceFamily</key>
|
||||||
<array>
|
<array>
|
||||||
<integer>1</integer>
|
<integer>1</integer>
|
||||||
|
@ -1,35 +1,19 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
|
||||||
<ProjectGuid>{4004C7B7-1A62-43F1-9DF2-52450FA67E70}</ProjectGuid>
|
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net6.0-ios</TargetFramework>
|
||||||
|
<SupportedOSPlatformVersion>13.4</SupportedOSPlatformVersion>
|
||||||
<RootNamespace>osu.Game.Rulesets.Catch.Tests</RootNamespace>
|
<RootNamespace>osu.Game.Rulesets.Catch.Tests</RootNamespace>
|
||||||
<AssemblyName>osu.Game.Rulesets.Catch.Tests.iOS</AssemblyName>
|
<AssemblyName>osu.Game.Rulesets.Catch.Tests.iOS</AssemblyName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="..\osu.iOS.props" />
|
<Import Project="..\osu.iOS.props" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Info.plist" />
|
|
||||||
<None Include="Entitlements.plist" />
|
|
||||||
<LinkDescription Include="..\osu.iOS\Linker.xml">
|
|
||||||
<Link>Linker.xml</Link>
|
|
||||||
</LinkDescription>
|
|
||||||
<Compile Include="Application.cs" />
|
|
||||||
<Compile Include="AppDelegate.cs" />
|
|
||||||
<Compile Include="..\osu.Game.Rulesets.Catch.Tests\**\*.cs" Exclude="**\obj\**">
|
<Compile Include="..\osu.Game.Rulesets.Catch.Tests\**\*.cs" Exclude="**\obj\**">
|
||||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Project References">
|
<ItemGroup Label="Project References">
|
||||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj">
|
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||||
<Project>{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}</Project>
|
<ProjectReference Include="..\osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj" />
|
||||||
<Name>osu.Game</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj">
|
|
||||||
<Project>{58F6C80C-1253-4A0E-A465-B8C85EBEADF3}</Project>
|
|
||||||
<Name>osu.Game.Rulesets.Catch</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
</Project>
|
||||||
</Project>
|
|
||||||
|
@ -121,9 +121,7 @@ namespace osu.Game.Rulesets.Catch.Edit
|
|||||||
return new SnapResult(originPosition, StartTime);
|
return new SnapResult(originPosition, StartTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
return enumerateSnappingCandidates(time)
|
return enumerateSnappingCandidates(time).MinBy(pos => Vector2.DistanceSquared(screenSpacePosition, pos.ScreenSpacePosition));
|
||||||
.OrderBy(pos => Vector2.DistanceSquared(screenSpacePosition, pos.ScreenSpacePosition))
|
|
||||||
.FirstOrDefault();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<SnapResult> enumerateSnappingCandidates(double time)
|
private IEnumerable<SnapResult> enumerateSnappingCandidates(double time)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup Label="Project">
|
<PropertyGroup Label="Project">
|
||||||
<TargetFramework>netstandard2.1</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<Description>catch the fruit. to the beat.</Description>
|
<Description>catch the fruit. to the beat.</Description>
|
||||||
@ -15,4 +15,4 @@
|
|||||||
<ItemGroup Label="Project References">
|
<ItemGroup Label="Project References">
|
||||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Mania.Tests.Android" android:installLocation="auto">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Mania.Tests.Android" android:installLocation="auto">
|
||||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29" />
|
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" />
|
||||||
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!mania Test" />
|
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!mania Test" />
|
||||||
</manifest>
|
</manifest>
|
@ -1,49 +1,24 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\osu.Android.props" />
|
<Import Project="..\osu.Android.props" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<TargetFramework>net6.0-android</TargetFramework>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<OutputType>Exe</OutputType>
|
||||||
<ProductVersion>8.0.30703</ProductVersion>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
<ProjectGuid>{531F1092-DB27-445D-AA33-2A77C7187C99}</ProjectGuid>
|
|
||||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<TemplateGuid>{122416d6-6b49-4ee2-a1e8-b825f31c79fe}</TemplateGuid>
|
|
||||||
<RootNamespace>osu.Game.Rulesets.Mania.Tests</RootNamespace>
|
<RootNamespace>osu.Game.Rulesets.Mania.Tests</RootNamespace>
|
||||||
<AssemblyName>osu.Game.Rulesets.Mania.Tests.Android</AssemblyName>
|
<AssemblyName>osu.Game.Rulesets.Mania.Tests.Android</AssemblyName>
|
||||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
|
||||||
<AndroidSupportedAbis>armeabi-v7a;x86;arm64-v8a</AndroidSupportedAbis>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<AndroidLinkMode>None</AndroidLinkMode>
|
|
||||||
<MandroidI18n>cjk;mideast;other;rare;west</MandroidI18n>
|
|
||||||
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="MainActivity.cs" />
|
<Compile Include="..\osu.Game.Rulesets.Mania.Tests\**\*.cs" Exclude="**\obj\**">
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="Properties\AndroidManifest.xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="..\osu.Game.Rulesets.Mania.Tests\*.cs">
|
|
||||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<!-- TargetPath is relative to RootNamespace,
|
||||||
|
and DllResourceStore is relative to AssemblyName. -->
|
||||||
|
<EmbeddedResource Include="..\osu.Game.Rulesets.Mania.Tests\**\Resources\**\*">
|
||||||
|
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||||
|
<TargetPath>Android\%(RecursiveDir)%(Filename)%(Extension)</TargetPath>
|
||||||
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj">
|
<ProjectReference Include="..\osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj" />
|
||||||
<Project>{48f4582b-7687-4621-9cbe-5c24197cb536}</Project>
|
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||||
<Name>osu.Game.Rulesets.Mania</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj">
|
|
||||||
<Project>{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}</Project>
|
|
||||||
<Name>osu.Game</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="System.Formats.Asn1">
|
|
||||||
<Version>5.0.0</Version>
|
|
||||||
</PackageReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
|
||||||
</Project>
|
</Project>
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
using osu.Framework.iOS;
|
|
||||||
using UIKit;
|
using UIKit;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mania.Tests.iOS
|
namespace osu.Game.Rulesets.Mania.Tests.iOS
|
||||||
@ -12,7 +11,7 @@ namespace osu.Game.Rulesets.Mania.Tests.iOS
|
|||||||
{
|
{
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
UIApplication.Main(args, typeof(GameUIApplication), typeof(AppDelegate));
|
UIApplication.Main(args, null, typeof(AppDelegate));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>MinimumOSVersion</key>
|
<key>MinimumOSVersion</key>
|
||||||
<string>10.0</string>
|
<string>13.4</string>
|
||||||
<key>UIDeviceFamily</key>
|
<key>UIDeviceFamily</key>
|
||||||
<array>
|
<array>
|
||||||
<integer>1</integer>
|
<integer>1</integer>
|
||||||
|
@ -1,35 +1,19 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
|
||||||
<ProjectGuid>{39FD990E-B6CE-4B2A-999F-BC008CF2C64C}</ProjectGuid>
|
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net6.0-ios</TargetFramework>
|
||||||
|
<SupportedOSPlatformVersion>13.4</SupportedOSPlatformVersion>
|
||||||
<RootNamespace>osu.Game.Rulesets.Mania.Tests</RootNamespace>
|
<RootNamespace>osu.Game.Rulesets.Mania.Tests</RootNamespace>
|
||||||
<AssemblyName>osu.Game.Rulesets.Mania.Tests.iOS</AssemblyName>
|
<AssemblyName>osu.Game.Rulesets.Mania.Tests.iOS</AssemblyName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="..\osu.iOS.props" />
|
<Import Project="..\osu.iOS.props" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Info.plist" />
|
|
||||||
<None Include="Entitlements.plist" />
|
|
||||||
<LinkDescription Include="..\osu.iOS\Linker.xml">
|
|
||||||
<Link>Linker.xml</Link>
|
|
||||||
</LinkDescription>
|
|
||||||
<Compile Include="Application.cs" />
|
|
||||||
<Compile Include="AppDelegate.cs" />
|
|
||||||
<Compile Include="..\osu.Game.Rulesets.Mania.Tests\**\*.cs" Exclude="**\obj\**">
|
<Compile Include="..\osu.Game.Rulesets.Mania.Tests\**\*.cs" Exclude="**\obj\**">
|
||||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Project References">
|
<ItemGroup Label="Project References">
|
||||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj">
|
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||||
<Project>{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}</Project>
|
<ProjectReference Include="..\osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj" />
|
||||||
<Name>osu.Game</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj">
|
|
||||||
<Project>{48F4582B-7687-4621-9CBE-5C24197CB536}</Project>
|
|
||||||
<Name>osu.Game.Rulesets.Mania</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
</Project>
|
||||||
</Project>
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup Label="Project">
|
<PropertyGroup Label="Project">
|
||||||
<TargetFramework>netstandard2.1</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<Description>smash the keys. to the beat.</Description>
|
<Description>smash the keys. to the beat.</Description>
|
||||||
@ -15,4 +15,4 @@
|
|||||||
<ItemGroup Label="Project References">
|
<ItemGroup Label="Project References">
|
||||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Osu.Tests.Android" android:installLocation="auto">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Osu.Tests.Android" android:installLocation="auto">
|
||||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29" />
|
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" />
|
||||||
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!standard Test" />
|
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!standard Test" />
|
||||||
</manifest>
|
</manifest>
|
@ -1,49 +1,27 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\osu.Android.props" />
|
<Import Project="..\osu.Android.props" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<TargetFramework>net6.0-android</TargetFramework>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<OutputType>Exe</OutputType>
|
||||||
<ProductVersion>8.0.30703</ProductVersion>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
<ProjectGuid>{90CAB706-39CB-4B93-9629-3218A6FF8E9B}</ProjectGuid>
|
|
||||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<TemplateGuid>{122416d6-6b49-4ee2-a1e8-b825f31c79fe}</TemplateGuid>
|
|
||||||
<RootNamespace>osu.Game.Rulesets.Osu.Tests</RootNamespace>
|
<RootNamespace>osu.Game.Rulesets.Osu.Tests</RootNamespace>
|
||||||
<AssemblyName>osu.Game.Rulesets.Osu.Tests.Android</AssemblyName>
|
<AssemblyName>osu.Game.Rulesets.Osu.Tests.Android</AssemblyName>
|
||||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
|
||||||
<AndroidSupportedAbis>armeabi-v7a;x86;arm64-v8a</AndroidSupportedAbis>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<AndroidLinkMode>None</AndroidLinkMode>
|
|
||||||
<MandroidI18n>cjk;mideast;other;rare;west</MandroidI18n>
|
|
||||||
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="MainActivity.cs" />
|
<Compile Include="..\osu.Game.Rulesets.Osu.Tests\**\*.cs" Exclude="**\obj\**">
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="Properties\AndroidManifest.xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="..\osu.Game.Rulesets.Osu.Tests\*.cs">
|
|
||||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<!-- TargetPath is relative to RootNamespace,
|
||||||
|
and DllResourceStore is relative to AssemblyName. -->
|
||||||
|
<EmbeddedResource Include="..\osu.Game.Rulesets.Osu.Tests\**\Resources\**\*">
|
||||||
|
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||||
|
<TargetPath>Android\%(RecursiveDir)%(Filename)%(Extension)</TargetPath>
|
||||||
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj">
|
<ProjectReference Include="..\osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj" />
|
||||||
<Project>{c92a607b-1fdd-4954-9f92-03ff547d9080}</Project>
|
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||||
<Name>osu.Game.Rulesets.Osu</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj">
|
|
||||||
<Project>{2a66dd92-adb1-4994-89e2-c94e04acda0d}</Project>
|
|
||||||
<Name>osu.Game</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="System.Formats.Asn1">
|
<PackageReference Include="Moq" Version="4.17.2" />
|
||||||
<Version>5.0.0</Version>
|
|
||||||
</PackageReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
|
||||||
</Project>
|
</Project>
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
using osu.Framework.iOS;
|
|
||||||
using UIKit;
|
using UIKit;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Tests.iOS
|
namespace osu.Game.Rulesets.Osu.Tests.iOS
|
||||||
@ -12,7 +11,7 @@ namespace osu.Game.Rulesets.Osu.Tests.iOS
|
|||||||
{
|
{
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
UIApplication.Main(args, typeof(GameUIApplication), typeof(AppDelegate));
|
UIApplication.Main(args, null, typeof(AppDelegate));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>MinimumOSVersion</key>
|
<key>MinimumOSVersion</key>
|
||||||
<string>10.0</string>
|
<string>13.4</string>
|
||||||
<key>UIDeviceFamily</key>
|
<key>UIDeviceFamily</key>
|
||||||
<array>
|
<array>
|
||||||
<integer>1</integer>
|
<integer>1</integer>
|
||||||
|
@ -1,35 +1,20 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<OutputType>Exe</OutputType>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
<TargetFramework>net6.0-ios</TargetFramework>
|
||||||
<ProjectGuid>{6653CA6F-DB06-4604-A3FD-762E25C2AF96}</ProjectGuid>
|
<SupportedOSPlatformVersion>13.4</SupportedOSPlatformVersion>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<RootNamespace>osu.Game.Rulesets.Osu.Tests</RootNamespace>
|
<RootNamespace>osu.Game.Rulesets.Osu.Tests</RootNamespace>
|
||||||
<AssemblyName>osu.Game.Rulesets.Osu.Tests.iOS</AssemblyName>
|
<AssemblyName>osu.Game.Rulesets.Osu.Tests.iOS</AssemblyName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="..\osu.iOS.props" />
|
<Import Project="..\osu.iOS.props" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Info.plist" />
|
|
||||||
<None Include="Entitlements.plist" />
|
|
||||||
<LinkDescription Include="..\osu.iOS\Linker.xml">
|
|
||||||
<Link>Linker.xml</Link>
|
|
||||||
</LinkDescription>
|
|
||||||
<Compile Include="Application.cs" />
|
|
||||||
<Compile Include="AppDelegate.cs" />
|
|
||||||
<Compile Include="..\osu.Game.Rulesets.Osu.Tests\**\*.cs" Exclude="**\obj\**">
|
<Compile Include="..\osu.Game.Rulesets.Osu.Tests\**\*.cs" Exclude="**\obj\**">
|
||||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Project References">
|
<ItemGroup Label="Project References">
|
||||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj">
|
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||||
<Project>{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}</Project>
|
<ProjectReference Include="..\osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj" />
|
||||||
<Name>osu.Game</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj">
|
|
||||||
<Project>{C92A607B-1FDD-4954-9F92-03FF547D9080}</Project>
|
|
||||||
<Name>osu.Game.Rulesets.Osu</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
</Project>
|
||||||
</Project>
|
|
||||||
|
@ -133,6 +133,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
switch (e.Action)
|
switch (e.Action)
|
||||||
{
|
{
|
||||||
case NotifyCollectionChangedAction.Add:
|
case NotifyCollectionChangedAction.Add:
|
||||||
|
Debug.Assert(e.NewItems != null);
|
||||||
|
|
||||||
// If inserting in the path (not appending),
|
// If inserting in the path (not appending),
|
||||||
// update indices of existing connections after insert location
|
// update indices of existing connections after insert location
|
||||||
if (e.NewStartingIndex < Pieces.Count)
|
if (e.NewStartingIndex < Pieces.Count)
|
||||||
@ -164,6 +166,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case NotifyCollectionChangedAction.Remove:
|
case NotifyCollectionChangedAction.Remove:
|
||||||
|
Debug.Assert(e.OldItems != null);
|
||||||
|
|
||||||
foreach (var point in e.OldItems.Cast<PathControlPoint>())
|
foreach (var point in e.OldItems.Cast<PathControlPoint>())
|
||||||
{
|
{
|
||||||
foreach (var piece in Pieces.Where(p => p.ControlPoint == point).ToArray())
|
foreach (var piece in Pieces.Where(p => p.ControlPoint == point).ToArray())
|
||||||
|
@ -82,7 +82,7 @@ namespace osu.Game.Rulesets.Osu.Replays
|
|||||||
|
|
||||||
private class ReplayFrameComparer : IComparer<ReplayFrame>
|
private class ReplayFrameComparer : IComparer<ReplayFrame>
|
||||||
{
|
{
|
||||||
public int Compare(ReplayFrame f1, ReplayFrame f2)
|
public int Compare(ReplayFrame? f1, ReplayFrame? f2)
|
||||||
{
|
{
|
||||||
if (f1 == null) throw new ArgumentNullException(nameof(f1));
|
if (f1 == null) throw new ArgumentNullException(nameof(f1));
|
||||||
if (f2 == null) throw new ArgumentNullException(nameof(f2));
|
if (f2 == null) throw new ArgumentNullException(nameof(f2));
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup Label="Project">
|
<PropertyGroup Label="Project">
|
||||||
<TargetFramework>netstandard2.1</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<Description>click the circles. to the beat.</Description>
|
<Description>click the circles. to the beat.</Description>
|
||||||
@ -15,4 +15,4 @@
|
|||||||
<ItemGroup Label="Project References">
|
<ItemGroup Label="Project References">
|
||||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Taiko.Tests.Android" android:installLocation="auto">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Taiko.Tests.Android" android:installLocation="auto">
|
||||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29" />
|
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" />
|
||||||
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!taiko Test" />
|
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!taiko Test" />
|
||||||
</manifest>
|
</manifest>
|
@ -1,49 +1,24 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\osu.Android.props" />
|
<Import Project="..\osu.Android.props" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<TargetFramework>net6.0-android</TargetFramework>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<OutputType>Exe</OutputType>
|
||||||
<ProductVersion>8.0.30703</ProductVersion>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
<ProjectGuid>{3701A0A1-8476-42C6-B5C4-D24129B4A484}</ProjectGuid>
|
|
||||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<TemplateGuid>{122416d6-6b49-4ee2-a1e8-b825f31c79fe}</TemplateGuid>
|
|
||||||
<RootNamespace>osu.Game.Rulesets.Taiko.Tests</RootNamespace>
|
<RootNamespace>osu.Game.Rulesets.Taiko.Tests</RootNamespace>
|
||||||
<AssemblyName>osu.Game.Rulesets.Taiko.Tests.Android</AssemblyName>
|
<AssemblyName>osu.Game.Rulesets.Taiko.Tests.Android</AssemblyName>
|
||||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
|
||||||
<AndroidSupportedAbis>armeabi-v7a;x86;arm64-v8a</AndroidSupportedAbis>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<AndroidLinkMode>None</AndroidLinkMode>
|
|
||||||
<MandroidI18n>cjk;mideast;other;rare;west</MandroidI18n>
|
|
||||||
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="MainActivity.cs" />
|
<Compile Include="..\osu.Game.Rulesets.Taiko.Tests\**\*.cs" Exclude="**\obj\**">
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="Properties\AndroidManifest.xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="..\osu.Game.Rulesets.Taiko.Tests\*.cs">
|
|
||||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<!-- TargetPath is relative to RootNamespace,
|
||||||
|
and DllResourceStore is relative to AssemblyName. -->
|
||||||
|
<EmbeddedResource Include="..\osu.Game.Rulesets.Taiko.Tests\**\Resources\**\*">
|
||||||
|
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||||
|
<TargetPath>Android\%(RecursiveDir)%(Filename)%(Extension)</TargetPath>
|
||||||
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj">
|
<ProjectReference Include="..\osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj" />
|
||||||
<Project>{f167e17a-7de6-4af5-b920-a5112296c695}</Project>
|
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||||
<Name>osu.Game.Rulesets.Taiko</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj">
|
|
||||||
<Project>{2a66dd92-adb1-4994-89e2-c94e04acda0d}</Project>
|
|
||||||
<Name>osu.Game</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="System.Formats.Asn1">
|
|
||||||
<Version>5.0.0</Version>
|
|
||||||
</PackageReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
|
||||||
</Project>
|
</Project>
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
using osu.Framework.iOS;
|
|
||||||
using UIKit;
|
using UIKit;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.Tests.iOS
|
namespace osu.Game.Rulesets.Taiko.Tests.iOS
|
||||||
@ -12,7 +11,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.iOS
|
|||||||
{
|
{
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
UIApplication.Main(args, typeof(GameUIApplication), typeof(AppDelegate));
|
UIApplication.Main(args, null, typeof(AppDelegate));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>MinimumOSVersion</key>
|
<key>MinimumOSVersion</key>
|
||||||
<string>10.0</string>
|
<string>13.4</string>
|
||||||
<key>UIDeviceFamily</key>
|
<key>UIDeviceFamily</key>
|
||||||
<array>
|
<array>
|
||||||
<integer>1</integer>
|
<integer>1</integer>
|
||||||
|
@ -1,35 +1,19 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
|
||||||
<ProjectGuid>{7E408809-66AC-49D1-AF4D-98834F9B979A}</ProjectGuid>
|
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net6.0-ios</TargetFramework>
|
||||||
|
<SupportedOSPlatformVersion>13.4</SupportedOSPlatformVersion>
|
||||||
<RootNamespace>osu.Game.Rulesets.Taiko.Tests</RootNamespace>
|
<RootNamespace>osu.Game.Rulesets.Taiko.Tests</RootNamespace>
|
||||||
<AssemblyName>osu.Game.Rulesets.Taiko.Tests.iOS</AssemblyName>
|
<AssemblyName>osu.Game.Rulesets.Taiko.Tests.iOS</AssemblyName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="..\osu.iOS.props" />
|
<Import Project="..\osu.iOS.props" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Info.plist" />
|
|
||||||
<None Include="Entitlements.plist" />
|
|
||||||
<LinkDescription Include="..\osu.iOS\Linker.xml">
|
|
||||||
<Link>Linker.xml</Link>
|
|
||||||
</LinkDescription>
|
|
||||||
<Compile Include="Application.cs" />
|
|
||||||
<Compile Include="AppDelegate.cs" />
|
|
||||||
<Compile Include="..\osu.Game.Rulesets.Taiko.Tests\**\*.cs" Exclude="**\obj\**">
|
<Compile Include="..\osu.Game.Rulesets.Taiko.Tests\**\*.cs" Exclude="**\obj\**">
|
||||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Project References">
|
<ItemGroup Label="Project References">
|
||||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj">
|
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||||
<Project>{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}</Project>
|
<ProjectReference Include="..\osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj" />
|
||||||
<Name>osu.Game</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj">
|
|
||||||
<Project>{F167E17A-7DE6-4AF5-B920-A5112296C695}</Project>
|
|
||||||
<Name>osu.Game.Rulesets.Taiko</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
</Project>
|
||||||
</Project>
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup Label="Project">
|
<PropertyGroup Label="Project">
|
||||||
<TargetFramework>netstandard2.1</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<Description>bash the drum. to the beat.</Description>
|
<Description>bash the drum. to the beat.</Description>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Tests.Android" android:installLocation="auto">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Tests.Android" android:installLocation="auto">
|
||||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29" />
|
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" />
|
||||||
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!visual Test" />
|
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!visual Test" />
|
||||||
</manifest>
|
</manifest>
|
@ -3,7 +3,9 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
using System.Reflection;
|
||||||
using Android.App;
|
using Android.App;
|
||||||
|
using Android.OS;
|
||||||
using osu.Framework.Android;
|
using osu.Framework.Android;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Android
|
namespace osu.Game.Tests.Android
|
||||||
@ -12,5 +14,16 @@ namespace osu.Game.Tests.Android
|
|||||||
public class MainActivity : AndroidGameActivity
|
public class MainActivity : AndroidGameActivity
|
||||||
{
|
{
|
||||||
protected override Framework.Game CreateGame() => new OsuTestBrowser();
|
protected override Framework.Game CreateGame() => new OsuTestBrowser();
|
||||||
|
|
||||||
|
protected override void OnCreate(Bundle savedInstanceState)
|
||||||
|
{
|
||||||
|
base.OnCreate(savedInstanceState);
|
||||||
|
|
||||||
|
// See the comment in OsuGameActivity
|
||||||
|
Assembly.Load("osu.Game.Rulesets.Osu");
|
||||||
|
Assembly.Load("osu.Game.Rulesets.Taiko");
|
||||||
|
Assembly.Load("osu.Game.Rulesets.Catch");
|
||||||
|
Assembly.Load("osu.Game.Rulesets.Mania");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,88 +1,34 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\osu.Android.props" />
|
<Import Project="..\osu.Android.props" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<TargetFramework>net6.0-android</TargetFramework>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<OutputType>Exe</OutputType>
|
||||||
<ProductVersion>8.0.30703</ProductVersion>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
<ProjectGuid>{5CC222DC-5716-4499-B897-DCBDDA4A5CF9}</ProjectGuid>
|
|
||||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<TemplateGuid>{122416d6-6b49-4ee2-a1e8-b825f31c79fe}</TemplateGuid>
|
|
||||||
<RootNamespace>osu.Game.Tests</RootNamespace>
|
<RootNamespace>osu.Game.Tests</RootNamespace>
|
||||||
<AssemblyName>osu.Game.Tests.Android</AssemblyName>
|
<AssemblyName>osu.Game.Tests.Android</AssemblyName>
|
||||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
|
||||||
<AndroidSupportedAbis>armeabi-v7a;x86;arm64-v8a</AndroidSupportedAbis>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="MainActivity.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="Properties\AndroidManifest.xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<NoWarn>$(NoWarn);CA2007</NoWarn>
|
<NoWarn>$(NoWarn);CA2007</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<AndroidLinkMode>None</AndroidLinkMode>
|
|
||||||
<MandroidI18n>cjk;mideast;other;rare;west</MandroidI18n>
|
|
||||||
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="..\osu.Game.Tests\**\Beatmaps\**\*.cs">
|
<Compile Include="..\osu.Game.Tests\**\*.cs" Exclude="**\obj\**">
|
||||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Remove="..\osu.Game.Tests\Beatmaps\Formats\OsuJsonDecoderTest.cs" />
|
<!-- TargetPath is relative to RootNamespace,
|
||||||
<Compile Include="..\osu.Game.Tests\**\Chat\**\*.cs">
|
and DllResourceStore is relative to AssemblyName. -->
|
||||||
|
<EmbeddedResource Include="..\osu.Game.Tests\**\Resources\**\*">
|
||||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||||
</Compile>
|
<TargetPath>Android\%(RecursiveDir)%(Filename)%(Extension)</TargetPath>
|
||||||
<Compile Include="..\osu.Game.Tests\**\NonVisual\**\*.cs">
|
</EmbeddedResource>
|
||||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="..\osu.Game.Tests\**\Scores\**\*.cs">
|
|
||||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="..\osu.Game.Tests\**\ScrollAlgorithms\**\*.cs">
|
|
||||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="..\osu.Game.Tests\**\Visual\**\*.cs">
|
|
||||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="..\osu.Game.Tests\**\Resources\**\*.cs">
|
|
||||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="..\osu.Game.Tests\*.cs">
|
|
||||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj">
|
<ProjectReference Include="..\osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj" />
|
||||||
<Project>{58f6c80c-1253-4a0e-a465-b8c85ebeadf3}</Project>
|
<ProjectReference Include="..\osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj" />
|
||||||
<Name>osu.Game.Rulesets.Catch</Name>
|
<ProjectReference Include="..\osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj" />
|
||||||
</ProjectReference>
|
<ProjectReference Include="..\osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj" />
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj">
|
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||||
<Project>{48f4582b-7687-4621-9cbe-5c24197cb536}</Project>
|
|
||||||
<Name>osu.Game.Rulesets.Mania</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj">
|
|
||||||
<Project>{c92a607b-1fdd-4954-9f92-03ff547d9080}</Project>
|
|
||||||
<Name>osu.Game.Rulesets.Osu</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj">
|
|
||||||
<Project>{f167e17a-7de6-4af5-b920-a5112296c695}</Project>
|
|
||||||
<Name>osu.Game.Rulesets.Taiko</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj">
|
|
||||||
<Project>{2a66dd92-adb1-4994-89e2-c94e04acda0d}</Project>
|
|
||||||
<Name>osu.Game</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Package References">
|
<ItemGroup Label="Package References">
|
||||||
<PackageReference Include="DeepEqual" Version="2.0.0" />
|
<PackageReference Include="DeepEqual" Version="2.0.0" />
|
||||||
<PackageReference Include="Moq" Version="4.17.2" />
|
<PackageReference Include="Moq" Version="4.17.2" />
|
||||||
<PackageReference Include="System.Formats.Asn1">
|
|
||||||
<Version>5.0.0</Version>
|
|
||||||
</PackageReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
using osu.Framework.iOS;
|
|
||||||
using UIKit;
|
using UIKit;
|
||||||
|
|
||||||
namespace osu.Game.Tests.iOS
|
namespace osu.Game.Tests.iOS
|
||||||
@ -12,7 +11,7 @@ namespace osu.Game.Tests.iOS
|
|||||||
{
|
{
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
UIApplication.Main(args, typeof(GameUIApplication), typeof(AppDelegate));
|
UIApplication.Main(args, null, typeof(AppDelegate));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>MinimumOSVersion</key>
|
<key>MinimumOSVersion</key>
|
||||||
<string>10.0</string>
|
<string>13.4</string>
|
||||||
<key>UIDeviceFamily</key>
|
<key>UIDeviceFamily</key>
|
||||||
<array>
|
<array>
|
||||||
<integer>1</integer>
|
<integer>1</integer>
|
||||||
|
@ -1,54 +1,26 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<ProjectGuid>{65FF8E19-6934-469B-B690-23C6D6E56A17}</ProjectGuid>
|
<TargetFramework>net6.0-ios</TargetFramework>
|
||||||
|
<SupportedOSPlatformVersion>13.4</SupportedOSPlatformVersion>
|
||||||
<RootNamespace>osu.Game.Tests</RootNamespace>
|
<RootNamespace>osu.Game.Tests</RootNamespace>
|
||||||
<AssemblyName>osu.Game.Tests.iOS</AssemblyName>
|
<AssemblyName>osu.Game.Tests.iOS</AssemblyName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="..\osu.iOS.props" />
|
<Import Project="..\osu.iOS.props" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Info.plist" />
|
|
||||||
<None Include="Entitlements.plist" />
|
|
||||||
<LinkDescription Include="..\osu.iOS\Linker.xml">
|
|
||||||
<Link>Linker.xml</Link>
|
|
||||||
</LinkDescription>
|
|
||||||
<Compile Include="Application.cs" />
|
|
||||||
<Compile Include="AppDelegate.cs" />
|
|
||||||
<Compile Include="..\osu.Game.Tests\**\*.cs" Exclude="**\obj\**">
|
<Compile Include="..\osu.Game.Tests\**\*.cs" Exclude="**\obj\**">
|
||||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup>
|
|
||||||
<NoWarn>$(NoWarn);CA2007</NoWarn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup Label="Project References">
|
<ItemGroup Label="Project References">
|
||||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj">
|
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||||
<Project>{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}</Project>
|
<ProjectReference Include="..\osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj" />
|
||||||
<Name>osu.Game</Name>
|
<ProjectReference Include="..\osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj" />
|
||||||
</ProjectReference>
|
<ProjectReference Include="..\osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj" />
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj">
|
<ProjectReference Include="..\osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj" />
|
||||||
<Project>{C92A607B-1FDD-4954-9F92-03FF547D9080}</Project>
|
|
||||||
<Name>osu.Game.Rulesets.Osu</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj">
|
|
||||||
<Project>{58F6C80C-1253-4A0E-A465-B8C85EBEADF3}</Project>
|
|
||||||
<Name>osu.Game.Rulesets.Catch</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj">
|
|
||||||
<Project>{48F4582B-7687-4621-9CBE-5C24197CB536}</Project>
|
|
||||||
<Name>osu.Game.Rulesets.Mania</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj">
|
|
||||||
<Project>{F167E17A-7DE6-4AF5-B920-A5112296C695}</Project>
|
|
||||||
<Name>osu.Game.Rulesets.Taiko</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Package References">
|
<ItemGroup Label="Package References">
|
||||||
<PackageReference Include="DeepEqual" Version="2.0.0" />
|
<PackageReference Include="DeepEqual" Version="2.0.0" />
|
||||||
<PackageReference Include="Moq" Version="4.17.2" />
|
<PackageReference Include="Moq" Version="4.17.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -26,6 +26,16 @@ namespace osu.Game.Tests.Chat
|
|||||||
MessageFormatter.WebsiteRootUrl = originalWebsiteRootUrl;
|
MessageFormatter.WebsiteRootUrl = originalWebsiteRootUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestUnsupportedProtocolLink()
|
||||||
|
{
|
||||||
|
Message result = MessageFormatter.FormatMessage(new Message { Content = "This is a gopher://really-old-protocol we don't support." });
|
||||||
|
|
||||||
|
Assert.AreEqual(result.Content, result.DisplayContent);
|
||||||
|
Assert.AreEqual(1, result.Links.Count);
|
||||||
|
Assert.AreEqual("gopher://really-old-protocol", result.Links[0].Url);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestBareLink()
|
public void TestBareLink()
|
||||||
{
|
{
|
||||||
|
@ -189,7 +189,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
if (request is not CommentDeleteRequest req)
|
if (request is not CommentDeleteRequest req)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
req.TriggerFailure(new Exception());
|
req.TriggerFailure(new InvalidOperationException());
|
||||||
delete = true;
|
delete = true;
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
@ -136,7 +136,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
|
|
||||||
if (testRequest.Progress >= 0.5f)
|
if (testRequest.Progress >= 0.5f)
|
||||||
{
|
{
|
||||||
testRequest.TriggerFailure(new Exception());
|
testRequest.TriggerFailure(new InvalidOperationException());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -245,8 +245,10 @@ namespace osu.Game.Tournament.IPC
|
|||||||
{
|
{
|
||||||
string stableInstallPath;
|
string stableInstallPath;
|
||||||
|
|
||||||
|
#pragma warning disable CA1416
|
||||||
using (RegistryKey key = Registry.ClassesRoot.OpenSubKey("osu"))
|
using (RegistryKey key = Registry.ClassesRoot.OpenSubKey("osu"))
|
||||||
stableInstallPath = key?.OpenSubKey(@"shell\open\command")?.GetValue(string.Empty)?.ToString()?.Split('"')[1].Replace("osu!.exe", "");
|
stableInstallPath = key?.OpenSubKey(@"shell\open\command")?.GetValue(string.Empty)?.ToString()?.Split('"')[1].Replace("osu!.exe", "");
|
||||||
|
#pragma warning restore CA1416
|
||||||
|
|
||||||
if (ipcFileExistsInDirectory(stableInstallPath))
|
if (ipcFileExistsInDirectory(stableInstallPath))
|
||||||
return stableInstallPath;
|
return stableInstallPath;
|
||||||
|
@ -70,7 +70,7 @@ namespace osu.Game.Tournament
|
|||||||
|
|
||||||
private async Task checkForChanges()
|
private async Task checkForChanges()
|
||||||
{
|
{
|
||||||
string serialisedLadder = await Task.Run(() => tournamentGame.GetSerialisedLadder());
|
string serialisedLadder = await Task.Run(() => tournamentGame.GetSerialisedLadder()).ConfigureAwait(false);
|
||||||
|
|
||||||
// If a save hasn't been triggered by the user yet, populate the initial value
|
// If a save hasn't been triggered by the user yet, populate the initial value
|
||||||
lastSerialisedLadder ??= serialisedLadder;
|
lastSerialisedLadder ??= serialisedLadder;
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
@ -54,8 +53,6 @@ namespace osu.Game.Tournament.Screens.Editors
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Assert(countries != null);
|
|
||||||
|
|
||||||
foreach (var c in countries)
|
foreach (var c in countries)
|
||||||
Storage.Add(c);
|
Storage.Add(c);
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
@ -102,10 +103,14 @@ namespace osu.Game.Tournament.Screens.Editors
|
|||||||
switch (args.Action)
|
switch (args.Action)
|
||||||
{
|
{
|
||||||
case NotifyCollectionChangedAction.Add:
|
case NotifyCollectionChangedAction.Add:
|
||||||
|
Debug.Assert(args.NewItems != null);
|
||||||
|
|
||||||
args.NewItems.Cast<TModel>().ForEach(i => flow.Add(CreateDrawable(i)));
|
args.NewItems.Cast<TModel>().ForEach(i => flow.Add(CreateDrawable(i)));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NotifyCollectionChangedAction.Remove:
|
case NotifyCollectionChangedAction.Remove:
|
||||||
|
Debug.Assert(args.OldItems != null);
|
||||||
|
|
||||||
args.OldItems.Cast<TModel>().ForEach(i => flow.RemoveAll(d => d.Model == i, true));
|
args.OldItems.Cast<TModel>().ForEach(i => flow.RemoveAll(d => d.Model == i, true));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
@ -20,8 +21,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
|
|||||||
{
|
{
|
||||||
public partial class LadderEditorSettings : PlayerSettingsGroup
|
public partial class LadderEditorSettings : PlayerSettingsGroup
|
||||||
{
|
{
|
||||||
private const int padding = 10;
|
|
||||||
|
|
||||||
private SettingsDropdown<TournamentRound> roundDropdown;
|
private SettingsDropdown<TournamentRound> roundDropdown;
|
||||||
private PlayerCheckbox losersCheckbox;
|
private PlayerCheckbox losersCheckbox;
|
||||||
private DateTextBox dateTimeBox;
|
private DateTextBox dateTimeBox;
|
||||||
@ -103,10 +102,14 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
|
|||||||
switch (args.Action)
|
switch (args.Action)
|
||||||
{
|
{
|
||||||
case NotifyCollectionChangedAction.Add:
|
case NotifyCollectionChangedAction.Add:
|
||||||
|
Debug.Assert(args.NewItems != null);
|
||||||
|
|
||||||
args.NewItems.Cast<TournamentRound>().ForEach(add);
|
args.NewItems.Cast<TournamentRound>().ForEach(add);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NotifyCollectionChangedAction.Remove:
|
case NotifyCollectionChangedAction.Remove:
|
||||||
|
Debug.Assert(args.OldItems != null);
|
||||||
|
|
||||||
args.OldItems.Cast<TournamentRound>().ForEach(i => Control.RemoveDropdownItem(i));
|
args.OldItems.Cast<TournamentRound>().ForEach(i => Control.RemoveDropdownItem(i));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
@ -25,10 +26,14 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
|
|||||||
switch (args.Action)
|
switch (args.Action)
|
||||||
{
|
{
|
||||||
case NotifyCollectionChangedAction.Add:
|
case NotifyCollectionChangedAction.Add:
|
||||||
|
Debug.Assert(args.NewItems != null);
|
||||||
|
|
||||||
args.NewItems.Cast<TournamentTeam>().ForEach(add);
|
args.NewItems.Cast<TournamentTeam>().ForEach(add);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NotifyCollectionChangedAction.Remove:
|
case NotifyCollectionChangedAction.Remove:
|
||||||
|
Debug.Assert(args.OldItems != null);
|
||||||
|
|
||||||
args.OldItems.Cast<TournamentTeam>().ForEach(i => Control.RemoveDropdownItem(i));
|
args.OldItems.Cast<TournamentTeam>().ForEach(i => Control.RemoveDropdownItem(i));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Caching;
|
using osu.Framework.Caching;
|
||||||
@ -81,11 +82,15 @@ namespace osu.Game.Tournament.Screens.Ladder
|
|||||||
switch (args.Action)
|
switch (args.Action)
|
||||||
{
|
{
|
||||||
case NotifyCollectionChangedAction.Add:
|
case NotifyCollectionChangedAction.Add:
|
||||||
|
Debug.Assert(args.NewItems != null);
|
||||||
|
|
||||||
foreach (var p in args.NewItems.Cast<TournamentMatch>())
|
foreach (var p in args.NewItems.Cast<TournamentMatch>())
|
||||||
addMatch(p);
|
addMatch(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NotifyCollectionChangedAction.Remove:
|
case NotifyCollectionChangedAction.Remove:
|
||||||
|
Debug.Assert(args.OldItems != null);
|
||||||
|
|
||||||
foreach (var p in args.OldItems.Cast<TournamentMatch>())
|
foreach (var p in args.OldItems.Cast<TournamentMatch>())
|
||||||
{
|
{
|
||||||
foreach (var d in MatchesContainer.Where(d => d.Match == p))
|
foreach (var d in MatchesContainer.Where(d => d.Match == p))
|
||||||
@ -153,7 +158,7 @@ namespace osu.Game.Tournament.Screens.Ladder
|
|||||||
|
|
||||||
foreach (var round in LadderInfo.Rounds)
|
foreach (var round in LadderInfo.Rounds)
|
||||||
{
|
{
|
||||||
var topMatch = MatchesContainer.Where(p => !p.Match.Losers.Value && p.Match.Round.Value == round).OrderBy(p => p.Y).FirstOrDefault();
|
var topMatch = MatchesContainer.Where(p => !p.Match.Losers.Value && p.Match.Round.Value == round).MinBy(p => p.Y);
|
||||||
|
|
||||||
if (topMatch == null) continue;
|
if (topMatch == null) continue;
|
||||||
|
|
||||||
@ -167,7 +172,7 @@ namespace osu.Game.Tournament.Screens.Ladder
|
|||||||
|
|
||||||
foreach (var round in LadderInfo.Rounds)
|
foreach (var round in LadderInfo.Rounds)
|
||||||
{
|
{
|
||||||
var topMatch = MatchesContainer.Where(p => p.Match.Losers.Value && p.Match.Round.Value == round).OrderBy(p => p.Y).FirstOrDefault();
|
var topMatch = MatchesContainer.Where(p => p.Match.Losers.Value && p.Match.Round.Value == round).MinBy(p => p.Y);
|
||||||
|
|
||||||
if (topMatch == null) continue;
|
if (topMatch == null) continue;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup Label="Project">
|
<PropertyGroup Label="Project">
|
||||||
<TargetFramework>netstandard2.1</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<Description>tools for tournaments.</Description>
|
<Description>tools for tournaments.</Description>
|
||||||
@ -11,4 +11,4 @@
|
|||||||
<ItemGroup Label="Package References">
|
<ItemGroup Label="Package References">
|
||||||
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
|
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Audio
|
|||||||
public bool Equals(SampleInfo? other)
|
public bool Equals(SampleInfo? other)
|
||||||
=> other != null && sampleNames.SequenceEqual(other.sampleNames);
|
=> other != null && sampleNames.SequenceEqual(other.sampleNames);
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object? obj)
|
||||||
=> obj is SampleInfo other && Equals(other);
|
=> obj is SampleInfo other && Equals(other);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
public override async Task<Live<BeatmapSetInfo>?> ImportAsUpdate(ProgressNotification notification, ImportTask importTask, BeatmapSetInfo original)
|
public override async Task<Live<BeatmapSetInfo>?> ImportAsUpdate(ProgressNotification notification, ImportTask importTask, BeatmapSetInfo original)
|
||||||
{
|
{
|
||||||
var imported = await Import(notification, new[] { importTask });
|
var imported = await Import(notification, new[] { importTask }).ConfigureAwait(true);
|
||||||
|
|
||||||
if (!imported.Any())
|
if (!imported.Any())
|
||||||
return null;
|
return null;
|
||||||
|
@ -178,7 +178,7 @@ namespace osu.Game.Beatmaps
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await cacheDownloadRequest.PerformAsync();
|
await cacheDownloadRequest.PerformAsync().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
|
|
||||||
public void AttachGroup(ControlPointGroup pointGroup) => Time = pointGroup.Time;
|
public void AttachGroup(ControlPointGroup pointGroup) => Time = pointGroup.Time;
|
||||||
|
|
||||||
public int CompareTo(ControlPoint other) => Time.CompareTo(other.Time);
|
public int CompareTo(ControlPoint? other) => Time.CompareTo(other?.Time);
|
||||||
|
|
||||||
public virtual Color4 GetRepresentingColour(OsuColour colours) => colours.Yellow;
|
public virtual Color4 GetRepresentingColour(OsuColour colours) => colours.Yellow;
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ControlPoint DeepClone()
|
public ControlPoint DeepClone()
|
||||||
{
|
{
|
||||||
var copy = (ControlPoint)Activator.CreateInstance(GetType());
|
var copy = (ControlPoint)Activator.CreateInstance(GetType())!;
|
||||||
|
|
||||||
copy.CopyFrom(this);
|
copy.CopyFrom(this);
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
Time = time;
|
Time = time;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int CompareTo(ControlPointGroup other) => Time.CompareTo(other.Time);
|
public int CompareTo(ControlPointGroup? other) => Time.CompareTo(other?.Time);
|
||||||
|
|
||||||
public void Add(ControlPoint point)
|
public void Add(ControlPoint point)
|
||||||
{
|
{
|
||||||
|
@ -70,14 +70,14 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public double BPMMaximum =>
|
public double BPMMaximum =>
|
||||||
60000 / (TimingPoints.OrderBy(c => c.BeatLength).FirstOrDefault() ?? TimingControlPoint.DEFAULT).BeatLength;
|
60000 / (TimingPoints.MinBy(c => c.BeatLength) ?? TimingControlPoint.DEFAULT).BeatLength;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Finds the minimum BPM represented by any timing control point.
|
/// Finds the minimum BPM represented by any timing control point.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public double BPMMinimum =>
|
public double BPMMinimum =>
|
||||||
60000 / (TimingPoints.OrderByDescending(c => c.BeatLength).FirstOrDefault() ?? TimingControlPoint.DEFAULT).BeatLength;
|
60000 / (TimingPoints.MaxBy(c => c.BeatLength) ?? TimingControlPoint.DEFAULT).BeatLength;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Remove all <see cref="ControlPointGroup"/>s and return to a pristine state.
|
/// Remove all <see cref="ControlPointGroup"/>s and return to a pristine state.
|
||||||
@ -300,7 +300,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
|
|
||||||
public ControlPointInfo DeepClone()
|
public ControlPointInfo DeepClone()
|
||||||
{
|
{
|
||||||
var controlPointInfo = (ControlPointInfo)Activator.CreateInstance(GetType());
|
var controlPointInfo = (ControlPointInfo)Activator.CreateInstance(GetType())!;
|
||||||
|
|
||||||
foreach (var point in AllControlPoints)
|
foreach (var point in AllControlPoints)
|
||||||
controlPointInfo.Add(point.Time, point.DeepClone());
|
controlPointInfo.Add(point.Time, point.DeepClone());
|
||||||
|
@ -51,11 +51,11 @@ namespace osu.Game.Beatmaps
|
|||||||
if (!recommendedDifficultyMapping.TryGetValue(r, out double recommendation))
|
if (!recommendedDifficultyMapping.TryGetValue(r, out double recommendation))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
BeatmapInfo beatmapInfo = beatmaps.Where(b => b.Ruleset.ShortName.Equals(r)).OrderBy(b =>
|
BeatmapInfo beatmapInfo = beatmaps.Where(b => b.Ruleset.ShortName.Equals(r, StringComparison.Ordinal)).MinBy(b =>
|
||||||
{
|
{
|
||||||
double difference = b.StarRating - recommendation;
|
double difference = b.StarRating - recommendation;
|
||||||
return difference >= 0 ? difference * 2 : difference * -1; // prefer easier over harder
|
return difference >= 0 ? difference * 2 : difference * -1; // prefer easier over harder
|
||||||
}).FirstOrDefault();
|
});
|
||||||
|
|
||||||
if (beatmapInfo != null)
|
if (beatmapInfo != null)
|
||||||
return beatmapInfo;
|
return beatmapInfo;
|
||||||
@ -90,7 +90,7 @@ namespace osu.Game.Beatmaps
|
|||||||
return recommendedDifficultyMapping
|
return recommendedDifficultyMapping
|
||||||
.OrderByDescending(pair => pair.Value)
|
.OrderByDescending(pair => pair.Value)
|
||||||
.Select(pair => pair.Key)
|
.Select(pair => pair.Key)
|
||||||
.Where(r => !r.Equals(ruleset.Value.ShortName))
|
.Where(r => !r.Equals(ruleset.Value.ShortName, StringComparison.Ordinal))
|
||||||
.Prepend(ruleset.Value.ShortName);
|
.Prepend(ruleset.Value.ShortName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,15 +91,15 @@ namespace osu.Game.Configuration
|
|||||||
OrderPosition = orderPosition;
|
OrderPosition = orderPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int CompareTo(SettingSourceAttribute other)
|
public int CompareTo(SettingSourceAttribute? other)
|
||||||
{
|
{
|
||||||
if (OrderPosition == other.OrderPosition)
|
if (OrderPosition == other?.OrderPosition)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// unordered items come last (are greater than any ordered items).
|
// unordered items come last (are greater than any ordered items).
|
||||||
if (OrderPosition == null)
|
if (OrderPosition == null)
|
||||||
return 1;
|
return 1;
|
||||||
if (other.OrderPosition == null)
|
if (other?.OrderPosition == null)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
// ordered items are sorted by the order value.
|
// ordered items are sorted by the order value.
|
||||||
@ -113,7 +113,7 @@ namespace osu.Game.Configuration
|
|||||||
{
|
{
|
||||||
foreach (var (attr, property) in obj.GetOrderedSettingsSourceProperties())
|
foreach (var (attr, property) in obj.GetOrderedSettingsSourceProperties())
|
||||||
{
|
{
|
||||||
object value = property.GetValue(obj);
|
object value = property.GetValue(obj)!;
|
||||||
|
|
||||||
if (attr.SettingControlType != null)
|
if (attr.SettingControlType != null)
|
||||||
{
|
{
|
||||||
@ -121,7 +121,7 @@ namespace osu.Game.Configuration
|
|||||||
if (controlType.EnumerateBaseTypes().All(t => !t.IsGenericType || t.GetGenericTypeDefinition() != typeof(SettingsItem<>)))
|
if (controlType.EnumerateBaseTypes().All(t => !t.IsGenericType || t.GetGenericTypeDefinition() != typeof(SettingsItem<>)))
|
||||||
throw new InvalidOperationException($"{nameof(SettingSourceAttribute)} had an unsupported custom control type ({controlType.ReadableName()})");
|
throw new InvalidOperationException($"{nameof(SettingSourceAttribute)} had an unsupported custom control type ({controlType.ReadableName()})");
|
||||||
|
|
||||||
var control = (Drawable)Activator.CreateInstance(controlType);
|
var control = (Drawable)Activator.CreateInstance(controlType)!;
|
||||||
controlType.GetProperty(nameof(SettingsItem<object>.SettingSourceObject))?.SetValue(control, obj);
|
controlType.GetProperty(nameof(SettingsItem<object>.SettingSourceObject))?.SetValue(control, obj);
|
||||||
controlType.GetProperty(nameof(SettingsItem<object>.LabelText))?.SetValue(control, attr.Label);
|
controlType.GetProperty(nameof(SettingsItem<object>.LabelText))?.SetValue(control, attr.Label);
|
||||||
controlType.GetProperty(nameof(SettingsItem<object>.TooltipText))?.SetValue(control, attr.Description);
|
controlType.GetProperty(nameof(SettingsItem<object>.TooltipText))?.SetValue(control, attr.Description);
|
||||||
@ -188,7 +188,7 @@ namespace osu.Game.Configuration
|
|||||||
|
|
||||||
case IBindable bindable:
|
case IBindable bindable:
|
||||||
var dropdownType = typeof(ModSettingsEnumDropdown<>).MakeGenericType(bindable.GetType().GetGenericArguments()[0]);
|
var dropdownType = typeof(ModSettingsEnumDropdown<>).MakeGenericType(bindable.GetType().GetGenericArguments()[0]);
|
||||||
var dropdown = (Drawable)Activator.CreateInstance(dropdownType);
|
var dropdown = (Drawable)Activator.CreateInstance(dropdownType)!;
|
||||||
|
|
||||||
dropdownType.GetProperty(nameof(SettingsDropdown<object>.LabelText))?.SetValue(dropdown, attr.Label);
|
dropdownType.GetProperty(nameof(SettingsDropdown<object>.LabelText))?.SetValue(dropdown, attr.Label);
|
||||||
dropdownType.GetProperty(nameof(SettingsDropdown<object>.TooltipText))?.SetValue(dropdown, attr.Description);
|
dropdownType.GetProperty(nameof(SettingsDropdown<object>.TooltipText))?.SetValue(dropdown, attr.Description);
|
||||||
@ -231,7 +231,7 @@ namespace osu.Game.Configuration
|
|||||||
// An unknown (e.g. enum) generic type.
|
// An unknown (e.g. enum) generic type.
|
||||||
var valueMethod = u.GetType().GetProperty(nameof(IBindable<int>.Value));
|
var valueMethod = u.GetType().GetProperty(nameof(IBindable<int>.Value));
|
||||||
Debug.Assert(valueMethod != null);
|
Debug.Assert(valueMethod != null);
|
||||||
return valueMethod.GetValue(u);
|
return valueMethod.GetValue(u)!;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// fall back for non-bindable cases.
|
// fall back for non-bindable cases.
|
||||||
|
@ -79,16 +79,16 @@ namespace osu.Game.Database
|
|||||||
switch (content)
|
switch (content)
|
||||||
{
|
{
|
||||||
case StableContent.Beatmaps:
|
case StableContent.Beatmaps:
|
||||||
return await new LegacyBeatmapImporter(beatmaps).GetAvailableCount(stableStorage);
|
return await new LegacyBeatmapImporter(beatmaps).GetAvailableCount(stableStorage).ConfigureAwait(false);
|
||||||
|
|
||||||
case StableContent.Skins:
|
case StableContent.Skins:
|
||||||
return await new LegacySkinImporter(skins).GetAvailableCount(stableStorage);
|
return await new LegacySkinImporter(skins).GetAvailableCount(stableStorage).ConfigureAwait(false);
|
||||||
|
|
||||||
case StableContent.Collections:
|
case StableContent.Collections:
|
||||||
return await new LegacyCollectionImporter(realmAccess).GetAvailableCount(stableStorage);
|
return await new LegacyCollectionImporter(realmAccess).GetAvailableCount(stableStorage).ConfigureAwait(false);
|
||||||
|
|
||||||
case StableContent.Scores:
|
case StableContent.Scores:
|
||||||
return await new LegacyScoreImporter(scores).GetAvailableCount(stableStorage);
|
return await new LegacyScoreImporter(scores).GetAvailableCount(stableStorage).ConfigureAwait(false);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new ArgumentException($"Only one {nameof(StableContent)} flag should be specified.");
|
throw new ArgumentException($"Only one {nameof(StableContent)} flag should be specified.");
|
||||||
|
@ -61,6 +61,6 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
public override int GetHashCode() => HashCode.Combine(ID);
|
public override int GetHashCode() => HashCode.Combine(ID);
|
||||||
|
|
||||||
public override string ToString() => PerformRead(i => i.ToString());
|
public override string? ToString() => PerformRead(i => i.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,9 +71,9 @@ namespace osu.Game.Database
|
|||||||
bool importSuccessful;
|
bool importSuccessful;
|
||||||
|
|
||||||
if (originalModel != null)
|
if (originalModel != null)
|
||||||
importSuccessful = (await importer.ImportAsUpdate(notification, new ImportTask(filename), originalModel)) != null;
|
importSuccessful = (await importer.ImportAsUpdate(notification, new ImportTask(filename), originalModel).ConfigureAwait(false)) != null;
|
||||||
else
|
else
|
||||||
importSuccessful = (await importer.Import(notification, new[] { new ImportTask(filename) })).Any();
|
importSuccessful = (await importer.Import(notification, new[] { new ImportTask(filename) }).ConfigureAwait(false)).Any();
|
||||||
|
|
||||||
// for now a failed import will be marked as a failed download for simplicity.
|
// for now a failed import will be marked as a failed download for simplicity.
|
||||||
if (!importSuccessful)
|
if (!importSuccessful)
|
||||||
|
@ -481,7 +481,7 @@ namespace osu.Game.Database
|
|||||||
// server, which we don't use. May want to report upstream or revisit in the future.
|
// server, which we don't use. May want to report upstream or revisit in the future.
|
||||||
using (var realm = getRealmInstance())
|
using (var realm = getRealmInstance())
|
||||||
// ReSharper disable once AccessToDisposedClosure (WriteAsync should be marked as [InstantHandle]).
|
// ReSharper disable once AccessToDisposedClosure (WriteAsync should be marked as [InstantHandle]).
|
||||||
await realm.WriteAsync(() => action(realm));
|
await realm.WriteAsync(() => action(realm)).ConfigureAwait(false);
|
||||||
|
|
||||||
pendingAsyncWrites.Signal();
|
pendingAsyncWrites.Signal();
|
||||||
});
|
});
|
||||||
@ -558,7 +558,7 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
return new InvokeOnDisposal(() => model.PropertyChanged -= onPropertyChanged);
|
return new InvokeOnDisposal(() => model.PropertyChanged -= onPropertyChanged);
|
||||||
|
|
||||||
void onPropertyChanged(object sender, PropertyChangedEventArgs args)
|
void onPropertyChanged(object? sender, PropertyChangedEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.PropertyName == propertyName)
|
if (args.PropertyName == propertyName)
|
||||||
onChanged(propLookupCompiled(model));
|
onChanged(propLookupCompiled(model));
|
||||||
|
@ -66,10 +66,10 @@ namespace osu.Game.Extensions
|
|||||||
|
|
||||||
foreach (var (_, property) in component.GetSettingsSourceProperties())
|
foreach (var (_, property) in component.GetSettingsSourceProperties())
|
||||||
{
|
{
|
||||||
if (!info.Settings.TryGetValue(property.Name.ToSnakeCase(), out object settingValue))
|
if (!info.Settings.TryGetValue(property.Name.ToSnakeCase(), out object? settingValue))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
skinnable.CopyAdjustedSetting((IBindable)property.GetValue(component), settingValue);
|
skinnable.CopyAdjustedSetting(((IBindable)property.GetValue(component)!), settingValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ namespace osu.Game.Extensions
|
|||||||
|
|
||||||
if (cancellationToken.IsCancellationRequested)
|
if (cancellationToken.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
tcs.SetCanceled();
|
tcs.SetCanceled(cancellationToken);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -277,7 +277,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
var samples = sampleMap[feedbackSampleType];
|
var samples = sampleMap[feedbackSampleType];
|
||||||
|
|
||||||
if (samples == null || samples.Length == 0)
|
if (samples.Length == 0)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return samples[RNG.Next(0, samples.Length)]?.GetChannel();
|
return samples[RNG.Next(0, samples.Length)]?.GetChannel();
|
||||||
|
@ -63,7 +63,7 @@ namespace osu.Game.IO.Serialization.Converters
|
|||||||
throw new JsonException("Expected $type token.");
|
throw new JsonException("Expected $type token.");
|
||||||
|
|
||||||
string typeName = lookupTable[(int)tok["$type"]];
|
string typeName = lookupTable[(int)tok["$type"]];
|
||||||
var instance = (T)Activator.CreateInstance(Type.GetType(typeName).AsNonNull());
|
var instance = (T)Activator.CreateInstance(Type.GetType(typeName).AsNonNull())!;
|
||||||
serializer.Populate(itemReader, instance);
|
serializer.Populate(itemReader, instance);
|
||||||
|
|
||||||
list.Add(instance);
|
list.Add(instance);
|
||||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Models
|
|||||||
|
|
||||||
public bool IsBot => false;
|
public bool IsBot => false;
|
||||||
|
|
||||||
public bool Equals(RealmUser other)
|
public bool Equals(RealmUser? other)
|
||||||
{
|
{
|
||||||
if (ReferenceEquals(null, other)) return false;
|
if (ReferenceEquals(null, other)) return false;
|
||||||
if (ReferenceEquals(this, other)) return true;
|
if (ReferenceEquals(this, other)) return true;
|
||||||
|
@ -39,7 +39,7 @@ namespace osu.Game.Online.API
|
|||||||
|
|
||||||
foreach (var (_, property) in mod.GetSettingsSourceProperties())
|
foreach (var (_, property) in mod.GetSettingsSourceProperties())
|
||||||
{
|
{
|
||||||
var bindable = (IBindable)property.GetValue(mod);
|
var bindable = (IBindable)property.GetValue(mod)!;
|
||||||
|
|
||||||
if (!bindable.IsDefault)
|
if (!bindable.IsDefault)
|
||||||
Settings.Add(property.Name.ToSnakeCase(), bindable.GetUnderlyingSettingValue());
|
Settings.Add(property.Name.ToSnakeCase(), bindable.GetUnderlyingSettingValue());
|
||||||
@ -60,16 +60,16 @@ namespace osu.Game.Online.API
|
|||||||
{
|
{
|
||||||
foreach (var (_, property) in resultMod.GetSettingsSourceProperties())
|
foreach (var (_, property) in resultMod.GetSettingsSourceProperties())
|
||||||
{
|
{
|
||||||
if (!Settings.TryGetValue(property.Name.ToSnakeCase(), out object settingValue))
|
if (!Settings.TryGetValue(property.Name.ToSnakeCase(), out object? settingValue))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
resultMod.CopyAdjustedSetting((IBindable)property.GetValue(resultMod), settingValue);
|
resultMod.CopyAdjustedSetting((IBindable)property.GetValue(resultMod)!, settingValue);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.Log($"Failed to copy mod setting value '{settingValue ?? "null"}' to \"{property.Name}\": {ex.Message}");
|
Logger.Log($"Failed to copy mod setting value '{settingValue}' to \"{property.Name}\": {ex.Message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -79,7 +79,7 @@ namespace osu.Game.Online.API
|
|||||||
|
|
||||||
public bool ShouldSerializeSettings() => Settings.Count > 0;
|
public bool ShouldSerializeSettings() => Settings.Count > 0;
|
||||||
|
|
||||||
public bool Equals(APIMod other)
|
public bool Equals(APIMod? other)
|
||||||
{
|
{
|
||||||
if (ReferenceEquals(null, other)) return false;
|
if (ReferenceEquals(null, other)) return false;
|
||||||
if (ReferenceEquals(this, other)) return true;
|
if (ReferenceEquals(this, other)) return true;
|
||||||
|
@ -143,7 +143,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
|
|
||||||
public bool Equals(IRulesetInfo? other) => other is APIRuleset r && this.MatchesOnlineID(r);
|
public bool Equals(IRulesetInfo? other) => other is APIRuleset r && this.MatchesOnlineID(r);
|
||||||
|
|
||||||
public int CompareTo(IRulesetInfo other)
|
public int CompareTo(IRulesetInfo? other)
|
||||||
{
|
{
|
||||||
if (!(other is APIRuleset ruleset))
|
if (!(other is APIRuleset ruleset))
|
||||||
throw new ArgumentException($@"Object is not of type {nameof(APIRuleset)}.", nameof(other));
|
throw new ArgumentException($@"Object is not of type {nameof(APIRuleset)}.", nameof(other));
|
||||||
|
@ -71,7 +71,7 @@ namespace osu.Game.Online.Chat
|
|||||||
{
|
{
|
||||||
int index = m.Index - captureOffset;
|
int index = m.Index - captureOffset;
|
||||||
|
|
||||||
string? displayText = string.Format(display,
|
string displayText = string.Format(display,
|
||||||
m.Groups[0],
|
m.Groups[0],
|
||||||
m.Groups["text"].Value,
|
m.Groups["text"].Value,
|
||||||
m.Groups["url"].Value).Trim();
|
m.Groups["url"].Value).Trim();
|
||||||
@ -109,7 +109,7 @@ namespace osu.Game.Online.Chat
|
|||||||
foreach (Match m in regex.Matches(result.Text, startIndex))
|
foreach (Match m in regex.Matches(result.Text, startIndex))
|
||||||
{
|
{
|
||||||
int index = m.Index;
|
int index = m.Index;
|
||||||
string? linkText = m.Groups["link"].Value;
|
string linkText = m.Groups["link"].Value;
|
||||||
int indexLength = linkText.Length;
|
int indexLength = linkText.Length;
|
||||||
|
|
||||||
var details = GetLinkDetails(linkText);
|
var details = GetLinkDetails(linkText);
|
||||||
@ -125,7 +125,7 @@ namespace osu.Game.Online.Chat
|
|||||||
|
|
||||||
public static LinkDetails GetLinkDetails(string url)
|
public static LinkDetails GetLinkDetails(string url)
|
||||||
{
|
{
|
||||||
string[]? args = url.Split('/', StringSplitOptions.RemoveEmptyEntries);
|
string[] args = url.Split('/', StringSplitOptions.RemoveEmptyEntries);
|
||||||
args[0] = args[0].TrimEnd(':');
|
args[0] = args[0].TrimEnd(':');
|
||||||
|
|
||||||
switch (args[0])
|
switch (args[0])
|
||||||
@ -362,6 +362,6 @@ namespace osu.Game.Online.Chat
|
|||||||
|
|
||||||
public bool Overlaps(Link otherLink) => Index < otherLink.Index + otherLink.Length && otherLink.Index < Index + Length;
|
public bool Overlaps(Link otherLink) => Index < otherLink.Index + otherLink.Length && otherLink.Index < Index + Length;
|
||||||
|
|
||||||
public int CompareTo(Link otherLink) => Index > otherLink.Index ? 1 : -1;
|
public int CompareTo(Link? otherLink) => Index > otherLink?.Index ? 1 : -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -61,12 +62,16 @@ namespace osu.Game.Online.Chat
|
|||||||
switch (e.Action)
|
switch (e.Action)
|
||||||
{
|
{
|
||||||
case NotifyCollectionChangedAction.Add:
|
case NotifyCollectionChangedAction.Add:
|
||||||
|
Debug.Assert(e.NewItems != null);
|
||||||
|
|
||||||
foreach (var channel in e.NewItems.Cast<Channel>())
|
foreach (var channel in e.NewItems.Cast<Channel>())
|
||||||
channel.NewMessagesArrived += checkNewMessages;
|
channel.NewMessagesArrived += checkNewMessages;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NotifyCollectionChangedAction.Remove:
|
case NotifyCollectionChangedAction.Remove:
|
||||||
|
Debug.Assert(e.OldItems != null);
|
||||||
|
|
||||||
foreach (var channel in e.OldItems.Cast<Channel>())
|
foreach (var channel in e.OldItems.Cast<Channel>())
|
||||||
channel.NewMessagesArrived -= checkNewMessages;
|
channel.NewMessagesArrived -= checkNewMessages;
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.SignalR.Client;
|
using Microsoft.AspNetCore.SignalR.Client;
|
||||||
@ -59,17 +60,21 @@ namespace osu.Game.Online
|
|||||||
var builder = new HubConnectionBuilder()
|
var builder = new HubConnectionBuilder()
|
||||||
.WithUrl(endpoint, options =>
|
.WithUrl(endpoint, options =>
|
||||||
{
|
{
|
||||||
// Use HttpClient.DefaultProxy once on net6 everywhere.
|
// Configuring proxies is not supported on iOS, see https://github.com/xamarin/xamarin-macios/issues/14632.
|
||||||
// The credential setter can also be removed at this point.
|
if (RuntimeInfo.OS != RuntimeInfo.Platform.iOS)
|
||||||
options.Proxy = WebRequest.DefaultWebProxy;
|
{
|
||||||
if (options.Proxy != null)
|
// Use HttpClient.DefaultProxy once on net6 everywhere.
|
||||||
options.Proxy.Credentials = CredentialCache.DefaultCredentials;
|
// The credential setter can also be removed at this point.
|
||||||
|
options.Proxy = WebRequest.DefaultWebProxy;
|
||||||
|
if (options.Proxy != null)
|
||||||
|
options.Proxy.Credentials = CredentialCache.DefaultCredentials;
|
||||||
|
}
|
||||||
|
|
||||||
options.Headers.Add("Authorization", $"Bearer {api.AccessToken}");
|
options.Headers.Add("Authorization", $"Bearer {api.AccessToken}");
|
||||||
options.Headers.Add("OsuVersionHash", versionHash);
|
options.Headers.Add("OsuVersionHash", versionHash);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (RuntimeInfo.SupportsJIT && preferMessagePack)
|
if (RuntimeFeature.IsDynamicCodeCompiled && preferMessagePack)
|
||||||
{
|
{
|
||||||
builder.AddMessagePackProtocol(options =>
|
builder.AddMessagePackProtocol(options =>
|
||||||
{
|
{
|
||||||
|
@ -68,7 +68,7 @@ namespace osu.Game.Online.Metadata
|
|||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
Logger.Log($"Requesting catch-up from {lastQueueId.Value}");
|
Logger.Log($"Requesting catch-up from {lastQueueId.Value}");
|
||||||
var catchUpChanges = await GetChangesSince(lastQueueId.Value);
|
var catchUpChanges = await GetChangesSince(lastQueueId.Value).ConfigureAwait(true);
|
||||||
|
|
||||||
lastQueueId.Value = catchUpChanges.LastProcessedQueueID;
|
lastQueueId.Value = catchUpChanges.LastProcessedQueueID;
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ namespace osu.Game.Online.Metadata
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
await ProcessChanges(catchUpChanges.BeatmapSetIDs);
|
await ProcessChanges(catchUpChanges.BeatmapSetIDs).ConfigureAwait(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@ -101,7 +101,7 @@ namespace osu.Game.Online.Metadata
|
|||||||
if (!catchingUp)
|
if (!catchingUp)
|
||||||
lastQueueId.Value = updates.LastProcessedQueueID;
|
lastQueueId.Value = updates.LastProcessedQueueID;
|
||||||
|
|
||||||
await ProcessChanges(updates.BeatmapSetIDs);
|
await ProcessChanges(updates.BeatmapSetIDs).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Task<BeatmapUpdates> GetChangesSince(int queueId)
|
public override Task<BeatmapUpdates> GetChangesSince(int queueId)
|
||||||
|
@ -822,7 +822,7 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
{
|
{
|
||||||
if (cancellationToken.IsCancellationRequested)
|
if (cancellationToken.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
tcs.SetCanceled();
|
tcs.SetCanceled(cancellationToken);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,10 +54,10 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
return UserID == other.UserID;
|
return UserID == other.UserID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object? obj)
|
||||||
{
|
{
|
||||||
if (ReferenceEquals(this, obj)) return true;
|
if (ReferenceEquals(this, obj)) return true;
|
||||||
if (obj.GetType() != GetType()) return false;
|
if (obj?.GetType() != GetType()) return false;
|
||||||
|
|
||||||
return Equals((MultiplayerRoomUser)obj);
|
return Equals((MultiplayerRoomUser)obj);
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return await connection.InvokeAsync<MultiplayerRoom>(nameof(IMultiplayerServer.JoinRoomWithPassword), roomId, password ?? string.Empty);
|
return await connection.InvokeAsync<MultiplayerRoom>(nameof(IMultiplayerServer.JoinRoomWithPassword), roomId, password ?? string.Empty).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
catch (HubException exception)
|
catch (HubException exception)
|
||||||
{
|
{
|
||||||
@ -88,8 +88,8 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
{
|
{
|
||||||
Debug.Assert(connector != null);
|
Debug.Assert(connector != null);
|
||||||
|
|
||||||
await connector.Reconnect();
|
await connector.Reconnect().ConfigureAwait(false);
|
||||||
return await JoinRoom(roomId, password);
|
return await JoinRoom(roomId, password).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw;
|
throw;
|
||||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Online.Notifications
|
|||||||
|
|
||||||
protected sealed override async Task<PersistentEndpointClient> BuildConnectionAsync(CancellationToken cancellationToken)
|
protected sealed override async Task<PersistentEndpointClient> BuildConnectionAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var client = await BuildNotificationClientAsync(cancellationToken);
|
var client = await BuildNotificationClientAsync(cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
client.ChannelJoined = c => ChannelJoined?.Invoke(c);
|
client.ChannelJoined = c => ChannelJoined?.Invoke(c);
|
||||||
client.ChannelParted = c => ChannelParted?.Invoke(c);
|
client.ChannelParted = c => ChannelParted?.Invoke(c);
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Net;
|
||||||
using System.Net.WebSockets;
|
using System.Net.WebSockets;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
@ -36,11 +37,11 @@ namespace osu.Game.Online.Notifications.WebSocket
|
|||||||
public override async Task ConnectAsync(CancellationToken cancellationToken)
|
public override async Task ConnectAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
await socket.ConnectAsync(new Uri(endpoint), cancellationToken).ConfigureAwait(false);
|
await socket.ConnectAsync(new Uri(endpoint), cancellationToken).ConfigureAwait(false);
|
||||||
await sendMessage(new StartChatRequest(), CancellationToken.None);
|
await sendMessage(new StartChatRequest(), CancellationToken.None).ConfigureAwait(false);
|
||||||
|
|
||||||
runReadLoop(cancellationToken);
|
runReadLoop(cancellationToken);
|
||||||
|
|
||||||
await base.ConnectAsync(cancellationToken);
|
await base.ConnectAsync(cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void runReadLoop(CancellationToken cancellationToken) => Task.Run(async () =>
|
private void runReadLoop(CancellationToken cancellationToken) => Task.Run(async () =>
|
||||||
@ -52,7 +53,7 @@ namespace osu.Game.Online.Notifications.WebSocket
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
WebSocketReceiveResult result = await socket.ReceiveAsync(buffer, cancellationToken);
|
WebSocketReceiveResult result = await socket.ReceiveAsync(buffer, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
switch (result.MessageType)
|
switch (result.MessageType)
|
||||||
{
|
{
|
||||||
@ -72,7 +73,7 @@ namespace osu.Game.Online.Notifications.WebSocket
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
await onMessageReceivedAsync(message);
|
await onMessageReceivedAsync(message).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -81,12 +82,12 @@ namespace osu.Game.Online.Notifications.WebSocket
|
|||||||
throw new NotImplementedException("Binary message type not supported.");
|
throw new NotImplementedException("Binary message type not supported.");
|
||||||
|
|
||||||
case WebSocketMessageType.Close:
|
case WebSocketMessageType.Close:
|
||||||
throw new Exception("Connection closed by remote host.");
|
throw new WebException("Connection closed by remote host.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
await InvokeClosed(ex);
|
await InvokeClosed(ex).ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -109,7 +110,7 @@ namespace osu.Game.Online.Notifications.WebSocket
|
|||||||
if (socket.State != WebSocketState.Open)
|
if (socket.State != WebSocketState.Open)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
await socket.SendAsync(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(message)), WebSocketMessageType.Text, true, cancellationToken);
|
await socket.SendAsync(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(message)), WebSocketMessageType.Text, true, cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task onMessageReceivedAsync(SocketMessage message)
|
private async Task onMessageReceivedAsync(SocketMessage message)
|
||||||
@ -141,7 +142,7 @@ namespace osu.Game.Online.Notifications.WebSocket
|
|||||||
Debug.Assert(messageData != null);
|
Debug.Assert(messageData != null);
|
||||||
|
|
||||||
foreach (var msg in messageData.Messages)
|
foreach (var msg in messageData.Messages)
|
||||||
HandleChannelJoined(await getChannel(msg.ChannelId));
|
HandleChannelJoined(await getChannel(msg.ChannelId).ConfigureAwait(false));
|
||||||
|
|
||||||
HandleMessages(messageData.Messages);
|
HandleMessages(messageData.Messages);
|
||||||
break;
|
break;
|
||||||
@ -150,7 +151,7 @@ namespace osu.Game.Online.Notifications.WebSocket
|
|||||||
|
|
||||||
private async Task<Channel> getChannel(long channelId)
|
private async Task<Channel> getChannel(long channelId)
|
||||||
{
|
{
|
||||||
if (channelsMap.TryGetValue(channelId, out Channel channel))
|
if (channelsMap.TryGetValue(channelId, out Channel? channel))
|
||||||
return channel;
|
return channel;
|
||||||
|
|
||||||
var tsc = new TaskCompletionSource<Channel>();
|
var tsc = new TaskCompletionSource<Channel>();
|
||||||
@ -166,13 +167,13 @@ namespace osu.Game.Online.Notifications.WebSocket
|
|||||||
|
|
||||||
API.Queue(req);
|
API.Queue(req);
|
||||||
|
|
||||||
return await tsc.Task;
|
return await tsc.Task.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async ValueTask DisposeAsync()
|
public override async ValueTask DisposeAsync()
|
||||||
{
|
{
|
||||||
await base.DisposeAsync();
|
await base.DisposeAsync().ConfigureAwait(false);
|
||||||
await closeAsync();
|
await closeAsync().ConfigureAwait(false);
|
||||||
socket.Dispose();
|
socket.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ namespace osu.Game.Online.Notifications.WebSocket
|
|||||||
req.Failure += ex => tcs.SetException(ex);
|
req.Failure += ex => tcs.SetException(ex);
|
||||||
api.Queue(req);
|
api.Queue(req);
|
||||||
|
|
||||||
string endpoint = await tcs.Task;
|
string endpoint = await tcs.Task.ConfigureAwait(false);
|
||||||
|
|
||||||
ClientWebSocket socket = new ClientWebSocket();
|
ClientWebSocket socket = new ClientWebSocket();
|
||||||
socket.Options.SetRequestHeader(@"Authorization", @$"Bearer {api.AccessToken}");
|
socket.Options.SetRequestHeader(@"Authorization", @$"Bearer {api.AccessToken}");
|
||||||
|
@ -65,11 +65,11 @@ namespace osu.Game.Online
|
|||||||
{
|
{
|
||||||
case APIState.Failing:
|
case APIState.Failing:
|
||||||
case APIState.Offline:
|
case APIState.Offline:
|
||||||
await disconnect(true);
|
await disconnect(true).ConfigureAwait(true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case APIState.Online:
|
case APIState.Online:
|
||||||
await connect();
|
await connect().ConfigureAwait(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -147,7 +147,7 @@ namespace osu.Game.Online
|
|||||||
{
|
{
|
||||||
bool hasBeenCancelled = cancellationToken.IsCancellationRequested;
|
bool hasBeenCancelled = cancellationToken.IsCancellationRequested;
|
||||||
|
|
||||||
await disconnect(true);
|
await disconnect(true).ConfigureAwait(false);
|
||||||
|
|
||||||
if (ex != null)
|
if (ex != null)
|
||||||
await handleErrorAndDelay(ex, CancellationToken.None).ConfigureAwait(false);
|
await handleErrorAndDelay(ex, CancellationToken.None).ConfigureAwait(false);
|
||||||
|
@ -33,7 +33,8 @@ namespace osu.Game.Online
|
|||||||
|
|
||||||
object? instance = Activator.CreateInstance(resolvedType);
|
object? instance = Activator.CreateInstance(resolvedType);
|
||||||
|
|
||||||
jsonSerializer.Populate(obj["$value"]!.CreateReader(), instance);
|
if (instance != null)
|
||||||
|
jsonSerializer.Populate(obj["$value"]!.CreateReader(), instance);
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ namespace osu.Game.Online.Spectator
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await connection.InvokeAsync(nameof(ISpectatorServer.BeginPlaySession), scoreToken, state);
|
await connection.InvokeAsync(nameof(ISpectatorServer.BeginPlaySession), scoreToken, state).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
@ -64,8 +64,8 @@ namespace osu.Game.Online.Spectator
|
|||||||
{
|
{
|
||||||
Debug.Assert(connector != null);
|
Debug.Assert(connector != null);
|
||||||
|
|
||||||
await connector.Reconnect();
|
await connector.Reconnect().ConfigureAwait(false);
|
||||||
await BeginPlayingInternal(scoreToken, state);
|
await BeginPlayingInternal(scoreToken, state).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exceptions can occur if, for instance, the locally played beatmap doesn't have a server-side counterpart.
|
// Exceptions can occur if, for instance, the locally played beatmap doesn't have a server-side counterpart.
|
||||||
|
@ -184,7 +184,7 @@ namespace osu.Game.Online.Spectator
|
|||||||
Header = header;
|
Header = header;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int CompareTo(TimedFrame other) => Time.CompareTo(other.Time);
|
public int CompareTo(TimedFrame? other) => Time.CompareTo(other?.Time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
|
using osu.Framework.Extensions;
|
||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
using osu.Framework.Extensions.TypeExtensions;
|
using osu.Framework.Extensions.TypeExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -332,7 +333,7 @@ namespace osu.Game
|
|||||||
/// <param name="link">The link to load.</param>
|
/// <param name="link">The link to load.</param>
|
||||||
public void HandleLink(LinkDetails link) => Schedule(() =>
|
public void HandleLink(LinkDetails link) => Schedule(() =>
|
||||||
{
|
{
|
||||||
string argString = link.Argument.ToString();
|
string argString = link.Argument.ToString() ?? string.Empty;
|
||||||
|
|
||||||
switch (link.Action)
|
switch (link.Action)
|
||||||
{
|
{
|
||||||
@ -406,6 +407,16 @@ namespace osu.Game
|
|||||||
if (url.StartsWith('/'))
|
if (url.StartsWith('/'))
|
||||||
url = $"{API.APIEndpointUrl}{url}";
|
url = $"{API.APIEndpointUrl}{url}";
|
||||||
|
|
||||||
|
if (!url.CheckIsValidUrl())
|
||||||
|
{
|
||||||
|
Notifications.Post(new SimpleErrorNotification
|
||||||
|
{
|
||||||
|
Text = $"The URL {url} has an unsupported or dangerous protocol and will not be opened.",
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
externalLinkOpener.OpenUrlExternally(url, bypassExternalUrlWarning);
|
externalLinkOpener.OpenUrlExternally(url, bypassExternalUrlWarning);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1031,6 +1042,8 @@ namespace osu.Game
|
|||||||
{
|
{
|
||||||
if (entry.Level < LogLevel.Important || entry.Target > LoggingTarget.Database) return;
|
if (entry.Level < LogLevel.Important || entry.Target > LoggingTarget.Database) return;
|
||||||
|
|
||||||
|
Debug.Assert(entry.Target != null);
|
||||||
|
|
||||||
const int short_term_display_limit = 3;
|
const int short_term_display_limit = 3;
|
||||||
|
|
||||||
if (recentLogCount < short_term_display_limit)
|
if (recentLogCount < short_term_display_limit)
|
||||||
@ -1043,7 +1056,7 @@ namespace osu.Game
|
|||||||
}
|
}
|
||||||
else if (recentLogCount == short_term_display_limit)
|
else if (recentLogCount == short_term_display_limit)
|
||||||
{
|
{
|
||||||
string logFile = $@"{entry.Target.ToString().ToLowerInvariant()}.log";
|
string logFile = $@"{entry.Target.Value.ToString().ToLowerInvariant()}.log";
|
||||||
|
|
||||||
Schedule(() => Notifications.Post(new SimpleNotification
|
Schedule(() => Notifications.Post(new SimpleNotification
|
||||||
{
|
{
|
||||||
|
@ -352,11 +352,13 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
protected virtual DrawableChannel CreateDrawableChannel(Channel newChannel) => new DrawableChannel(newChannel);
|
protected virtual DrawableChannel CreateDrawableChannel(Channel newChannel) => new DrawableChannel(newChannel);
|
||||||
|
|
||||||
private void joinedChannelsChanged(object sender, NotifyCollectionChangedEventArgs args)
|
private void joinedChannelsChanged(object? sender, NotifyCollectionChangedEventArgs args)
|
||||||
{
|
{
|
||||||
switch (args.Action)
|
switch (args.Action)
|
||||||
{
|
{
|
||||||
case NotifyCollectionChangedAction.Add:
|
case NotifyCollectionChangedAction.Add:
|
||||||
|
Debug.Assert(args.NewItems != null);
|
||||||
|
|
||||||
IEnumerable<Channel> newChannels = args.NewItems.OfType<Channel>().Where(isChatChannel);
|
IEnumerable<Channel> newChannels = args.NewItems.OfType<Channel>().Where(isChatChannel);
|
||||||
|
|
||||||
foreach (var channel in newChannels)
|
foreach (var channel in newChannels)
|
||||||
@ -365,6 +367,8 @@ namespace osu.Game.Overlays
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case NotifyCollectionChangedAction.Remove:
|
case NotifyCollectionChangedAction.Remove:
|
||||||
|
Debug.Assert(args.OldItems != null);
|
||||||
|
|
||||||
IEnumerable<Channel> leftChannels = args.OldItems.OfType<Channel>().Where(isChatChannel);
|
IEnumerable<Channel> leftChannels = args.OldItems.OfType<Channel>().Where(isChatChannel);
|
||||||
|
|
||||||
foreach (var channel in leftChannels)
|
foreach (var channel in leftChannels)
|
||||||
@ -384,7 +388,7 @@ namespace osu.Game.Overlays
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void availableChannelsChanged(object sender, NotifyCollectionChangedEventArgs args)
|
private void availableChannelsChanged(object? sender, NotifyCollectionChangedEventArgs args)
|
||||||
=> channelListing.UpdateAvailableChannels(channelManager.AvailableChannels);
|
=> channelListing.UpdateAvailableChannels(channelManager.AvailableChannels);
|
||||||
|
|
||||||
private void handleChatMessage(string message)
|
private void handleChatMessage(string message)
|
||||||
|
@ -19,6 +19,7 @@ using System;
|
|||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
|
using System.Diagnostics;
|
||||||
using osu.Framework.Extensions.LocalisationExtensions;
|
using osu.Framework.Extensions.LocalisationExtensions;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
@ -360,6 +361,8 @@ namespace osu.Game.Overlays.Comments
|
|||||||
switch (args.Action)
|
switch (args.Action)
|
||||||
{
|
{
|
||||||
case NotifyCollectionChangedAction.Add:
|
case NotifyCollectionChangedAction.Add:
|
||||||
|
Debug.Assert(args.NewItems != null);
|
||||||
|
|
||||||
onRepliesAdded(args.NewItems.Cast<DrawableComment>());
|
onRepliesAdded(args.NewItems.Cast<DrawableComment>());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -301,7 +301,7 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
if (currentStepIndex < steps.Count)
|
if (currentStepIndex < steps.Count)
|
||||||
{
|
{
|
||||||
var nextScreen = (Screen)Activator.CreateInstance(steps[currentStepIndex.Value]);
|
var nextScreen = (Screen)Activator.CreateInstance(steps[currentStepIndex.Value])!;
|
||||||
|
|
||||||
loadingShowDelegate = Scheduler.AddDelayed(() => loading.Show(), 200);
|
loadingShowDelegate = Scheduler.AddDelayed(() => loading.Show(), 200);
|
||||||
nextScreen.OnLoadComplete += _ =>
|
nextScreen.OnLoadComplete += _ =>
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
using System.Diagnostics;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -131,8 +130,6 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
|
|||||||
{
|
{
|
||||||
var metadata = beatmapInfo.Metadata;
|
var metadata = beatmapInfo.Metadata;
|
||||||
|
|
||||||
Debug.Assert(metadata != null);
|
|
||||||
|
|
||||||
return new Drawable[]
|
return new Drawable[]
|
||||||
{
|
{
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -269,8 +268,6 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
|||||||
{
|
{
|
||||||
var metadata = beatmapInfo.Metadata;
|
var metadata = beatmapInfo.Metadata;
|
||||||
|
|
||||||
Debug.Assert(metadata != null);
|
|
||||||
|
|
||||||
return new Drawable[]
|
return new Drawable[]
|
||||||
{
|
{
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
using System.Diagnostics;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
@ -29,8 +28,6 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
|
|
||||||
var r = ruleset.CreateInstance();
|
var r = ruleset.CreateInstance();
|
||||||
|
|
||||||
Debug.Assert(r != null);
|
|
||||||
|
|
||||||
foreach (int variant in r.AvailableVariants)
|
foreach (int variant in r.AvailableVariants)
|
||||||
Add(new VariantBindingsSubsection(ruleset, variant));
|
Add(new VariantBindingsSubsection(ruleset, variant));
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,6 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a fresh <see cref="Mod"/> instance based on this mod.
|
/// Create a fresh <see cref="Mod"/> instance based on this mod.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Mod CreateInstance() => (Mod)Activator.CreateInstance(GetType());
|
Mod CreateInstance() => (Mod)Activator.CreateInstance(GetType())!;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
|
|
||||||
foreach ((SettingSourceAttribute attr, PropertyInfo property) in this.GetOrderedSettingsSourceProperties())
|
foreach ((SettingSourceAttribute attr, PropertyInfo property) in this.GetOrderedSettingsSourceProperties())
|
||||||
{
|
{
|
||||||
var bindable = (IBindable)property.GetValue(this);
|
var bindable = (IBindable)property.GetValue(this)!;
|
||||||
|
|
||||||
if (!bindable.IsDefault)
|
if (!bindable.IsDefault)
|
||||||
tooltipTexts.Add($"{attr.Label} {bindable}");
|
tooltipTexts.Add($"{attr.Label} {bindable}");
|
||||||
@ -134,7 +134,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual Mod DeepClone()
|
public virtual Mod DeepClone()
|
||||||
{
|
{
|
||||||
var result = (Mod)Activator.CreateInstance(GetType());
|
var result = (Mod)Activator.CreateInstance(GetType())!;
|
||||||
result.CopyFrom(this);
|
result.CopyFrom(this);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -150,8 +150,8 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
|
|
||||||
foreach (var (_, prop) in this.GetSettingsSourceProperties())
|
foreach (var (_, prop) in this.GetSettingsSourceProperties())
|
||||||
{
|
{
|
||||||
var targetBindable = (IBindable)prop.GetValue(this);
|
var targetBindable = (IBindable)prop.GetValue(this)!;
|
||||||
var sourceBindable = (IBindable)prop.GetValue(source);
|
var sourceBindable = (IBindable)prop.GetValue(source)!;
|
||||||
|
|
||||||
CopyAdjustedSetting(targetBindable, sourceBindable);
|
CopyAdjustedSetting(targetBindable, sourceBindable);
|
||||||
}
|
}
|
||||||
@ -183,9 +183,9 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(IMod other) => other is Mod them && Equals(them);
|
public bool Equals(IMod? other) => other is Mod them && Equals(them);
|
||||||
|
|
||||||
public bool Equals(Mod other)
|
public bool Equals(Mod? other)
|
||||||
{
|
{
|
||||||
if (ReferenceEquals(null, other)) return false;
|
if (ReferenceEquals(null, other)) return false;
|
||||||
if (ReferenceEquals(this, other)) return true;
|
if (ReferenceEquals(this, other)) return true;
|
||||||
@ -209,16 +209,16 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reset all custom settings for this mod back to their defaults.
|
/// Reset all custom settings for this mod back to their defaults.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void ResetSettingsToDefaults() => CopyFrom((Mod)Activator.CreateInstance(GetType()));
|
public virtual void ResetSettingsToDefaults() => CopyFrom((Mod)Activator.CreateInstance(GetType())!);
|
||||||
|
|
||||||
private class ModSettingsEqualityComparer : IEqualityComparer<IBindable>
|
private class ModSettingsEqualityComparer : IEqualityComparer<IBindable>
|
||||||
{
|
{
|
||||||
public static ModSettingsEqualityComparer Default { get; } = new ModSettingsEqualityComparer();
|
public static ModSettingsEqualityComparer Default { get; } = new ModSettingsEqualityComparer();
|
||||||
|
|
||||||
public bool Equals(IBindable x, IBindable y)
|
public bool Equals(IBindable? x, IBindable? y)
|
||||||
{
|
{
|
||||||
object xValue = x.GetUnderlyingSettingValue();
|
object? xValue = x?.GetUnderlyingSettingValue();
|
||||||
object yValue = y.GetUnderlyingSettingValue();
|
object? yValue = y?.GetUnderlyingSettingValue();
|
||||||
|
|
||||||
return EqualityComparer<object>.Default.Equals(xValue, yValue);
|
return EqualityComparer<object>.Default.Equals(xValue, yValue);
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
@ -57,12 +58,16 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
switch (args.Action)
|
switch (args.Action)
|
||||||
{
|
{
|
||||||
case NotifyCollectionChangedAction.Add:
|
case NotifyCollectionChangedAction.Add:
|
||||||
|
Debug.Assert(args.NewItems != null);
|
||||||
|
|
||||||
foreach (var c in args.NewItems.Cast<PathControlPoint>())
|
foreach (var c in args.NewItems.Cast<PathControlPoint>())
|
||||||
c.Changed += invalidate;
|
c.Changed += invalidate;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NotifyCollectionChangedAction.Reset:
|
case NotifyCollectionChangedAction.Reset:
|
||||||
case NotifyCollectionChangedAction.Remove:
|
case NotifyCollectionChangedAction.Remove:
|
||||||
|
Debug.Assert(args.OldItems != null);
|
||||||
|
|
||||||
foreach (var c in args.OldItems.Cast<PathControlPoint>())
|
foreach (var c in args.OldItems.Cast<PathControlPoint>())
|
||||||
c.Changed -= invalidate;
|
c.Changed -= invalidate;
|
||||||
break;
|
break;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user