mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 23:22:55 +08:00
Merge remote-tracking branch 'origin/master' into Private_Messages
This commit is contained in:
commit
525e50e8dd
@ -0,0 +1,18 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="VisualTests (net461)" type="DotNetProject" factoryName=".NET Project" singleton="true">
|
||||
<option name="EXE_PATH" value="$PROJECT_DIR$/osu.Game.Tests/bin/Debug/net461/osu.Game.Tests.exe" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/osu.Game.Tests" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<envs />
|
||||
<option name="USE_MONO" value="0" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="PROJECT_PATH" value="$PROJECT_DIR$/osu.Game.Tests/osu.Game.Tests.csproj" />
|
||||
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||
<option name="PROJECT_TFM" value=".NETFramework,Version=v4.6.1" />
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
@ -0,0 +1,18 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="VisualTests (netcoreapp2.0)" type="DotNetProject" factoryName=".NET Project">
|
||||
<option name="EXE_PATH" value="$PROJECT_DIR$/osu.Game.Tests/bin/Debug/netcoreapp2.0/osu.Game.Tests.dll" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/osu.Game.Tests" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<envs />
|
||||
<option name="USE_MONO" value="0" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="PROJECT_PATH" value="$PROJECT_DIR$/osu.Game.Tests/osu.Game.Tests.csproj" />
|
||||
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||
<option name="PROJECT_TFM" value=".NETCoreApp,Version=v2.0" />
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
18
.idea/.idea.osu/.idea/runConfigurations/osu___net461_.xml
Normal file
18
.idea/.idea.osu/.idea/runConfigurations/osu___net461_.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="osu! (net461)" type="DotNetProject" factoryName=".NET Project" singleton="true">
|
||||
<option name="EXE_PATH" value="$PROJECT_DIR$/osu.Desktop/bin/Debug/net461/osu!.exe" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/osu.Desktop" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<envs />
|
||||
<option name="USE_MONO" value="0" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="PROJECT_PATH" value="$PROJECT_DIR$/osu.Desktop/osu.Desktop.csproj" />
|
||||
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||
<option name="PROJECT_TFM" value=".NETFramework,Version=v4.6.1" />
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
@ -0,0 +1,18 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="osu! (netcoreapp2.0)" type="DotNetProject" factoryName=".NET Project">
|
||||
<option name="EXE_PATH" value="$PROJECT_DIR$/osu.Desktop/bin/Debug/netcoreapp2.0/osu!.dll" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/osu.Desktop" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<envs />
|
||||
<option name="USE_MONO" value="0" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="PROJECT_PATH" value="$PROJECT_DIR$/osu.Desktop/osu.Desktop.csproj" />
|
||||
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||
<option name="PROJECT_TFM" value=".NETCoreApp,Version=v2.0" />
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
16
.vscode/launch.json
vendored
16
.vscode/launch.json
vendored
@ -8,10 +8,7 @@
|
||||
},
|
||||
"type": "mono",
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/osu.Desktop/bin/Debug/net461/osu!.exe",
|
||||
"args": [
|
||||
"--tests"
|
||||
],
|
||||
"program": "${workspaceRoot}/osu.Game.Tests/bin/Debug/net461/osu.Game.Tests.exe",
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Debug, msbuild)",
|
||||
"runtimeExecutable": null,
|
||||
@ -25,10 +22,7 @@
|
||||
},
|
||||
"type": "mono",
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/osu.Desktop/bin/Release/net461/osu!.exe",
|
||||
"args": [
|
||||
"--tests"
|
||||
],
|
||||
"program": "${workspaceRoot}/osu.Game.Tests/bin/Debug/net461/osu.Game.Tests.exe",
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Release, msbuild)",
|
||||
"runtimeExecutable": null,
|
||||
@ -69,8 +63,7 @@
|
||||
"request": "launch",
|
||||
"program": "dotnet",
|
||||
"args": [
|
||||
"${workspaceRoot}/osu.Desktop/bin/Debug/netcoreapp2.0/osu!.dll",
|
||||
"--tests"
|
||||
"${workspaceRoot}/osu.Game.Tests/bin/Debug/netcoreapp2.0/osu.Game.Tests.dll"
|
||||
],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Debug, dotnet)",
|
||||
@ -83,8 +76,7 @@
|
||||
"request": "launch",
|
||||
"program": "dotnet",
|
||||
"args": [
|
||||
"${workspaceRoot}/osu.Desktop/bin/Release/netcoreapp2.0/osu!.dll",
|
||||
"--tests"
|
||||
"${workspaceRoot}/osu.Game.Tests/bin/Debug/netcoreapp2.0/osu.Game.Tests.dll"
|
||||
],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Release, dotnet)",
|
||||
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -1,3 +0,0 @@
|
||||
// Place your settings in this file to overwrite default and user settings.
|
||||
{
|
||||
}
|
@ -22,10 +22,6 @@ build:
|
||||
project: osu.sln
|
||||
parallel: true
|
||||
verbosity: minimal
|
||||
test:
|
||||
assemblies:
|
||||
only:
|
||||
- 'osu.Desktop\**\*.dll'
|
||||
after_build:
|
||||
- cmd: inspectcode --o="inspectcodereport.xml" --projects:osu.Game* --caches-home="inspectcode" osu.sln > NUL
|
||||
- cmd: NVika parsereport "inspectcodereport.xml" --treatwarningsaserrors
|
@ -1 +1 @@
|
||||
Subproject commit b59149e1cebe28675dcd2ebd014e5793d9626c09
|
||||
Subproject commit 02d7a0fa4798d197cd08570ee48951edbb7c7860
|
@ -5,10 +5,6 @@
|
||||
<OutputType>Exe</OutputType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Company>ppy Pty Ltd</Company>
|
||||
<Copyright>ppy Pty Ltd 2007-2017</Copyright>
|
||||
<Title>osu.Desktop.Deploy</Title>
|
||||
<Product>osu.Desktop.Deploy</Product>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="Project References">
|
||||
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj" />
|
||||
|
@ -44,9 +44,6 @@ namespace osu.Desktop
|
||||
{
|
||||
switch (args.FirstOrDefault() ?? string.Empty)
|
||||
{
|
||||
case "--tests":
|
||||
host.Run(new OsuTestBrowser());
|
||||
break;
|
||||
default:
|
||||
host.Run(new OsuGameDesktop(args));
|
||||
break;
|
||||
|
@ -5,19 +5,13 @@
|
||||
<OutputType>WinExe</OutputType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Company>ppy Pty Ltd</Company>
|
||||
<Description>click the circles. to the beat.</Description>
|
||||
<Copyright>ppy Pty Ltd 2007-2017</Copyright>
|
||||
<AssemblyName>osu!</AssemblyName>
|
||||
<Title>osu!lazer</Title>
|
||||
<Product>osu!lazer</Product>
|
||||
<ApplicationIcon>lazer.ico</ApplicationIcon>
|
||||
<Configurations>$(CONFIGURATIONS);VisualTests</Configurations>
|
||||
<Version>0.0.0.0</Version>
|
||||
<FileVersion>0.0.0.0</FileVersion>
|
||||
<!-- DeepEqual is not netstandard-compatible. This is fine since we run tests with .NET Framework anyway.
|
||||
(Not sure why this is needed here, since we don't directly reference DeepEquals in this project...) -->
|
||||
<NoWarn>NU1701</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Defines">
|
||||
<DefineConstants Condition="'$(TargetFramework)' == 'net461'">$(DefineConstants);NET_FRAMEWORK</DefineConstants>
|
||||
@ -25,23 +19,18 @@
|
||||
<PropertyGroup>
|
||||
<StartupObject>osu.Desktop.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'VisualTests|AnyCPU'">
|
||||
<StartArguments>--tests</StartArguments>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="Project References">
|
||||
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj" />
|
||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||
<ProjectReference Include="..\osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj" />
|
||||
<ProjectReference Include="..\osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj" />
|
||||
<ProjectReference Include="..\osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj" />
|
||||
<ProjectReference Include="..\osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj" />
|
||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||
<ProjectReference Include="..\osu-resources\osu.Game.Resources\osu.Game.Resources.csproj" />
|
||||
<ProjectReference Include="..\osu.Game.Tests\osu.Game.Tests.csproj" />
|
||||
<PackageReference Include="Microsoft.Win32.Registry" Version="4.4.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.1" />
|
||||
<PackageReference Include="NUnit" Version="3.8.1" />
|
||||
<PackageReference Include="squirrel.windows" Version="1.7.8" Condition="'$(TargetFramework)' == 'net461'" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Resources">
|
||||
|
59
osu.Game.Rulesets.Catch.Tests/.vscode/launch.json
vendored
Normal file
59
osu.Game.Rulesets.Catch.Tests/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "VisualTests (Debug, net461)",
|
||||
"windows": {
|
||||
"type": "clr"
|
||||
},
|
||||
"type": "mono",
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/bin/Debug/net461/osu.Game.Rulesets.Catch.Tests.exe",
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Debug, msbuild)",
|
||||
"runtimeExecutable": null,
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"name": "VisualTests (Release, net461)",
|
||||
"windows": {
|
||||
"type": "clr"
|
||||
},
|
||||
"type": "mono",
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/bin/Debug/net461/osu.Game.Rulesets.Catch.Tests.exe",
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Release, msbuild)",
|
||||
"runtimeExecutable": null,
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"name": "VisualTests (Debug, netcoreapp2.0)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"program": "dotnet",
|
||||
"args": [
|
||||
"${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Catch.Tests.dll"
|
||||
],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Debug, dotnet)",
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"name": "VisualTests (Release, netcoreapp2.0)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"program": "dotnet",
|
||||
"args": [
|
||||
"${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Catch.Tests.dll"
|
||||
],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Release, dotnet)",
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
}
|
||||
]
|
||||
}
|
87
osu.Game.Rulesets.Catch.Tests/.vscode/tasks.json
vendored
Normal file
87
osu.Game.Rulesets.Catch.Tests/.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Build (Debug, msbuild)",
|
||||
"type": "shell",
|
||||
"command": "msbuild",
|
||||
"args": [
|
||||
"osu.Game.Rulesets.Catch.Tests.csproj",
|
||||
"/p:TargetFramework=net461",
|
||||
"/p:GenerateFullPaths=true",
|
||||
"/m",
|
||||
"/verbosity:m"
|
||||
],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Build (Release, msbuild)",
|
||||
"type": "shell",
|
||||
"command": "msbuild",
|
||||
"args": [
|
||||
"osu.Game.Rulesets.Catch.Tests.csproj",
|
||||
"/p:Configuration=Release",
|
||||
"/p:TargetFramework=net461",
|
||||
"/p:GenerateFullPaths=true",
|
||||
"/m",
|
||||
"/verbosity:m"
|
||||
],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Build (Debug, dotnet)",
|
||||
"type": "shell",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"build",
|
||||
"--no-restore",
|
||||
"osu.Game.Rulesets.Catch.Tests.csproj",
|
||||
"/p:TargetFramework=netcoreapp2.0",
|
||||
"/p:GenerateFullPaths=true",
|
||||
"/m",
|
||||
"/verbosity:m"
|
||||
],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Build (Release, dotnet)",
|
||||
"type": "shell",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"build",
|
||||
"--no-restore",
|
||||
"osu.Game.Rulesets.Catch.Tests.csproj",
|
||||
"/p:TargetFramework=netcoreapp2.0",
|
||||
"/p:Configuration=Release",
|
||||
"/p:GenerateFullPaths=true",
|
||||
"/m",
|
||||
"/verbosity:m"
|
||||
],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Restore (net461)",
|
||||
"type": "shell",
|
||||
"command": "nuget",
|
||||
"args": [
|
||||
"restore"
|
||||
],
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Restore (netcoreapp2.0)",
|
||||
"type": "shell",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"restore"
|
||||
],
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
62
osu.Game.Rulesets.Catch.Tests/TestCaseAutoJuiceStream.cs
Normal file
62
osu.Game.Rulesets.Catch.Tests/TestCaseAutoJuiceStream.cs
Normal file
@ -0,0 +1,62 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Catch.Objects;
|
||||
using osu.Game.Rulesets.Catch.UI;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Tests.Visual;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
public class TestCaseAutoJuiceStream : TestCasePlayer
|
||||
{
|
||||
public TestCaseAutoJuiceStream()
|
||||
: base(new CatchRuleset())
|
||||
{
|
||||
}
|
||||
|
||||
protected override Beatmap CreateBeatmap(Ruleset ruleset)
|
||||
{
|
||||
var beatmap = new Beatmap
|
||||
{
|
||||
BeatmapInfo = new BeatmapInfo
|
||||
{
|
||||
BaseDifficulty = new BeatmapDifficulty { CircleSize = 6, SliderMultiplier = 3 },
|
||||
Ruleset = ruleset.RulesetInfo
|
||||
}
|
||||
};
|
||||
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
float width = (i % 10 + 1) / 20f;
|
||||
|
||||
beatmap.HitObjects.Add(new JuiceStream
|
||||
{
|
||||
X = 0.5f - width / 2,
|
||||
ControlPoints = new List<Vector2>
|
||||
{
|
||||
Vector2.Zero,
|
||||
new Vector2(width * CatchPlayfield.BASE_WIDTH, 0)
|
||||
},
|
||||
CurveType = CurveType.Linear,
|
||||
Distance = width * CatchPlayfield.BASE_WIDTH,
|
||||
StartTime = i * 2000,
|
||||
NewCombo = i % 8 == 0
|
||||
});
|
||||
}
|
||||
|
||||
return beatmap;
|
||||
}
|
||||
|
||||
protected override Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset)
|
||||
{
|
||||
beatmap.Mods.Value = beatmap.Mods.Value.Concat(new[] { ruleset.GetAutoplayMod() });
|
||||
return base.CreatePlayer(beatmap, ruleset);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\osu.TestProject.props" />
|
||||
<PropertyGroup Label="Project">
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="Project References">
|
||||
<ProjectReference Include="..\osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -8,5 +8,6 @@ namespace osu.Game.Rulesets.Catch.Mods
|
||||
public class CatchModHardRock : ModHardRock
|
||||
{
|
||||
public override double ScoreMultiplier => 1.12;
|
||||
public override bool Ranked => true;
|
||||
}
|
||||
}
|
||||
|
11
osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs
Normal file
11
osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,11 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
// We publish our internal attributes to other sub-projects of the framework.
|
||||
// Note, that we omit visual tests as they are meant to test the framework
|
||||
// behavior "in the wild".
|
||||
|
||||
[assembly: InternalsVisibleTo("osu.Game.Rulesets.Catch.Tests")]
|
||||
[assembly: InternalsVisibleTo("osu.Game.Rulesets.Catch.Tests.Dynamic")]
|
@ -108,6 +108,7 @@ namespace osu.Game.Rulesets.Catch.Replays
|
||||
case BananaShower.Banana _:
|
||||
case TinyDroplet _:
|
||||
case Droplet _:
|
||||
case Fruit _:
|
||||
moveToNext(nestedObj);
|
||||
break;
|
||||
}
|
||||
|
@ -30,10 +30,10 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
Anchor = Anchor.TopCentre;
|
||||
Origin = Anchor.TopCentre;
|
||||
|
||||
ScaledContent.Anchor = Anchor.BottomLeft;
|
||||
ScaledContent.Origin = Anchor.BottomLeft;
|
||||
base.Content.Anchor = Anchor.BottomLeft;
|
||||
base.Content.Origin = Anchor.BottomLeft;
|
||||
|
||||
ScaledContent.AddRange(new Drawable[]
|
||||
base.Content.AddRange(new Drawable[]
|
||||
{
|
||||
explodingFruitContainer = new Container
|
||||
{
|
||||
@ -57,7 +57,6 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
|
||||
public override void Add(DrawableHitObject h)
|
||||
{
|
||||
h.Depth = (float)h.HitObject.StartTime;
|
||||
h.OnJudgement += onJudgement;
|
||||
|
||||
base.Add(h);
|
||||
|
@ -5,25 +5,9 @@
|
||||
<OutputType>Library</OutputType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Company>ppy Pty Ltd</Company>
|
||||
<Version>1.0.0.0</Version>
|
||||
<Copyright>ppy Pty Ltd 2007-2017</Copyright>
|
||||
<AssemblyTitle>osu.Game.Rulesets.Catch</AssemblyTitle>
|
||||
<Description>catch the fruit. to the beat.</Description>
|
||||
<Product>osu.Game.Rulesets.Catch</Product>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="Service">
|
||||
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Project References">
|
||||
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj" />
|
||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.1" />
|
||||
<PackageReference Include="NUnit" Version="3.8.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Resources">
|
||||
<EmbeddedResource Include="Resources\**\*.*" />
|
||||
</ItemGroup>
|
||||
</Project>
|
59
osu.Game.Rulesets.Mania.Tests/.vscode/launch.json
vendored
Normal file
59
osu.Game.Rulesets.Mania.Tests/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "VisualTests (Debug, net461)",
|
||||
"windows": {
|
||||
"type": "clr"
|
||||
},
|
||||
"type": "mono",
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/bin/Debug/net461/osu.Game.Rulesets.Mania.Tests.exe",
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Debug, msbuild)",
|
||||
"runtimeExecutable": null,
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"name": "VisualTests (Release, net461)",
|
||||
"windows": {
|
||||
"type": "clr"
|
||||
},
|
||||
"type": "mono",
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/bin/Debug/net461/osu.Game.Rulesets.Mania.Tests.exe",
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Release, msbuild)",
|
||||
"runtimeExecutable": null,
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"name": "VisualTests (Debug, netcoreapp2.0)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"program": "dotnet",
|
||||
"args": [
|
||||
"${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Mania.Tests.dll"
|
||||
],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Debug, dotnet)",
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"name": "VisualTests (Release, netcoreapp2.0)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"program": "dotnet",
|
||||
"args": [
|
||||
"${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Mania.Tests.dll"
|
||||
],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Release, dotnet)",
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
}
|
||||
]
|
||||
}
|
87
osu.Game.Rulesets.Mania.Tests/.vscode/tasks.json
vendored
Normal file
87
osu.Game.Rulesets.Mania.Tests/.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Build (Debug, msbuild)",
|
||||
"type": "shell",
|
||||
"command": "msbuild",
|
||||
"args": [
|
||||
"osu.Game.Rulesets.Mania.Tests.csproj",
|
||||
"/p:TargetFramework=net461",
|
||||
"/p:GenerateFullPaths=true",
|
||||
"/m",
|
||||
"/verbosity:m"
|
||||
],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Build (Release, msbuild)",
|
||||
"type": "shell",
|
||||
"command": "msbuild",
|
||||
"args": [
|
||||
"osu.Game.Rulesets.Mania.Tests.csproj",
|
||||
"/p:Configuration=Release",
|
||||
"/p:TargetFramework=net461",
|
||||
"/p:GenerateFullPaths=true",
|
||||
"/m",
|
||||
"/verbosity:m"
|
||||
],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Build (Debug, dotnet)",
|
||||
"type": "shell",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"build",
|
||||
"--no-restore",
|
||||
"osu.Game.Rulesets.Mania.Tests.csproj",
|
||||
"/p:TargetFramework=netcoreapp2.0",
|
||||
"/p:GenerateFullPaths=true",
|
||||
"/m",
|
||||
"/verbosity:m"
|
||||
],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Build (Release, dotnet)",
|
||||
"type": "shell",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"build",
|
||||
"--no-restore",
|
||||
"osu.Game.Rulesets.Mania.Tests.csproj",
|
||||
"/p:TargetFramework=netcoreapp2.0",
|
||||
"/p:Configuration=Release",
|
||||
"/p:GenerateFullPaths=true",
|
||||
"/m",
|
||||
"/verbosity:m"
|
||||
],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Restore (net461)",
|
||||
"type": "shell",
|
||||
"command": "nuget",
|
||||
"args": [
|
||||
"restore"
|
||||
],
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Restore (netcoreapp2.0)",
|
||||
"type": "shell",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"restore"
|
||||
],
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\osu.TestProject.props" />
|
||||
<PropertyGroup Label="Project">
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="Project References">
|
||||
<ProjectReference Include="..\osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
11
osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs
Normal file
11
osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,11 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
// We publish our internal attributes to other sub-projects of the framework.
|
||||
// Note, that we omit visual tests as they are meant to test the framework
|
||||
// behavior "in the wild".
|
||||
|
||||
[assembly: InternalsVisibleTo("osu.Game.Rulesets.Mania.Tests")]
|
||||
[assembly: InternalsVisibleTo("osu.Game.Rulesets.Mania.Tests.Dynamic")]
|
@ -205,7 +205,6 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
/// <param name="hitObject">The DrawableHitObject to add.</param>
|
||||
public override void Add(DrawableHitObject hitObject)
|
||||
{
|
||||
hitObject.Depth = (float)hitObject.HitObject.StartTime;
|
||||
hitObject.AccentColour = AccentColour;
|
||||
hitObject.OnJudgement += OnJudgement;
|
||||
|
||||
@ -263,21 +262,13 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
|
||||
public bool OnPressed(ManiaAction action)
|
||||
{
|
||||
// Play the sounds of the next hitobject
|
||||
if (HitObjects.AliveObjects.Any())
|
||||
{
|
||||
// If there are alive hitobjects, we can abuse the fact that AliveObjects are sorted by time (see: Add())
|
||||
HitObjects.AliveObjects.First().PlaySamples();
|
||||
}
|
||||
else
|
||||
{
|
||||
// If not, we do a slow search - we might want to do a BinarySearch here if this becomes problematic
|
||||
// We fallback to LastOrDefault() if we're beyond the last note in the map
|
||||
var hitObject = HitObjects.Objects.FirstOrDefault(h => h.HitObject.StartTime > Time.Current) ?? HitObjects.Objects.LastOrDefault();
|
||||
hitObject?.PlaySamples();
|
||||
}
|
||||
if (action != Action)
|
||||
return false;
|
||||
|
||||
return false;
|
||||
var hitObject = HitObjects.Objects.LastOrDefault(h => h.HitObject.StartTime > Time.Current) ?? HitObjects.Objects.FirstOrDefault();
|
||||
hitObject?.PlaySamples();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool OnReleased(ManiaAction action) => false;
|
||||
|
@ -5,25 +5,9 @@
|
||||
<OutputType>Library</OutputType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Company>ppy Pty Ltd</Company>
|
||||
<Version>1.0.0.0</Version>
|
||||
<Copyright>ppy Pty Ltd 2007-2017</Copyright>
|
||||
<AssemblyTitle>osu.Game.Rulests.Mania</AssemblyTitle>
|
||||
<Description>smash the keys. to the beat.</Description>
|
||||
<Product>osu.Game.Rulests.Mania</Product>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="Service">
|
||||
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Project References">
|
||||
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj" />
|
||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.1" />
|
||||
<PackageReference Include="NUnit" Version="3.8.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Resources">
|
||||
<EmbeddedResource Include="Resources\**\*.*" />
|
||||
</ItemGroup>
|
||||
</Project>
|
59
osu.Game.Rulesets.Osu.Tests/.vscode/launch.json
vendored
Normal file
59
osu.Game.Rulesets.Osu.Tests/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "VisualTests (Debug, net461)",
|
||||
"windows": {
|
||||
"type": "clr"
|
||||
},
|
||||
"type": "mono",
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/bin/Debug/net461/osu.Game.Rulesets.Osu.Tests.exe",
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Debug, msbuild)",
|
||||
"runtimeExecutable": null,
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"name": "VisualTests (Release, net461)",
|
||||
"windows": {
|
||||
"type": "clr"
|
||||
},
|
||||
"type": "mono",
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/bin/Debug/net461/osu.Game.Rulesets.Osu.Tests.exe",
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Release, msbuild)",
|
||||
"runtimeExecutable": null,
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"name": "VisualTests (Debug, netcoreapp2.0)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"program": "dotnet",
|
||||
"args": [
|
||||
"${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Osu.Tests.dll"
|
||||
],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Debug, dotnet)",
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"name": "VisualTests (Release, netcoreapp2.0)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"program": "dotnet",
|
||||
"args": [
|
||||
"${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Osu.Tests.dll"
|
||||
],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Release, dotnet)",
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
}
|
||||
]
|
||||
}
|
87
osu.Game.Rulesets.Osu.Tests/.vscode/tasks.json
vendored
Normal file
87
osu.Game.Rulesets.Osu.Tests/.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Build (Debug, msbuild)",
|
||||
"type": "shell",
|
||||
"command": "msbuild",
|
||||
"args": [
|
||||
"osu.Game.Rulesets.Osu.Tests.csproj",
|
||||
"/p:TargetFramework=net461",
|
||||
"/p:GenerateFullPaths=true",
|
||||
"/m",
|
||||
"/verbosity:m"
|
||||
],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Build (Release, msbuild)",
|
||||
"type": "shell",
|
||||
"command": "msbuild",
|
||||
"args": [
|
||||
"osu.Game.Rulesets.Osu.Tests.csproj",
|
||||
"/p:Configuration=Release",
|
||||
"/p:TargetFramework=net461",
|
||||
"/p:GenerateFullPaths=true",
|
||||
"/m",
|
||||
"/verbosity:m"
|
||||
],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Build (Debug, dotnet)",
|
||||
"type": "shell",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"build",
|
||||
"--no-restore",
|
||||
"osu.Game.Rulesets.Osu.Tests.csproj",
|
||||
"/p:TargetFramework=netcoreapp2.0",
|
||||
"/p:GenerateFullPaths=true",
|
||||
"/m",
|
||||
"/verbosity:m"
|
||||
],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Build (Release, dotnet)",
|
||||
"type": "shell",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"build",
|
||||
"--no-restore",
|
||||
"osu.Game.Rulesets.Osu.Tests.csproj",
|
||||
"/p:TargetFramework=netcoreapp2.0",
|
||||
"/p:Configuration=Release",
|
||||
"/p:GenerateFullPaths=true",
|
||||
"/m",
|
||||
"/verbosity:m"
|
||||
],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Restore (net461)",
|
||||
"type": "shell",
|
||||
"command": "nuget",
|
||||
"args": [
|
||||
"restore"
|
||||
],
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Restore (netcoreapp2.0)",
|
||||
"type": "shell",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"restore"
|
||||
],
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\osu.TestProject.props" />
|
||||
<PropertyGroup Label="Project">
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="Project References">
|
||||
<ProjectReference Include="..\osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -21,6 +21,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Layers.Selection.Overlays
|
||||
Size = hitCircle.Size;
|
||||
Scale = hitCircle.Scale;
|
||||
|
||||
CornerRadius = Size.X / 2;
|
||||
|
||||
AddInternal(new RingPiece());
|
||||
|
||||
hitCircle.HitObject.PositionChanged += _ => Position = hitCircle.Position;
|
||||
|
@ -38,6 +38,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Layers.Selection.Overlays
|
||||
Scale = slider.HeadCircle.Scale;
|
||||
|
||||
AddInternal(new RingPiece());
|
||||
|
||||
Select();
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -52,5 +54,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Layers.Selection.Overlays
|
||||
|
||||
RelativeAnchorPosition = hitObject.RelativeAnchorPosition;
|
||||
}
|
||||
|
||||
// Todo: This is temporary, since the slider circle masks don't do anything special yet. In the future they will handle input.
|
||||
public override bool HandleMouseInput => false;
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Edit;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
@ -59,5 +60,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Layers.Selection.Overlays
|
||||
}
|
||||
|
||||
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => body.ReceiveMouseInputAt(screenSpacePos);
|
||||
|
||||
public override Vector2 SelectionPoint => ToScreenSpace(OriginPosition);
|
||||
public override Quad SelectionQuad => body.PathDrawQuad;
|
||||
}
|
||||
}
|
||||
|
@ -8,5 +8,6 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
public class OsuEditPlayfield : OsuPlayfield
|
||||
{
|
||||
protected override bool ProxyApproachCircles => false;
|
||||
protected override bool DisplayJudgements => false;
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
public class OsuModAutoplay : ModAutoplay<OsuHitObject>
|
||||
{
|
||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot), typeof(OsuModSpunOut) }).ToArray();
|
||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModAutopilot)).Append(typeof(OsuModSpunOut)).ToArray();
|
||||
|
||||
protected override Score CreateReplayScore(Beatmap<OsuHitObject> beatmap)
|
||||
{
|
||||
|
@ -14,6 +14,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
public class OsuModHardRock : ModHardRock, IApplicableToHitObject<OsuHitObject>
|
||||
{
|
||||
public override double ScoreMultiplier => 1.06;
|
||||
public override bool Ranked => true;
|
||||
|
||||
public void ApplyToHitObject(OsuHitObject hitObject)
|
||||
{
|
||||
|
@ -9,6 +9,6 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
public class OsuModNoFail : ModNoFail
|
||||
{
|
||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray();
|
||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModAutopilot)).ToArray();
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,6 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
public class OsuModRelax : ModRelax
|
||||
{
|
||||
public override string Description => @"You don't need to click. Give your clicking/tapping fingers a break from the heat of things.";
|
||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray();
|
||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModAutopilot)).ToArray();
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,6 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
public class OsuModSuddenDeath : ModSuddenDeath
|
||||
{
|
||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray();
|
||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModAutopilot)).ToArray();
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Rulesets.Osu.Judgements;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using OpenTK.Graphics;
|
||||
@ -177,8 +176,5 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
public Drawable ProxiedLayer => HeadCircle.ApproachCircle;
|
||||
|
||||
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => Body.ReceiveMouseInputAt(screenSpacePos);
|
||||
|
||||
public override Vector2 SelectionPoint => ToScreenSpace(OriginPosition);
|
||||
public override Quad SelectionQuad => Body.PathDrawQuad;
|
||||
}
|
||||
}
|
||||
|
@ -7,10 +7,11 @@ using osu.Game.Rulesets.Objects;
|
||||
using OpenTK;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Rulesets.Edit.Types;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Objects
|
||||
{
|
||||
public abstract class OsuHitObject : HitObject, IHasComboInformation, IHasPosition
|
||||
public abstract class OsuHitObject : HitObject, IHasComboInformation, IHasEditablePosition
|
||||
{
|
||||
public const double OBJECT_RADIUS = 64;
|
||||
|
||||
|
11
osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs
Normal file
11
osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,11 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
// We publish our internal attributes to other sub-projects of the framework.
|
||||
// Note, that we omit visual tests as they are meant to test the framework
|
||||
// behavior "in the wild".
|
||||
|
||||
[assembly: InternalsVisibleTo("osu.Game.Rulesets.Osu.Tests")]
|
||||
[assembly: InternalsVisibleTo("osu.Game.Rulesets.Osu.Tests.Dynamic")]
|
@ -92,17 +92,17 @@ namespace osu.Game.Rulesets.Osu.Replays
|
||||
if (h.StartTime - h.HitWindows.HalfWindowFor(HitResult.Miss) > endTime + h.HitWindows.HalfWindowFor(HitResult.Meh) + 50)
|
||||
{
|
||||
if (!(prev is Spinner) && h.StartTime - endTime < 1000) AddFrameToReplay(new OsuReplayFrame(endTime + h.HitWindows.HalfWindowFor(HitResult.Meh), new Vector2(prev.StackedEndPosition.X, prev.StackedEndPosition.Y)));
|
||||
if (!(h is Spinner)) AddFrameToReplay(new OsuReplayFrame(h.StartTime - h.HitWindows.HalfWindowFor(HitResult.Meh), new Vector2(h.StackedPosition.X, h.StackedPosition.Y)));
|
||||
if (!(h is Spinner)) AddFrameToReplay(new OsuReplayFrame(h.StartTime - h.HitWindows.HalfWindowFor(HitResult.Miss), new Vector2(h.StackedPosition.X, h.StackedPosition.Y)));
|
||||
}
|
||||
else if (h.StartTime - h.HitWindows.HalfWindowFor(HitResult.Meh) > endTime + h.HitWindows.HalfWindowFor(HitResult.Meh) + 50)
|
||||
{
|
||||
if (!(prev is Spinner) && h.StartTime - endTime < 1000) AddFrameToReplay(new OsuReplayFrame(endTime + h.HitWindows.HalfWindowFor(HitResult.Meh), new Vector2(prev.StackedEndPosition.X, prev.StackedEndPosition.Y)));
|
||||
if (!(h is Spinner)) AddFrameToReplay(new OsuReplayFrame(h.StartTime - h.HitWindows.HalfWindowFor(HitResult.Meh), new Vector2(h.StackedPosition.X, h.StackedPosition.Y)));
|
||||
}
|
||||
else if (h.StartTime - h.HitWindows.HalfWindowFor(HitResult.Meh) > endTime + h.HitWindows.HalfWindowFor(HitResult.Meh) + 50)
|
||||
else if (h.StartTime - h.HitWindows.HalfWindowFor(HitResult.Good) > endTime + h.HitWindows.HalfWindowFor(HitResult.Good) + 50)
|
||||
{
|
||||
if (!(prev is Spinner) && h.StartTime - endTime < 1000) AddFrameToReplay(new OsuReplayFrame(endTime + h.HitWindows.HalfWindowFor(HitResult.Meh), new Vector2(prev.StackedEndPosition.X, prev.StackedEndPosition.Y)));
|
||||
if (!(h is Spinner)) AddFrameToReplay(new OsuReplayFrame(h.StartTime - h.HitWindows.HalfWindowFor(HitResult.Meh), new Vector2(h.StackedPosition.X, h.StackedPosition.Y)));
|
||||
if (!(prev is Spinner) && h.StartTime - endTime < 1000) AddFrameToReplay(new OsuReplayFrame(endTime + h.HitWindows.HalfWindowFor(HitResult.Good), new Vector2(prev.StackedEndPosition.X, prev.StackedEndPosition.Y)));
|
||||
if (!(h is Spinner)) AddFrameToReplay(new OsuReplayFrame(h.StartTime - h.HitWindows.HalfWindowFor(HitResult.Good), new Vector2(h.StackedPosition.X, h.StackedPosition.Y)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Osu.Replays
|
||||
{
|
||||
new ReplayState<OsuAction>
|
||||
{
|
||||
Mouse = new ReplayMouseState(ToScreenSpace(Position ?? Vector2.Zero)),
|
||||
Mouse = new ReplayMouseState(GamefieldToScreenSpace(Position ?? Vector2.Zero)),
|
||||
PressedActions = CurrentFrame.Actions
|
||||
}
|
||||
};
|
||||
|
@ -24,6 +24,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
// Todo: This should not be a thing, but is currently required for the editor
|
||||
// https://github.com/ppy/osu-framework/issues/1283
|
||||
protected virtual bool ProxyApproachCircles => true;
|
||||
protected virtual bool DisplayJudgements => true;
|
||||
|
||||
public static readonly Vector2 BASE_SIZE = new Vector2(512, 384);
|
||||
|
||||
@ -55,8 +56,6 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
|
||||
public override void Add(DrawableHitObject h)
|
||||
{
|
||||
h.Depth = (float)h.HitObject.StartTime;
|
||||
|
||||
h.OnJudgement += onJudgement;
|
||||
|
||||
var c = h as IDrawableHitObjectWithProxiedApproach;
|
||||
@ -75,7 +74,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
|
||||
private void onJudgement(DrawableHitObject judgedObject, Judgement judgement)
|
||||
{
|
||||
if (!judgedObject.DisplayJudgement)
|
||||
if (!judgedObject.DisplayJudgement || !DisplayJudgements)
|
||||
return;
|
||||
|
||||
DrawableOsuJudgement explosion = new DrawableOsuJudgement(judgement, judgedObject)
|
||||
|
@ -5,25 +5,9 @@
|
||||
<OutputType>Library</OutputType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Company>ppy Pty Ltd</Company>
|
||||
<Version>1.0.0.0</Version>
|
||||
<Copyright>ppy Pty Ltd 2007-2017</Copyright>
|
||||
<AssemblyTitle>osu.Game.Rulesets.Osu</AssemblyTitle>
|
||||
<Description>click the circles. to the beat.</Description>
|
||||
<Product>osu.Game.Rulesets.Osu</Product>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="Service">
|
||||
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Project References">
|
||||
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj" />
|
||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.1" />
|
||||
<PackageReference Include="NUnit" Version="3.8.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Resources">
|
||||
<EmbeddedResource Include="Resources\**\*.*" />
|
||||
</ItemGroup>
|
||||
</Project>
|
59
osu.Game.Rulesets.Taiko.Tests/.vscode/launch.json
vendored
Normal file
59
osu.Game.Rulesets.Taiko.Tests/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "VisualTests (Debug, net461)",
|
||||
"windows": {
|
||||
"type": "clr"
|
||||
},
|
||||
"type": "mono",
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/bin/Debug/net461/osu.Game.Rulesets.Taiko.Tests.exe",
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Debug, msbuild)",
|
||||
"runtimeExecutable": null,
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"name": "VisualTests (Release, net461)",
|
||||
"windows": {
|
||||
"type": "clr"
|
||||
},
|
||||
"type": "mono",
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/bin/Debug/net461/osu.Game.Rulesets.Taiko.Tests.exe",
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Release, msbuild)",
|
||||
"runtimeExecutable": null,
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"name": "VisualTests (Debug, netcoreapp2.0)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"program": "dotnet",
|
||||
"args": [
|
||||
"${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Taiko.Tests.dll"
|
||||
],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Debug, dotnet)",
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"name": "VisualTests (Release, netcoreapp2.0)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"program": "dotnet",
|
||||
"args": [
|
||||
"${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Taiko.Tests.dll"
|
||||
],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"preLaunchTask": "Build (Release, dotnet)",
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
}
|
||||
]
|
||||
}
|
87
osu.Game.Rulesets.Taiko.Tests/.vscode/tasks.json
vendored
Normal file
87
osu.Game.Rulesets.Taiko.Tests/.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Build (Debug, msbuild)",
|
||||
"type": "shell",
|
||||
"command": "msbuild",
|
||||
"args": [
|
||||
"osu.Game.Rulesets.Taiko.Tests.csproj",
|
||||
"/p:TargetFramework=net461",
|
||||
"/p:GenerateFullPaths=true",
|
||||
"/m",
|
||||
"/verbosity:m"
|
||||
],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Build (Release, msbuild)",
|
||||
"type": "shell",
|
||||
"command": "msbuild",
|
||||
"args": [
|
||||
"osu.Game.Rulesets.Taiko.Tests.csproj",
|
||||
"/p:Configuration=Release",
|
||||
"/p:TargetFramework=net461",
|
||||
"/p:GenerateFullPaths=true",
|
||||
"/m",
|
||||
"/verbosity:m"
|
||||
],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Build (Debug, dotnet)",
|
||||
"type": "shell",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"build",
|
||||
"--no-restore",
|
||||
"osu.Game.Rulesets.Taiko.Tests.csproj",
|
||||
"/p:TargetFramework=netcoreapp2.0",
|
||||
"/p:GenerateFullPaths=true",
|
||||
"/m",
|
||||
"/verbosity:m"
|
||||
],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Build (Release, dotnet)",
|
||||
"type": "shell",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"build",
|
||||
"--no-restore",
|
||||
"osu.Game.Rulesets.Taiko.Tests.csproj",
|
||||
"/p:TargetFramework=netcoreapp2.0",
|
||||
"/p:Configuration=Release",
|
||||
"/p:GenerateFullPaths=true",
|
||||
"/m",
|
||||
"/verbosity:m"
|
||||
],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Restore (net461)",
|
||||
"type": "shell",
|
||||
"command": "nuget",
|
||||
"args": [
|
||||
"restore"
|
||||
],
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Restore (netcoreapp2.0)",
|
||||
"type": "shell",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"restore"
|
||||
],
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\osu.TestProject.props" />
|
||||
<PropertyGroup Label="Project">
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="Project References">
|
||||
<ProjectReference Include="..\osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -8,5 +8,6 @@ namespace osu.Game.Rulesets.Taiko.Mods
|
||||
public class TaikoModHardRock : ModHardRock
|
||||
{
|
||||
public override double ScoreMultiplier => 1.06;
|
||||
public override bool Ranked => true;
|
||||
}
|
||||
}
|
||||
|
11
osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs
Normal file
11
osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,11 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
// We publish our internal attributes to other sub-projects of the framework.
|
||||
// Note, that we omit visual tests as they are meant to test the framework
|
||||
// behavior "in the wild".
|
||||
|
||||
[assembly: InternalsVisibleTo("osu.Game.Rulesets.Taiko.Tests")]
|
||||
[assembly: InternalsVisibleTo("osu.Game.Rulesets.Taiko.Tests.Dynamic")]
|
@ -208,8 +208,6 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
|
||||
public override void Add(DrawableHitObject h)
|
||||
{
|
||||
h.Depth = (float)h.HitObject.StartTime;
|
||||
|
||||
h.OnJudgement += OnJudgement;
|
||||
|
||||
base.Add(h);
|
||||
|
@ -5,25 +5,9 @@
|
||||
<OutputType>Library</OutputType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Company>ppy Pty Ltd</Company>
|
||||
<Version>1.0.0.0</Version>
|
||||
<Copyright>ppy Pty Ltd 2007-2017</Copyright>
|
||||
<AssemblyTitle>osu.Game.Rulesets.Taiko</AssemblyTitle>
|
||||
<Description>bash the drum. to the beat.</Description>
|
||||
<Product>osu.Game.Rulesets.Taiko</Product>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="Service">
|
||||
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Project References">
|
||||
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj" />
|
||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.1" />
|
||||
<PackageReference Include="NUnit" Version="3.8.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Resources">
|
||||
<EmbeddedResource Include="Resources\**\*.*" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -52,6 +52,7 @@ namespace osu.Game.Tests.Visual
|
||||
FavouriteCount = 356,
|
||||
Submitted = new DateTime(2016, 2, 10),
|
||||
Ranked = new DateTime(2016, 6, 19),
|
||||
Status = BeatmapSetOnlineStatus.Ranked,
|
||||
BPM = 236,
|
||||
HasVideo = true,
|
||||
Covers = new BeatmapSetOnlineCovers
|
||||
@ -222,6 +223,7 @@ namespace osu.Game.Tests.Visual
|
||||
FavouriteCount = 58,
|
||||
Submitted = new DateTime(2016, 6, 11),
|
||||
Ranked = new DateTime(2016, 7, 12),
|
||||
Status = BeatmapSetOnlineStatus.Pending,
|
||||
BPM = 160,
|
||||
HasVideo = false,
|
||||
Covers = new BeatmapSetOnlineCovers
|
||||
|
@ -2,7 +2,9 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
||||
namespace osu.Game.Tests.Visual
|
||||
@ -10,10 +12,12 @@ namespace osu.Game.Tests.Visual
|
||||
[TestFixture]
|
||||
public class TestCaseBreadcrumbs : OsuTestCase
|
||||
{
|
||||
private readonly BreadcrumbControl<BreadcrumbTab> breadcrumbs;
|
||||
|
||||
public TestCaseBreadcrumbs()
|
||||
{
|
||||
BreadcrumbControl<BreadcrumbTab> c;
|
||||
Add(c = new BreadcrumbControl<BreadcrumbTab>
|
||||
|
||||
Add(breadcrumbs = new BreadcrumbControl<BreadcrumbTab>
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
@ -21,9 +25,15 @@ namespace osu.Game.Tests.Visual
|
||||
Width = 0.5f,
|
||||
});
|
||||
|
||||
AddStep(@"first", () => c.Current.Value = BreadcrumbTab.Click);
|
||||
AddStep(@"second", () => c.Current.Value = BreadcrumbTab.The);
|
||||
AddStep(@"third", () => c.Current.Value = BreadcrumbTab.Circles);
|
||||
AddStep(@"first", () => breadcrumbs.Current.Value = BreadcrumbTab.Click);
|
||||
AddStep(@"second", () => breadcrumbs.Current.Value = BreadcrumbTab.The);
|
||||
AddStep(@"third", () => breadcrumbs.Current.Value = BreadcrumbTab.Circles);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
breadcrumbs.StripColour = colours.Blue;
|
||||
}
|
||||
|
||||
private enum BreadcrumbTab
|
||||
|
@ -9,7 +9,6 @@ using osu.Framework.Graphics.Cursor;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Framework.Testing.Input;
|
||||
using osu.Game.Graphics.Cursor;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using OpenTK;
|
||||
@ -18,88 +17,74 @@ using OpenTK.Graphics;
|
||||
namespace osu.Game.Tests.Visual
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestCaseCursors : OsuTestCase
|
||||
public class TestCaseCursors : ManualInputManagerTestCase
|
||||
{
|
||||
private readonly ManualInputManager inputManager;
|
||||
private readonly CursorOverrideContainer cursorOverrideContainer;
|
||||
private readonly CustomCursorBox[] cursorBoxes = new CustomCursorBox[6];
|
||||
|
||||
public TestCaseCursors()
|
||||
{
|
||||
Child = inputManager = new ManualInputManager
|
||||
Child = cursorOverrideContainer = new CursorOverrideContainer
|
||||
{
|
||||
Child = cursorOverrideContainer = new CursorOverrideContainer
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new[]
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new[]
|
||||
// Middle user
|
||||
cursorBoxes[0] = new CustomCursorBox(Color4.Green)
|
||||
{
|
||||
// Middle user
|
||||
cursorBoxes[0] = new CustomCursorBox(Color4.Green)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Size = new Vector2(0.5f),
|
||||
},
|
||||
// Top-left user
|
||||
cursorBoxes[1] = new CustomCursorBox(Color4.Blue)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Size = new Vector2(0.4f)
|
||||
},
|
||||
// Bottom-right user
|
||||
cursorBoxes[2] = new CustomCursorBox(Color4.Red)
|
||||
{
|
||||
Anchor = Anchor.BottomRight,
|
||||
Origin = Anchor.BottomRight,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Size = new Vector2(0.4f)
|
||||
},
|
||||
// Bottom-left local
|
||||
cursorBoxes[3] = new CustomCursorBox(Color4.Magenta, false)
|
||||
{
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Size = new Vector2(0.4f)
|
||||
},
|
||||
// Top-right local
|
||||
cursorBoxes[4] = new CustomCursorBox(Color4.Cyan, false)
|
||||
{
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Size = new Vector2(0.4f)
|
||||
},
|
||||
// Left-local
|
||||
cursorBoxes[5] = new CustomCursorBox(Color4.Yellow, false)
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Size = new Vector2(0.2f, 1),
|
||||
},
|
||||
}
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Size = new Vector2(0.5f),
|
||||
},
|
||||
// Top-left user
|
||||
cursorBoxes[1] = new CustomCursorBox(Color4.Blue)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Size = new Vector2(0.4f)
|
||||
},
|
||||
// Bottom-right user
|
||||
cursorBoxes[2] = new CustomCursorBox(Color4.Red)
|
||||
{
|
||||
Anchor = Anchor.BottomRight,
|
||||
Origin = Anchor.BottomRight,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Size = new Vector2(0.4f)
|
||||
},
|
||||
// Bottom-left local
|
||||
cursorBoxes[3] = new CustomCursorBox(Color4.Magenta, false)
|
||||
{
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Size = new Vector2(0.4f)
|
||||
},
|
||||
// Top-right local
|
||||
cursorBoxes[4] = new CustomCursorBox(Color4.Cyan, false)
|
||||
{
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Size = new Vector2(0.4f)
|
||||
},
|
||||
// Left-local
|
||||
cursorBoxes[5] = new CustomCursorBox(Color4.Yellow, false)
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Size = new Vector2(0.2f, 1),
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
returnUserInput();
|
||||
|
||||
AddToggleStep("Smooth transitions", b => cursorBoxes.ForEach(box => box.SmoothTransition = b));
|
||||
|
||||
testUserCursor();
|
||||
testLocalCursor();
|
||||
testUserCursorOverride();
|
||||
testMultipleLocalCursors();
|
||||
returnUserInput();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns input back to the user.
|
||||
/// </summary>
|
||||
private void returnUserInput()
|
||||
{
|
||||
AddStep("Return user input", () => inputManager.UseParentState = true);
|
||||
ReturnUserInput();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -109,7 +94,7 @@ namespace osu.Game.Tests.Visual
|
||||
/// </summary>
|
||||
private void testUserCursor()
|
||||
{
|
||||
AddStep("Move to green area", () => inputManager.MoveMouseTo(cursorBoxes[0]));
|
||||
AddStep("Move to green area", () => InputManager.MoveMouseTo(cursorBoxes[0]));
|
||||
AddAssert("Check green cursor visible", () => checkVisible(cursorBoxes[0].Cursor));
|
||||
AddAssert("Check green cursor at mouse", () => checkAtMouse(cursorBoxes[0].Cursor));
|
||||
AddStep("Move out", moveOut);
|
||||
@ -124,7 +109,7 @@ namespace osu.Game.Tests.Visual
|
||||
/// </summary>
|
||||
private void testLocalCursor()
|
||||
{
|
||||
AddStep("Move to purple area", () => inputManager.MoveMouseTo(cursorBoxes[3]));
|
||||
AddStep("Move to purple area", () => InputManager.MoveMouseTo(cursorBoxes[3]));
|
||||
AddAssert("Check purple cursor visible", () => checkVisible(cursorBoxes[3].Cursor));
|
||||
AddAssert("Check purple cursor at mouse", () => checkAtMouse(cursorBoxes[3].Cursor));
|
||||
AddAssert("Check global cursor visible", () => checkVisible(cursorOverrideContainer.Cursor));
|
||||
@ -141,7 +126,7 @@ namespace osu.Game.Tests.Visual
|
||||
/// </summary>
|
||||
private void testUserCursorOverride()
|
||||
{
|
||||
AddStep("Move to blue-green boundary", () => inputManager.MoveMouseTo(cursorBoxes[1].ScreenSpaceDrawQuad.BottomRight - new Vector2(10)));
|
||||
AddStep("Move to blue-green boundary", () => InputManager.MoveMouseTo(cursorBoxes[1].ScreenSpaceDrawQuad.BottomRight - new Vector2(10)));
|
||||
AddAssert("Check blue cursor visible", () => checkVisible(cursorBoxes[1].Cursor));
|
||||
AddAssert("Check green cursor invisible", () => !checkVisible(cursorBoxes[0].Cursor));
|
||||
AddAssert("Check blue cursor at mouse", () => checkAtMouse(cursorBoxes[1].Cursor));
|
||||
@ -156,7 +141,7 @@ namespace osu.Game.Tests.Visual
|
||||
/// </summary>
|
||||
private void testMultipleLocalCursors()
|
||||
{
|
||||
AddStep("Move to yellow-purple boundary", () => inputManager.MoveMouseTo(cursorBoxes[5].ScreenSpaceDrawQuad.BottomRight - new Vector2(10)));
|
||||
AddStep("Move to yellow-purple boundary", () => InputManager.MoveMouseTo(cursorBoxes[5].ScreenSpaceDrawQuad.BottomRight - new Vector2(10)));
|
||||
AddAssert("Check purple cursor visible", () => checkVisible(cursorBoxes[3].Cursor));
|
||||
AddAssert("Check purple cursor at mouse", () => checkAtMouse(cursorBoxes[3].Cursor));
|
||||
AddAssert("Check yellow cursor visible", () => checkVisible(cursorBoxes[5].Cursor));
|
||||
@ -172,7 +157,7 @@ namespace osu.Game.Tests.Visual
|
||||
/// </summary>
|
||||
private void testUserOverrideWithLocal()
|
||||
{
|
||||
AddStep("Move to yellow-blue boundary", () => inputManager.MoveMouseTo(cursorBoxes[5].ScreenSpaceDrawQuad.TopRight - new Vector2(10)));
|
||||
AddStep("Move to yellow-blue boundary", () => InputManager.MoveMouseTo(cursorBoxes[5].ScreenSpaceDrawQuad.TopRight - new Vector2(10)));
|
||||
AddAssert("Check blue cursor visible", () => checkVisible(cursorBoxes[1].Cursor));
|
||||
AddAssert("Check blue cursor at mouse", () => checkAtMouse(cursorBoxes[1].Cursor));
|
||||
AddAssert("Check yellow cursor visible", () => checkVisible(cursorBoxes[5].Cursor));
|
||||
@ -186,7 +171,7 @@ namespace osu.Game.Tests.Visual
|
||||
/// Moves the cursor to a point not covered by any cursor containers.
|
||||
/// </summary>
|
||||
private void moveOut()
|
||||
=> inputManager.MoveMouseTo(new Vector2(inputManager.ScreenSpaceDrawQuad.Centre.X, inputManager.ScreenSpaceDrawQuad.TopLeft.Y));
|
||||
=> InputManager.MoveMouseTo(new Vector2(InputManager.ScreenSpaceDrawQuad.Centre.X, InputManager.ScreenSpaceDrawQuad.TopLeft.Y));
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a cursor is visible.
|
||||
@ -199,7 +184,7 @@ namespace osu.Game.Tests.Visual
|
||||
/// </summary>
|
||||
/// <param name="cursorContainer">The cursor to check.</param>
|
||||
private bool checkAtMouse(CursorContainer cursorContainer)
|
||||
=> Precision.AlmostEquals(inputManager.CurrentState.Mouse.NativeState.Position, cursorContainer.ToScreenSpace(cursorContainer.ActiveCursor.DrawPosition));
|
||||
=> Precision.AlmostEquals(InputManager.CurrentState.Mouse.NativeState.Position, cursorContainer.ToScreenSpace(cursorContainer.ActiveCursor.DrawPosition));
|
||||
|
||||
private class CustomCursorBox : Container, IProvideCursor
|
||||
{
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using JetBrains.Annotations;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Timing;
|
||||
@ -12,7 +13,6 @@ using osu.Game.Rulesets.Edit;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Osu.Edit;
|
||||
using osu.Game.Rulesets.Osu.Edit.Layers.Selection.Overlays;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Screens.Edit.Screens.Compose.Layers;
|
||||
using osu.Game.Tests.Beatmaps;
|
||||
@ -20,19 +20,16 @@ using osu.Game.Tests.Beatmaps;
|
||||
namespace osu.Game.Tests.Visual
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestCaseEditorSelectionLayer : OsuTestCase
|
||||
public class TestCaseHitObjectComposer : OsuTestCase
|
||||
{
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||
{
|
||||
typeof(SelectionLayer),
|
||||
typeof(SelectionBox),
|
||||
typeof(MaskSelection),
|
||||
typeof(DragLayer),
|
||||
typeof(HitObjectComposer),
|
||||
typeof(OsuHitObjectComposer),
|
||||
typeof(HitObjectMaskLayer),
|
||||
typeof(HitObjectMask),
|
||||
typeof(HitCircleMask),
|
||||
typeof(SliderMask),
|
||||
typeof(SliderCircleMask)
|
||||
typeof(NotNullAttribute)
|
||||
};
|
||||
|
||||
private DependencyContainer dependencies;
|
@ -122,7 +122,7 @@ namespace osu.Game.Tests.Visual
|
||||
Direction = direction;
|
||||
|
||||
Padding = new MarginPadding(2);
|
||||
ScaledContent.Masking = true;
|
||||
Content.Masking = true;
|
||||
|
||||
AddInternal(new Box
|
||||
{
|
||||
|
@ -1,39 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\osu.Game.props" />
|
||||
<Import Project="..\osu.TestProject.props" />
|
||||
<PropertyGroup Label="Project">
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Company>ppy Pty Ltd</Company>
|
||||
<Version>1.0.0.0</Version>
|
||||
<Copyright>ppy Pty Ltd 2007-2017</Copyright>
|
||||
<AssemblyTitle>osu.Game.Tests</AssemblyTitle>
|
||||
<Product>osu.Game.Tests</Product>
|
||||
<!-- DeepEqual is not netstandard-compatible. This is fine since we run tests with .NET Framework anyway. -->
|
||||
<NoWarn>NU1701</NoWarn>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="Service">
|
||||
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Project References">
|
||||
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj" />
|
||||
<ProjectReference Include="..\osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj" />
|
||||
<ProjectReference Include="..\osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj" />
|
||||
<ProjectReference Include="..\osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj" />
|
||||
<ProjectReference Include="..\osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj" />
|
||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||
<ProjectReference Include="..\osu-resources\osu.Game.Resources\osu.Game.Resources.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.1" />
|
||||
<PackageReference Include="DeepEqual" Version="1.6.0" />
|
||||
<PackageReference Include="NUnit" Version="3.8.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Resources">
|
||||
<EmbeddedResource Include="Resources\Soleily - Renatus %28Gamu%29 [Insane].osu" />
|
||||
<EmbeddedResource Include="Resources\Himeringo - Yotsuya-san ni Yoroshiku %28RLC%29 [Winber1%27s Extreme].osu" />
|
||||
<EmbeddedResource Include="Resources\Within Temptation - The Unforgiving %28Armin%29 [Marathon].osu" />
|
||||
<EmbeddedResource Include="Resources\Kozato snow - Rengetsu Ouka %28_Kiva%29 [Yuki YukI].osu" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -8,4 +8,14 @@
|
||||
<Link>osu.licenseheader</Link>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Resources">
|
||||
<EmbeddedResource Include="Resources\**\*.*" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Project">
|
||||
<Company>ppy Pty Ltd</Company>
|
||||
<Copyright>ppy Pty Ltd 2007-2018</Copyright>
|
||||
<!-- DeepEqual is not netstandard-compatible. This is fine since we run tests with .NET Framework anyway.
|
||||
This is required due to https://github.com/NuGet/Home/issues/5740 -->
|
||||
<NoWarn>NU1701</NoWarn>
|
||||
</PropertyGroup>
|
||||
</Project>
|
@ -26,6 +26,11 @@ namespace osu.Game.Beatmaps
|
||||
/// </summary>
|
||||
public DateTimeOffset? LastUpdated { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The status of this beatmap set.
|
||||
/// </summary>
|
||||
public BeatmapSetOnlineStatus Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not this beatmap set has a background video.
|
||||
/// </summary>
|
||||
|
17
osu.Game/Beatmaps/BeatmapSetOnlineStatus.cs
Normal file
17
osu.Game/Beatmaps/BeatmapSetOnlineStatus.cs
Normal file
@ -0,0 +1,17 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.Beatmaps
|
||||
{
|
||||
public enum BeatmapSetOnlineStatus
|
||||
{
|
||||
None = -3,
|
||||
Graveyard = -2,
|
||||
WIP = -1,
|
||||
Pending = 0,
|
||||
Ranked = 1,
|
||||
Approved = 2,
|
||||
Qualified = 3,
|
||||
Loved = 4,
|
||||
}
|
||||
}
|
54
osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs
Normal file
54
osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs
Normal file
@ -0,0 +1,54 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.Beatmaps.Drawables
|
||||
{
|
||||
public class BeatmapSetOnlineStatusPill : CircularContainer
|
||||
{
|
||||
private readonly OsuSpriteText statusText;
|
||||
|
||||
private BeatmapSetOnlineStatus status = BeatmapSetOnlineStatus.None;
|
||||
public BeatmapSetOnlineStatus Status
|
||||
{
|
||||
get { return status; }
|
||||
set
|
||||
{
|
||||
if (value == status) return;
|
||||
status = value;
|
||||
|
||||
statusText.Text = Enum.GetName(typeof(BeatmapSetOnlineStatus), Status)?.ToUpper();
|
||||
}
|
||||
}
|
||||
|
||||
public BeatmapSetOnlineStatusPill(float textSize, MarginPadding textPadding)
|
||||
{
|
||||
AutoSizeAxes = Axes.Both;
|
||||
Masking = true;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = Color4.Black,
|
||||
Alpha = 0.5f,
|
||||
},
|
||||
statusText = new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Font = @"Exo2.0-Bold",
|
||||
TextSize = textSize,
|
||||
Padding = textPadding,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@ -16,7 +16,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
public TOutput Decode(StreamReader primaryStream, params StreamReader[] otherStreams)
|
||||
{
|
||||
var output = CreateTemplateObject();
|
||||
foreach (StreamReader stream in new[] { primaryStream }.Concat(otherStreams))
|
||||
foreach (StreamReader stream in otherStreams.Prepend(primaryStream))
|
||||
ParseStreamInto(stream, output);
|
||||
return output;
|
||||
}
|
||||
|
@ -81,13 +81,13 @@ namespace osu.Game.Beatmaps.Formats
|
||||
handleDifficulty(line);
|
||||
return;
|
||||
case Section.Events:
|
||||
handleEvents(line);
|
||||
handleEvent(line);
|
||||
return;
|
||||
case Section.TimingPoints:
|
||||
handleTimingPoints(line);
|
||||
handleTimingPoint(line);
|
||||
return;
|
||||
case Section.HitObjects:
|
||||
handleHitObjects(line);
|
||||
handleHitObject(line);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -246,7 +246,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
}
|
||||
}
|
||||
|
||||
private void handleEvents(string line)
|
||||
private void handleEvent(string line)
|
||||
{
|
||||
string[] split = line.Split(',');
|
||||
|
||||
@ -275,93 +275,99 @@ namespace osu.Game.Beatmaps.Formats
|
||||
}
|
||||
}
|
||||
|
||||
private void handleTimingPoints(string line)
|
||||
private void handleTimingPoint(string line)
|
||||
{
|
||||
string[] split = line.Split(',');
|
||||
|
||||
double time = getOffsetTime(double.Parse(split[0].Trim(), NumberFormatInfo.InvariantInfo));
|
||||
double beatLength = double.Parse(split[1].Trim(), NumberFormatInfo.InvariantInfo);
|
||||
double speedMultiplier = beatLength < 0 ? 100.0 / -beatLength : 1;
|
||||
|
||||
TimeSignatures timeSignature = TimeSignatures.SimpleQuadruple;
|
||||
if (split.Length >= 3)
|
||||
timeSignature = split[2][0] == '0' ? TimeSignatures.SimpleQuadruple : (TimeSignatures)int.Parse(split[2]);
|
||||
|
||||
LegacySampleBank sampleSet = defaultSampleBank;
|
||||
if (split.Length >= 4)
|
||||
sampleSet = (LegacySampleBank)int.Parse(split[3]);
|
||||
|
||||
//SampleBank sampleBank = SampleBank.Default;
|
||||
//if (split.Length >= 5)
|
||||
// sampleBank = (SampleBank)int.Parse(split[4]);
|
||||
|
||||
int sampleVolume = defaultSampleVolume;
|
||||
if (split.Length >= 6)
|
||||
sampleVolume = int.Parse(split[5]);
|
||||
|
||||
bool timingChange = true;
|
||||
if (split.Length >= 7)
|
||||
timingChange = split[6][0] == '1';
|
||||
|
||||
bool kiaiMode = false;
|
||||
bool omitFirstBarSignature = false;
|
||||
if (split.Length >= 8)
|
||||
try
|
||||
{
|
||||
int effectFlags = int.Parse(split[7]);
|
||||
kiaiMode = (effectFlags & 1) > 0;
|
||||
omitFirstBarSignature = (effectFlags & 8) > 0;
|
||||
}
|
||||
string[] split = line.Split(',');
|
||||
|
||||
string stringSampleSet = sampleSet.ToString().ToLower();
|
||||
if (stringSampleSet == @"none")
|
||||
stringSampleSet = @"normal";
|
||||
double time = getOffsetTime(double.Parse(split[0].Trim(), NumberFormatInfo.InvariantInfo));
|
||||
double beatLength = double.Parse(split[1].Trim(), NumberFormatInfo.InvariantInfo);
|
||||
double speedMultiplier = beatLength < 0 ? 100.0 / -beatLength : 1;
|
||||
|
||||
DifficultyControlPoint difficultyPoint = beatmap.ControlPointInfo.DifficultyPointAt(time);
|
||||
SampleControlPoint samplePoint = beatmap.ControlPointInfo.SamplePointAt(time);
|
||||
EffectControlPoint effectPoint = beatmap.ControlPointInfo.EffectPointAt(time);
|
||||
TimeSignatures timeSignature = TimeSignatures.SimpleQuadruple;
|
||||
if (split.Length >= 3)
|
||||
timeSignature = split[2][0] == '0' ? TimeSignatures.SimpleQuadruple : (TimeSignatures)int.Parse(split[2]);
|
||||
|
||||
if (timingChange)
|
||||
{
|
||||
beatmap.ControlPointInfo.TimingPoints.Add(new TimingControlPoint
|
||||
LegacySampleBank sampleSet = defaultSampleBank;
|
||||
if (split.Length >= 4)
|
||||
sampleSet = (LegacySampleBank)int.Parse(split[3]);
|
||||
|
||||
//SampleBank sampleBank = SampleBank.Default;
|
||||
//if (split.Length >= 5)
|
||||
// sampleBank = (SampleBank)int.Parse(split[4]);
|
||||
|
||||
int sampleVolume = defaultSampleVolume;
|
||||
if (split.Length >= 6)
|
||||
sampleVolume = int.Parse(split[5]);
|
||||
|
||||
bool timingChange = true;
|
||||
if (split.Length >= 7)
|
||||
timingChange = split[6][0] == '1';
|
||||
|
||||
bool kiaiMode = false;
|
||||
bool omitFirstBarSignature = false;
|
||||
if (split.Length >= 8)
|
||||
{
|
||||
Time = time,
|
||||
BeatLength = beatLength,
|
||||
TimeSignature = timeSignature
|
||||
});
|
||||
}
|
||||
int effectFlags = int.Parse(split[7]);
|
||||
kiaiMode = (effectFlags & 1) > 0;
|
||||
omitFirstBarSignature = (effectFlags & 8) > 0;
|
||||
}
|
||||
|
||||
if (speedMultiplier != difficultyPoint.SpeedMultiplier)
|
||||
{
|
||||
beatmap.ControlPointInfo.DifficultyPoints.RemoveAll(x => x.Time == time);
|
||||
beatmap.ControlPointInfo.DifficultyPoints.Add(new DifficultyControlPoint
|
||||
{
|
||||
Time = time,
|
||||
SpeedMultiplier = speedMultiplier
|
||||
});
|
||||
}
|
||||
string stringSampleSet = sampleSet.ToString().ToLower();
|
||||
if (stringSampleSet == @"none")
|
||||
stringSampleSet = @"normal";
|
||||
|
||||
if (stringSampleSet != samplePoint.SampleBank || sampleVolume != samplePoint.SampleVolume)
|
||||
{
|
||||
beatmap.ControlPointInfo.SamplePoints.Add(new SampleControlPoint
|
||||
{
|
||||
Time = time,
|
||||
SampleBank = stringSampleSet,
|
||||
SampleVolume = sampleVolume
|
||||
});
|
||||
}
|
||||
DifficultyControlPoint difficultyPoint = beatmap.ControlPointInfo.DifficultyPointAt(time);
|
||||
SampleControlPoint samplePoint = beatmap.ControlPointInfo.SamplePointAt(time);
|
||||
EffectControlPoint effectPoint = beatmap.ControlPointInfo.EffectPointAt(time);
|
||||
|
||||
if (kiaiMode != effectPoint.KiaiMode || omitFirstBarSignature != effectPoint.OmitFirstBarLine)
|
||||
{
|
||||
beatmap.ControlPointInfo.EffectPoints.Add(new EffectControlPoint
|
||||
if (timingChange)
|
||||
{
|
||||
Time = time,
|
||||
KiaiMode = kiaiMode,
|
||||
OmitFirstBarLine = omitFirstBarSignature
|
||||
});
|
||||
beatmap.ControlPointInfo.TimingPoints.Add(new TimingControlPoint
|
||||
{
|
||||
Time = time,
|
||||
BeatLength = beatLength,
|
||||
TimeSignature = timeSignature
|
||||
});
|
||||
}
|
||||
|
||||
if (speedMultiplier != difficultyPoint.SpeedMultiplier)
|
||||
{
|
||||
beatmap.ControlPointInfo.DifficultyPoints.RemoveAll(x => x.Time == time);
|
||||
beatmap.ControlPointInfo.DifficultyPoints.Add(new DifficultyControlPoint
|
||||
{
|
||||
Time = time,
|
||||
SpeedMultiplier = speedMultiplier
|
||||
});
|
||||
}
|
||||
|
||||
if (stringSampleSet != samplePoint.SampleBank || sampleVolume != samplePoint.SampleVolume)
|
||||
{
|
||||
beatmap.ControlPointInfo.SamplePoints.Add(new SampleControlPoint
|
||||
{
|
||||
Time = time,
|
||||
SampleBank = stringSampleSet,
|
||||
SampleVolume = sampleVolume
|
||||
});
|
||||
}
|
||||
|
||||
if (kiaiMode != effectPoint.KiaiMode || omitFirstBarSignature != effectPoint.OmitFirstBarLine)
|
||||
{
|
||||
beatmap.ControlPointInfo.EffectPoints.Add(new EffectControlPoint
|
||||
{
|
||||
Time = time,
|
||||
KiaiMode = kiaiMode,
|
||||
OmitFirstBarLine = omitFirstBarSignature
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (FormatException e)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void handleHitObjects(string line)
|
||||
private void handleHitObject(string line)
|
||||
{
|
||||
// If the ruleset wasn't specified, assume the osu!standard ruleset.
|
||||
if (parser == null)
|
||||
|
@ -17,6 +17,8 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
protected override TabItem<T> CreateTabItem(T value) => new BreadcrumbTabItem(value);
|
||||
|
||||
protected override float StripWidth() => base.StripWidth() - (padding + 8);
|
||||
|
||||
public BreadcrumbControl()
|
||||
{
|
||||
Height = 26;
|
||||
|
@ -14,22 +14,36 @@ using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
public class OsuTabControl<T> : TabControl<T>
|
||||
{
|
||||
private readonly Box strip;
|
||||
|
||||
protected override Dropdown<T> CreateDropdown() => new OsuTabDropdown();
|
||||
|
||||
protected override TabItem<T> CreateTabItem(T value) => new OsuTabItem(value);
|
||||
|
||||
protected virtual float StripWidth() => TabContainer.Children.Sum(c => c.IsPresent ? c.DrawWidth + TabContainer.Spacing.X : 0) - TabContainer.Spacing.X;
|
||||
protected virtual float StripHeight() => 1;
|
||||
|
||||
private static bool isEnumType => typeof(T).IsEnum;
|
||||
|
||||
public OsuTabControl()
|
||||
{
|
||||
TabContainer.Spacing = new Vector2(10f, 0f);
|
||||
|
||||
Add(strip = new Box
|
||||
{
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
Height = StripHeight(),
|
||||
Colour = Color4.White.Opacity(0),
|
||||
});
|
||||
|
||||
if (isEnumType)
|
||||
foreach (var val in (T[])Enum.GetValues(typeof(T)))
|
||||
AddItem(val);
|
||||
@ -57,6 +71,12 @@ namespace osu.Game.Graphics.UserInterface
|
||||
}
|
||||
}
|
||||
|
||||
public Color4 StripColour
|
||||
{
|
||||
get => strip.Colour;
|
||||
set => strip.Colour = value;
|
||||
}
|
||||
|
||||
protected override TabFillFlowContainer CreateTabFlow() => new OsuTabFillFlowContainer
|
||||
{
|
||||
Direction = FillDirection.Full,
|
||||
@ -65,6 +85,15 @@ namespace osu.Game.Graphics.UserInterface
|
||||
Masking = true
|
||||
};
|
||||
|
||||
protected override void UpdateAfterChildren()
|
||||
{
|
||||
base.UpdateAfterChildren();
|
||||
|
||||
// dont bother calculating if the strip is invisible
|
||||
if (strip.Colour.MaxAlpha > 0)
|
||||
strip.Width = Interpolation.ValueAt(MathHelper.Clamp(Clock.ElapsedFrameTime, 0, 1000), strip.Width, StripWidth(), 0, 500, Easing.OutQuint);
|
||||
}
|
||||
|
||||
public class OsuTabItem : TabItem<T>, IHasAccentColour
|
||||
{
|
||||
protected readonly SpriteText Text;
|
||||
|
@ -45,7 +45,7 @@ namespace osu.Game.Input.Bindings
|
||||
};
|
||||
|
||||
protected override IEnumerable<Drawable> KeyBindingInputQueue =>
|
||||
handler == null ? base.KeyBindingInputQueue : new[] { handler }.Concat(base.KeyBindingInputQueue);
|
||||
handler == null ? base.KeyBindingInputQueue : base.KeyBindingInputQueue.Prepend(handler);
|
||||
}
|
||||
|
||||
public enum GlobalAction
|
||||
|
@ -13,9 +13,9 @@ namespace osu.Game.Input.Handlers
|
||||
public abstract class ReplayInputHandler : InputHandler
|
||||
{
|
||||
/// <summary>
|
||||
/// A function provided to convert replay coordinates from gamefield to screen space.
|
||||
/// A function that converts coordinates from gamefield to screen space.
|
||||
/// </summary>
|
||||
public Func<Vector2, Vector2> ToScreenSpace { protected get; set; }
|
||||
public Func<Vector2, Vector2> GamefieldToScreenSpace { protected get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Update the current frame based on an incoming time value.
|
||||
|
@ -30,6 +30,9 @@ namespace osu.Game.Online.API.Requests
|
||||
[JsonProperty(@"video")]
|
||||
private bool hasVideo { get; set; }
|
||||
|
||||
[JsonProperty(@"status")]
|
||||
private BeatmapSetOnlineStatus status { get; set; }
|
||||
|
||||
[JsonProperty(@"submitted_date")]
|
||||
private DateTimeOffset submitted { get; set; }
|
||||
|
||||
@ -60,6 +63,7 @@ namespace osu.Game.Online.API.Requests
|
||||
PlayCount = playCount,
|
||||
FavouriteCount = favouriteCount,
|
||||
BPM = bpm,
|
||||
Status = status,
|
||||
HasVideo = hasVideo,
|
||||
Submitted = submitted,
|
||||
Ranked = ranked,
|
||||
|
@ -30,6 +30,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
private readonly FillFlowContainer videoButtons;
|
||||
private readonly AuthorInfo author;
|
||||
private readonly Container downloadButtonsContainer;
|
||||
private readonly BeatmapSetOnlineStatusPill onlineStatusPill;
|
||||
public Details Details;
|
||||
|
||||
private BeatmapManager beatmaps;
|
||||
@ -50,6 +51,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
Picker.BeatmapSet = author.BeatmapSet = Details.BeatmapSet = BeatmapSet;
|
||||
title.Text = BeatmapSet.Metadata.Title;
|
||||
artist.Text = BeatmapSet.Metadata.Artist;
|
||||
onlineStatusPill.Status = BeatmapSet.OnlineInfo.Status;
|
||||
|
||||
downloadButtonsContainer.FadeIn();
|
||||
noVideoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 0 : 1, transition_duration);
|
||||
@ -204,11 +206,23 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
},
|
||||
},
|
||||
},
|
||||
Details = new Details
|
||||
new FillFlowContainer
|
||||
{
|
||||
Anchor = Anchor.BottomRight,
|
||||
Origin = Anchor.BottomRight,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Margin = new MarginPadding { Right = BeatmapSetOverlay.X_PADDING },
|
||||
Direction = FillDirection.Vertical,
|
||||
Spacing = new Vector2(10),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
onlineStatusPill = new BeatmapSetOnlineStatusPill(14, new MarginPadding { Horizontal = 25, Vertical = 8 })
|
||||
{
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
},
|
||||
Details = new Details(),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -11,7 +11,9 @@ using osu.Framework.Localisation;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.Drawables;
|
||||
|
||||
namespace osu.Game.Overlays.Direct
|
||||
{
|
||||
@ -20,7 +22,7 @@ namespace osu.Game.Overlays.Direct
|
||||
private const float horizontal_padding = 10;
|
||||
private const float vertical_padding = 5;
|
||||
|
||||
private FillFlowContainer bottomPanel;
|
||||
private FillFlowContainer bottomPanel, statusContainer;
|
||||
private PlayButton playButton;
|
||||
private Box progressBar;
|
||||
|
||||
@ -199,7 +201,37 @@ namespace osu.Game.Overlays.Direct
|
||||
Size = new Vector2(30),
|
||||
Alpha = 0,
|
||||
},
|
||||
statusContainer = new FillFlowContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Margin = new MarginPadding { Top = 5, Left = 5 },
|
||||
Spacing = new Vector2(5),
|
||||
},
|
||||
});
|
||||
|
||||
if (SetInfo.OnlineInfo?.HasVideo ?? false)
|
||||
{
|
||||
statusContainer.Add(new IconPill(FontAwesome.fa_film));
|
||||
}
|
||||
|
||||
statusContainer.Add(new BeatmapSetOnlineStatusPill(12, new MarginPadding { Horizontal = 10, Vertical = 5 })
|
||||
{
|
||||
Status = SetInfo.OnlineInfo?.Status ?? BeatmapSetOnlineStatus.None,
|
||||
});
|
||||
}
|
||||
|
||||
protected override bool OnHover(InputState state)
|
||||
{
|
||||
statusContainer.FadeOut(120, Easing.InOutQuint);
|
||||
|
||||
return base.OnHover(state);
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(InputState state)
|
||||
{
|
||||
base.OnHoverLost(state);
|
||||
|
||||
statusContainer.FadeIn(120, Easing.InOutQuint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ namespace osu.Game.Overlays.Direct
|
||||
public class Header : SearchableListHeader<DirectTab>
|
||||
{
|
||||
protected override Color4 BackgroundColour => OsuColour.FromHex(@"252f3a");
|
||||
protected override float TabStripWidth => 298;
|
||||
|
||||
protected override DirectTab DefaultTab => DirectTab.Search;
|
||||
protected override Drawable CreateHeaderText() => new OsuSpriteText { Text = @"osu!direct", TextSize = 25 };
|
||||
|
43
osu.Game/Overlays/Direct/IconPill.cs
Normal file
43
osu.Game/Overlays/Direct/IconPill.cs
Normal file
@ -0,0 +1,43 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Direct
|
||||
{
|
||||
public class IconPill : CircularContainer
|
||||
{
|
||||
public IconPill(FontAwesome icon)
|
||||
{
|
||||
AutoSizeAxes = Axes.Both;
|
||||
Masking = true;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = Color4.Black,
|
||||
Alpha = 0.5f,
|
||||
},
|
||||
new Container
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Margin = new MarginPadding(5),
|
||||
Child = new SpriteIcon
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Icon = icon,
|
||||
Size = new Vector2(12),
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user