Compare commits
286 Commits
2025.1119.
...
old-testin
| Author | SHA1 | Date | |
|---|---|---|---|
| 17d56f8db0 | |||
| 9637ea1df7 | |||
| 0940d61f7e | |||
| e6a6352a9c | |||
|
|
734c6f933d | ||
|
|
ac213c90cb | ||
|
|
74ca87c252 | ||
|
|
032912e62b | ||
|
|
1e79c56240 | ||
| 86f0159e65 | |||
| ae5a64ba81 | |||
|
|
82256ae2de | ||
|
|
1142be45ec | ||
|
|
dcb6d71287 | ||
|
|
881a35b382 | ||
|
|
89d8b402af | ||
|
|
1d351002df | ||
| e3a7ae30cd | |||
| b6f845d99c | |||
|
|
2606f3a0b5 | ||
|
|
1c463aa060 | ||
|
|
7853abe8aa | ||
|
|
1aff418981 | ||
|
|
62e92bb242 | ||
|
|
79151ae5b4 | ||
| a1d6bda63e | |||
| 547d22a4b5 | |||
|
|
c17db2cdd0 | ||
|
|
bbdd70c843 | ||
|
|
4250a54245 | ||
|
|
40fdb8662e | ||
|
|
6ce8b0a4bc | ||
|
|
b30047def6 | ||
|
|
0ffb86262f | ||
|
|
f71eb4b980 | ||
|
|
1faf02e860 | ||
|
|
d700375e55 | ||
|
|
095a67c24e | ||
|
|
86054497d0 | ||
|
|
c4f7dee82b | ||
|
|
22825f6509 | ||
|
|
691e8bcd05 | ||
|
|
e68bab4f4b | ||
|
|
9430a62af4 | ||
| b4c530ac04 | |||
| 5af05d2479 | |||
| 43ab18ffea | |||
| 9f59259a40 | |||
| 82b3015fcc | |||
| 68f92ab57c | |||
| d76d4d9a35 | |||
|
|
bb7417c099 | ||
|
|
066e093987 | ||
|
|
56e0c3e65d | ||
|
|
89d7726903 | ||
|
|
36f1bfef07 | ||
|
|
118f07878a | ||
|
|
e144968893 | ||
|
|
d2ffea41c6 | ||
|
|
a8be9b1381 | ||
|
|
bdac75e542 | ||
|
|
5c2df50714 | ||
|
|
887d280bfa | ||
|
|
42b184f167 | ||
|
|
27737bd4e9 | ||
|
|
84db289779 | ||
|
|
4c0522b795 | ||
|
|
8bb885a0dc | ||
|
|
0b06acb29d | ||
|
|
b129837e57 | ||
|
|
07ea9fe2a4 | ||
|
|
3e221c7f61 | ||
|
|
7106a6a5e5 | ||
|
|
eaf2721f5b | ||
| 490a6fd724 | |||
|
|
59a27dad3d | ||
|
|
f73307876e | ||
|
|
4e4aa44a02 | ||
|
|
d6cd748d2a | ||
| 237e1828f8 | |||
| 3413f722f7 | |||
| 9f779dac03 | |||
| 0727c53cdc | |||
| a57ff24191 | |||
|
|
c23d6b7fd1 | ||
|
|
582ff999aa | ||
|
|
a6c001244f | ||
|
|
a96b024ac5 | ||
|
|
1c10acba76 | ||
|
|
4ae4c700ae | ||
|
|
2be50d917a | ||
|
|
35fdc6f8b9 | ||
|
|
d04029bcc7 | ||
|
|
107098314a | ||
|
|
d1d76a76ba | ||
|
|
fbac5db964 | ||
|
|
5a920d15c1 | ||
|
|
324d088d46 | ||
|
|
1db4b897eb | ||
|
|
8e2230d149 | ||
|
|
8d33c35646 | ||
|
|
c359898a75 | ||
|
|
6343bf7d29 | ||
|
|
b1e27d842b | ||
|
|
28eeb7f743 | ||
|
|
38c3167a9d | ||
|
|
66ebce8c12 | ||
|
|
fed9564b40 | ||
|
|
f595a47059 | ||
|
|
8a9f60df68 | ||
|
|
2d8b1e7152 | ||
|
|
fef8117b5c | ||
|
|
99da986e02 | ||
|
|
1c33291b3f | ||
|
|
c6cc92315c | ||
|
|
12170df80a | ||
|
|
3e4c038a37 | ||
|
|
5d76353ae4 | ||
|
|
0b3ec3f1e1 | ||
|
|
043a1c2793 | ||
|
|
ca8247c667 | ||
|
|
a5ae542502 | ||
|
|
fe5cbc4932 | ||
|
|
0a378e5efd | ||
|
|
2a7e71d7fd | ||
|
|
1d221c1a7a | ||
| bdb3418b67 | |||
|
|
82f4406c79 | ||
|
|
0b4f96efc8 | ||
|
|
92e9a36744 | ||
|
|
c6eba26a67 | ||
|
|
8f927ea7b5 | ||
|
|
a8f058141b | ||
|
|
78c6973298 | ||
|
|
d8d7c80832 | ||
|
|
ae33690632 | ||
|
|
9e2ea63e70 | ||
|
|
6bb25b2abe | ||
|
|
037743e002 | ||
|
|
6244617e5e | ||
|
|
ddfcb4d6da | ||
|
|
2660f4dcb0 | ||
|
|
5a865476ce | ||
|
|
2472c91924 | ||
|
|
db50019f31 | ||
|
|
1e43509e4a | ||
|
|
ded8aaecfd | ||
|
|
75df8e3639 | ||
|
|
0d9a50e839 | ||
|
|
7473c62949 | ||
|
|
8d30e3d852 | ||
|
|
97fdc89fe3 | ||
|
|
f6a6c9f885 | ||
|
|
26c50b874c | ||
|
|
83706b7fb6 | ||
|
|
9e3486d4e6 | ||
|
|
545b13c3fb | ||
|
|
2c9fc32756 | ||
|
|
79bfe7880a | ||
|
|
0786e619f1 | ||
|
|
c968981697 | ||
|
|
45567f19b7 | ||
|
|
f0f4e7c7a5 | ||
|
|
1d353ef637 | ||
|
|
52af905237 | ||
|
|
64668eafb9 | ||
|
|
b0762fc8ec | ||
|
|
d59e9572d2 | ||
|
|
098da946e1 | ||
|
|
510fc506fb | ||
|
|
da09ad9c46 | ||
|
|
aaff7d358f | ||
|
|
a69b2cd803 | ||
|
|
855d5dba3c | ||
|
|
9c981a52f8 | ||
|
|
96de47ac4f | ||
|
|
43834b55f2 | ||
|
|
8fb402665e | ||
|
|
e4975e8d3b | ||
|
|
dbd9f13f2d | ||
|
|
ec890cd459 | ||
|
|
33c8c4d639 | ||
|
|
83ce56b718 | ||
|
|
9d88c761d3 | ||
|
|
49eb013967 | ||
|
|
b6ccc8cae4 | ||
|
|
d0e09e5b5c | ||
|
|
8900c79758 | ||
|
|
fd652982ce | ||
|
|
a2bfb409d2 | ||
| 936640edeb | |||
| 1187d03333 | |||
|
|
26da75ecfb | ||
|
|
9f8554cc13 | ||
|
|
713b6453c0 | ||
|
|
1b3ac49f2a | ||
|
|
d8b71423b0 | ||
|
|
2c40e116e1 | ||
|
|
90e7faf271 | ||
|
|
fc74726d11 | ||
|
|
5d3997152a | ||
|
|
41b56971e5 | ||
|
|
98e7a10e1e | ||
|
|
e99b9984d0 | ||
|
|
38504fed22 | ||
|
|
13dab24d41 | ||
|
|
67530b39cf | ||
|
|
19f5e5ba7c | ||
|
|
56ce955e0c | ||
|
|
73349ab182 | ||
|
|
a6a98fc078 | ||
|
|
a8594f1c08 | ||
|
|
d3860f1630 | ||
|
|
15ee49348d | ||
|
|
908a950cd2 | ||
|
|
df79269e6f | ||
|
|
34146b8bcb | ||
|
|
08ed2844b4 | ||
|
|
871c0ebe3d | ||
|
|
6362cdb675 | ||
|
|
8e78f4dac4 | ||
|
|
fa8d303922 | ||
|
|
d465bee0ab | ||
|
|
721ba8aeba | ||
|
|
1dd026c0f0 | ||
|
|
a873f2be65 | ||
|
|
edf7a126c8 | ||
|
|
f0f33b6df4 | ||
|
|
6052ed790d | ||
|
|
107c481fb9 | ||
|
|
aba567d258 | ||
|
|
094454499c | ||
|
|
c7e1a5770d | ||
|
|
a8ac82aa1f | ||
|
|
47faf774b0 | ||
|
|
be77257ddb | ||
|
|
397041099e | ||
|
|
4b59a4657f | ||
|
|
02090bf6c4 | ||
|
|
603c77e3e9 | ||
|
|
f284864f96 | ||
|
|
fa1bf7bd96 | ||
|
|
ef4408a73e | ||
|
|
6f7f9802bd | ||
|
|
277f4268db | ||
|
|
80fbcd5fbd | ||
|
|
9c2319b989 | ||
|
|
a040143825 | ||
|
|
fbd83cb048 | ||
|
|
843c318ec1 | ||
|
|
0c341c1f3e | ||
|
|
ae5584bd88 | ||
|
|
fe56ba2921 | ||
|
|
1ca4c8860b | ||
|
|
1e05613859 | ||
|
|
424ef9237f | ||
|
|
e541e917a4 | ||
|
|
7796394685 | ||
|
|
32900f563c | ||
|
|
e349a597ba | ||
|
|
1e91dde92e | ||
|
|
435cd272ea | ||
|
|
72507b80c7 | ||
|
|
c56c528824 | ||
|
|
1df640898f | ||
|
|
7b55b9e4f2 | ||
|
|
6a6c7ad3ba | ||
|
|
afdebcf188 | ||
|
|
1ec6735a35 | ||
|
|
1867aad1a6 | ||
|
|
b1bc5cae87 | ||
|
|
038bf3fdda | ||
|
|
61c3aad537 | ||
|
|
3aad0868af | ||
|
|
973c4c8319 | ||
|
|
ac21f8b960 | ||
| e78c8fa03d | |||
|
|
0b3b6468a5 | ||
|
|
7d1c54f045 | ||
|
|
fd504e5641 | ||
|
|
93ed0483b6 | ||
|
|
4dd0672aa5 | ||
|
|
66eff14d2b | ||
|
|
245ade004a | ||
|
|
6cb46106fe | ||
|
|
3666e4c332 |
@@ -1,8 +1,10 @@
|
|||||||
name: Update osu-web mod definitions
|
name: Update osu-web mod definitions (DO NOT USE YET!!!!!)
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_dispatch:
|
||||||
tags:
|
# push:
|
||||||
- '*'
|
# tags:
|
||||||
|
# - '*'
|
||||||
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read # to fetch code (actions/checkout)
|
contents: read # to fetch code (actions/checkout)
|
||||||
10
.github/workflows/ci.yml
vendored
@@ -1,4 +1,10 @@
|
|||||||
on: [push, pull_request]
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
|
||||||
name: Continuous Integration
|
name: Continuous Integration
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
@@ -33,7 +39,7 @@ jobs:
|
|||||||
key: inspectcode-${{ hashFiles('.config/dotnet-tools.json', '.github/workflows/ci.yml', 'osu.sln*', 'osu*.slnf', '.editorconfig', '.globalconfig', 'CodeAnalysis/*', '**/*.csproj', '**/*.props') }}
|
key: inspectcode-${{ hashFiles('.config/dotnet-tools.json', '.github/workflows/ci.yml', 'osu.sln*', 'osu*.slnf', '.editorconfig', '.globalconfig', 'CodeAnalysis/*', '**/*.csproj', '**/*.props') }}
|
||||||
|
|
||||||
- name: Dotnet code style
|
- name: Dotnet code style
|
||||||
run: dotnet build -c Debug -warnaserror osu.Desktop.slnf -p:EnforceCodeStyleInBuild=true
|
run: dotnet build -c Debug -warnaserror osu.Desktop.slnf
|
||||||
|
|
||||||
- name: CodeFileSanity
|
- name: CodeFileSanity
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
3
.github/workflows/deploy.yml
vendored
@@ -4,6 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
notify_pending_production_deploy:
|
notify_pending_production_deploy:
|
||||||
@@ -12,7 +13,7 @@ jobs:
|
|||||||
- name: Submit pending deployment notification
|
- name: Submit pending deployment notification
|
||||||
run: |
|
run: |
|
||||||
export TITLE="Pending osu Production Deployment: $GITHUB_REF_NAME"
|
export TITLE="Pending osu Production Deployment: $GITHUB_REF_NAME"
|
||||||
export URL="https://github.com/ppy/osu/actions/runs/$GITHUB_RUN_ID"
|
export URL="https://github.com/jvnkosu-dev/client/actions/runs/$GITHUB_RUN_ID"
|
||||||
export DESCRIPTION="Awaiting approval for building NuGet packages for tag $GITHUB_REF_NAME:
|
export DESCRIPTION="Awaiting approval for building NuGet packages for tag $GITHUB_REF_NAME:
|
||||||
[View Workflow Run]($URL)"
|
[View Workflow Run]($URL)"
|
||||||
export ACTOR_ICON="https://avatars.githubusercontent.com/u/$GITHUB_ACTOR_ID"
|
export ACTOR_ICON="https://avatars.githubusercontent.com/u/$GITHUB_ACTOR_ID"
|
||||||
|
|||||||
8
.github/workflows/sentry-release.yml
vendored
@@ -21,9 +21,9 @@ jobs:
|
|||||||
uses: getsentry/action-release@v1
|
uses: getsentry/action-release@v1
|
||||||
env:
|
env:
|
||||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||||
SENTRY_ORG: ppy
|
SENTRY_ORG: jvnkosu
|
||||||
SENTRY_PROJECT: osu
|
SENTRY_PROJECT: client
|
||||||
SENTRY_URL: https://sentry.ppy.sh/
|
SENTRY_URL: https://satellite.jvnko.boats/
|
||||||
with:
|
with:
|
||||||
environment: production
|
environment: production
|
||||||
version: osu@${{ github.ref_name }}
|
version: jvnkosu@${{ github.ref_name }}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PackageType>Template</PackageType>
|
<PackageType>Template</PackageType>
|
||||||
<PackageId>ppy.osu.Game.Templates</PackageId>
|
<PackageId>jvnkosu.Client.Templates</PackageId>
|
||||||
<Title>osu! templates</Title>
|
<Title>osu! templates</Title>
|
||||||
<Authors>ppy Pty Ltd</Authors>
|
<Authors>ppy Pty Ltd</Authors>
|
||||||
<PackageLicenseUrl>https://github.com/ppy/osu/blob/master/LICENCE</PackageLicenseUrl>
|
<PackageLicenseUrl>https://github.com/ppy/osu/blob/master/LICENCE</PackageLicenseUrl>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2025.1118.1" />
|
<PackageReference Include="ppy.osu.Framework.Android" Version="2025.1209.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<!-- Fody does not handle Android build well, and warns when unchanged.
|
<!-- Fody does not handle Android build well, and warns when unchanged.
|
||||||
|
|||||||
@@ -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" package="sh.ppy.osulazer" android:installLocation="auto">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="boats.jvnko.osu.android" android:installLocation="auto">
|
||||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34" />
|
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34" />
|
||||||
<application android:allowBackup="true"
|
<application android:allowBackup="true"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
|
|||||||
@@ -148,7 +148,13 @@ namespace osu.Desktop
|
|||||||
|
|
||||||
var iconStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico");
|
var iconStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico");
|
||||||
if (iconStream != null)
|
if (iconStream != null)
|
||||||
|
try
|
||||||
|
{
|
||||||
host.Window.SetIconFromStream(iconStream);
|
host.Window.SetIconFromStream(iconStream);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
host.Window.Title = Name;
|
host.Window.Title = Name;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ namespace osu.Desktop.Windows
|
|||||||
|
|
||||||
private static readonly UriAssociation[] uri_associations =
|
private static readonly UriAssociation[] uri_associations =
|
||||||
{
|
{
|
||||||
new UriAssociation(@"osu", WindowsAssociationManagerStrings.OsuProtocol, Icons.Lazer),
|
new UriAssociation(@"jvnkosu", WindowsAssociationManagerStrings.OsuProtocol, Icons.Lazer),
|
||||||
new UriAssociation(@"osump", WindowsAssociationManagerStrings.OsuMultiplayer, Icons.Lazer),
|
new UriAssociation(@"jvnkosump", WindowsAssociationManagerStrings.OsuMultiplayer, Icons.Lazer),
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Catch.Edit.Blueprints
|
|||||||
private double placementStartTime;
|
private double placementStartTime;
|
||||||
private double placementEndTime;
|
private double placementEndTime;
|
||||||
|
|
||||||
protected override bool IsValidForPlacement => Precision.DefinitelyBigger(HitObject.Duration, 0);
|
protected override bool IsValidForPlacement => base.IsValidForPlacement && (PlacementActive == PlacementState.Waiting || Precision.DefinitelyBigger(HitObject.Duration, 0));
|
||||||
|
|
||||||
public BananaShowerPlacementBlueprint()
|
public BananaShowerPlacementBlueprint()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Catch.Edit.Blueprints
|
|||||||
|
|
||||||
private InputManager inputManager = null!;
|
private InputManager inputManager = null!;
|
||||||
|
|
||||||
protected override bool IsValidForPlacement => Precision.DefinitelyBigger(HitObject.Duration, 0);
|
protected override bool IsValidForPlacement => base.IsValidForPlacement && (PlacementActive == PlacementState.Waiting || Precision.DefinitelyBigger(HitObject.Duration, 0));
|
||||||
|
|
||||||
public JuiceStreamPlacementBlueprint()
|
public JuiceStreamPlacementBlueprint()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@@ -224,7 +225,8 @@ namespace osu.Game.Rulesets.Catch.Edit
|
|||||||
#region Clipboard handling
|
#region Clipboard handling
|
||||||
|
|
||||||
public override string ConvertSelectionToString()
|
public override string ConvertSelectionToString()
|
||||||
=> string.Join(',', EditorBeatmap.SelectedHitObjects.Cast<CatchHitObject>().OrderBy(h => h.StartTime).Select(h => (h.IndexInCurrentCombo + 1).ToString()));
|
=> string.Join(',', EditorBeatmap.SelectedHitObjects.Cast<CatchHitObject>().OrderBy(h => h.StartTime)
|
||||||
|
.Select(h => (h.IndexInCurrentCombo + 1).ToString(CultureInfo.InvariantCulture)));
|
||||||
|
|
||||||
// 1,2,3,4 ...
|
// 1,2,3,4 ...
|
||||||
private static readonly Regex selection_regex = new Regex(@"^\d+(,\d+)*$", RegexOptions.Compiled);
|
private static readonly Regex selection_regex = new Regex(@"^\d+(,\d+)*$", RegexOptions.Compiled);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<PropertyGroup Label="Nuget">
|
<PropertyGroup Label="Nuget">
|
||||||
<Title>osu!catch (ruleset)</Title>
|
<Title>osu!catch (ruleset)</Title>
|
||||||
<PackageId>ppy.osu.Game.Rulesets.Catch</PackageId>
|
<PackageId>jvnkosu.Client.Rulesets.Catch</PackageId>
|
||||||
<IsPackable>true</IsPackable>
|
<IsPackable>true</IsPackable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
@@ -16,6 +17,7 @@ using osu.Game.Rulesets.Objects;
|
|||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using osu.Game.Rulesets.UI.Scrolling;
|
using osu.Game.Rulesets.UI.Scrolling;
|
||||||
|
using osu.Game.Screens.Edit;
|
||||||
using osu.Game.Tests.Visual;
|
using osu.Game.Tests.Visual;
|
||||||
using osuTK.Input;
|
using osuTK.Input;
|
||||||
|
|
||||||
@@ -36,21 +38,8 @@ namespace osu.Game.Rulesets.Mania.Tests.Editor
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestPlaceBeforeCurrentTimeDownwards()
|
public void TestPlaceBeforeCurrentTimeDownwards()
|
||||||
{
|
{
|
||||||
|
AddStep("seek to 200", () => HitObjectContainer.Dependencies.Get<EditorClock>().Seek(200));
|
||||||
AddStep("move mouse before current time", () =>
|
AddStep("move mouse before current time", () =>
|
||||||
{
|
|
||||||
var column = this.ChildrenOfType<Column>().Single();
|
|
||||||
InputManager.MoveMouseTo(column.ScreenSpacePositionAtTime(-100));
|
|
||||||
});
|
|
||||||
|
|
||||||
AddStep("click", () => InputManager.Click(MouseButton.Left));
|
|
||||||
|
|
||||||
AddAssert("note start time < 0", () => getNote().StartTime < 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void TestPlaceAfterCurrentTimeDownwards()
|
|
||||||
{
|
|
||||||
AddStep("move mouse after current time", () =>
|
|
||||||
{
|
{
|
||||||
var column = this.ChildrenOfType<Column>().Single();
|
var column = this.ChildrenOfType<Column>().Single();
|
||||||
InputManager.MoveMouseTo(column.ScreenSpacePositionAtTime(100));
|
InputManager.MoveMouseTo(column.ScreenSpacePositionAtTime(100));
|
||||||
@@ -58,7 +47,22 @@ namespace osu.Game.Rulesets.Mania.Tests.Editor
|
|||||||
|
|
||||||
AddStep("click", () => InputManager.Click(MouseButton.Left));
|
AddStep("click", () => InputManager.Click(MouseButton.Left));
|
||||||
|
|
||||||
AddAssert("note start time > 0", () => getNote().StartTime > 0);
|
AddAssert("note start time < 200", () => getNote().StartTime < 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestPlaceAfterCurrentTimeDownwards()
|
||||||
|
{
|
||||||
|
AddStep("seek to 200", () => HitObjectContainer.Dependencies.Get<EditorClock>().Seek(200));
|
||||||
|
AddStep("move mouse after current time", () =>
|
||||||
|
{
|
||||||
|
var column = this.ChildrenOfType<Column>().Single();
|
||||||
|
InputManager.MoveMouseTo(column.ScreenSpacePositionAtTime(300));
|
||||||
|
});
|
||||||
|
|
||||||
|
AddStep("click", () => InputManager.Click(MouseButton.Left));
|
||||||
|
|
||||||
|
AddAssert("note start time > 200", () => getNote().StartTime > 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Note getNote() => this.ChildrenOfType<DrawableNote>().FirstOrDefault()?.HitObject;
|
private Note getNote() => this.ChildrenOfType<DrawableNote>().FirstOrDefault()?.HitObject;
|
||||||
|
|||||||
@@ -18,15 +18,11 @@ namespace osu.Game.Rulesets.Mania.Tests.Editor
|
|||||||
public void TestNormalSelection()
|
public void TestNormalSelection()
|
||||||
{
|
{
|
||||||
addStepClickLink("00:05:920 (5920|3,6623|3,6857|2,7326|1)");
|
addStepClickLink("00:05:920 (5920|3,6623|3,6857|2,7326|1)");
|
||||||
AddAssert("selected group", () => checkSnapAndSelectColumn(5_920, new List<(int, int)>
|
AddAssert("selected group", () => checkSnapAndSelectColumn(5_920, [(5_920, 3), (6_623, 3), (6_857, 2), (7_326, 1)]));
|
||||||
{ (5_920, 3), (6_623, 3), (6_857, 2), (7_326, 1) }
|
|
||||||
));
|
|
||||||
|
|
||||||
addReset();
|
addReset();
|
||||||
addStepClickLink("00:42:716 (42716|3,43420|2,44123|0,44357|1,45295|1)");
|
addStepClickLink("00:42:716 (42716|3,43420|2,44123|0,44357|1,45295|1)");
|
||||||
AddAssert("selected ungrouped", () => checkSnapAndSelectColumn(42_716, new List<(int, int)>
|
AddAssert("selected ungrouped", () => checkSnapAndSelectColumn(42_716, [(42_716, 3), (43_420, 2), (44_123, 0), (44_357, 1), (45_295, 1)]));
|
||||||
{ (42_716, 3), (43_420, 2), (44_123, 0), (44_357, 1), (45_295, 1) }
|
|
||||||
));
|
|
||||||
|
|
||||||
addReset();
|
addReset();
|
||||||
AddStep("add notes to row", () =>
|
AddStep("add notes to row", () =>
|
||||||
@@ -41,15 +37,20 @@ namespace osu.Game.Rulesets.Mania.Tests.Editor
|
|||||||
EditorBeatmap.AddRange(new[] { second, third, forth });
|
EditorBeatmap.AddRange(new[] { second, third, forth });
|
||||||
});
|
});
|
||||||
addStepClickLink("00:11:545 (11545|0,11545|1,11545|2,11545|3)");
|
addStepClickLink("00:11:545 (11545|0,11545|1,11545|2,11545|3)");
|
||||||
AddAssert("selected in row", () => checkSnapAndSelectColumn(11_545, new List<(int, int)>
|
AddAssert("selected in row", () => checkSnapAndSelectColumn(11_545, [(11_545, 0), (11_545, 1), (11_545, 2), (11_545, 3)]));
|
||||||
{ (11_545, 0), (11_545, 1), (11_545, 2), (11_545, 3) }
|
|
||||||
));
|
|
||||||
|
|
||||||
addReset();
|
addReset();
|
||||||
addStepClickLink("01:36:623 (96623|1,97560|1,97677|1,97795|1,98966|1)");
|
addStepClickLink("01:36:623 (96623|1,97560|1,97677|1,97795|1,98966|1)");
|
||||||
AddAssert("selected in column", () => checkSnapAndSelectColumn(96_623, new List<(int, int)>
|
AddAssert("selected in column", () => checkSnapAndSelectColumn(96_623, [(96_623, 1), (97_560, 1), (97_677, 1), (97_795, 1), (98_966, 1)]));
|
||||||
{ (96_623, 1), (97_560, 1), (97_677, 1), (97_795, 1), (98_966, 1) }
|
}
|
||||||
));
|
|
||||||
|
[Test]
|
||||||
|
public void TestRoundingToNearestMillisecondApplied()
|
||||||
|
{
|
||||||
|
AddStep("resnap note to have fractional coordinates",
|
||||||
|
() => EditorBeatmap.HitObjects.OfType<ManiaHitObject>().Single(ho => ho.StartTime == 85_373 && ho.Column == 1).StartTime = 85_373.125);
|
||||||
|
addStepClickLink("01:25:373 (85373|1)");
|
||||||
|
AddAssert("selected note", () => checkSnapAndSelectColumn(85_373.125, [(85_373.125, 1)]));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@@ -75,7 +76,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Editor
|
|||||||
|
|
||||||
private void addReset() => addStepClickLink("00:00:000", "reset", false);
|
private void addReset() => addStepClickLink("00:00:000", "reset", false);
|
||||||
|
|
||||||
private bool checkSnapAndSelectColumn(double startTime, IReadOnlyCollection<(int, int)>? columnPairs = null)
|
private bool checkSnapAndSelectColumn(double startTime, IReadOnlyCollection<(double, int)>? columnPairs = null)
|
||||||
{
|
{
|
||||||
bool checkColumns = columnPairs != null
|
bool checkColumns = columnPairs != null
|
||||||
? EditorBeatmap.SelectedHitObjects.All(x => columnPairs.Any(col => isNoteAt(x, col.Item1, col.Item2)))
|
? EditorBeatmap.SelectedHitObjects.All(x => columnPairs.Any(col => isNoteAt(x, col.Item1, col.Item2)))
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private IScrollingInfo scrollingInfo { get; set; } = null!;
|
private IScrollingInfo scrollingInfo { get; set; } = null!;
|
||||||
|
|
||||||
protected override bool IsValidForPlacement => Precision.DefinitelyBigger(HitObject.Duration, 0);
|
protected override bool IsValidForPlacement => base.IsValidForPlacement && (PlacementActive == PlacementState.Waiting || Precision.DefinitelyBigger(HitObject.Duration, 0));
|
||||||
|
|
||||||
public HoldNotePlacementBlueprint()
|
public HoldNotePlacementBlueprint()
|
||||||
: base(new HoldNote())
|
: base(new HoldNote())
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
using osu.Game.Rulesets.Edit.Tools;
|
using osu.Game.Rulesets.Edit.Tools;
|
||||||
@@ -54,7 +56,8 @@ namespace osu.Game.Rulesets.Mania.Edit
|
|||||||
};
|
};
|
||||||
|
|
||||||
public override string ConvertSelectionToString()
|
public override string ConvertSelectionToString()
|
||||||
=> string.Join(',', EditorBeatmap.SelectedHitObjects.Cast<ManiaHitObject>().OrderBy(h => h.StartTime).Select(h => $"{h.StartTime}|{h.Column}"));
|
=> string.Join(',', EditorBeatmap.SelectedHitObjects.Cast<ManiaHitObject>().OrderBy(h => h.StartTime)
|
||||||
|
.Select(h => FormattableString.Invariant($"{Math.Round(h.StartTime)}|{h.Column}")));
|
||||||
|
|
||||||
// 123|0,456|1,789|2 ...
|
// 123|0,456|1,789|2 ...
|
||||||
private static readonly Regex selection_regex = new Regex(@"^\d+\|\d+(,\d+\|\d+)*$", RegexOptions.Compiled);
|
private static readonly Regex selection_regex = new Regex(@"^\d+\|\d+(,\d+\|\d+)*$", RegexOptions.Compiled);
|
||||||
@@ -73,10 +76,10 @@ namespace osu.Game.Rulesets.Mania.Edit
|
|||||||
if (split.Length != 2)
|
if (split.Length != 2)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!double.TryParse(split[0], out double time) || !int.TryParse(split[1], out int column))
|
if (!int.TryParse(split[0], out int time) || !int.TryParse(split[1], out int column))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ManiaHitObject? current = remainingHitObjects.FirstOrDefault(h => h.StartTime == time && h.Column == column);
|
ManiaHitObject? current = remainingHitObjects.FirstOrDefault(h => Precision.AlmostEquals(h.StartTime, time, 0.5) && h.Column == column);
|
||||||
|
|
||||||
if (current == null)
|
if (current == null)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<PropertyGroup Label="Nuget">
|
<PropertyGroup Label="Nuget">
|
||||||
<Title>osu!mania (ruleset)</Title>
|
<Title>osu!mania (ruleset)</Title>
|
||||||
<PackageId>ppy.osu.Game.Rulesets.Mania</PackageId>
|
<PackageId>jvnkosu.Client.Rulesets.Mania</PackageId>
|
||||||
<IsPackable>true</IsPackable>
|
<IsPackable>true</IsPackable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -245,13 +245,13 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
|
|||||||
AddAssert("grid spacing is distance to slider tail", () =>
|
AddAssert("grid spacing is distance to slider tail", () =>
|
||||||
{
|
{
|
||||||
var composer = Editor.ChildrenOfType<RectangularPositionSnapGrid>().Single();
|
var composer = Editor.ChildrenOfType<RectangularPositionSnapGrid>().Single();
|
||||||
return Precision.AlmostEquals(composer.Spacing.Value.X, 32.05, 0.01)
|
return Precision.AlmostEquals(composer.Spacing.Value.X, 32.05, 0.1)
|
||||||
&& Precision.AlmostEquals(composer.Spacing.Value.X, composer.Spacing.Value.Y);
|
&& Precision.AlmostEquals(composer.Spacing.Value.X, composer.Spacing.Value.Y);
|
||||||
});
|
});
|
||||||
AddAssert("grid rotation points to slider tail", () =>
|
AddAssert("grid rotation points to slider tail", () =>
|
||||||
{
|
{
|
||||||
var composer = Editor.ChildrenOfType<RectangularPositionSnapGrid>().Single();
|
var composer = Editor.ChildrenOfType<RectangularPositionSnapGrid>().Single();
|
||||||
return Precision.AlmostEquals(composer.GridLineRotation.Value, 0.09, 0.01);
|
return Precision.AlmostEquals(composer.GridLineRotation.Value, 0.09, 0.1);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep("start grid placement", () => InputManager.Key(Key.Number5));
|
AddStep("start grid placement", () => InputManager.Key(Key.Number5));
|
||||||
@@ -280,9 +280,9 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
|
|||||||
AddAssert("grid spacing and rotation unchanged", () =>
|
AddAssert("grid spacing and rotation unchanged", () =>
|
||||||
{
|
{
|
||||||
var composer = Editor.ChildrenOfType<RectangularPositionSnapGrid>().Single();
|
var composer = Editor.ChildrenOfType<RectangularPositionSnapGrid>().Single();
|
||||||
return Precision.AlmostEquals(composer.Spacing.Value.X, 32.05, 0.01)
|
return Precision.AlmostEquals(composer.Spacing.Value.X, 32.05, 0.1)
|
||||||
&& Precision.AlmostEquals(composer.Spacing.Value.X, composer.Spacing.Value.Y)
|
&& Precision.AlmostEquals(composer.Spacing.Value.X, composer.Spacing.Value.Y)
|
||||||
&& Precision.AlmostEquals(composer.GridLineRotation.Value, 0.09, 0.01);
|
&& Precision.AlmostEquals(composer.GridLineRotation.Value, 0.09, 0.1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders;
|
using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
@@ -22,7 +23,12 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
|
|||||||
[TestFixture]
|
[TestFixture]
|
||||||
public partial class TestSceneSliderDrawing : TestSceneOsuEditor
|
public partial class TestSceneSliderDrawing : TestSceneOsuEditor
|
||||||
{
|
{
|
||||||
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset) => new TestBeatmap(ruleset, false);
|
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset)
|
||||||
|
{
|
||||||
|
var beatmap = new TestBeatmap(ruleset, false);
|
||||||
|
beatmap.ControlPointInfo.Add(0, new TimingControlPoint());
|
||||||
|
return beatmap;
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestTouchInputPlaceHitCircleDirectly()
|
public void TestTouchInputPlaceHitCircleDirectly()
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Testing;
|
||||||
|
using osu.Game.Configuration;
|
||||||
|
using osu.Game.Skinning;
|
||||||
|
using osu.Game.Tests.Visual;
|
||||||
|
using osuTK.Input;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Osu.Tests
|
||||||
|
{
|
||||||
|
public partial class TestSceneGameplayCursorSizeChange : PlayerTestScene
|
||||||
|
{
|
||||||
|
private const float initial_cursor_size = 1f;
|
||||||
|
protected override Ruleset CreatePlayerRuleset() => new OsuRuleset();
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private SkinManager? skins { get; set; }
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
if (skins != null) skins.CurrentSkinInfo.Value = skins.DefaultClassicSkin.SkinInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
[SetUpSteps]
|
||||||
|
public override void SetUpSteps()
|
||||||
|
{
|
||||||
|
base.SetUpSteps();
|
||||||
|
|
||||||
|
AddStep("Set gameplay cursor size: 1", () => LocalConfig.SetValue(OsuSetting.GameplayCursorSize, initial_cursor_size));
|
||||||
|
AddStep("resume player", () => Player.GameplayClockContainer.Start());
|
||||||
|
AddUntilStep("clock running", () => Player.GameplayClockContainer.IsRunning);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestPausedChangeCursorSize()
|
||||||
|
{
|
||||||
|
AddStep("move cursor to center", () => InputManager.MoveMouseTo(Player.ScreenSpaceDrawQuad.Centre));
|
||||||
|
AddStep("move cursor to top left", () => InputManager.MoveMouseTo(Player.ScreenSpaceDrawQuad.TopLeft));
|
||||||
|
AddStep("move cursor to center", () => InputManager.MoveMouseTo(Player.ScreenSpaceDrawQuad.Centre));
|
||||||
|
AddStep("move cursor to top right", () => InputManager.MoveMouseTo(Player.ScreenSpaceDrawQuad.TopRight));
|
||||||
|
AddStep("press escape", () => InputManager.Key(Key.Escape));
|
||||||
|
|
||||||
|
AddSliderStep("cursor size", 0.1f, 2f, 1f, v => LocalConfig.SetValue(OsuSetting.GameplayCursorSize, v));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override TestPlayer CreatePlayer(Ruleset ruleset) => new TestPlayer(true, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints
|
|||||||
{
|
{
|
||||||
this.gridToolboxGroup = gridToolboxGroup;
|
this.gridToolboxGroup = gridToolboxGroup;
|
||||||
originalOrigin = gridToolboxGroup.StartPosition.Value;
|
originalOrigin = gridToolboxGroup.StartPosition.Value;
|
||||||
originalSpacing = gridToolboxGroup.Spacing.Value;
|
originalSpacing = gridToolboxGroup.GridLineSpacing.Value;
|
||||||
originalRotation = gridToolboxGroup.GridLinesRotation.Value;
|
originalRotation = gridToolboxGroup.GridLinesRotation.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints
|
|||||||
{
|
{
|
||||||
// Reset the grid to the default values.
|
// Reset the grid to the default values.
|
||||||
gridToolboxGroup.StartPosition.Value = gridToolboxGroup.StartPosition.Default;
|
gridToolboxGroup.StartPosition.Value = gridToolboxGroup.StartPosition.Default;
|
||||||
gridToolboxGroup.Spacing.Value = gridToolboxGroup.Spacing.Default;
|
gridToolboxGroup.GridLineSpacing.Value = gridToolboxGroup.GridLineSpacing.Default;
|
||||||
if (!gridToolboxGroup.GridLinesRotation.Disabled)
|
if (!gridToolboxGroup.GridLinesRotation.Disabled)
|
||||||
gridToolboxGroup.GridLinesRotation.Value = gridToolboxGroup.GridLinesRotation.Default;
|
gridToolboxGroup.GridLinesRotation.Value = gridToolboxGroup.GridLinesRotation.Default;
|
||||||
EndPlacement(true);
|
EndPlacement(true);
|
||||||
@@ -112,7 +112,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints
|
|||||||
// Default to the original spacing and rotation if the distance is too small.
|
// Default to the original spacing and rotation if the distance is too small.
|
||||||
if (Vector2.Distance(gridToolboxGroup.StartPosition.Value, pos) < 2)
|
if (Vector2.Distance(gridToolboxGroup.StartPosition.Value, pos) < 2)
|
||||||
{
|
{
|
||||||
gridToolboxGroup.Spacing.Value = originalSpacing;
|
gridToolboxGroup.GridLineSpacing.Value = originalSpacing;
|
||||||
if (!gridToolboxGroup.GridLinesRotation.Disabled)
|
if (!gridToolboxGroup.GridLinesRotation.Disabled)
|
||||||
gridToolboxGroup.GridLinesRotation.Value = originalRotation;
|
gridToolboxGroup.GridLinesRotation.Value = originalRotation;
|
||||||
}
|
}
|
||||||
@@ -134,7 +134,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints
|
|||||||
private void resetGridState()
|
private void resetGridState()
|
||||||
{
|
{
|
||||||
gridToolboxGroup.StartPosition.Value = originalOrigin;
|
gridToolboxGroup.StartPosition.Value = originalOrigin;
|
||||||
gridToolboxGroup.Spacing.Value = originalSpacing;
|
gridToolboxGroup.GridLineSpacing.Value = originalSpacing;
|
||||||
if (!gridToolboxGroup.GridLinesRotation.Disabled)
|
if (!gridToolboxGroup.GridLinesRotation.Disabled)
|
||||||
gridToolboxGroup.GridLinesRotation.Value = originalRotation;
|
gridToolboxGroup.GridLinesRotation.Value = originalRotation;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
|
|||||||
|
|
||||||
private readonly IncrementalBSplineBuilder bSplineBuilder = new IncrementalBSplineBuilder { Degree = 4 };
|
private readonly IncrementalBSplineBuilder bSplineBuilder = new IncrementalBSplineBuilder { Degree = 4 };
|
||||||
|
|
||||||
protected override bool IsValidForPlacement => HitObject.Path.HasValidLengthForPlacement;
|
protected override bool IsValidForPlacement => base.IsValidForPlacement && (PlacementActive == PlacementState.Waiting || HitObject.Path.HasValidLengthForPlacement);
|
||||||
|
|
||||||
public SliderPlacementBlueprint()
|
public SliderPlacementBlueprint()
|
||||||
: base(new Slider())
|
: base(new Slider())
|
||||||
|
|||||||
@@ -5,8 +5,10 @@ using System;
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Edit
|
namespace osu.Game.Rulesets.Osu.Edit
|
||||||
{
|
{
|
||||||
@@ -42,25 +44,31 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
private readonly BindableInt displayTolerance = new BindableInt(90)
|
private readonly BindableInt displayTolerance = new BindableInt(90)
|
||||||
{
|
{
|
||||||
MinValue = 5,
|
MinValue = 5,
|
||||||
MaxValue = 100
|
MaxValue = 100,
|
||||||
|
Precision = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
private readonly BindableInt displayCornerThreshold = new BindableInt(40)
|
private readonly BindableInt displayCornerThreshold = new BindableInt(40)
|
||||||
{
|
{
|
||||||
MinValue = 5,
|
MinValue = 5,
|
||||||
MaxValue = 100
|
MaxValue = 100,
|
||||||
|
Precision = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
private readonly BindableInt displayCircleThreshold = new BindableInt(30)
|
private readonly BindableInt displayCircleThreshold = new BindableInt(30)
|
||||||
{
|
{
|
||||||
MinValue = 0,
|
MinValue = 0,
|
||||||
MaxValue = 100
|
MaxValue = 100,
|
||||||
|
Precision = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
private ExpandableSlider<int> toleranceSlider = null!;
|
private ExpandableSlider<int> toleranceSlider = null!;
|
||||||
private ExpandableSlider<int> cornerThresholdSlider = null!;
|
private ExpandableSlider<int> cornerThresholdSlider = null!;
|
||||||
private ExpandableSlider<int> circleThresholdSlider = null!;
|
private ExpandableSlider<int> circleThresholdSlider = null!;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private IExpandingContainer? expandingContainer { get; set; }
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
@@ -68,15 +76,18 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
{
|
{
|
||||||
toleranceSlider = new ExpandableSlider<int>
|
toleranceSlider = new ExpandableSlider<int>
|
||||||
{
|
{
|
||||||
Current = displayTolerance
|
Current = displayTolerance,
|
||||||
|
ExpandedLabelText = "Control point spacing",
|
||||||
},
|
},
|
||||||
cornerThresholdSlider = new ExpandableSlider<int>
|
cornerThresholdSlider = new ExpandableSlider<int>
|
||||||
{
|
{
|
||||||
Current = displayCornerThreshold
|
Current = displayCornerThreshold,
|
||||||
|
ExpandedLabelText = "Corner bias",
|
||||||
},
|
},
|
||||||
circleThresholdSlider = new ExpandableSlider<int>
|
circleThresholdSlider = new ExpandableSlider<int>
|
||||||
{
|
{
|
||||||
Current = displayCircleThreshold
|
Current = displayCircleThreshold,
|
||||||
|
ExpandedLabelText = "Perfect curve bias"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -88,24 +99,18 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
displayTolerance.BindValueChanged(tolerance =>
|
displayTolerance.BindValueChanged(tolerance =>
|
||||||
{
|
{
|
||||||
toleranceSlider.ContractedLabelText = $"C. P. S.: {tolerance.NewValue:N0}";
|
toleranceSlider.ContractedLabelText = $"C. P. S.: {tolerance.NewValue:N0}";
|
||||||
toleranceSlider.ExpandedLabelText = $"Control Point Spacing: {tolerance.NewValue:N0}";
|
|
||||||
|
|
||||||
Tolerance.Value = displayToInternalTolerance(tolerance.NewValue);
|
Tolerance.Value = displayToInternalTolerance(tolerance.NewValue);
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
displayCornerThreshold.BindValueChanged(threshold =>
|
displayCornerThreshold.BindValueChanged(threshold =>
|
||||||
{
|
{
|
||||||
cornerThresholdSlider.ContractedLabelText = $"C. T.: {threshold.NewValue:N0}";
|
cornerThresholdSlider.ContractedLabelText = $"C. B.: {threshold.NewValue:N0}";
|
||||||
cornerThresholdSlider.ExpandedLabelText = $"Corner Threshold: {threshold.NewValue:N0}";
|
|
||||||
|
|
||||||
CornerThreshold.Value = displayToInternalCornerThreshold(threshold.NewValue);
|
CornerThreshold.Value = displayToInternalCornerThreshold(threshold.NewValue);
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
displayCircleThreshold.BindValueChanged(threshold =>
|
displayCircleThreshold.BindValueChanged(threshold =>
|
||||||
{
|
{
|
||||||
circleThresholdSlider.ContractedLabelText = $"P. C. T.: {threshold.NewValue:N0}";
|
circleThresholdSlider.ContractedLabelText = $"P. C. B.: {threshold.NewValue:N0}";
|
||||||
circleThresholdSlider.ExpandedLabelText = $"Perfect Curve Threshold: {threshold.NewValue:N0}";
|
|
||||||
|
|
||||||
CircleThreshold.Value = displayToInternalCircleThreshold(threshold.NewValue);
|
CircleThreshold.Value = displayToInternalCircleThreshold(threshold.NewValue);
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
@@ -119,6 +124,11 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
displayCircleThreshold.Value = internalToDisplayCircleThreshold(threshold.NewValue)
|
displayCircleThreshold.Value = internalToDisplayCircleThreshold(threshold.NewValue)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
expandingContainer?.Expanded.BindValueChanged(v =>
|
||||||
|
{
|
||||||
|
Spacing = v.NewValue ? new Vector2(5) : new Vector2(15);
|
||||||
|
}, true);
|
||||||
|
|
||||||
float displayToInternalTolerance(float v) => v / 50f;
|
float displayToInternalTolerance(float v) => v / 50f;
|
||||||
int internalToDisplayTolerance(float v) => (int)Math.Round(v * 50f);
|
int internalToDisplayTolerance(float v) => (int)Math.Round(v * 50f);
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
{
|
{
|
||||||
MinValue = 0f,
|
MinValue = 0f,
|
||||||
MaxValue = OsuPlayfield.BASE_SIZE.X,
|
MaxValue = OsuPlayfield.BASE_SIZE.X,
|
||||||
Precision = 0.01f,
|
Precision = 0.1f,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -48,17 +48,17 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
{
|
{
|
||||||
MinValue = 0f,
|
MinValue = 0f,
|
||||||
MaxValue = OsuPlayfield.BASE_SIZE.Y,
|
MaxValue = OsuPlayfield.BASE_SIZE.Y,
|
||||||
Precision = 0.01f,
|
Precision = 0.1f,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The spacing between grid lines.
|
/// The spacing between grid lines.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public BindableFloat Spacing { get; } = new BindableFloat(4f)
|
public BindableFloat GridLineSpacing { get; } = new BindableFloat(4f)
|
||||||
{
|
{
|
||||||
MinValue = 4f,
|
MinValue = 4f,
|
||||||
MaxValue = 256f,
|
MaxValue = 256f,
|
||||||
Precision = 0.01f,
|
Precision = 0.1f,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -68,7 +68,7 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
{
|
{
|
||||||
MinValue = -180f,
|
MinValue = -180f,
|
||||||
MaxValue = 180f,
|
MaxValue = 180f,
|
||||||
Precision = 0.01f,
|
Precision = 0.1f,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -115,7 +115,7 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
float dist = Vector2.Distance(point1, point2);
|
float dist = Vector2.Distance(point1, point2);
|
||||||
while (dist >= max_automatic_spacing)
|
while (dist >= max_automatic_spacing)
|
||||||
dist /= 2;
|
dist /= 2;
|
||||||
Spacing.Value = dist;
|
GridLineSpacing.Value = dist;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@@ -127,21 +127,25 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
{
|
{
|
||||||
Current = StartPositionX,
|
Current = StartPositionX,
|
||||||
KeyboardStep = 1,
|
KeyboardStep = 1,
|
||||||
|
ExpandedLabelText = "X offset",
|
||||||
},
|
},
|
||||||
startPositionYSlider = new ExpandableSlider<float>
|
startPositionYSlider = new ExpandableSlider<float>
|
||||||
{
|
{
|
||||||
Current = StartPositionY,
|
Current = StartPositionY,
|
||||||
KeyboardStep = 1,
|
KeyboardStep = 1,
|
||||||
|
ExpandedLabelText = "Y offset",
|
||||||
},
|
},
|
||||||
spacingSlider = new ExpandableSlider<float>
|
spacingSlider = new ExpandableSlider<float>
|
||||||
{
|
{
|
||||||
Current = Spacing,
|
Current = GridLineSpacing,
|
||||||
KeyboardStep = 1,
|
KeyboardStep = 1,
|
||||||
|
ExpandedLabelText = "Spacing",
|
||||||
},
|
},
|
||||||
gridLinesRotationSlider = new ExpandableSlider<float>
|
gridLinesRotationSlider = new ExpandableSlider<float>
|
||||||
{
|
{
|
||||||
Current = GridLinesRotation,
|
Current = GridLinesRotation,
|
||||||
KeyboardStep = 1,
|
KeyboardStep = 1,
|
||||||
|
ExpandedLabelText = "Rotation",
|
||||||
},
|
},
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
@@ -170,7 +174,7 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
Spacing.Value = editorBeatmap.GridSize;
|
GridLineSpacing.Value = editorBeatmap.GridSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@@ -182,14 +186,12 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
StartPositionX.BindValueChanged(x =>
|
StartPositionX.BindValueChanged(x =>
|
||||||
{
|
{
|
||||||
startPositionXSlider.ContractedLabelText = $"X: {x.NewValue:#,0.##}";
|
startPositionXSlider.ContractedLabelText = $"X: {x.NewValue:#,0.##}";
|
||||||
startPositionXSlider.ExpandedLabelText = $"X Offset: {x.NewValue:#,0.##}";
|
|
||||||
StartPosition.Value = new Vector2(x.NewValue, StartPosition.Value.Y);
|
StartPosition.Value = new Vector2(x.NewValue, StartPosition.Value.Y);
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
StartPositionY.BindValueChanged(y =>
|
StartPositionY.BindValueChanged(y =>
|
||||||
{
|
{
|
||||||
startPositionYSlider.ContractedLabelText = $"Y: {y.NewValue:#,0.##}";
|
startPositionYSlider.ContractedLabelText = $"Y: {y.NewValue:#,0.##}";
|
||||||
startPositionYSlider.ExpandedLabelText = $"Y Offset: {y.NewValue:#,0.##}";
|
|
||||||
StartPosition.Value = new Vector2(StartPosition.Value.X, y.NewValue);
|
StartPosition.Value = new Vector2(StartPosition.Value.X, y.NewValue);
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
@@ -199,10 +201,9 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
StartPositionY.Value = pos.NewValue.Y;
|
StartPositionY.Value = pos.NewValue.Y;
|
||||||
});
|
});
|
||||||
|
|
||||||
Spacing.BindValueChanged(spacing =>
|
GridLineSpacing.BindValueChanged(spacing =>
|
||||||
{
|
{
|
||||||
spacingSlider.ContractedLabelText = $"S: {spacing.NewValue:#,0.##}";
|
spacingSlider.ContractedLabelText = $"S: {spacing.NewValue:#,0.##}";
|
||||||
spacingSlider.ExpandedLabelText = $"Spacing: {spacing.NewValue:#,0.##}";
|
|
||||||
SpacingVector.Value = new Vector2(spacing.NewValue);
|
SpacingVector.Value = new Vector2(spacing.NewValue);
|
||||||
editorBeatmap.GridSize = (int)spacing.NewValue;
|
editorBeatmap.GridSize = (int)spacing.NewValue;
|
||||||
}, true);
|
}, true);
|
||||||
@@ -210,7 +211,6 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
GridLinesRotation.BindValueChanged(rotation =>
|
GridLinesRotation.BindValueChanged(rotation =>
|
||||||
{
|
{
|
||||||
gridLinesRotationSlider.ContractedLabelText = $"R: {rotation.NewValue:#,0.##}";
|
gridLinesRotationSlider.ContractedLabelText = $"R: {rotation.NewValue:#,0.##}";
|
||||||
gridLinesRotationSlider.ExpandedLabelText = $"Rotation: {rotation.NewValue:#,0.##}";
|
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
GridType.BindValueChanged(v =>
|
GridType.BindValueChanged(v =>
|
||||||
@@ -239,6 +239,8 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
{
|
{
|
||||||
gridTypeButtons.FadeTo(v.NewValue ? 1f : 0f, 500, Easing.OutQuint);
|
gridTypeButtons.FadeTo(v.NewValue ? 1f : 0f, 500, Easing.OutQuint);
|
||||||
gridTypeButtons.BypassAutoSizeAxes = !v.NewValue ? Axes.Y : Axes.None;
|
gridTypeButtons.BypassAutoSizeAxes = !v.NewValue ? Axes.Y : Axes.None;
|
||||||
|
|
||||||
|
Spacing = v.NewValue ? new Vector2(5) : new Vector2(15);
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,7 +254,7 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
switch (e.Action)
|
switch (e.Action)
|
||||||
{
|
{
|
||||||
case GlobalAction.EditorCycleGridSpacing:
|
case GlobalAction.EditorCycleGridSpacing:
|
||||||
Spacing.Value = Spacing.Value * 2 >= max_automatic_spacing ? Spacing.Value / 8 : Spacing.Value * 2;
|
GridLineSpacing.Value = GridLineSpacing.Value * 2 >= max_automatic_spacing ? GridLineSpacing.Value / 8 : GridLineSpacing.Value * 2;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case GlobalAction.EditorCycleGridType:
|
case GlobalAction.EditorCycleGridType:
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
@@ -142,7 +143,7 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
case PositionSnapGridType.Triangle:
|
case PositionSnapGridType.Triangle:
|
||||||
var triangularPositionSnapGrid = new TriangularPositionSnapGrid();
|
var triangularPositionSnapGrid = new TriangularPositionSnapGrid();
|
||||||
|
|
||||||
triangularPositionSnapGrid.Spacing.BindTo(OsuGridToolboxGroup.Spacing);
|
triangularPositionSnapGrid.Spacing.BindTo(OsuGridToolboxGroup.GridLineSpacing);
|
||||||
triangularPositionSnapGrid.GridLineRotation.BindTo(OsuGridToolboxGroup.GridLinesRotation);
|
triangularPositionSnapGrid.GridLineRotation.BindTo(OsuGridToolboxGroup.GridLinesRotation);
|
||||||
|
|
||||||
positionSnapGrid = triangularPositionSnapGrid;
|
positionSnapGrid = triangularPositionSnapGrid;
|
||||||
@@ -151,7 +152,7 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
case PositionSnapGridType.Circle:
|
case PositionSnapGridType.Circle:
|
||||||
var circularPositionSnapGrid = new CircularPositionSnapGrid();
|
var circularPositionSnapGrid = new CircularPositionSnapGrid();
|
||||||
|
|
||||||
circularPositionSnapGrid.Spacing.BindTo(OsuGridToolboxGroup.Spacing);
|
circularPositionSnapGrid.Spacing.BindTo(OsuGridToolboxGroup.GridLineSpacing);
|
||||||
|
|
||||||
positionSnapGrid = circularPositionSnapGrid;
|
positionSnapGrid = circularPositionSnapGrid;
|
||||||
break;
|
break;
|
||||||
@@ -171,7 +172,8 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
=> new OsuBlueprintContainer(this);
|
=> new OsuBlueprintContainer(this);
|
||||||
|
|
||||||
public override string ConvertSelectionToString()
|
public override string ConvertSelectionToString()
|
||||||
=> string.Join(',', selectedHitObjects.Cast<OsuHitObject>().OrderBy(h => h.StartTime).Select(h => (h.IndexInCurrentCombo + 1).ToString()));
|
=> string.Join(',', selectedHitObjects.Cast<OsuHitObject>().OrderBy(h => h.StartTime)
|
||||||
|
.Select(h => (h.IndexInCurrentCombo + 1).ToString(CultureInfo.InvariantCulture)));
|
||||||
|
|
||||||
// 1,2,3,4 ...
|
// 1,2,3,4 ...
|
||||||
private static readonly Regex selection_regex = new Regex(@"^\d+(,\d+)*$", RegexOptions.Compiled);
|
private static readonly Regex selection_regex = new Regex(@"^\d+(,\d+)*$", RegexOptions.Compiled);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public override LocalisableString Description => @"Don't use the same key twice in a row!";
|
public override LocalisableString Description => @"Don't use the same key twice in a row!";
|
||||||
public override IconUsage? Icon => OsuIcon.ModAlternate;
|
public override IconUsage? Icon => OsuIcon.ModAlternate;
|
||||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModSingleTap) }).ToArray();
|
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModSingleTap) }).ToArray();
|
||||||
|
public override bool Ranked => true;
|
||||||
|
|
||||||
protected override bool CheckValidNewAction(OsuAction action) => LastAcceptedAction != action;
|
protected override bool CheckValidNewAction(OsuAction action) => LastAcceptedAction != action;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
|
||||||
|
|
||||||
using osu.Framework.Audio;
|
|
||||||
using osu.Framework.Bindables;
|
|
||||||
using osu.Game.Configuration;
|
|
||||||
using osu.Game.Overlays.Settings;
|
|
||||||
using osu.Game.Rulesets.Mods;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Mods
|
|
||||||
{
|
|
||||||
public class OsuModRateAdjustConcrete : ModRateAdjustConcrete
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -16,6 +16,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public override IconUsage? Icon => OsuIcon.ModSingleTap;
|
public override IconUsage? Icon => OsuIcon.ModSingleTap;
|
||||||
public override LocalisableString Description => @"You must only use one key!";
|
public override LocalisableString Description => @"You must only use one key!";
|
||||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAlternate) }).ToArray();
|
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAlternate) }).ToArray();
|
||||||
|
public override bool Ranked => true;
|
||||||
|
|
||||||
protected override bool CheckValidNewAction(OsuAction action) => LastAcceptedAction == null || LastAcceptedAction == action;
|
protected override bool CheckValidNewAction(OsuAction action) => LastAcceptedAction == null || LastAcceptedAction == action;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -232,10 +232,7 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
|
|
||||||
case ModType.Special:
|
case ModType.Special:
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
return new Mod[]
|
return Array.Empty<Mod>();
|
||||||
{
|
|
||||||
new OsuModRateAdjustConcrete(),
|
|
||||||
};
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -257,7 +254,11 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
|
|
||||||
public override string ShortName => SHORT_NAME;
|
public override string ShortName => SHORT_NAME;
|
||||||
|
|
||||||
|
#if !DEBUG
|
||||||
public override string PlayingVerb => "Clicking circles";
|
public override string PlayingVerb => "Clicking circles";
|
||||||
|
#else
|
||||||
|
public override string PlayingVerb => "Debugging circles";
|
||||||
|
#endif
|
||||||
|
|
||||||
public override RulesetSettingsSubsection CreateSettings() => new OsuSettingsSubsection(this);
|
public override RulesetSettingsSubsection CreateSettings() => new OsuSettingsSubsection(this);
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
|
||||||
using osu.Framework.Graphics.Lines;
|
using osu.Framework.Graphics.Lines;
|
||||||
using osu.Framework.Graphics.Performance;
|
using osu.Framework.Graphics.Performance;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
@@ -12,7 +11,7 @@ using osuTK;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.UI.ReplayAnalysis
|
namespace osu.Game.Rulesets.Osu.UI.ReplayAnalysis
|
||||||
{
|
{
|
||||||
public partial class CursorPathContainer : Path
|
public partial class CursorPathContainer : SmoothPath
|
||||||
{
|
{
|
||||||
private readonly LifetimeEntryManager lifetimeManager = new LifetimeEntryManager();
|
private readonly LifetimeEntryManager lifetimeManager = new LifetimeEntryManager();
|
||||||
private readonly SortedSet<AnalysisFrameEntry> aliveEntries = new SortedSet<AnalysisFrameEntry>(new AimLinePointComparator());
|
private readonly SortedSet<AnalysisFrameEntry> aliveEntries = new SortedSet<AnalysisFrameEntry>(new AimLinePointComparator());
|
||||||
@@ -22,14 +21,13 @@ namespace osu.Game.Rulesets.Osu.UI.ReplayAnalysis
|
|||||||
lifetimeManager.EntryBecameAlive += entryBecameAlive;
|
lifetimeManager.EntryBecameAlive += entryBecameAlive;
|
||||||
lifetimeManager.EntryBecameDead += entryBecameDead;
|
lifetimeManager.EntryBecameDead += entryBecameDead;
|
||||||
|
|
||||||
PathRadius = 0.5f;
|
PathRadius = 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
Colour = colours.Pink2;
|
Colour = colours.Pink2;
|
||||||
BackgroundColour = colours.Pink2.Opacity(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<PropertyGroup Label="Nuget">
|
<PropertyGroup Label="Nuget">
|
||||||
<Title>osu! (ruleset)</Title>
|
<Title>osu! (ruleset)</Title>
|
||||||
<PackageId>ppy.osu.Game.Rulesets.Osu</PackageId>
|
<PackageId>jvnkosu.Client.Rulesets.Osu</PackageId>
|
||||||
<IsPackable>true</IsPackable>
|
<IsPackable>true</IsPackable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace osu.Game.Rulesets.Taiko.Edit.Blueprints
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private TaikoHitObjectComposer? composer { get; set; }
|
private TaikoHitObjectComposer? composer { get; set; }
|
||||||
|
|
||||||
protected override bool IsValidForPlacement => Precision.DefinitelyBigger(spanPlacementObject.Duration, 0);
|
protected override bool IsValidForPlacement => base.IsValidForPlacement && (PlacementActive == PlacementState.Waiting || Precision.DefinitelyBigger(spanPlacementObject.Duration, 0));
|
||||||
|
|
||||||
public TaikoSpanPlacementBlueprint(HitObject hitObject)
|
public TaikoSpanPlacementBlueprint(HitObject hitObject)
|
||||||
: base(hitObject)
|
: base(hitObject)
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ namespace osu.Game.Rulesets.Taiko.Edit.Checks
|
|||||||
protected override IEnumerable<(DifficultyRating rating, double thresholdMs, string name)> GetThresholds()
|
protected override IEnumerable<(DifficultyRating rating, double thresholdMs, string name)> GetThresholds()
|
||||||
{
|
{
|
||||||
// See lowest difficulty requirements in https://osu.ppy.sh/wiki/en/Ranking_criteria/osu%21taiko#general
|
// See lowest difficulty requirements in https://osu.ppy.sh/wiki/en/Ranking_criteria/osu%21taiko#general
|
||||||
yield return (DifficultyRating.Hard, new TimeSpan(0, 3, 30).TotalMilliseconds, "Muzukashii");
|
yield return (DifficultyRating.Hard, new TimeSpan(0, 2, 30).TotalMilliseconds, "Muzukashii");
|
||||||
yield return (DifficultyRating.Insane, new TimeSpan(0, 4, 15).TotalMilliseconds, "Oni");
|
yield return (DifficultyRating.Insane, new TimeSpan(0, 3, 15).TotalMilliseconds, "Oni");
|
||||||
yield return (DifficultyRating.Expert, new TimeSpan(0, 5, 0).TotalMilliseconds, "Inner Oni");
|
yield return (DifficultyRating.Expert, new TimeSpan(0, 4, 0).TotalMilliseconds, "Inner Oni");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ namespace osu.Game.Rulesets.Taiko.Mods
|
|||||||
public override IconUsage? Icon => OsuIcon.ModSingleTap;
|
public override IconUsage? Icon => OsuIcon.ModSingleTap;
|
||||||
public override LocalisableString Description => @"One key for dons, one key for kats.";
|
public override LocalisableString Description => @"One key for dons, one key for kats.";
|
||||||
|
|
||||||
|
public override bool Ranked => true;
|
||||||
public override double ScoreMultiplier => 1.0;
|
public override double ScoreMultiplier => 1.0;
|
||||||
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModRelax), typeof(TaikoModCinema) };
|
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModRelax), typeof(TaikoModCinema) };
|
||||||
public override ModType Type => ModType.Conversion;
|
public override ModType Type => ModType.Conversion;
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ namespace osu.Game.Rulesets.Taiko.Mods
|
|||||||
public override ModType Type => ModType.Conversion;
|
public override ModType Type => ModType.Conversion;
|
||||||
public override double ScoreMultiplier => 1;
|
public override double ScoreMultiplier => 1;
|
||||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModRandom)).ToArray();
|
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModRandom)).ToArray();
|
||||||
|
public override bool Ranked => true;
|
||||||
|
|
||||||
public void ApplyToBeatmap(IBeatmap beatmap)
|
public void ApplyToBeatmap(IBeatmap beatmap)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<PropertyGroup Label="Nuget">
|
<PropertyGroup Label="Nuget">
|
||||||
<Title>osu!taiko (ruleset)</Title>
|
<Title>osu!taiko (ruleset)</Title>
|
||||||
<PackageId>ppy.osu.Game.Rulesets.Taiko</PackageId>
|
<PackageId>jvnkosu.Client.Rulesets.Taiko</PackageId>
|
||||||
<IsPackable>true</IsPackable>
|
<IsPackable>true</IsPackable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace osu.Game.Tests.Chat
|
|||||||
public void OneTimeSetUp()
|
public void OneTimeSetUp()
|
||||||
{
|
{
|
||||||
originalWebsiteRootUrl = MessageFormatter.WebsiteRootUrl;
|
originalWebsiteRootUrl = MessageFormatter.WebsiteRootUrl;
|
||||||
MessageFormatter.WebsiteRootUrl = "dev.ppy.sh";
|
MessageFormatter.WebsiteRootUrl = "osu.jvnko.boats";
|
||||||
}
|
}
|
||||||
|
|
||||||
[OneTimeTearDown]
|
[OneTimeTearDown]
|
||||||
@@ -47,11 +47,11 @@ namespace osu.Game.Tests.Chat
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestSupportedProtocolLinkParsing()
|
public void TestSupportedProtocolLinkParsing()
|
||||||
{
|
{
|
||||||
Message result = MessageFormatter.FormatMessage(new Message { Content = "forgotspacehttps://dev.ppy.sh joinmyosump://12345 jointheosu://chan/#english" });
|
Message result = MessageFormatter.FormatMessage(new Message { Content = "forgotspacehttps://osu.jvnko.boats joinmyjvnkosump://12345 jointhejvnkosu://chan/#english" });
|
||||||
|
|
||||||
Assert.AreEqual("https://dev.ppy.sh", result.Links[0].Url);
|
Assert.AreEqual("https://osu.jvnko.boats", result.Links[0].Url);
|
||||||
Assert.AreEqual("osump://12345", result.Links[1].Url);
|
Assert.AreEqual("jvnkosump://12345", result.Links[1].Url);
|
||||||
Assert.AreEqual("osu://chan/#english", result.Links[2].Url);
|
Assert.AreEqual("jvnkosu://chan/#english", result.Links[2].Url);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@@ -66,15 +66,15 @@ namespace osu.Game.Tests.Chat
|
|||||||
Assert.AreEqual(36, result.Links[0].Length);
|
Assert.AreEqual(36, result.Links[0].Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase(LinkAction.OpenBeatmap, "456", "https://dev.ppy.sh/beatmapsets/123#osu/456")]
|
[TestCase(LinkAction.OpenBeatmap, "456", "https://osu.jvnko.boats/beatmapsets/123#osu/456")]
|
||||||
[TestCase(LinkAction.OpenBeatmap, "456", "https://dev.ppy.sh/beatmapsets/123#osu/456?whatever")]
|
[TestCase(LinkAction.OpenBeatmap, "456", "https://osu.jvnko.boats/beatmapsets/123#osu/456?whatever")]
|
||||||
[TestCase(LinkAction.OpenBeatmap, "456", "https://dev.ppy.sh/beatmapsets/123/456")]
|
[TestCase(LinkAction.OpenBeatmap, "456", "https://osu.jvnko.boats/beatmapsets/123/456")]
|
||||||
[TestCase(LinkAction.External, "https://dev.ppy.sh/beatmapsets/abc/def", "https://dev.ppy.sh/beatmapsets/abc/def")]
|
[TestCase(LinkAction.External, "https://osu.jvnko.boats/beatmapsets/abc/def", "https://osu.jvnko.boats/beatmapsets/abc/def")]
|
||||||
[TestCase(LinkAction.OpenBeatmapSet, "123", "https://dev.ppy.sh/beatmapsets/123")]
|
[TestCase(LinkAction.OpenBeatmapSet, "123", "https://osu.jvnko.boats/beatmapsets/123")]
|
||||||
[TestCase(LinkAction.OpenBeatmapSet, "123", "https://dev.ppy.sh/beatmapsets/123/whatever")]
|
[TestCase(LinkAction.OpenBeatmapSet, "123", "https://osu.jvnko.boats/beatmapsets/123/whatever")]
|
||||||
[TestCase(LinkAction.External, "https://dev.ppy.sh/beatmapsets/abc", "https://dev.ppy.sh/beatmapsets/abc")]
|
[TestCase(LinkAction.External, "https://osu.jvnko.boats/beatmapsets/abc", "https://osu.jvnko.boats/beatmapsets/abc")]
|
||||||
[TestCase(LinkAction.External, "https://dev.ppy.sh/beatmapsets/discussions", "https://dev.ppy.sh/beatmapsets/discussions")]
|
[TestCase(LinkAction.External, "https://osu.jvnko.boats/beatmapsets/discussions", "https://osu.jvnko.boats/beatmapsets/discussions")]
|
||||||
[TestCase(LinkAction.External, "https://dev.ppy.sh/beatmapsets/discussions/123", "https://dev.ppy.sh/beatmapsets/discussions/123")]
|
[TestCase(LinkAction.External, "https://osu.jvnko.boats/beatmapsets/discussions/123", "https://osu.jvnko.boats/beatmapsets/discussions/123")]
|
||||||
public void TestBeatmapLinks(LinkAction expectedAction, string expectedArg, string link)
|
public void TestBeatmapLinks(LinkAction expectedAction, string expectedArg, string link)
|
||||||
{
|
{
|
||||||
Message result = MessageFormatter.FormatMessage(new Message { Content = link });
|
Message result = MessageFormatter.FormatMessage(new Message { Content = link });
|
||||||
@@ -150,7 +150,7 @@ namespace osu.Game.Tests.Chat
|
|||||||
|
|
||||||
Assert.AreEqual("This is a Wiki Link.", result.DisplayContent);
|
Assert.AreEqual("This is a Wiki Link.", result.DisplayContent);
|
||||||
Assert.AreEqual(1, result.Links.Count);
|
Assert.AreEqual(1, result.Links.Count);
|
||||||
Assert.AreEqual("https://dev.ppy.sh/wiki/Wiki Link", result.Links[0].Url);
|
Assert.AreEqual("https://osu.jvnko.boats/wiki/Wiki Link", result.Links[0].Url);
|
||||||
Assert.AreEqual(10, result.Links[0].Index);
|
Assert.AreEqual(10, result.Links[0].Index);
|
||||||
Assert.AreEqual(9, result.Links[0].Length);
|
Assert.AreEqual(9, result.Links[0].Length);
|
||||||
}
|
}
|
||||||
@@ -163,15 +163,15 @@ namespace osu.Game.Tests.Chat
|
|||||||
Assert.AreEqual("This is a Wiki Link Wiki:LinkWiki.Link.", result.DisplayContent);
|
Assert.AreEqual("This is a Wiki Link Wiki:LinkWiki.Link.", result.DisplayContent);
|
||||||
Assert.AreEqual(3, result.Links.Count);
|
Assert.AreEqual(3, result.Links.Count);
|
||||||
|
|
||||||
Assert.AreEqual("https://dev.ppy.sh/wiki/Wiki Link", result.Links[0].Url);
|
Assert.AreEqual("https://osu.jvnko.boats/wiki/Wiki Link", result.Links[0].Url);
|
||||||
Assert.AreEqual(10, result.Links[0].Index);
|
Assert.AreEqual(10, result.Links[0].Index);
|
||||||
Assert.AreEqual(9, result.Links[0].Length);
|
Assert.AreEqual(9, result.Links[0].Length);
|
||||||
|
|
||||||
Assert.AreEqual("https://dev.ppy.sh/wiki/Wiki:Link", result.Links[1].Url);
|
Assert.AreEqual("https://osu.jvnko.boats/wiki/Wiki:Link", result.Links[1].Url);
|
||||||
Assert.AreEqual(20, result.Links[1].Index);
|
Assert.AreEqual(20, result.Links[1].Index);
|
||||||
Assert.AreEqual(9, result.Links[1].Length);
|
Assert.AreEqual(9, result.Links[1].Length);
|
||||||
|
|
||||||
Assert.AreEqual("https://dev.ppy.sh/wiki/Wiki.Link", result.Links[2].Url);
|
Assert.AreEqual("https://osu.jvnko.boats/wiki/Wiki.Link", result.Links[2].Url);
|
||||||
Assert.AreEqual(29, result.Links[2].Index);
|
Assert.AreEqual(29, result.Links[2].Index);
|
||||||
Assert.AreEqual(9, result.Links[2].Length);
|
Assert.AreEqual(9, result.Links[2].Length);
|
||||||
}
|
}
|
||||||
@@ -452,7 +452,7 @@ namespace osu.Game.Tests.Chat
|
|||||||
Assert.AreEqual(1, result.Links.Count);
|
Assert.AreEqual(1, result.Links.Count);
|
||||||
Assert.AreEqual($"{OsuGameBase.OSU_PROTOCOL}chan/#english", result.Links[0].Url);
|
Assert.AreEqual($"{OsuGameBase.OSU_PROTOCOL}chan/#english", result.Links[0].Url);
|
||||||
Assert.AreEqual(26, result.Links[0].Index);
|
Assert.AreEqual(26, result.Links[0].Index);
|
||||||
Assert.AreEqual(19, result.Links[0].Length);
|
Assert.AreEqual(23, result.Links[0].Length);
|
||||||
|
|
||||||
result = MessageFormatter.FormatMessage(new Message { Content = $"This is a [custom protocol]({OsuGameBase.OSU_PROTOCOL}chan/#english)." });
|
result = MessageFormatter.FormatMessage(new Message { Content = $"This is a [custom protocol]({OsuGameBase.OSU_PROTOCOL}chan/#english)." });
|
||||||
|
|
||||||
@@ -467,13 +467,13 @@ namespace osu.Game.Tests.Chat
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestOsuMpProtocol()
|
public void TestOsuMpProtocol()
|
||||||
{
|
{
|
||||||
Message result = MessageFormatter.FormatMessage(new Message { Content = "Join my multiplayer game osump://12346." });
|
Message result = MessageFormatter.FormatMessage(new Message { Content = "Join my multiplayer game jvnkosump://12346." });
|
||||||
|
|
||||||
Assert.AreEqual(result.Content, result.DisplayContent);
|
Assert.AreEqual(result.Content, result.DisplayContent);
|
||||||
Assert.AreEqual(1, result.Links.Count);
|
Assert.AreEqual(1, result.Links.Count);
|
||||||
Assert.AreEqual("osump://12346", result.Links[0].Url);
|
Assert.AreEqual("jvnkosump://12346", result.Links[0].Url);
|
||||||
Assert.AreEqual(25, result.Links[0].Index);
|
Assert.AreEqual(25, result.Links[0].Index);
|
||||||
Assert.AreEqual(13, result.Links[0].Length);
|
Assert.AreEqual(17, result.Links[0].Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@@ -499,7 +499,7 @@ namespace osu.Game.Tests.Chat
|
|||||||
Assert.AreEqual("This is a simple test with some [traps] and wiki links. Don't forget to visit https://osu.ppy.sh now![emoji]", result.DisplayContent);
|
Assert.AreEqual("This is a simple test with some [traps] and wiki links. Don't forget to visit https://osu.ppy.sh now![emoji]", result.DisplayContent);
|
||||||
Assert.AreEqual(4, result.Links.Count);
|
Assert.AreEqual(4, result.Links.Count);
|
||||||
|
|
||||||
Link f = result.Links.Find(l => l.Url == "https://dev.ppy.sh/wiki/wiki links");
|
Link f = result.Links.Find(l => l.Url == "https://osu.jvnko.boats/wiki/wiki links");
|
||||||
Assert.That(f, Is.Not.Null);
|
Assert.That(f, Is.Not.Null);
|
||||||
Assert.AreEqual(44, f.Index);
|
Assert.AreEqual(44, f.Index);
|
||||||
Assert.AreEqual(10, f.Length);
|
Assert.AreEqual(10, f.Length);
|
||||||
@@ -554,8 +554,8 @@ namespace osu.Game.Tests.Chat
|
|||||||
Assert.AreEqual("/relative", result.Argument);
|
Assert.AreEqual("/relative", result.Argument);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase("https://dev.ppy.sh/home/changelog", "")]
|
[TestCase("https://osu.jvnko.boats/home/changelog", "")]
|
||||||
[TestCase("https://dev.ppy.sh/home/changelog/lazer/2021.1012", "lazer/2021.1012")]
|
[TestCase("https://osu.jvnko.boats/home/changelog/lazer/2021.1012", "lazer/2021.1012")]
|
||||||
public void TestChangelogLinks(string link, string expectedArg)
|
public void TestChangelogLinks(string link, string expectedArg)
|
||||||
{
|
{
|
||||||
LinkDetails result = MessageFormatter.GetLinkDetails(link);
|
LinkDetails result = MessageFormatter.GetLinkDetails(link);
|
||||||
|
|||||||
@@ -220,6 +220,31 @@ namespace osu.Game.Tests.Chat
|
|||||||
AddAssert("channel has no messages", () => channel.Messages, () => Is.Empty);
|
AddAssert("channel has no messages", () => channel.Messages, () => Is.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestPrivateChannelsPurgedOnUserChange()
|
||||||
|
{
|
||||||
|
var pmChannel = createChannel(1002, ChannelType.PM);
|
||||||
|
AddStep("join a few private channels", () =>
|
||||||
|
{
|
||||||
|
channelManager.JoinChannel(createChannel(1001, ChannelType.PM));
|
||||||
|
channelManager.JoinChannel(createChannel(1003, ChannelType.Team));
|
||||||
|
channelManager.JoinChannel(pmChannel);
|
||||||
|
});
|
||||||
|
AddStep("close a PM channel", () => channelManager.LeaveChannel(pmChannel));
|
||||||
|
|
||||||
|
AddStep("switch user", () =>
|
||||||
|
{
|
||||||
|
((DummyAPIAccess.DummyLocalUserState)API.LocalUserState).User.Value = new APIUser
|
||||||
|
{
|
||||||
|
Id = 9009,
|
||||||
|
Username = "someone_else"
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
AddAssert("not joined to private channels of previous user",
|
||||||
|
() => !channelManager.JoinedChannels.Select(ch => ch.Id).Any(id => id >= 1001 && id <= 1003));
|
||||||
|
}
|
||||||
|
|
||||||
private void handlePostMessageRequest(PostMessageRequest request)
|
private void handlePostMessageRequest(PostMessageRequest request)
|
||||||
{
|
{
|
||||||
var message = new Message(++currentMessageId)
|
var message = new Message(++currentMessageId)
|
||||||
@@ -250,7 +275,7 @@ namespace osu.Game.Tests.Chat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Channel createChannel(int id, ChannelType type) => new Channel(new APIUser())
|
private Channel createChannel(int id, ChannelType type) => new Channel(new APIUser { Id = id })
|
||||||
{
|
{
|
||||||
Id = id,
|
Id = id,
|
||||||
Name = $"Channel {id}",
|
Name = $"Channel {id}",
|
||||||
|
|||||||
@@ -134,10 +134,12 @@ namespace osu.Game.Tests.Mods
|
|||||||
|
|
||||||
var mod = (OsuModDifficultyAdjust)apiMod.ToMod(ruleset);
|
var mod = (OsuModDifficultyAdjust)apiMod.ToMod(ruleset);
|
||||||
|
|
||||||
|
// WARNING: this only makes sense for debug builds which have very extended limits
|
||||||
|
// release builds still use sane values
|
||||||
Assert.Multiple(() =>
|
Assert.Multiple(() =>
|
||||||
{
|
{
|
||||||
Assert.That(mod.CircleSize.Value, Is.GreaterThanOrEqualTo(0).And.LessThanOrEqualTo(11));
|
Assert.That(mod.CircleSize.Value, Is.GreaterThanOrEqualTo(-250).And.LessThanOrEqualTo(13));
|
||||||
Assert.That(mod.ApproachRate.Value, Is.GreaterThanOrEqualTo(-10).And.LessThanOrEqualTo(11));
|
Assert.That(mod.ApproachRate.Value, Is.GreaterThanOrEqualTo(-250).And.LessThanOrEqualTo(13));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -738,6 +738,16 @@ namespace osu.Game.Tests.NonVisual.Filtering
|
|||||||
new object[] { "submitted=99999", false },
|
new object[] { "submitted=99999", false },
|
||||||
new object[] { "submitted>=2012-03-05-04", false },
|
new object[] { "submitted>=2012-03-05-04", false },
|
||||||
new object[] { "submitted>=2012/03.05-04", false },
|
new object[] { "submitted>=2012/03.05-04", false },
|
||||||
|
|
||||||
|
new object[] { "created<2012", true },
|
||||||
|
new object[] { "created<2012.03", true },
|
||||||
|
new object[] { "created<2012/03/05", true },
|
||||||
|
new object[] { "created<2012-3-5", true },
|
||||||
|
|
||||||
|
new object[] { "created<0", false },
|
||||||
|
new object[] { "created=99999", false },
|
||||||
|
new object[] { "created>=2012-03-05-04", false },
|
||||||
|
new object[] { "created>=2012/03.05-04", false },
|
||||||
};
|
};
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Online.Multiplayer.MatchTypes.Matchmaking;
|
using osu.Game.Online.Multiplayer.MatchTypes.Matchmaking;
|
||||||
@@ -149,5 +150,33 @@ namespace osu.Game.Tests.Online.Matchmaking
|
|||||||
Assert.AreEqual(5, state.Users.GetOrAdd(5).Placement);
|
Assert.AreEqual(5, state.Users.GetOrAdd(5).Placement);
|
||||||
Assert.AreEqual(6, state.Users.GetOrAdd(6).Placement);
|
Assert.AreEqual(6, state.Users.GetOrAdd(6).Placement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void AbandonOrder()
|
||||||
|
{
|
||||||
|
var state = new MatchmakingRoomState();
|
||||||
|
|
||||||
|
state.AdvanceRound();
|
||||||
|
state.RecordScores(
|
||||||
|
[
|
||||||
|
new SoloScoreInfo { UserID = 1, TotalScore = 1000 },
|
||||||
|
new SoloScoreInfo { UserID = 2, TotalScore = 500 },
|
||||||
|
], placement_points);
|
||||||
|
|
||||||
|
Assert.AreEqual(1, state.Users.GetOrAdd(1).Placement);
|
||||||
|
Assert.AreEqual(2, state.Users.GetOrAdd(2).Placement);
|
||||||
|
|
||||||
|
state.Users.GetOrAdd(1).AbandonedAt = DateTimeOffset.Now;
|
||||||
|
state.RecordScores([], placement_points);
|
||||||
|
|
||||||
|
Assert.AreEqual(2, state.Users.GetOrAdd(1).Placement);
|
||||||
|
Assert.AreEqual(1, state.Users.GetOrAdd(2).Placement);
|
||||||
|
|
||||||
|
state.Users.GetOrAdd(2).AbandonedAt = DateTimeOffset.Now - TimeSpan.FromMinutes(1);
|
||||||
|
state.RecordScores([], placement_points);
|
||||||
|
|
||||||
|
Assert.AreEqual(1, state.Users.GetOrAdd(1).Placement);
|
||||||
|
Assert.AreEqual(2, state.Users.GetOrAdd(2).Placement);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace osu.Game.Tests.Online
|
|||||||
Assert.NotNull(converted);
|
Assert.NotNull(converted);
|
||||||
Assert.That(converted, Is.TypeOf(typeof(UnknownMod)));
|
Assert.That(converted, Is.TypeOf(typeof(UnknownMod)));
|
||||||
Assert.That(converted.Type, Is.EqualTo(ModType.System));
|
Assert.That(converted.Type, Is.EqualTo(ModType.System));
|
||||||
Assert.That(converted.Acronym, Is.EqualTo("WNG??"));
|
Assert.That(converted.Acronym, Is.EqualTo("WNG!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ namespace osu.Game.Tests.Online
|
|||||||
public override Live<BeatmapSetInfo>? ImportModel(BeatmapSetInfo item, ArchiveReader? archive = null, ImportParameters parameters = default,
|
public override Live<BeatmapSetInfo>? ImportModel(BeatmapSetInfo item, ArchiveReader? archive = null, ImportParameters parameters = default,
|
||||||
CancellationToken cancellationToken = default)
|
CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
if (!testBeatmapManager.AllowImport.Wait(TimeSpan.FromSeconds(10), cancellationToken))
|
if (!testBeatmapManager.AllowImport.Wait(TimeSpan.FromSeconds(30), cancellationToken))
|
||||||
throw new TimeoutException("Timeout waiting for import to be allowed.");
|
throw new TimeoutException("Timeout waiting for import to be allowed.");
|
||||||
|
|
||||||
return testBeatmapManager.CurrentImport = base.ImportModel(item, archive, parameters, cancellationToken);
|
return testBeatmapManager.CurrentImport = base.ImportModel(item, archive, parameters, cancellationToken);
|
||||||
|
|||||||
BIN
osu.Game.Tests/Resources/Archives/modified-classic-20250827.osk
Normal file
BIN
osu.Game.Tests/Resources/special-skin/score-0@2x.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-1@2x.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-2@2x.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-3@2x.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-4@2x.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-5@2x.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-6@2x.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-7@2x.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-8@2x.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-9@2x.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-comma@2x.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-dot@2x.png
Normal file
|
After Width: | Height: | Size: 930 B |
BIN
osu.Game.Tests/Resources/special-skin/score-percent@2x.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-pp@2x.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-x@2x.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
@@ -81,6 +81,8 @@ namespace osu.Game.Tests.Skins
|
|||||||
"Archives/modified-argon-20250809.osk",
|
"Archives/modified-argon-20250809.osk",
|
||||||
// Covers "Argon" judgement counter
|
// Covers "Argon" judgement counter
|
||||||
"Archives/modified-argon-20250308.osk",
|
"Archives/modified-argon-20250308.osk",
|
||||||
|
// Covers "Argon" clicks/s counter, longest combo counter, skinnable SR display and beatmap status pill
|
||||||
|
"Archives/modified-argon-20251215-jvnkosu.osk",
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -266,7 +266,11 @@ namespace osu.Game.Tests.Visual.Background
|
|||||||
|
|
||||||
FadeAccessibleResults results = null;
|
FadeAccessibleResults results = null;
|
||||||
|
|
||||||
AddStep("Transition to Results", () => player.Push(results = new FadeAccessibleResults(TestResources.CreateTestScoreInfo())));
|
AddStep("Transition to Results", () =>
|
||||||
|
{
|
||||||
|
player.ValidForResume = false;
|
||||||
|
player.Push(results = new FadeAccessibleResults(TestResources.CreateTestScoreInfo()));
|
||||||
|
});
|
||||||
|
|
||||||
AddUntilStep("Wait for results is current", () => results.IsCurrentScreen());
|
AddUntilStep("Wait for results is current", () => results.IsCurrentScreen());
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace osu.Game.Tests.Visual.Beatmaps
|
|||||||
AddStep("create thumbnail", () =>
|
AddStep("create thumbnail", () =>
|
||||||
{
|
{
|
||||||
var beatmapSet = CreateAPIBeatmapSet(Ruleset.Value);
|
var beatmapSet = CreateAPIBeatmapSet(Ruleset.Value);
|
||||||
beatmapSet.OnlineID = 241526; // ID hardcoded to ensure that the preview track exists online.
|
beatmapSet.OnlineID = 1; // ID hardcoded to ensure that the preview track exists online.
|
||||||
|
|
||||||
Child = thumbnail = new BeatmapCardThumbnail(beatmapSet, beatmapSet)
|
Child = thumbnail = new BeatmapCardThumbnail(beatmapSet, beatmapSet)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
double lastStarRating = 0;
|
double lastStarRating = 0;
|
||||||
double lastLength = 0;
|
double lastLength = 0;
|
||||||
|
|
||||||
AddStep("Add timing point", () => EditorBeatmap.ControlPointInfo.Add(200, new TimingControlPoint { BeatLength = 600 }));
|
AddStep("Add timing point", () => EditorBeatmap.ControlPointInfo.Add(0, new TimingControlPoint { BeatLength = 600 }));
|
||||||
AddStep("Change to placement mode", () => InputManager.Key(Key.Number2));
|
AddStep("Change to placement mode", () => InputManager.Key(Key.Number2));
|
||||||
AddStep("Move to playfield", () => InputManager.MoveMouseTo(Game.ScreenSpaceDrawQuad.Centre));
|
AddStep("Move to playfield", () => InputManager.MoveMouseTo(Game.ScreenSpaceDrawQuad.Centre));
|
||||||
AddStep("Place single hitcircle", () => InputManager.Click(MouseButton.Left));
|
AddStep("Place single hitcircle", () => InputManager.Click(MouseButton.Left));
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
setUpEditor(new OsuRuleset().RulesetInfo);
|
setUpEditor(new OsuRuleset().RulesetInfo);
|
||||||
AddAssert("is osu! ruleset", () => editorBeatmap.BeatmapInfo.Ruleset.Equals(new OsuRuleset().RulesetInfo));
|
AddAssert("is osu! ruleset", () => editorBeatmap.BeatmapInfo.Ruleset.Equals(new OsuRuleset().RulesetInfo));
|
||||||
|
|
||||||
AddStep("jump to encoded link", () => Game.HandleLink("osu://edit/00:14:142%20(1)"));
|
AddStep("jump to encoded link", () => Game.HandleLink("jvnkosu://edit/00:14:142%20(1)"));
|
||||||
|
|
||||||
AddUntilStep("wait for seek", () => editorClock.SeekingOrStopped.Value);
|
AddUntilStep("wait for seek", () => editorClock.SeekingOrStopped.Value);
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using osu.Framework.Screens;
|
|||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Input.Bindings;
|
using osu.Game.Input.Bindings;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
@@ -27,7 +28,12 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
{
|
{
|
||||||
protected override Ruleset CreateEditorRuleset() => new OsuRuleset();
|
protected override Ruleset CreateEditorRuleset() => new OsuRuleset();
|
||||||
|
|
||||||
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset) => new TestBeatmap(ruleset, false);
|
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset)
|
||||||
|
{
|
||||||
|
var beatmap = new TestBeatmap(ruleset, false);
|
||||||
|
beatmap.ControlPointInfo.Add(0, new TimingControlPoint());
|
||||||
|
return beatmap;
|
||||||
|
}
|
||||||
|
|
||||||
private GlobalActionContainer globalActionContainer => this.ChildrenOfType<GlobalActionContainer>().Single();
|
private GlobalActionContainer globalActionContainer => this.ChildrenOfType<GlobalActionContainer>().Single();
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using NUnit.Framework;
|
|||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
@@ -27,7 +28,12 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
{
|
{
|
||||||
protected override Ruleset CreateEditorRuleset() => new OsuRuleset();
|
protected override Ruleset CreateEditorRuleset() => new OsuRuleset();
|
||||||
|
|
||||||
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset) => new TestBeatmap(ruleset, false);
|
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset)
|
||||||
|
{
|
||||||
|
var beatmap = new TestBeatmap(ruleset, false);
|
||||||
|
beatmap.ControlPointInfo.Add(0, new TimingControlPoint { BeatLength = 500 });
|
||||||
|
return beatmap;
|
||||||
|
}
|
||||||
|
|
||||||
private TimelineBlueprintContainer blueprintContainer
|
private TimelineBlueprintContainer blueprintContainer
|
||||||
=> Editor.ChildrenOfType<TimelineBlueprintContainer>().First();
|
=> Editor.ChildrenOfType<TimelineBlueprintContainer>().First();
|
||||||
@@ -80,7 +86,7 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
{
|
{
|
||||||
InputManager.Key(Key.Number1);
|
InputManager.Key(Key.Number1);
|
||||||
blueprint = this.ChildrenOfType<TimelineHitObjectBlueprint>().First();
|
blueprint = this.ChildrenOfType<TimelineHitObjectBlueprint>().First();
|
||||||
InputManager.MoveMouseTo(blueprint);
|
InputManager.MoveMouseTo(blueprint, new Vector2(-1, 0));
|
||||||
InputManager.Click(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
|
using osu.Game.Screens.Play.HUD;
|
||||||
|
using osu.Game.Screens.Select.Leaderboards;
|
||||||
|
using osuTK.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.Tests.Visual.Gameplay
|
||||||
|
{
|
||||||
|
public partial class TestSceneDrawableGameplayLeaderboardScore : OsuTestScene
|
||||||
|
{
|
||||||
|
private readonly APIUser user = new APIUser { Username = "user" };
|
||||||
|
private readonly BindableLong totalScore = new BindableLong();
|
||||||
|
private readonly Bindable<int?> position = new Bindable<int?>();
|
||||||
|
private readonly BindableBool quit = new BindableBool();
|
||||||
|
private readonly BindableBool expanded = new BindableBool();
|
||||||
|
|
||||||
|
public TestSceneDrawableGameplayLeaderboardScore()
|
||||||
|
{
|
||||||
|
AddSliderStep("total score", 0, 1_000_000, 500_000, s => totalScore.Value = s);
|
||||||
|
AddSliderStep("position", 1, 100, 5, s => position.Value = s);
|
||||||
|
AddToggleStep("toggle quit", q => quit.Value = q);
|
||||||
|
AddToggleStep("toggle expanded", e => expanded.Value = e);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static readonly OsuColour osu_colour = new OsuColour();
|
||||||
|
|
||||||
|
private static readonly object?[][] leaderboard_variants =
|
||||||
|
{
|
||||||
|
new object?[] { false, null },
|
||||||
|
new object?[] { true, null },
|
||||||
|
new object?[] { false, osu_colour.TeamColourRed },
|
||||||
|
new object?[] { true, osu_colour.TeamColourRed },
|
||||||
|
new object?[] { false, osu_colour.TeamColourBlue },
|
||||||
|
new object?[] { true, osu_colour.TeamColourBlue },
|
||||||
|
};
|
||||||
|
|
||||||
|
[TestCaseSource(nameof(leaderboard_variants))]
|
||||||
|
public void TestVariants(bool tracked, Color4? teamColour)
|
||||||
|
{
|
||||||
|
AddStep("show", () =>
|
||||||
|
{
|
||||||
|
GameplayLeaderboardScore score = new GameplayLeaderboardScore(user, tracked, totalScore)
|
||||||
|
{
|
||||||
|
Position = { BindTarget = position },
|
||||||
|
HasQuit = { BindTarget = quit },
|
||||||
|
TeamColour = teamColour,
|
||||||
|
};
|
||||||
|
Child = new Container
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
Width = 250,
|
||||||
|
Child = new DrawableGameplayLeaderboardScore(score)
|
||||||
|
{
|
||||||
|
Expanded = { BindTarget = expanded },
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -80,7 +80,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
KeyCounter counter = null!;
|
KeyCounter counter = null!;
|
||||||
|
|
||||||
loadPlayer(() => new OsuRuleset());
|
loadPlayer(() => new OsuRuleset());
|
||||||
AddStep("get key counter", () => counter = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterActionTrigger<OsuAction> actionTrigger && actionTrigger.Action == OsuAction.LeftButton));
|
AddStep("get key counter", () => counter = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterBindingTrigger<OsuAction> actionTrigger && actionTrigger.Action == OsuAction.LeftButton));
|
||||||
checkKey(() => counter, 0, false);
|
checkKey(() => counter, 0, false);
|
||||||
|
|
||||||
AddStep("press Z", () => InputManager.PressKey(Key.Z));
|
AddStep("press Z", () => InputManager.PressKey(Key.Z));
|
||||||
@@ -117,7 +117,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
KeyCounter counter = null!;
|
KeyCounter counter = null!;
|
||||||
|
|
||||||
loadPlayer(() => new ManiaRuleset());
|
loadPlayer(() => new ManiaRuleset());
|
||||||
AddStep("get key counter", () => counter = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterActionTrigger<ManiaAction> actionTrigger && actionTrigger.Action == ManiaAction.Key4));
|
AddStep("get key counter", () => counter = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterBindingTrigger<ManiaAction> actionTrigger && actionTrigger.Action == ManiaAction.Key4));
|
||||||
checkKey(() => counter, 0, false);
|
checkKey(() => counter, 0, false);
|
||||||
|
|
||||||
AddStep("press space", () => InputManager.PressKey(Key.Space));
|
AddStep("press space", () => InputManager.PressKey(Key.Space));
|
||||||
@@ -150,8 +150,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
KeyCounter counterX = null!;
|
KeyCounter counterX = null!;
|
||||||
|
|
||||||
loadPlayer(() => new OsuRuleset());
|
loadPlayer(() => new OsuRuleset());
|
||||||
AddStep("get key counter Z", () => counterZ = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterActionTrigger<OsuAction> actionTrigger && actionTrigger.Action == OsuAction.LeftButton));
|
AddStep("get key counter Z", () => counterZ = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterBindingTrigger<OsuAction> actionTrigger && actionTrigger.Action == OsuAction.LeftButton));
|
||||||
AddStep("get key counter X", () => counterX = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterActionTrigger<OsuAction> actionTrigger && actionTrigger.Action == OsuAction.RightButton));
|
AddStep("get key counter X", () => counterX = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterBindingTrigger<OsuAction> actionTrigger && actionTrigger.Action == OsuAction.RightButton));
|
||||||
|
|
||||||
AddStep("press Z", () => InputManager.PressKey(Key.Z));
|
AddStep("press Z", () => InputManager.PressKey(Key.Z));
|
||||||
AddStep("pause", () => Player.Pause());
|
AddStep("pause", () => Player.Pause());
|
||||||
@@ -184,7 +184,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
KeyCounter counter = null!;
|
KeyCounter counter = null!;
|
||||||
|
|
||||||
loadPlayer(() => new ManiaRuleset());
|
loadPlayer(() => new ManiaRuleset());
|
||||||
AddStep("get key counter", () => counter = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterActionTrigger<ManiaAction> actionTrigger && actionTrigger.Action == ManiaAction.Key4));
|
AddStep("get key counter", () => counter = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterBindingTrigger<ManiaAction> actionTrigger && actionTrigger.Action == ManiaAction.Key4));
|
||||||
|
|
||||||
AddStep("press space", () => InputManager.PressKey(Key.Space));
|
AddStep("press space", () => InputManager.PressKey(Key.Space));
|
||||||
AddStep("pause", () => Player.Pause());
|
AddStep("pause", () => Player.Pause());
|
||||||
@@ -204,8 +204,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
KeyCounter counterX = null!;
|
KeyCounter counterX = null!;
|
||||||
|
|
||||||
loadPlayer(() => new OsuRuleset());
|
loadPlayer(() => new OsuRuleset());
|
||||||
AddStep("get key counter Z", () => counterZ = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterActionTrigger<OsuAction> actionTrigger && actionTrigger.Action == OsuAction.LeftButton));
|
AddStep("get key counter Z", () => counterZ = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterBindingTrigger<OsuAction> actionTrigger && actionTrigger.Action == OsuAction.LeftButton));
|
||||||
AddStep("get key counter X", () => counterX = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterActionTrigger<OsuAction> actionTrigger && actionTrigger.Action == OsuAction.RightButton));
|
AddStep("get key counter X", () => counterX = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterBindingTrigger<OsuAction> actionTrigger && actionTrigger.Action == OsuAction.RightButton));
|
||||||
|
|
||||||
AddStep("press Z", () => InputManager.PressKey(Key.Z));
|
AddStep("press Z", () => InputManager.PressKey(Key.Z));
|
||||||
AddStep("pause", () => Player.Pause());
|
AddStep("pause", () => Player.Pause());
|
||||||
@@ -247,7 +247,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
KeyCounter counter = null!;
|
KeyCounter counter = null!;
|
||||||
|
|
||||||
loadPlayer(() => new ManiaRuleset());
|
loadPlayer(() => new ManiaRuleset());
|
||||||
AddStep("get key counter", () => counter = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterActionTrigger<ManiaAction> actionTrigger && actionTrigger.Action == ManiaAction.Key4));
|
AddStep("get key counter", () => counter = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterBindingTrigger<ManiaAction> actionTrigger && actionTrigger.Action == ManiaAction.Key4));
|
||||||
|
|
||||||
AddStep("press space", () => InputManager.PressKey(Key.Space));
|
AddStep("press space", () => InputManager.PressKey(Key.Space));
|
||||||
checkKey(() => counter, 1, true);
|
checkKey(() => counter, 1, true);
|
||||||
@@ -271,7 +271,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
KeyCounter counter = null!;
|
KeyCounter counter = null!;
|
||||||
|
|
||||||
loadPlayer(() => new OsuRuleset());
|
loadPlayer(() => new OsuRuleset());
|
||||||
AddStep("get key counter", () => counter = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterActionTrigger<OsuAction> actionTrigger && actionTrigger.Action == OsuAction.LeftButton));
|
AddStep("get key counter", () => counter = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterBindingTrigger<OsuAction> actionTrigger && actionTrigger.Action == OsuAction.LeftButton));
|
||||||
|
|
||||||
AddStep("pause", () => Player.Pause());
|
AddStep("pause", () => Player.Pause());
|
||||||
AddStep("resume", () => Player.Resume());
|
AddStep("resume", () => Player.Resume());
|
||||||
@@ -297,7 +297,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
KeyCounter counter = null!;
|
KeyCounter counter = null!;
|
||||||
|
|
||||||
loadPlayer(() => new OsuRuleset());
|
loadPlayer(() => new OsuRuleset());
|
||||||
AddStep("get key counter", () => counter = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterActionTrigger<OsuAction> actionTrigger && actionTrigger.Action == OsuAction.LeftButton));
|
AddStep("get key counter", () => counter = this.ChildrenOfType<KeyCounter>().Single(k => k.Trigger is KeyCounterBindingTrigger<OsuAction> actionTrigger && actionTrigger.Action == OsuAction.LeftButton));
|
||||||
|
|
||||||
AddStep("press Z", () => InputManager.PressKey(Key.Z));
|
AddStep("press Z", () => InputManager.PressKey(Key.Z));
|
||||||
AddAssert("circle hit", () => Player.ScoreProcessor.HighestCombo.Value, () => Is.EqualTo(1));
|
AddAssert("circle hit", () => Player.ScoreProcessor.HighestCombo.Value, () => Is.EqualTo(1));
|
||||||
|
|||||||
@@ -642,7 +642,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
if (!AllowLoad.Wait(TimeSpan.FromSeconds(10)))
|
if (!AllowLoad.Wait(TimeSpan.FromSeconds(30)))
|
||||||
throw new TimeoutException();
|
throw new TimeoutException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
34
osu.Game.Tests/Visual/Matchmaking/MatchmakingTestScene.cs
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Game.Overlays;
|
||||||
|
using osu.Game.Screens;
|
||||||
|
using osu.Game.Screens.OnlinePlay.Matchmaking.Match;
|
||||||
|
using osu.Game.Tests.Visual.Multiplayer;
|
||||||
|
|
||||||
|
namespace osu.Game.Tests.Visual.Matchmaking
|
||||||
|
{
|
||||||
|
public abstract partial class MatchmakingTestScene : MultiplayerTestScene
|
||||||
|
{
|
||||||
|
protected override Container<Drawable> Content { get; }
|
||||||
|
|
||||||
|
[Cached]
|
||||||
|
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Plum);
|
||||||
|
|
||||||
|
protected MatchmakingTestScene()
|
||||||
|
{
|
||||||
|
BackgroundScreenStack backgroundStack;
|
||||||
|
|
||||||
|
base.Content.AddRange(new Drawable[]
|
||||||
|
{
|
||||||
|
backgroundStack = new BackgroundScreenStack(),
|
||||||
|
Content = new Container { RelativeSizeAxes = Axes.Both }
|
||||||
|
});
|
||||||
|
|
||||||
|
backgroundStack.Push(new MatchmakingBackgroundScreen(colourProvider));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,7 +8,6 @@ using NUnit.Framework;
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Framework.Utils;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
@@ -17,12 +16,11 @@ using osu.Game.Online.API.Requests.Responses;
|
|||||||
using osu.Game.Online.Rooms;
|
using osu.Game.Online.Rooms;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect;
|
using osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect;
|
||||||
using osu.Game.Tests.Visual.OnlinePlay;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Matchmaking
|
namespace osu.Game.Tests.Visual.Matchmaking
|
||||||
{
|
{
|
||||||
public partial class TestSceneBeatmapSelectGrid : OnlinePlayTestScene
|
public partial class TestSceneBeatmapSelectGrid : MatchmakingTestScene
|
||||||
{
|
{
|
||||||
private MatchmakingPlaylistItem[] items = null!;
|
private MatchmakingPlaylistItem[] items = null!;
|
||||||
|
|
||||||
@@ -131,7 +129,7 @@ namespace osu.Game.Tests.Visual.Matchmaking
|
|||||||
{
|
{
|
||||||
var (candidateItems, finalItem) = pickRandomItems(5);
|
var (candidateItems, finalItem) = pickRandomItems(5);
|
||||||
|
|
||||||
grid.RollAndDisplayFinalBeatmap(candidateItems, finalItem);
|
grid.RollAndDisplayFinalBeatmap(candidateItems, finalItem, finalItem);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,7 +158,7 @@ namespace osu.Game.Tests.Visual.Matchmaking
|
|||||||
grid.ArrangeItemsForRollAnimation(duration: 0, stagger: 0);
|
grid.ArrangeItemsForRollAnimation(duration: 0, stagger: 0);
|
||||||
grid.PlayRollAnimation(finalItem, duration: 0);
|
grid.PlayRollAnimation(finalItem, duration: 0);
|
||||||
|
|
||||||
Scheduler.AddDelayed(() => grid.PresentRolledBeatmap(finalItem), 500);
|
Scheduler.AddDelayed(() => grid.PresentRolledBeatmap(finalItem, finalItem), 500);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,7 +173,25 @@ namespace osu.Game.Tests.Visual.Matchmaking
|
|||||||
grid.ArrangeItemsForRollAnimation(duration: 0, stagger: 0);
|
grid.ArrangeItemsForRollAnimation(duration: 0, stagger: 0);
|
||||||
grid.PlayRollAnimation(finalItem, duration: 0);
|
grid.PlayRollAnimation(finalItem, duration: 0);
|
||||||
|
|
||||||
Scheduler.AddDelayed(() => grid.PresentUnanimouslyChosenBeatmap(finalItem), 500);
|
Scheduler.AddDelayed(() => grid.PresentUnanimouslyChosenBeatmap(finalItem, finalItem), 500);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestPresentRandomItem()
|
||||||
|
{
|
||||||
|
AddStep("present random item panel", () =>
|
||||||
|
{
|
||||||
|
var (candidateItems, finalItem) = pickRandomItems(4);
|
||||||
|
|
||||||
|
grid.TransferCandidatePanelsToRollContainer(candidateItems.Append(-1).ToArray(), duration: 0);
|
||||||
|
grid.ArrangeItemsForRollAnimation(duration: 0, stagger: 0);
|
||||||
|
grid.PlayRollAnimation(-1, duration: 0);
|
||||||
|
|
||||||
|
Scheduler.AddDelayed(() =>
|
||||||
|
{
|
||||||
|
grid.PresentRolledBeatmap(-1, finalItem);
|
||||||
|
}, 500);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,20 +236,19 @@ namespace osu.Game.Tests.Visual.Matchmaking
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestPresentRandomItem()
|
public void TestRollAnimationFinalRandom()
|
||||||
{
|
{
|
||||||
AddStep("present random item panel", () =>
|
AddStep("play animation", () =>
|
||||||
{
|
{
|
||||||
grid.TransferCandidatePanelsToRollContainer(pickRandomItems(4).candidateItems.Append(-1).ToArray(), duration: 0);
|
(long[] candidateItems, _) = pickRandomItems(5);
|
||||||
grid.ArrangeItemsForRollAnimation(duration: 0, stagger: 0);
|
|
||||||
grid.PlayRollAnimation(-1, duration: 0);
|
|
||||||
|
|
||||||
Scheduler.AddDelayed(() => grid.PresentUnanimouslyChosenBeatmap(-1), 500);
|
candidateItems = candidateItems.Append(-1).ToArray();
|
||||||
|
long finalItem = items.First(i => !candidateItems.Contains(i.ID)).ID;
|
||||||
|
|
||||||
|
grid.RollAndDisplayFinalBeatmap(candidateItems, -1, finalItem);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddWaitStep("wait for animation", 5);
|
AddWaitStep("wait for animation", 10);
|
||||||
|
|
||||||
AddStep("reveal beatmap", () => grid.RevealRandomItem(items[RNG.Next(items.Length)].PlaylistItem));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private (long[] candidateItems, long finalItem) pickRandomItems(int count)
|
private (long[] candidateItems, long finalItem) pickRandomItems(int count)
|
||||||
|
|||||||
@@ -12,11 +12,10 @@ using osu.Game.Online.Rooms;
|
|||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Rulesets.Osu.Mods;
|
using osu.Game.Rulesets.Osu.Mods;
|
||||||
using osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect;
|
using osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect;
|
||||||
using osu.Game.Tests.Visual.Multiplayer;
|
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Matchmaking
|
namespace osu.Game.Tests.Visual.Matchmaking
|
||||||
{
|
{
|
||||||
public partial class TestSceneBeatmapSelectPanel : MultiplayerTestScene
|
public partial class TestSceneBeatmapSelectPanel : MatchmakingTestScene
|
||||||
{
|
{
|
||||||
[Cached]
|
[Cached]
|
||||||
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple);
|
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple);
|
||||||
@@ -99,7 +98,7 @@ namespace osu.Game.Tests.Visual.Matchmaking
|
|||||||
|
|
||||||
AddToggleStep("allow selection", value => panel!.AllowSelection = value);
|
AddToggleStep("allow selection", value => panel!.AllowSelection = value);
|
||||||
|
|
||||||
AddStep("reveal beatmap", () => panel!.RevealBeatmap(CreateAPIBeatmap(), []));
|
AddStep("reveal beatmap", () => panel!.PresentAsChosenBeatmap(new MatchmakingPlaylistItem(new MultiplayerPlaylistItem(), CreateAPIBeatmap(), [])));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ using osuTK;
|
|||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Matchmaking
|
namespace osu.Game.Tests.Visual.Matchmaking
|
||||||
{
|
{
|
||||||
public partial class TestSceneMatchmakingChatDisplay : ScreenTestScene
|
public partial class TestSceneMatchmakingChatDisplay : MatchmakingTestScene
|
||||||
{
|
{
|
||||||
private MatchmakingChatDisplay? chat;
|
private MatchmakingChatDisplay? chat;
|
||||||
|
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ namespace osu.Game.Tests.Visual.Matchmaking
|
|||||||
{
|
{
|
||||||
Value =
|
Value =
|
||||||
[
|
[
|
||||||
new MatchmakingPool { Id = 0, RulesetId = 0, Name = "osu!" },
|
new MatchmakingPool { Id = 0, RulesetId = 0, Name = "Free-for-all" },
|
||||||
new MatchmakingPool { Id = 1, RulesetId = 1, Name = "osu!taiko" },
|
new MatchmakingPool { Id = 1, RulesetId = 1, Name = "1v1" },
|
||||||
new MatchmakingPool { Id = 2, RulesetId = 2, Name = "osu!catch" },
|
new MatchmakingPool { Id = 2, RulesetId = 2, Name = "1v1" },
|
||||||
new MatchmakingPool { Id = 3, RulesetId = 3, Variant = 4, Name = "osu!mania (4k)" },
|
new MatchmakingPool { Id = 3, RulesetId = 3, Variant = 4, Name = "1v1" },
|
||||||
new MatchmakingPool { Id = 4, RulesetId = 3, Variant = 7, Name = "osu!mania (7k)" },
|
new MatchmakingPool { Id = 4, RulesetId = 3, Variant = 7, Name = "1v1" },
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ namespace osu.Game.Tests.Visual.Matchmaking
|
|||||||
|
|
||||||
state.CandidateItems = beatmaps.Select(b => b.ID).ToArray();
|
state.CandidateItems = beatmaps.Select(b => b.ID).ToArray();
|
||||||
state.CandidateItem = beatmaps[0].ID;
|
state.CandidateItem = beatmaps[0].ID;
|
||||||
|
state.GameplayItem = beatmaps[0].ID;
|
||||||
}, waitTime: 35);
|
}, waitTime: 35);
|
||||||
|
|
||||||
changeStage(MatchmakingStage.WaitingForClientsBeatmapDownload);
|
changeStage(MatchmakingStage.WaitingForClientsBeatmapDownload);
|
||||||
|
|||||||
@@ -3,11 +3,10 @@
|
|||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Screens.OnlinePlay.Matchmaking.Match.Results;
|
using osu.Game.Screens.OnlinePlay.Matchmaking.Match.Results;
|
||||||
using osu.Game.Tests.Visual.Multiplayer;
|
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Matchmaking
|
namespace osu.Game.Tests.Visual.Matchmaking
|
||||||
{
|
{
|
||||||
public partial class TestScenePanelRoomAward : MultiplayerTestScene
|
public partial class TestScenePanelRoomAward : MatchmakingTestScene
|
||||||
{
|
{
|
||||||
public override void SetUpSteps()
|
public override void SetUpSteps()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,16 +6,16 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
|
using osu.Framework.Testing;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
using osu.Game.Online.Rooms;
|
using osu.Game.Online.Rooms;
|
||||||
using osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect;
|
using osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect;
|
||||||
using osu.Game.Tests.Visual.Multiplayer;
|
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Matchmaking
|
namespace osu.Game.Tests.Visual.Matchmaking
|
||||||
{
|
{
|
||||||
public partial class TestScenePickScreen : MultiplayerTestScene
|
public partial class TestScenePickScreen : MatchmakingTestScene
|
||||||
{
|
{
|
||||||
private readonly IReadOnlyList<APIUser> users = new[]
|
private readonly IReadOnlyList<APIUser> users = new[]
|
||||||
{
|
{
|
||||||
@@ -104,8 +104,28 @@ namespace osu.Game.Tests.Visual.Matchmaking
|
|||||||
long[] candidateItems = selectedItems.ToArray();
|
long[] candidateItems = selectedItems.ToArray();
|
||||||
long finalItem = candidateItems[Random.Shared.Next(candidateItems.Length)];
|
long finalItem = candidateItems[Random.Shared.Next(candidateItems.Length)];
|
||||||
|
|
||||||
screen.RollFinalBeatmap(candidateItems, finalItem);
|
screen.RollFinalBeatmap(candidateItems, finalItem, finalItem);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestExpiredBeatmapNotShown()
|
||||||
|
{
|
||||||
|
SubScreenBeatmapSelect screen = null!;
|
||||||
|
|
||||||
|
AddStep("add screen with expired items", () =>
|
||||||
|
{
|
||||||
|
MultiplayerClient.ClientRoom!.Playlist =
|
||||||
|
[
|
||||||
|
new MultiplayerPlaylistItem(items[0]) { Expired = true },
|
||||||
|
new MultiplayerPlaylistItem(items[1])
|
||||||
|
];
|
||||||
|
|
||||||
|
Child = new ScreenStack(screen = new SubScreenBeatmapSelect());
|
||||||
|
});
|
||||||
|
|
||||||
|
AddUntilStep("items displayed", () => screen.ChildrenOfType<MatchmakingSelectPanelBeatmap>().Any());
|
||||||
|
AddAssert("expired item not shown", () => screen.ChildrenOfType<MatchmakingSelectPanelBeatmap>().Count(), () => Is.EqualTo(1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,12 +11,11 @@ using osu.Game.Online.Multiplayer;
|
|||||||
using osu.Game.Online.Multiplayer.MatchTypes.Matchmaking;
|
using osu.Game.Online.Multiplayer.MatchTypes.Matchmaking;
|
||||||
using osu.Game.Online.Rooms;
|
using osu.Game.Online.Rooms;
|
||||||
using osu.Game.Screens.OnlinePlay.Matchmaking.Match;
|
using osu.Game.Screens.OnlinePlay.Matchmaking.Match;
|
||||||
using osu.Game.Tests.Visual.Multiplayer;
|
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Matchmaking
|
namespace osu.Game.Tests.Visual.Matchmaking
|
||||||
{
|
{
|
||||||
public partial class TestScenePlayerPanel : MultiplayerTestScene
|
public partial class TestScenePlayerPanel : MatchmakingTestScene
|
||||||
{
|
{
|
||||||
private PlayerPanel panel = null!;
|
private PlayerPanel panel = null!;
|
||||||
|
|
||||||
|
|||||||
@@ -15,12 +15,11 @@ using osu.Game.Online.Multiplayer;
|
|||||||
using osu.Game.Online.Multiplayer.MatchTypes.Matchmaking;
|
using osu.Game.Online.Multiplayer.MatchTypes.Matchmaking;
|
||||||
using osu.Game.Online.Rooms;
|
using osu.Game.Online.Rooms;
|
||||||
using osu.Game.Screens.OnlinePlay.Matchmaking.Match;
|
using osu.Game.Screens.OnlinePlay.Matchmaking.Match;
|
||||||
using osu.Game.Tests.Visual.Multiplayer;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Matchmaking
|
namespace osu.Game.Tests.Visual.Matchmaking
|
||||||
{
|
{
|
||||||
public partial class TestScenePlayerPanelOverlay : MultiplayerTestScene
|
public partial class TestScenePlayerPanelOverlay : MatchmakingTestScene
|
||||||
{
|
{
|
||||||
private PlayerPanelOverlay list = null!;
|
private PlayerPanelOverlay list = null!;
|
||||||
|
|
||||||
|
|||||||
@@ -11,12 +11,11 @@ using osu.Game.Online.Multiplayer.MatchTypes.Matchmaking;
|
|||||||
using osu.Game.Online.Rooms;
|
using osu.Game.Online.Rooms;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Screens.OnlinePlay.Matchmaking.Match.Results;
|
using osu.Game.Screens.OnlinePlay.Matchmaking.Match.Results;
|
||||||
using osu.Game.Tests.Visual.Multiplayer;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Matchmaking
|
namespace osu.Game.Tests.Visual.Matchmaking
|
||||||
{
|
{
|
||||||
public partial class TestSceneResultsScreen : MultiplayerTestScene
|
public partial class TestSceneResultsScreen : MatchmakingTestScene
|
||||||
{
|
{
|
||||||
public override void SetUpSteps()
|
public override void SetUpSteps()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using NUnit.Framework;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
@@ -14,12 +15,11 @@ using osu.Game.Online.Rooms;
|
|||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using osu.Game.Screens.OnlinePlay.Matchmaking.Match.RoundResults;
|
using osu.Game.Screens.OnlinePlay.Matchmaking.Match.RoundResults;
|
||||||
using osu.Game.Tests.Visual.Multiplayer;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Matchmaking
|
namespace osu.Game.Tests.Visual.Matchmaking
|
||||||
{
|
{
|
||||||
public partial class TestSceneRoundResultsScreen : MultiplayerTestScene
|
public partial class TestSceneRoundResultsScreen : MatchmakingTestScene
|
||||||
{
|
{
|
||||||
public override void SetUpSteps()
|
public override void SetUpSteps()
|
||||||
{
|
{
|
||||||
@@ -27,8 +27,15 @@ namespace osu.Game.Tests.Visual.Matchmaking
|
|||||||
|
|
||||||
AddStep("join room", () => JoinRoom(CreateDefaultRoom(MatchType.Matchmaking)));
|
AddStep("join room", () => JoinRoom(CreateDefaultRoom(MatchType.Matchmaking)));
|
||||||
WaitForJoined();
|
WaitForJoined();
|
||||||
|
}
|
||||||
|
|
||||||
setupRequestHandler();
|
[TestCase(2)]
|
||||||
|
[TestCase(4)]
|
||||||
|
[TestCase(8)]
|
||||||
|
[TestCase(16)]
|
||||||
|
public void TestDisplayScores(int scoreCount)
|
||||||
|
{
|
||||||
|
setupRequestHandler(scoreCount);
|
||||||
|
|
||||||
AddStep("load screen", () =>
|
AddStep("load screen", () =>
|
||||||
{
|
{
|
||||||
@@ -41,7 +48,7 @@ namespace osu.Game.Tests.Visual.Matchmaking
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupRequestHandler()
|
private void setupRequestHandler(int scoreCount)
|
||||||
{
|
{
|
||||||
AddStep("setup request handler", () =>
|
AddStep("setup request handler", () =>
|
||||||
{
|
{
|
||||||
@@ -72,7 +79,7 @@ namespace osu.Game.Tests.Visual.Matchmaking
|
|||||||
case IndexPlaylistScoresRequest index:
|
case IndexPlaylistScoresRequest index:
|
||||||
var result = new IndexedMultiplayerScores();
|
var result = new IndexedMultiplayerScores();
|
||||||
|
|
||||||
for (int i = 0; i < 8; ++i)
|
for (int i = 0; i < scoreCount; ++i)
|
||||||
{
|
{
|
||||||
result.Scores.Add(new MultiplayerScore
|
result.Scores.Add(new MultiplayerScore
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,11 +9,10 @@ using osu.Game.Online.Multiplayer.MatchTypes.Matchmaking;
|
|||||||
using osu.Game.Online.Rooms;
|
using osu.Game.Online.Rooms;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Screens.OnlinePlay.Matchmaking.Match;
|
using osu.Game.Screens.OnlinePlay.Matchmaking.Match;
|
||||||
using osu.Game.Tests.Visual.Multiplayer;
|
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Matchmaking
|
namespace osu.Game.Tests.Visual.Matchmaking
|
||||||
{
|
{
|
||||||
public partial class TestSceneStageDisplay : MultiplayerTestScene
|
public partial class TestSceneStageDisplay : MatchmakingTestScene
|
||||||
{
|
{
|
||||||
[Cached]
|
[Cached]
|
||||||
protected readonly OverlayColourProvider ColourProvider = new OverlayColourProvider(OverlayColourScheme.Plum);
|
protected readonly OverlayColourProvider ColourProvider = new OverlayColourProvider(OverlayColourScheme.Plum);
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
AddStep("check request received", () =>
|
AddStep("check request received", () =>
|
||||||
{
|
{
|
||||||
multiplayerClient.Verify(m => m.SendMatchRequest(It.Is<StartMatchCountdownRequest>(req =>
|
multiplayerClient.Verify(m => m.SendMatchRequest(It.Is<StartMatchCountdownRequest>(req =>
|
||||||
req.Duration == TimeSpan.FromSeconds(10)
|
req.Duration == TimeSpan.FromSeconds(30)
|
||||||
)), Times.Once);
|
)), Times.Once);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -181,7 +181,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
AddStep("check request received", () =>
|
AddStep("check request received", () =>
|
||||||
{
|
{
|
||||||
multiplayerClient.Verify(m => m.SendMatchRequest(It.Is<StartMatchCountdownRequest>(req =>
|
multiplayerClient.Verify(m => m.SendMatchRequest(It.Is<StartMatchCountdownRequest>(req =>
|
||||||
req.Duration == TimeSpan.FromSeconds(10)
|
req.Duration == TimeSpan.FromSeconds(30)
|
||||||
)), Times.Once);
|
)), Times.Once);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -305,6 +305,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
{
|
{
|
||||||
new APIMod(new OsuModDoubleTime { SpeedChange = { Value = 2.0 } }),
|
new APIMod(new OsuModDoubleTime { SpeedChange = { Value = 2.0 } }),
|
||||||
new APIMod(new OsuModStrictTracking()),
|
new APIMod(new OsuModStrictTracking()),
|
||||||
|
new APIMod(new OsuModAutoplay()), // THIS IS PURELY TO ENABLE UNRANKED BADGE AND LET TEST PASS
|
||||||
|
// I AM NOT PROUD OF THIS
|
||||||
},
|
},
|
||||||
AllowedMods = new[]
|
AllowedMods = new[]
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
using osu.Game.Rulesets.Osu;
|
using osu.Game.Rulesets.Osu;
|
||||||
@@ -33,6 +35,9 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new MultiplayerSkipOverlay(120000)
|
new MultiplayerSkipOverlay(120000)
|
||||||
|
{
|
||||||
|
RequestSkip = () => MultiplayerClient.VoteToSkipIntro().WaitSafely(),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -47,26 +52,83 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
int i2 = i;
|
int userId = i;
|
||||||
|
|
||||||
AddStep($"join user {i2}", () =>
|
AddStep($"join user {userId}", () =>
|
||||||
{
|
{
|
||||||
MultiplayerClient.AddUser(new APIUser
|
MultiplayerClient.AddUser(new APIUser
|
||||||
{
|
{
|
||||||
Id = i2,
|
Id = userId,
|
||||||
Username = $"User {i2}"
|
Username = $"User {userId}"
|
||||||
});
|
});
|
||||||
|
|
||||||
MultiplayerClient.ChangeUserState(i2, MultiplayerUserState.Playing);
|
MultiplayerClient.ChangeUserState(userId, MultiplayerUserState.Playing);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
AddStep("local user votes", () => MultiplayerClient.VoteToSkipIntro().WaitSafely());
|
AddStep("user 0 votes", () => MultiplayerClient.UserVoteToSkipIntro(0).WaitSafely());
|
||||||
|
AddStep("local user votes", () => this.ChildrenOfType<MultiplayerSkipOverlay.Button>().Single().TriggerClick());
|
||||||
|
AddStep("user 1 votes", () => MultiplayerClient.UserVoteToSkipIntro(1).WaitSafely());
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestLeavingBeforeLocalVote()
|
||||||
|
{
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
int i2 = i;
|
int userId = i;
|
||||||
AddStep($"user {i2} votes", () => MultiplayerClient.UserVoteToSkipIntro(i2).WaitSafely());
|
|
||||||
|
AddStep($"join user {userId}", () =>
|
||||||
|
{
|
||||||
|
MultiplayerClient.AddUser(new APIUser
|
||||||
|
{
|
||||||
|
Id = userId,
|
||||||
|
Username = $"User {userId}"
|
||||||
|
});
|
||||||
|
|
||||||
|
MultiplayerClient.ChangeUserState(userId, MultiplayerUserState.Playing);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
AddStep("user 0 votes", () => MultiplayerClient.UserVoteToSkipIntro(0).WaitSafely());
|
||||||
|
AddStep("user 1 leaves", () => MultiplayerClient.RemoveUser(new APIUser { Id = 1 }));
|
||||||
|
AddStep("user 2 leaves", () => MultiplayerClient.RemoveUser(new APIUser { Id = 2 }));
|
||||||
|
AddStep("user 3 leaves", () => MultiplayerClient.RemoveUser(new APIUser { Id = 3 }));
|
||||||
|
AddStep("user 0 leaves", () => MultiplayerClient.RemoveUser(new APIUser { Id = 0 }));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestLeavingAfterLocalVote()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
int userId = i;
|
||||||
|
|
||||||
|
AddStep($"join user {userId}", () =>
|
||||||
|
{
|
||||||
|
MultiplayerClient.AddUser(new APIUser
|
||||||
|
{
|
||||||
|
Id = userId,
|
||||||
|
Username = $"User {userId}"
|
||||||
|
});
|
||||||
|
|
||||||
|
MultiplayerClient.ChangeUserState(userId, MultiplayerUserState.Playing);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
AddStep("local user votes", () => this.ChildrenOfType<MultiplayerSkipOverlay.Button>().Single().TriggerClick());
|
||||||
|
AddStep("user 0 votes", () => MultiplayerClient.UserVoteToSkipIntro(0).WaitSafely());
|
||||||
|
AddStep("user 1 leaves", () => MultiplayerClient.RemoveUser(new APIUser { Id = 1 }));
|
||||||
|
AddStep("user 2 leaves", () => MultiplayerClient.RemoveUser(new APIUser { Id = 2 }));
|
||||||
|
AddStep("user 3 leaves", () => MultiplayerClient.RemoveUser(new APIUser { Id = 3 }));
|
||||||
|
AddStep("user 0 leaves", () => MultiplayerClient.RemoveUser(new APIUser { Id = 0 }));
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class TestMultiplayerSkipOverlay : MultiplayerSkipOverlay
|
||||||
|
{
|
||||||
|
public TestMultiplayerSkipOverlay()
|
||||||
|
: base(120000)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -387,7 +387,7 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
||||||
{
|
{
|
||||||
// Importantly, this occurs before base.load().
|
// Importantly, this occurs before base.load().
|
||||||
if (!loader.AllowLoad.Wait(TimeSpan.FromSeconds(10)))
|
if (!loader.AllowLoad.Wait(TimeSpan.FromSeconds(30)))
|
||||||
throw new TimeoutException();
|
throw new TimeoutException();
|
||||||
|
|
||||||
return base.CreateChildDependencies(parent);
|
return base.CreateChildDependencies(parent);
|
||||||
|
|||||||
@@ -920,8 +920,12 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
[Explicit("Featured Artist dialog is never displayed as the filter is disabled by default.")]
|
||||||
public void TestFeaturedArtistDisclaimerDialog()
|
public void TestFeaturedArtistDisclaimerDialog()
|
||||||
{
|
{
|
||||||
|
// NO-OP: FA dialog is not displayed ever
|
||||||
|
|
||||||
|
/*
|
||||||
BeatmapListingOverlay getBeatmapListingOverlay() => Game.ChildrenOfType<BeatmapListingOverlay>().FirstOrDefault();
|
BeatmapListingOverlay getBeatmapListingOverlay() => Game.ChildrenOfType<BeatmapListingOverlay>().FirstOrDefault();
|
||||||
|
|
||||||
AddStep("Wait for notifications to load", () => Game.SearchBeatmapSet(string.Empty));
|
AddStep("Wait for notifications to load", () => Game.SearchBeatmapSet(string.Empty));
|
||||||
@@ -939,6 +943,7 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
AddAssert("dialog dismissed", () => Game.ChildrenOfType<DialogOverlay>().Single().CurrentDialog == null);
|
AddAssert("dialog dismissed", () => Game.ChildrenOfType<DialogOverlay>().Single().CurrentDialog == null);
|
||||||
|
|
||||||
AddUntilStep("featured artist filter is off", () => !getBeatmapListingOverlay().ChildrenOfType<BeatmapSearchGeneralFilterRow>().First().Current.Contains(SearchGeneral.FeaturedArtists));
|
AddUntilStep("featured artist filter is off", () => !getBeatmapListingOverlay().ChildrenOfType<BeatmapSearchGeneralFilterRow>().First().Current.Contains(SearchGeneral.FeaturedArtists));
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
private const int requested_beatmap_id = 75;
|
private const int requested_beatmap_id = 75;
|
||||||
private const int requested_beatmap_set_id = 1;
|
private const int requested_beatmap_set_id = 1;
|
||||||
|
|
||||||
protected override TestOsuGame CreateTestGame() => new TestOsuGame(LocalStorage, API, new[] { $"osu://b/{requested_beatmap_id}" });
|
protected override TestOsuGame CreateTestGame() => new TestOsuGame(LocalStorage, API, new[] { $"jvnkosu://b/{requested_beatmap_id}" });
|
||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void Setup() => Schedule(() =>
|
public void Setup() => Schedule(() =>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
{
|
{
|
||||||
private const int requested_beatmap_set_id = 1;
|
private const int requested_beatmap_set_id = 1;
|
||||||
|
|
||||||
protected override TestOsuGame CreateTestGame() => new TestOsuGame(LocalStorage, API, new[] { $"osu://s/{requested_beatmap_set_id}" });
|
protected override TestOsuGame CreateTestGame() => new TestOsuGame(LocalStorage, API, new[] { $"jvnkosu://s/{requested_beatmap_set_id}" });
|
||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void Setup() => Schedule(() =>
|
public void Setup() => Schedule(() =>
|
||||||
|
|||||||
@@ -84,9 +84,9 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
public void TestFeaturedArtistFilter()
|
public void TestFeaturedArtistFilter()
|
||||||
{
|
{
|
||||||
AddAssert("is visible", () => overlay.State.Value == Visibility.Visible);
|
AddAssert("is visible", () => overlay.State.Value == Visibility.Visible);
|
||||||
AddAssert("featured artist filter is on", () => overlay.ChildrenOfType<BeatmapSearchGeneralFilterRow>().First().Current.Contains(SearchGeneral.FeaturedArtists));
|
|
||||||
AddStep("toggle featured artist filter", () => overlay.ChildrenOfType<FilterTabItem<SearchGeneral>>().First(i => i.Value == SearchGeneral.FeaturedArtists).TriggerClick());
|
|
||||||
AddAssert("featured artist filter is off", () => !overlay.ChildrenOfType<BeatmapSearchGeneralFilterRow>().First().Current.Contains(SearchGeneral.FeaturedArtists));
|
AddAssert("featured artist filter is off", () => !overlay.ChildrenOfType<BeatmapSearchGeneralFilterRow>().First().Current.Contains(SearchGeneral.FeaturedArtists));
|
||||||
|
AddStep("toggle featured artist filter", () => overlay.ChildrenOfType<FilterTabItem<SearchGeneral>>().First(i => i.Value == SearchGeneral.FeaturedArtists).TriggerClick());
|
||||||
|
AddAssert("featured artist filter is on", () => overlay.ChildrenOfType<BeatmapSearchGeneralFilterRow>().First().Current.Contains(SearchGeneral.FeaturedArtists));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|||||||
@@ -55,31 +55,31 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
});
|
});
|
||||||
|
|
||||||
[TestCase("test!")]
|
[TestCase("test!")]
|
||||||
[TestCase("dev.ppy.sh!")]
|
[TestCase("osu.jvnko.boats!")]
|
||||||
[TestCase("https://dev.ppy.sh!", LinkAction.External)]
|
[TestCase("https://osu.jvnko.boats!", LinkAction.External)]
|
||||||
[TestCase("http://dev.ppy.sh!", LinkAction.External)]
|
[TestCase("http://osu.jvnko.boats!", LinkAction.External)]
|
||||||
[TestCase("forgothttps://dev.ppy.sh!", LinkAction.External)]
|
[TestCase("forgothttps://osu.jvnko.boats!", LinkAction.External)]
|
||||||
[TestCase("forgothttp://dev.ppy.sh!", LinkAction.External)]
|
[TestCase("forgothttp://osu.jvnko.boats!", LinkAction.External)]
|
||||||
[TestCase("00:12:345 - Test?", LinkAction.OpenEditorTimestamp)]
|
[TestCase("00:12:345 - Test?", LinkAction.OpenEditorTimestamp)]
|
||||||
[TestCase("00:12:345 (1,2) - Test?", LinkAction.OpenEditorTimestamp)]
|
[TestCase("00:12:345 (1,2) - Test?", LinkAction.OpenEditorTimestamp)]
|
||||||
[TestCase($"{OsuGameBase.OSU_PROTOCOL}edit/00:12:345 - Test?", LinkAction.OpenEditorTimestamp)]
|
[TestCase($"{OsuGameBase.OSU_PROTOCOL}edit/00:12:345 - Test?", LinkAction.OpenEditorTimestamp)]
|
||||||
[TestCase($"{OsuGameBase.OSU_PROTOCOL}edit/00:12:345 (1,2) - Test?", LinkAction.OpenEditorTimestamp)]
|
[TestCase($"{OsuGameBase.OSU_PROTOCOL}edit/00:12:345 (1,2) - Test?", LinkAction.OpenEditorTimestamp)]
|
||||||
[TestCase($"{OsuGameBase.OSU_PROTOCOL}00:12:345 - not an editor timestamp", LinkAction.External)]
|
[TestCase($"{OsuGameBase.OSU_PROTOCOL}00:12:345 - not an editor timestamp", LinkAction.External)]
|
||||||
[TestCase("Wiki link for tasty [[Performance Points]]", LinkAction.OpenWiki)]
|
[TestCase("Wiki link for tasty [[Performance Points]]", LinkAction.OpenWiki)]
|
||||||
[TestCase("(osu forums)[https://dev.ppy.sh/forum] (old link format)", LinkAction.External)]
|
[TestCase("(osu forums)[https://osu.jvnko.boats/forum] (old link format)", LinkAction.External)]
|
||||||
[TestCase("[https://dev.ppy.sh/home New site] (new link format)", LinkAction.External)]
|
[TestCase("[https://osu.jvnko.boats/home New site] (new link format)", LinkAction.External)]
|
||||||
[TestCase("[osu forums](https://dev.ppy.sh/forum) (new link format 2)", LinkAction.External)]
|
[TestCase("[osu forums](https://osu.jvnko.boats/forum) (new link format 2)", LinkAction.External)]
|
||||||
[TestCase("[https://dev.ppy.sh/home This is only a link to the new osu webpage but this is supposed to test word wrap.]", LinkAction.External)]
|
[TestCase("[https://osu.jvnko.boats/home This is only a link to the new osu webpage but this is supposed to test word wrap.]", LinkAction.External)]
|
||||||
[TestCase("Let's (try)[https://dev.ppy.sh/home] [https://dev.ppy.sh/b/252238 multiple links] https://dev.ppy.sh/home", LinkAction.External, LinkAction.OpenBeatmap, LinkAction.External)]
|
[TestCase("Let's (try)[https://osu.jvnko.boats/home] [https://osu.jvnko.boats/b/252238 multiple links] https://osu.jvnko.boats/home", LinkAction.External, LinkAction.OpenBeatmap, LinkAction.External)]
|
||||||
[TestCase("[https://dev.ppy.sh/home New link format with escaped [and \\[ paired] braces]", LinkAction.External)]
|
[TestCase("[https://osu.jvnko.boats/home New link format with escaped [and \\[ paired] braces]", LinkAction.External)]
|
||||||
[TestCase("[Markdown link format with escaped [and \\[ paired] braces](https://dev.ppy.sh/home)", LinkAction.External)]
|
[TestCase("[Markdown link format with escaped [and \\[ paired] braces](https://osu.jvnko.boats/home)", LinkAction.External)]
|
||||||
[TestCase("(Old link format with escaped (and \\( paired) parentheses)[https://dev.ppy.sh/home] and [[also a rogue wiki link]]", LinkAction.External, LinkAction.OpenWiki)]
|
[TestCase("(Old link format with escaped (and \\( paired) parentheses)[https://osu.jvnko.boats/home] and [[also a rogue wiki link]]", LinkAction.External, LinkAction.OpenWiki)]
|
||||||
[TestCase("#lobby or #osu would be blue (and work) in the ChatDisplay test (when a proper ChatOverlay is present).")] // note that there's 0 links here (they get removed if a channel is not found)
|
[TestCase("#lobby or #osu would be blue (and work) in the ChatDisplay test (when a proper ChatOverlay is present).")] // note that there's 0 links here (they get removed if a channel is not found)
|
||||||
[TestCase("Join my multiplayer game osu://room/12346.", LinkAction.JoinRoom)]
|
[TestCase("Join my multiplayer game jvnkosu://room/12346.", LinkAction.JoinRoom)]
|
||||||
[TestCase("Join my multiplayer gameosu://room/12346.", LinkAction.JoinRoom)]
|
[TestCase("Join my multiplayer gamejvnkosu://room/12346.", LinkAction.JoinRoom)]
|
||||||
[TestCase("Join my [multiplayer game](osu://room/12346).", LinkAction.JoinRoom)]
|
[TestCase("Join my [multiplayer game](jvnkosu://room/12346).", LinkAction.JoinRoom)]
|
||||||
[TestCase("Join my multiplayer game http://dev.ppy.sh/multiplayer/rooms/12346", LinkAction.JoinRoom)]
|
[TestCase("Join my multiplayer game http://osu.jvnko.boats/multiplayer/rooms/12346", LinkAction.JoinRoom)]
|
||||||
[TestCase("Join my [multiplayer game](http://dev.ppy.sh/multiplayer/rooms/12346).", LinkAction.JoinRoom)]
|
[TestCase("Join my [multiplayer game](http://osu.jvnko.boats/multiplayer/rooms/12346).", LinkAction.JoinRoom)]
|
||||||
[TestCase($"Join my [#english]({OsuGameBase.OSU_PROTOCOL}chan/#english).", LinkAction.OpenChannel)]
|
[TestCase($"Join my [#english]({OsuGameBase.OSU_PROTOCOL}chan/#english).", LinkAction.OpenChannel)]
|
||||||
[TestCase($"Join my {OsuGameBase.OSU_PROTOCOL}chan/#english.", LinkAction.OpenChannel)]
|
[TestCase($"Join my {OsuGameBase.OSU_PROTOCOL}chan/#english.", LinkAction.OpenChannel)]
|
||||||
[TestCase($"Join my{OsuGameBase.OSU_PROTOCOL}chan/#english.", LinkAction.OpenChannel)]
|
[TestCase($"Join my{OsuGameBase.OSU_PROTOCOL}chan/#english.", LinkAction.OpenChannel)]
|
||||||
@@ -91,11 +91,11 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
addMessageWithChecks(text, expectedActions: actions);
|
addMessageWithChecks(text, expectedActions: actions);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase("is now listening to [https://dev.ppy.sh/s/93523 IMAGE -MATERIAL- <Version 0>]", true, false, LinkAction.OpenBeatmapSet)]
|
[TestCase("is now listening to [https://osu.jvnko.boats/s/93523 IMAGE -MATERIAL- <Version 0>]", true, false, LinkAction.OpenBeatmapSet)]
|
||||||
[TestCase("is now playing [https://dev.ppy.sh/b/252238 IMAGE -MATERIAL- <Version 0>]", true, false, LinkAction.OpenBeatmap)]
|
[TestCase("is now playing [https://osu.jvnko.boats/b/252238 IMAGE -MATERIAL- <Version 0>]", true, false, LinkAction.OpenBeatmap)]
|
||||||
[TestCase("I am important!", false, true)]
|
[TestCase("I am important!", false, true)]
|
||||||
[TestCase("feels important", true, true)]
|
[TestCase("feels important", true, true)]
|
||||||
[TestCase("likes to post this [https://dev.ppy.sh/home link].", true, true, LinkAction.External)]
|
[TestCase("likes to post this [https://osu.jvnko.boats/home link].", true, true, LinkAction.External)]
|
||||||
public void TestActionAndImportantLinks(string text, bool isAction, bool isImportant, params LinkAction[] expectedActions)
|
public void TestActionAndImportantLinks(string text, bool isAction, bool isImportant, params LinkAction[] expectedActions)
|
||||||
{
|
{
|
||||||
addMessageWithChecks(text, isAction, isImportant, expectedActions);
|
addMessageWithChecks(text, isAction, isImportant, expectedActions);
|
||||||
@@ -135,9 +135,9 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
int messageIndex = 0;
|
int messageIndex = 0;
|
||||||
|
|
||||||
addEchoWithWait("sent!", "received!");
|
addEchoWithWait("sent!", "received!");
|
||||||
addEchoWithWait("https://dev.ppy.sh/home", null, 500);
|
addEchoWithWait("https://osu.jvnko.boats/home", null, 500);
|
||||||
addEchoWithWait("[https://dev.ppy.sh/forum let's try multiple words too!]");
|
addEchoWithWait("[https://osu.jvnko.boats/forum let's try multiple words too!]");
|
||||||
addEchoWithWait("(long loading times! clickable while loading?)[https://dev.ppy.sh/home]", null, 5000);
|
addEchoWithWait("(long loading times! clickable while loading?)[https://osu.jvnko.boats/home]", null, 5000);
|
||||||
|
|
||||||
void addEchoWithWait(string text, string? completeText = null, double delay = 250)
|
void addEchoWithWait(string text, string? completeText = null, double delay = 250)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -146,5 +146,165 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
checkCount++;
|
checkCount++;
|
||||||
}, 10);
|
}, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestAlternatingBackgroundDoesNotChangeAtMaxHistory()
|
||||||
|
{
|
||||||
|
AddStep("fill up the channel", () =>
|
||||||
|
{
|
||||||
|
for (int i = 0; i < Channel.MAX_HISTORY; i++)
|
||||||
|
{
|
||||||
|
channel.AddNewMessages(new Message
|
||||||
|
{
|
||||||
|
ChannelId = channel.Id,
|
||||||
|
Content = $"Message {i}",
|
||||||
|
Timestamp = DateTimeOffset.Now,
|
||||||
|
Sender = new APIUser
|
||||||
|
{
|
||||||
|
Id = 3,
|
||||||
|
Username = "LocalUser " + RNG.Next(0, int.MaxValue - 100).ToString("N")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
AddUntilStep($"{Channel.MAX_HISTORY} messages present", () => drawableChannel.ChildrenOfType<ChatLine>().Count(), () => Is.EqualTo(Channel.MAX_HISTORY));
|
||||||
|
|
||||||
|
ChatLine? lastLine = null;
|
||||||
|
bool lastLineAlternatingBackground = false;
|
||||||
|
|
||||||
|
AddStep("grab last line", () =>
|
||||||
|
{
|
||||||
|
lastLine = drawableChannel.ChildrenOfType<ChatLine>().Last();
|
||||||
|
lastLineAlternatingBackground = lastLine.AlternatingBackground;
|
||||||
|
});
|
||||||
|
|
||||||
|
AddStep("add another message", () => channel.AddNewMessages(new Message
|
||||||
|
{
|
||||||
|
ChannelId = channel.Id,
|
||||||
|
Content = "One final message",
|
||||||
|
Timestamp = DateTimeOffset.Now,
|
||||||
|
Sender = new APIUser
|
||||||
|
{
|
||||||
|
Id = 3,
|
||||||
|
Username = "LocalUser " + RNG.Next(0, int.MaxValue - 100).ToString("N")
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
AddAssert("second-last message has same background", () => lastLine!.AlternatingBackground, () => Is.EqualTo(lastLineAlternatingBackground));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestAlternatingBackgroundUpdatedOnRemoval()
|
||||||
|
{
|
||||||
|
AddStep("add 3 messages", () =>
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 3; i++)
|
||||||
|
{
|
||||||
|
channel.AddNewMessages(new Message
|
||||||
|
{
|
||||||
|
ChannelId = channel.Id,
|
||||||
|
Content = $"Message {i}",
|
||||||
|
Timestamp = DateTimeOffset.Now,
|
||||||
|
Sender = new APIUser
|
||||||
|
{
|
||||||
|
Id = i,
|
||||||
|
Username = "LocalUser " + RNG.Next(0, int.MaxValue - 100).ToString("N")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
AddUntilStep("3 messages present", () => drawableChannel.ChildrenOfType<ChatLine>().Count(), () => Is.EqualTo(3));
|
||||||
|
assertAlternatingBackground(0, false);
|
||||||
|
assertAlternatingBackground(1, true);
|
||||||
|
assertAlternatingBackground(2, false);
|
||||||
|
|
||||||
|
AddStep("remove middle message", () => channel.RemoveMessagesFromUser(1));
|
||||||
|
AddUntilStep("2 messages present", () => drawableChannel.ChildrenOfType<ChatLine>().Count(), () => Is.EqualTo(2));
|
||||||
|
assertAlternatingBackground(0, true);
|
||||||
|
assertAlternatingBackground(1, false);
|
||||||
|
|
||||||
|
void assertAlternatingBackground(int lineIndex, bool shouldBeAlternating)
|
||||||
|
=> AddAssert($"line {lineIndex} {(shouldBeAlternating ? "has" : "does not have")} alternating background",
|
||||||
|
() => drawableChannel.ChildrenOfType<ChatLine>().ElementAt(lineIndex).AlternatingBackground,
|
||||||
|
() => Is.EqualTo(shouldBeAlternating));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestTimestampsUpdateOnRemoval()
|
||||||
|
{
|
||||||
|
AddStep("add 3 messages", () =>
|
||||||
|
{
|
||||||
|
channel.AddNewMessages(
|
||||||
|
new Message
|
||||||
|
{
|
||||||
|
ChannelId = channel.Id,
|
||||||
|
Content = "Message 0",
|
||||||
|
Timestamp = new DateTimeOffset(2022, 11, 21, 20, 0, 0, TimeSpan.Zero),
|
||||||
|
Sender = new APIUser
|
||||||
|
{
|
||||||
|
Id = 0,
|
||||||
|
Username = "LocalUser " + RNG.Next(0, int.MaxValue - 100).ToString("N")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new Message
|
||||||
|
{
|
||||||
|
ChannelId = channel.Id,
|
||||||
|
Content = "Message 1",
|
||||||
|
Timestamp = new DateTimeOffset(2022, 11, 21, 20, 0, 0, TimeSpan.Zero).AddSeconds(1),
|
||||||
|
Sender = new APIUser
|
||||||
|
{
|
||||||
|
Id = 1,
|
||||||
|
Username = "LocalUser " + RNG.Next(0, int.MaxValue - 100).ToString("N")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new Message
|
||||||
|
{
|
||||||
|
ChannelId = channel.Id,
|
||||||
|
Content = "Message 2",
|
||||||
|
Timestamp = new DateTimeOffset(2022, 11, 21, 20, 0, 0, TimeSpan.Zero).AddMinutes(1),
|
||||||
|
Sender = new APIUser
|
||||||
|
{
|
||||||
|
Id = 2,
|
||||||
|
Username = "LocalUser " + RNG.Next(0, int.MaxValue - 100).ToString("N")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new Message
|
||||||
|
{
|
||||||
|
ChannelId = channel.Id,
|
||||||
|
Content = "Message 3",
|
||||||
|
Timestamp = new DateTimeOffset(2022, 11, 21, 20, 0, 0, TimeSpan.Zero).AddMinutes(1).AddSeconds(1),
|
||||||
|
Sender = new APIUser
|
||||||
|
{
|
||||||
|
Id = 3,
|
||||||
|
Username = "LocalUser " + RNG.Next(0, int.MaxValue - 100).ToString("N")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
AddUntilStep("4 messages present", () => drawableChannel.ChildrenOfType<ChatLine>().Count(), () => Is.EqualTo(4));
|
||||||
|
assertTimestamp(0, true);
|
||||||
|
assertTimestamp(1, false);
|
||||||
|
assertTimestamp(2, true);
|
||||||
|
assertTimestamp(3, false);
|
||||||
|
|
||||||
|
AddStep("remove message 0", () => channel.RemoveMessagesFromUser(0));
|
||||||
|
AddUntilStep("3 messages present", () => drawableChannel.ChildrenOfType<ChatLine>().Count(), () => Is.EqualTo(3));
|
||||||
|
assertTimestamp(0, true);
|
||||||
|
assertTimestamp(1, true);
|
||||||
|
assertTimestamp(2, false);
|
||||||
|
|
||||||
|
AddStep("remove message 2", () => channel.RemoveMessagesFromUser(2));
|
||||||
|
AddUntilStep("2 messages present", () => drawableChannel.ChildrenOfType<ChatLine>().Count(), () => Is.EqualTo(2));
|
||||||
|
assertTimestamp(0, true);
|
||||||
|
assertTimestamp(1, true);
|
||||||
|
|
||||||
|
void assertTimestamp(int lineIndex, bool shouldHaveTimestamp)
|
||||||
|
=> AddAssert($"line {lineIndex} {(shouldHaveTimestamp ? "has" : "does not have")} timestamp",
|
||||||
|
() => drawableChannel.ChildrenOfType<ChatLine>().ElementAt(lineIndex).RequiresTimestamp,
|
||||||
|
() => Is.EqualTo(shouldHaveTimestamp));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
AddStep("show example score", () =>
|
AddStep("show example score", () =>
|
||||||
{
|
{
|
||||||
var score = TestResources.CreateTestScoreInfo(createTestBeatmap(new RealmUser()));
|
var score = TestResources.CreateTestScoreInfo(createTestBeatmap(new RealmUser()));
|
||||||
score.Mods = score.Mods.Append(new OsuModDifficultyAdjust()).ToArray();
|
score.Mods = score.Mods.Append(new OsuModAutoplay()).ToArray();
|
||||||
showPanel(score);
|
showPanel(score);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
scrollToAndStartBinding("Increase volume");
|
scrollToAndStartBinding("Increase volume");
|
||||||
AddStep("press shift", () => InputManager.PressKey(Key.ShiftLeft));
|
AddStep("press shift", () => InputManager.PressKey(Key.ShiftLeft));
|
||||||
AddStep("release shift", () => InputManager.ReleaseKey(Key.ShiftLeft));
|
AddStep("release shift", () => InputManager.ReleaseKey(Key.ShiftLeft));
|
||||||
checkBinding("Increase volume", "LShift");
|
checkBinding("Increase volume", "Shift");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@@ -77,7 +77,7 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
AddStep("press shift", () => InputManager.PressKey(Key.ShiftLeft));
|
AddStep("press shift", () => InputManager.PressKey(Key.ShiftLeft));
|
||||||
AddStep("press k", () => InputManager.Key(Key.K));
|
AddStep("press k", () => InputManager.Key(Key.K));
|
||||||
AddStep("release shift", () => InputManager.ReleaseKey(Key.ShiftLeft));
|
AddStep("release shift", () => InputManager.ReleaseKey(Key.ShiftLeft));
|
||||||
checkBinding("Increase volume", "LShift-K");
|
checkBinding("Increase volume", "Shift-K");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@@ -121,7 +121,7 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
|
|
||||||
AddStep("schedule button clicks", () =>
|
AddStep("schedule button clicks", () =>
|
||||||
{
|
{
|
||||||
var clearButton = firstRow.ChildrenOfType<KeyBindingRow.ClearButton>().Single();
|
var clearButton = firstRow.ChildrenOfType<DangerousRoundedButton>().Single();
|
||||||
|
|
||||||
InputManager.MoveMouseTo(clearButton);
|
InputManager.MoveMouseTo(clearButton);
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
{
|
{
|
||||||
AddStep("click clear button", () =>
|
AddStep("click clear button", () =>
|
||||||
{
|
{
|
||||||
var clearButton = multiBindingRow.ChildrenOfType<KeyBindingRow.ClearButton>().Single();
|
var clearButton = multiBindingRow.ChildrenOfType<DangerousRoundedButton>().Single();
|
||||||
|
|
||||||
InputManager.MoveMouseTo(clearButton);
|
InputManager.MoveMouseTo(clearButton);
|
||||||
InputManager.Click(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
@@ -386,7 +386,7 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
AddStep("clear binding", () =>
|
AddStep("clear binding", () =>
|
||||||
{
|
{
|
||||||
var row = panel.ChildrenOfType<KeyBindingRow>().First(r => r.ChildrenOfType<OsuSpriteText>().Any(s => s.Text.ToString() == "Left (centre)"));
|
var row = panel.ChildrenOfType<KeyBindingRow>().First(r => r.ChildrenOfType<OsuSpriteText>().Any(s => s.Text.ToString() == "Left (centre)"));
|
||||||
row.ChildrenOfType<KeyBindingRow.ClearButton>().Single().TriggerClick();
|
row.ChildrenOfType<DangerousRoundedButton>().Single().TriggerClick();
|
||||||
});
|
});
|
||||||
scrollToAndStartBinding("Left (rim)");
|
scrollToAndStartBinding("Left (rim)");
|
||||||
AddStep("bind M1", () => InputManager.Click(MouseButton.Left));
|
AddStep("bind M1", () => InputManager.Click(MouseButton.Left));
|
||||||
@@ -462,7 +462,7 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
AddStep("clear binding", () =>
|
AddStep("clear binding", () =>
|
||||||
{
|
{
|
||||||
var row = panel.ChildrenOfType<KeyBindingRow>().First(r => r.ChildrenOfType<OsuSpriteText>().Any(s => s.Text.ToString() == "Left (centre)"));
|
var row = panel.ChildrenOfType<KeyBindingRow>().First(r => r.ChildrenOfType<OsuSpriteText>().Any(s => s.Text.ToString() == "Left (centre)"));
|
||||||
row.ChildrenOfType<KeyBindingRow.ClearButton>().Single().TriggerClick();
|
row.ChildrenOfType<DangerousRoundedButton>().Single().TriggerClick();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
private void testInfoLabels(int expectedCount)
|
private void testInfoLabels(int expectedCount)
|
||||||
{
|
{
|
||||||
AddAssert("check info labels exists", () => infoWedge.Info.ChildrenOfType<BeatmapInfoWedge.WedgeInfoText.InfoLabel>().Any());
|
AddAssert("check info labels exists", () => infoWedge.Info.ChildrenOfType<BeatmapInfoWedge.WedgeInfoText.InfoLabel>().Any());
|
||||||
AddAssert("check info labels count", () => infoWedge.Info.ChildrenOfType<BeatmapInfoWedge.WedgeInfoText.InfoLabel>().Count() == expectedCount);
|
AddAssert("check info labels count", () => infoWedge.Info.ChildrenOfType<BeatmapInfoWedge.WedgeInfoText.InfoLabel>().Count() >= expectedCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
[SetUpSteps]
|
[SetUpSteps]
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
|||||||
assertGroup(results, 3, "Pending", pendingBeatmap.Beatmaps, ref total);
|
assertGroup(results, 3, "Pending", pendingBeatmap.Beatmaps, ref total);
|
||||||
assertGroup(results, 4, "Graveyard", graveyardBeatmap.Beatmaps, ref total);
|
assertGroup(results, 4, "Graveyard", graveyardBeatmap.Beatmaps, ref total);
|
||||||
assertGroup(results, 5, "Local", localBeatmap.Beatmaps, ref total);
|
assertGroup(results, 5, "Local", localBeatmap.Beatmaps, ref total);
|
||||||
assertGroup(results, 6, "Unknown", noneBeatmap.Beatmaps, ref total);
|
assertGroup(results, 6, "Offline", noneBeatmap.Beatmaps, ref total);
|
||||||
assertGroup(results, 7, "Loved", lovedBeatmap.Beatmaps, ref total);
|
assertGroup(results, 7, "Loved", lovedBeatmap.Beatmaps, ref total);
|
||||||
assertTotal(results, total);
|
assertTotal(results, total);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestUnrankedBadge()
|
public void TestUnrankedBadge()
|
||||||
{
|
{
|
||||||
AddStep(@"Add unranked mod", () => changeMods(new[] { new OsuModDeflate() }));
|
AddStep(@"Add unranked mod", () => changeMods(new[] { new OsuModAutoplay() }));
|
||||||
AddUntilStep("Unranked badge shown", () => footerButtonMods.ChildrenOfType<FooterButtonMods.UnrankedBadge>().Single().Alpha == 1);
|
AddUntilStep("Unranked badge shown", () => footerButtonMods.ChildrenOfType<FooterButtonMods.UnrankedBadge>().Single().Alpha == 1);
|
||||||
AddStep(@"Clear selected mod", () => changeMods(Array.Empty<Mod>()));
|
AddStep(@"Clear selected mod", () => changeMods(Array.Empty<Mod>()));
|
||||||
AddUntilStep("Unranked badge not shown", () => footerButtonMods.ChildrenOfType<FooterButtonMods.UnrankedBadge>().Single().Alpha == 0);
|
AddUntilStep("Unranked badge not shown", () => footerButtonMods.ChildrenOfType<FooterButtonMods.UnrankedBadge>().Single().Alpha == 0);
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ using osu.Game.Screens.Menu;
|
|||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
using osu.Game.Screens.Ranking;
|
using osu.Game.Screens.Ranking;
|
||||||
using osu.Game.Screens.Select;
|
using osu.Game.Screens.Select;
|
||||||
using osu.Game.Screens.Select.Filter;
|
|
||||||
using osu.Game.Screens.Select.Leaderboards;
|
using osu.Game.Screens.Select.Leaderboards;
|
||||||
using osu.Game.Screens.SelectV2;
|
using osu.Game.Screens.SelectV2;
|
||||||
using osu.Game.Tests.Resources;
|
using osu.Game.Tests.Resources;
|
||||||
@@ -144,41 +143,6 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
|||||||
void onScreenPushed(IScreen lastScreen, IScreen newScreen) => screensPushed.Add(lastScreen);
|
void onScreenPushed(IScreen lastScreen, IScreen newScreen) => screensPushed.Add(lastScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase(true)]
|
|
||||||
[TestCase(false)]
|
|
||||||
public void TestHoveringLeftSideReexpandsGroupSelectionIsIn(bool mouseOverPanel)
|
|
||||||
{
|
|
||||||
ImportBeatmapForRuleset(0);
|
|
||||||
|
|
||||||
LoadSongSelect();
|
|
||||||
SortAndGroupBy(SortMode.Difficulty, GroupMode.Difficulty);
|
|
||||||
|
|
||||||
AddStep("move mouse to carousel", () => InputManager.MoveMouseTo(Carousel));
|
|
||||||
|
|
||||||
AddUntilStep("expanded group is below 1 star",
|
|
||||||
() => (Carousel.ChildrenOfType<PanelGroupStarDifficulty>().SingleOrDefault(p => p.Expanded.Value)?.Item?.Model as StarDifficultyGroupDefinition)?.Difficulty.Stars,
|
|
||||||
() => Is.EqualTo(0));
|
|
||||||
|
|
||||||
AddStep("select next group", () =>
|
|
||||||
{
|
|
||||||
InputManager.PressKey(Key.ShiftLeft);
|
|
||||||
InputManager.Key(Key.Right);
|
|
||||||
InputManager.ReleaseKey(Key.ShiftLeft);
|
|
||||||
});
|
|
||||||
AddUntilStep("expanded group is 3 star",
|
|
||||||
() => (Carousel.ChildrenOfType<PanelGroupStarDifficulty>().SingleOrDefault(p => p.Expanded.Value)?.Item?.Model as StarDifficultyGroupDefinition)?.Difficulty.Stars,
|
|
||||||
() => Is.EqualTo(3));
|
|
||||||
|
|
||||||
if (mouseOverPanel)
|
|
||||||
AddStep("move mouse over left panel", () => InputManager.MoveMouseTo(this.ChildrenOfType<BeatmapTitleWedge>().Single()));
|
|
||||||
else
|
|
||||||
AddStep("move mouse to left side container", () => InputManager.MoveMouseTo(this.ChildrenOfType<Screens.Select.SongSelect.LeftSideInteractionContainer>().Single()));
|
|
||||||
|
|
||||||
AddUntilStep("expanded group is below 1 star",
|
|
||||||
() => (Carousel.ChildrenOfType<PanelGroupStarDifficulty>().Single(p => p.Expanded.Value).Item?.Model as StarDifficultyGroupDefinition)?.Difficulty.Stars,
|
|
||||||
() => Is.EqualTo(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Hotkeys
|
#region Hotkeys
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|||||||