From f461f03b0857ac2a7fd5e3e92abb67fd5a3916b7 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 16 Nov 2017 14:51:31 +0900 Subject: [PATCH 001/109] Make osu! compile with framework changes --- osu-framework | 2 +- osu.Desktop/OsuGameDesktop.cs | 4 ++-- osu.Desktop/osu.Desktop.csproj | 3 +-- osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj | 3 +-- osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 3 +-- osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 3 +-- osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj | 3 +-- osu.Game.Tests/osu.Game.Tests.csproj | 3 +-- osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarUserArea.cs | 1 + osu.Game/osu.Game.csproj | 3 +-- 11 files changed, 12 insertions(+), 18 deletions(-) diff --git a/osu-framework b/osu-framework index c95b9350ed..aa7fb2f83c 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit c95b9350edb6305cfefdf08f902f6f73d336736b +Subproject commit aa7fb2f83c5883a23eca0f5799905669fa6cead3 diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index 3393bbf7fb..60d70e1ece 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -100,7 +100,7 @@ namespace osu.Desktop { desktopWindow.CursorState |= CursorState.Hidden; - desktopWindow.Icon = new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico")); + // desktopWindow.Icon = new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico")); desktopWindow.Title = Name; desktopWindow.FileDrop += fileDrop; @@ -109,7 +109,7 @@ namespace osu.Desktop private void fileDrop(object sender, FileDropEventArgs e) { - var filePaths = new [] { e.FileName }; + var filePaths = new[] { e.FileName }; if (filePaths.All(f => Path.GetExtension(f) == @".osz")) Task.Factory.StartNew(() => BeatmapManager.Import(filePaths), TaskCreationOptions.LongRunning); diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 91c0da6f65..dd328858e0 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -136,8 +136,7 @@ $(SolutionDir)\packages\squirrel.windows.1.7.8\lib\Net45\NuGet.Squirrel.dll True - - $(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll + True diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index a666984b95..0c61a5b312 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -37,8 +37,7 @@ $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll True - - $(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll + True diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 6f45a64d92..edc77f5c7b 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -37,8 +37,7 @@ $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll True - - $(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll + True diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 3c90749777..3939b3f108 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -38,8 +38,7 @@ $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll True - - $(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll + True diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index bf627d205a..868460e3d6 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -37,8 +37,7 @@ $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll True - - $(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll + True diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 974bde9319..3d134f79bf 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -34,8 +34,7 @@ $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll True - - $(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll + True diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index 56b9a55398..4e7712936a 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs @@ -18,7 +18,7 @@ using System.ComponentModel; using osu.Game.Graphics; using OpenTK.Graphics; using osu.Framework.Extensions.Color4Extensions; - +using RectangleF = osu.Framework.Graphics.Primitives.RectangleF; using Container = osu.Framework.Graphics.Containers.Container; namespace osu.Game.Overlays.Settings.Sections.General diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs b/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs index 95a25fcb86..7683406b49 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs @@ -6,6 +6,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using OpenTK; +using RectangleF = osu.Framework.Graphics.Primitives.RectangleF; namespace osu.Game.Overlays.Toolbar { diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index ac1498c9d9..6ef8f6570d 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -143,8 +143,7 @@ $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll True - - $(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll + True From d2ab0621f32b2f1b2a9b09e894316d8c762afee8 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 19 Nov 2017 13:46:51 +0900 Subject: [PATCH 002/109] Make osu.Game + rulesets compile with netstandard --- LangVer.props | 6 + OpenTK.props | 9 + osu-framework | 2 +- osu-resources | 2 +- osu.Desktop/OsuGameDesktop.cs | 2 - osu.Game.Rulesets.Catch/OpenTK.dll.config | 25 - .../Properties/AssemblyInfo.cs | 28 - osu.Game.Rulesets.Catch/app.config | 19 - .../osu.Game.Rulesets.Catch.csproj | 115 +-- osu.Game.Rulesets.Mania/OpenTK.dll.config | 25 - .../Properties/AssemblyInfo.cs | 28 - osu.Game.Rulesets.Mania/app.config | 19 - .../osu.Game.Rulesets.Mania.csproj | 138 +-- osu.Game.Rulesets.Osu/OpenTK.dll.config | 25 - .../Properties/AssemblyInfo.cs | 28 - osu.Game.Rulesets.Osu/app.config | 19 - .../osu.Game.Rulesets.Osu.csproj | 146 +-- osu.Game.Rulesets.Taiko/OpenTK.dll.config | 25 - .../Properties/AssemblyInfo.cs | 28 - osu.Game.Rulesets.Taiko/app.config | 19 - .../osu.Game.Rulesets.Taiko.csproj | 137 +-- osu.Game.props | 8 + osu.Game/Beatmaps/BeatmapManager.cs | 4 +- osu.Game/Beatmaps/IO/OszArchiveReader.cs | 14 +- osu.Game/IO/Legacy/SerializationReader.cs | 3 +- osu.Game/IO/Legacy/SerializationWriter.cs | 4 +- .../20171019041408_InitialCreate.cs | 2 - .../20171025071459_AddMissingIndexRules.cs | 2 - .../Migrations/OsuDbContextModelSnapshot.cs | 4 - osu.Game/OpenTK.dll.config | 25 - .../Sections/General/LoginSettings.cs | 1 - osu.Game/Overlays/Toolbar/ToolbarUserArea.cs | 1 - osu.Game/Properties/AssemblyInfo.cs | 28 - osu.Game/Utils/ZipUtils.cs | 33 + osu.Game/app.config | 19 - osu.Game/osu.Game.csproj | 836 +----------------- osu.sln | 14 +- 37 files changed, 169 insertions(+), 1674 deletions(-) create mode 100644 LangVer.props create mode 100644 OpenTK.props delete mode 100644 osu.Game.Rulesets.Catch/OpenTK.dll.config delete mode 100644 osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs delete mode 100644 osu.Game.Rulesets.Catch/app.config delete mode 100644 osu.Game.Rulesets.Mania/OpenTK.dll.config delete mode 100644 osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs delete mode 100644 osu.Game.Rulesets.Mania/app.config delete mode 100644 osu.Game.Rulesets.Osu/OpenTK.dll.config delete mode 100644 osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs delete mode 100644 osu.Game.Rulesets.Osu/app.config delete mode 100644 osu.Game.Rulesets.Taiko/OpenTK.dll.config delete mode 100644 osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs delete mode 100644 osu.Game.Rulesets.Taiko/app.config create mode 100644 osu.Game.props delete mode 100644 osu.Game/OpenTK.dll.config delete mode 100644 osu.Game/Properties/AssemblyInfo.cs create mode 100644 osu.Game/Utils/ZipUtils.cs delete mode 100644 osu.Game/app.config diff --git a/LangVer.props b/LangVer.props new file mode 100644 index 0000000000..6b1d1dae73 --- /dev/null +++ b/LangVer.props @@ -0,0 +1,6 @@ + + + + 6 + + \ No newline at end of file diff --git a/OpenTK.props b/OpenTK.props new file mode 100644 index 0000000000..0876c52b66 --- /dev/null +++ b/OpenTK.props @@ -0,0 +1,9 @@ + + + + + + PreserveNewest + + + \ No newline at end of file diff --git a/osu-framework b/osu-framework index aa7fb2f83c..7d5df64338 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit aa7fb2f83c5883a23eca0f5799905669fa6cead3 +Subproject commit 7d5df64338e3b3be7bdf3509e9c47a3e9b930430 diff --git a/osu-resources b/osu-resources index 1750ab8f67..c3def1cf00 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 1750ab8f6761ab35592fd46da71fbe0c141bfd93 +Subproject commit c3def1cf0038c5a8bcbe35a56914ffeebb25b10b diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index 60d70e1ece..3eaa23f4c7 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -2,10 +2,8 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using System.Drawing; using System.IO; using System.Linq; -using System.Reflection; using System.Threading.Tasks; using Microsoft.Win32; using osu.Desktop.Overlays; diff --git a/osu.Game.Rulesets.Catch/OpenTK.dll.config b/osu.Game.Rulesets.Catch/OpenTK.dll.config deleted file mode 100644 index 5620e3d9e2..0000000000 --- a/osu.Game.Rulesets.Catch/OpenTK.dll.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs deleted file mode 100644 index dd2006c60c..0000000000 --- a/osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("osu.Game.Rulesets.Catch")] -[assembly: AssemblyDescription("catch the fruit. to the beat.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("ppy Pty Ltd")] -[assembly: AssemblyProduct("osu.Game.Rulesets.Catch")] -[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("58f6c80c-1253-4a0e-a465-b8c85ebeadf3")] - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/osu.Game.Rulesets.Catch/app.config b/osu.Game.Rulesets.Catch/app.config deleted file mode 100644 index c9d4e44b1a..0000000000 --- a/osu.Game.Rulesets.Catch/app.config +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index 0c61a5b312..76396f1815 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -1,102 +1,23 @@ - - - - - Debug - AnyCPU - {58F6C80C-1253-4A0E-A465-B8C85EBEADF3} + + + + + netstandard2.0;net461 Library - Properties - osu.Game.Rulesets.Catch - osu.Game.Rulesets.Catch - v4.6.1 - 512 + AnyCPU + true + ppy Pty Ltd + 1.0.0.0 + ppy Pty Ltd 2007-2017 + osu.Game.Rulesets.Catch + catch the fruit. to the beat. + osu.Game.Rulesets.Catch - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - 6 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll - True - - - True - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - osu.licenseheader - - - - - - - - {C76BF5B3-985E-4D39-95FE-97C9C879B83A} - osu.Framework - True - - - {2a66dd92-adb1-4994-89e2-c94e04acda0d} - osu.Game - True - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania/OpenTK.dll.config b/osu.Game.Rulesets.Mania/OpenTK.dll.config deleted file mode 100644 index 5620e3d9e2..0000000000 --- a/osu.Game.Rulesets.Mania/OpenTK.dll.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs deleted file mode 100644 index 85a8f95b14..0000000000 --- a/osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("osu.Game.Rulesets.Mania")] -[assembly: AssemblyDescription("smash the keys. to the beat.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("ppy Pty Ltd")] -[assembly: AssemblyProduct("osu.Game.Rulesets.Mania")] -[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("48f4582b-7687-4621-9cbe-5c24197cb536")] - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/osu.Game.Rulesets.Mania/app.config b/osu.Game.Rulesets.Mania/app.config deleted file mode 100644 index c9d4e44b1a..0000000000 --- a/osu.Game.Rulesets.Mania/app.config +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index edc77f5c7b..ba9176c853 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -1,125 +1,23 @@ - - - - - Debug - AnyCPU - {48F4582B-7687-4621-9CBE-5C24197CB536} + + + + + netstandard2.0;net461 Library - Properties - osu.Game.Rulesets.Mania - osu.Game.Rulesets.Mania - v4.6.1 - 512 + AnyCPU + true + ppy Pty Ltd + 1.0.0.0 + ppy Pty Ltd 2007-2017 + osu.Game.Rulests.Mania + smash the keys. to the beat. + osu.Game.Rulests.Mania - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - 6 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll - True - - - True - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - osu.licenseheader - - - - - - - - {C76BF5B3-985E-4D39-95FE-97C9C879B83A} - osu.Framework - True - - - {2a66dd92-adb1-4994-89e2-c94e04acda0d} - osu.Game - True - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Osu/OpenTK.dll.config b/osu.Game.Rulesets.Osu/OpenTK.dll.config deleted file mode 100644 index 5620e3d9e2..0000000000 --- a/osu.Game.Rulesets.Osu/OpenTK.dll.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs deleted file mode 100644 index b6cf47071a..0000000000 --- a/osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("osu.Game.Mode.Osu")] -[assembly: AssemblyDescription("click the circles. to the beat.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("ppy Pty Ltd")] -[assembly: AssemblyProduct("osu.Game.Mode.Osu")] -[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("c92a607b-1fdd-4954-9f92-03ff547d9080")] - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/osu.Game.Rulesets.Osu/app.config b/osu.Game.Rulesets.Osu/app.config deleted file mode 100644 index c9d4e44b1a..0000000000 --- a/osu.Game.Rulesets.Osu/app.config +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 3939b3f108..a28ee218b5 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -1,133 +1,23 @@ - - - - - Debug - AnyCPU - {C92A607B-1FDD-4954-9F92-03FF547D9080} + + + + + netstandard2.0;net461 Library - Properties - osu.Game.Rulesets.Osu - osu.Game.Rulesets.Osu - v4.6.1 - 512 - + AnyCPU + true + ppy Pty Ltd + 1.0.0.0 + ppy Pty Ltd 2007-2017 + osu.Game.Rulesets.Osu + click the circles. to the beat. + osu.Game.Rulesets.Osu - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - 6 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll - True - - - True - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - osu.licenseheader - - - - - - - - {C76BF5B3-985E-4D39-95FE-97C9C879B83A} - osu.Framework - True - - - {2a66dd92-adb1-4994-89e2-c94e04acda0d} - osu.Game - True - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko/OpenTK.dll.config b/osu.Game.Rulesets.Taiko/OpenTK.dll.config deleted file mode 100644 index 5620e3d9e2..0000000000 --- a/osu.Game.Rulesets.Taiko/OpenTK.dll.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs deleted file mode 100644 index f6a9c8f101..0000000000 --- a/osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("osu.Game.Rulesets.Taiko")] -[assembly: AssemblyDescription("bash the drum. to the beat.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("ppy Pty Ltd")] -[assembly: AssemblyProduct("osu.Game.Rulesets.Taiko")] -[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("f167e17a-7de6-4af5-b920-a5112296c695")] - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/osu.Game.Rulesets.Taiko/app.config b/osu.Game.Rulesets.Taiko/app.config deleted file mode 100644 index c9d4e44b1a..0000000000 --- a/osu.Game.Rulesets.Taiko/app.config +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index 868460e3d6..c4899d3c5c 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -1,124 +1,23 @@ - - - - - Debug - AnyCPU - {F167E17A-7DE6-4AF5-B920-A5112296C695} + + + + + netstandard2.0;net461 Library - Properties - osu.Game.Rulesets.Taiko - osu.Game.Rulesets.Taiko - v4.6.1 - 512 + AnyCPU + true + ppy Pty Ltd + 1.0.0.0 + ppy Pty Ltd 2007-2017 + osu.Game.Rulesets.Taiko + bash the drum. to the beat. + osu.Game.Rulesets.Taiko - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - 6 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll - True - - - True - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - osu.licenseheader - - - - - - - - {C76BF5B3-985E-4D39-95FE-97C9C879B83A} - osu.Framework - True - - - {2a66dd92-adb1-4994-89e2-c94e04acda0d} - osu.Game - True - - - - \ No newline at end of file diff --git a/osu.Game.props b/osu.Game.props new file mode 100644 index 0000000000..c352fa2b06 --- /dev/null +++ b/osu.Game.props @@ -0,0 +1,8 @@ + + + + + osu.licenseheader + + + \ No newline at end of file diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index ff0abd3d78..4bce2a96da 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -7,7 +7,6 @@ using System.IO; using System.Linq; using System.Linq.Expressions; using System.Threading.Tasks; -using Ionic.Zip; using Microsoft.EntityFrameworkCore; using osu.Framework.Audio.Track; using osu.Framework.Extensions; @@ -24,6 +23,7 @@ using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Overlays.Notifications; using osu.Game.Rulesets; +using osu.Game.Utils; namespace osu.Game.Beatmaps { @@ -418,7 +418,7 @@ namespace osu.Game.Beatmaps /// A reader giving access to the beatmap's content. private ArchiveReader getReaderFrom(string path) { - if (ZipFile.IsZipFile(path)) + if (ZipUtils.IsZipArchive(path)) // ReSharper disable once InconsistentlySynchronizedField return new OszArchiveReader(storage.GetStream(path)); return new LegacyFilesystemReader(path); diff --git a/osu.Game/Beatmaps/IO/OszArchiveReader.cs b/osu.Game/Beatmaps/IO/OszArchiveReader.cs index 4e0c40d28e..491bd06487 100644 --- a/osu.Game/Beatmaps/IO/OszArchiveReader.cs +++ b/osu.Game/Beatmaps/IO/OszArchiveReader.cs @@ -4,31 +4,31 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using Ionic.Zip; +using SharpCompress.Archives.Zip; namespace osu.Game.Beatmaps.IO { public sealed class OszArchiveReader : ArchiveReader { private readonly Stream archiveStream; - private readonly ZipFile archive; + private readonly ZipArchive archive; public OszArchiveReader(Stream archiveStream) { this.archiveStream = archiveStream; - archive = ZipFile.Read(archiveStream); + archive = ZipArchive.Open(archiveStream); } public override Stream GetStream(string name) { - ZipEntry entry = archive.Entries.SingleOrDefault(e => e.FileName == name); + ZipArchiveEntry entry = archive.Entries.SingleOrDefault(e => e.Key == name); if (entry == null) throw new FileNotFoundException(); // allow seeking MemoryStream copy = new MemoryStream(); - using (Stream s = entry.OpenReader()) + using (Stream s = entry.OpenEntryStream()) s.CopyTo(copy); copy.Position = 0; @@ -42,8 +42,8 @@ namespace osu.Game.Beatmaps.IO archiveStream.Dispose(); } - public override IEnumerable Filenames => archive.Entries.Select(e => e.FileName).ToArray(); + public override IEnumerable Filenames => archive.Entries.Select(e => e.Key).ToArray(); public override Stream GetUnderlyingStream() => archiveStream; } -} \ No newline at end of file +} diff --git a/osu.Game/IO/Legacy/SerializationReader.cs b/osu.Game/IO/Legacy/SerializationReader.cs index c7ea884821..e79eef4e2b 100644 --- a/osu.Game/IO/Legacy/SerializationReader.cs +++ b/osu.Game/IO/Legacy/SerializationReader.cs @@ -7,7 +7,6 @@ using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; using System.Runtime.Serialization.Formatters.Binary; using System.Text; @@ -175,7 +174,7 @@ namespace osu.Game.IO.Legacy versionBinder = new VersionConfigToNamespaceAssemblyObjectBinder(); formatter = new BinaryFormatter { - AssemblyFormat = FormatterAssemblyStyle.Simple, +// AssemblyFormat = FormatterAssemblyStyle.Simple, Binder = versionBinder }; } diff --git a/osu.Game/IO/Legacy/SerializationWriter.cs b/osu.Game/IO/Legacy/SerializationWriter.cs index 7325129128..c8af66fd8a 100644 --- a/osu.Game/IO/Legacy/SerializationWriter.cs +++ b/osu.Game/IO/Legacy/SerializationWriter.cs @@ -219,7 +219,7 @@ namespace osu.Game.IO.Legacy Write((byte)ObjType.otherType); BinaryFormatter b = new BinaryFormatter { - AssemblyFormat = FormatterAssemblyStyle.Simple, +// AssemblyFormat = FormatterAssemblyStyle.Simple, TypeFormat = FormatterTypeStyle.TypesWhenNeeded }; b.Serialize(BaseStream, obj); @@ -259,4 +259,4 @@ namespace osu.Game.IO.Legacy WriteRawBytes(Encoding.UTF8.GetBytes(str)); } } -} \ No newline at end of file +} diff --git a/osu.Game/Migrations/20171019041408_InitialCreate.cs b/osu.Game/Migrations/20171019041408_InitialCreate.cs index 23e5b6f8bb..922aa85f18 100644 --- a/osu.Game/Migrations/20171019041408_InitialCreate.cs +++ b/osu.Game/Migrations/20171019041408_InitialCreate.cs @@ -1,6 +1,4 @@ using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; namespace osu.Game.Migrations { diff --git a/osu.Game/Migrations/20171025071459_AddMissingIndexRules.cs b/osu.Game/Migrations/20171025071459_AddMissingIndexRules.cs index a20652eedc..ad8884a4bf 100644 --- a/osu.Game/Migrations/20171025071459_AddMissingIndexRules.cs +++ b/osu.Game/Migrations/20171025071459_AddMissingIndexRules.cs @@ -1,6 +1,4 @@ using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; namespace osu.Game.Migrations { diff --git a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs index 7029dcdcd5..025607bbd9 100644 --- a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs +++ b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs @@ -1,11 +1,7 @@ // using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; using osu.Game.Database; -using System; namespace osu.Game.Migrations { diff --git a/osu.Game/OpenTK.dll.config b/osu.Game/OpenTK.dll.config deleted file mode 100644 index 5620e3d9e2..0000000000 --- a/osu.Game/OpenTK.dll.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index 4e7712936a..9e962a64a6 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs @@ -5,7 +5,6 @@ using System; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface; using osu.Game.Configuration; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs b/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs index 7683406b49..3a0abf0232 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs @@ -4,7 +4,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using OpenTK; using RectangleF = osu.Framework.Graphics.Primitives.RectangleF; diff --git a/osu.Game/Properties/AssemblyInfo.cs b/osu.Game/Properties/AssemblyInfo.cs deleted file mode 100644 index e28f8a3873..0000000000 --- a/osu.Game/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("osu.Game")] -[assembly: AssemblyDescription("click the circles. to the beat.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("ppy Pty Ltd")] -[assembly: AssemblyProduct("osu.Game")] -[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("55e28cb2-7b6c-4595-8dcc-9871d8aad7e9")] - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/osu.Game/Utils/ZipUtils.cs b/osu.Game/Utils/ZipUtils.cs new file mode 100644 index 0000000000..c1e0d75a7b --- /dev/null +++ b/osu.Game/Utils/ZipUtils.cs @@ -0,0 +1,33 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using System; +using SharpCompress.Archives.Zip; + +namespace osu.Game.Utils +{ + public static class ZipUtils + { + public static bool IsZipArchive(string path) + { + try + { + using (var arc = ZipArchive.Open(path)) + { + foreach (var entry in arc.Entries) + { + using (entry.OpenEntryStream()) + { + } + } + } + + return true; + } + catch (Exception) + { + return false; + } + } + } +} diff --git a/osu.Game/app.config b/osu.Game/app.config deleted file mode 100644 index 7f2ad68041..0000000000 --- a/osu.Game/app.config +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 6ef8f6570d..f995fc76e1 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -1,823 +1,27 @@ - - - - {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D} - Debug - AnyCPU + + + + + netstandard2.0;net461 Library - Properties - osu.Game - osu.Game - 3CF060CD28877D0E3112948951A64B2A7CEEC909 - codesigning.pfx - false - false - false - - - 3.5 - - - OnOutputUpdated - false - LocalIntranet - v4.6.1 - true - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 2 - 1.0.0.%2a - false - true - 12.0.0 - 2.0 - - - - - - - true - full - false - bin\Debug\ - TRACE;DEBUG - prompt - 0 - true - false AnyCPU true - false - false - false - - - 6 + ppy Pty Ltd + 1.0.0.0 + ppy Pty Ltd 2007-2017 + osu.Game + click the circles. to the beat. + osu.Game - - none - true - bin\Release\ - - - prompt - 4 - true - false - AnyCPU - true - false - false - - - - - - - - - $(SolutionDir)\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll - True - - - $(SolutionDir)\packages\Humanizer.Core.2.2.0\lib\netstandard1.0\Humanizer.dll - - - $(SolutionDir)\packages\Microsoft.Data.Sqlite.Core.2.0.0\lib\netstandard2.0\Microsoft.Data.Sqlite.dll - - - $(SolutionDir)\packages\Microsoft.EntityFrameworkCore.2.0.0\lib\netstandard2.0\Microsoft.EntityFrameworkCore.dll - - - $(SolutionDir)\packages\Microsoft.EntityFrameworkCore.Design.2.0.0\lib\net461\Microsoft.EntityFrameworkCore.Design.dll - - - $(SolutionDir)\packages\Microsoft.EntityFrameworkCore.Relational.2.0.0\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Relational.dll - - - $(SolutionDir)\packages\Microsoft.EntityFrameworkCore.Sqlite.Core.2.0.0\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Sqlite.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Caching.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Caching.Abstractions.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Caching.Memory.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Caching.Memory.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Configuration.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.DependencyInjection.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Logging.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Logging.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Logging.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Options.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Options.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Primitives.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll - - - - - $(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - True - - - $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll - True - - - True - - - $(SolutionDir)\packages\Remotion.Linq.2.1.2\lib\net45\Remotion.Linq.dll - - - $(SolutionDir)\packages\SharpCompress.0.18.1\lib\net45\SharpCompress.dll - True - - - $(SolutionDir)\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\net45\SQLitePCLRaw.batteries_green.dll - True - - - $(SolutionDir)\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\net45\SQLitePCLRaw.batteries_v2.dll - True - - - $(SolutionDir)\packages\SQLitePCLRaw.core.1.1.8\lib\net45\SQLitePCLRaw.core.dll - True - - - $(SolutionDir)\packages\SQLitePCLRaw.provider.e_sqlite3.net45.1.1.8\lib\net45\SQLitePCLRaw.provider.e_sqlite3.dll - True - - - - $(SolutionDir)\packages\System.Collections.Immutable.1.4.0\lib\netstandard2.0\System.Collections.Immutable.dll - - - $(SolutionDir)\packages\System.ComponentModel.Annotations.4.4.0\lib\net461\System.ComponentModel.Annotations.dll - - - - - - $(SolutionDir)\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll - - - $(SolutionDir)\packages\System.Interactive.Async.3.1.1\lib\net46\System.Interactive.Async.dll - - - $(SolutionDir)\packages\System.Runtime.CompilerServices.Unsafe.4.4.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll - - - $(SolutionDir)\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll - True - + + + - - - osu.licenseheader - - - - - + + + + + + - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 2.0 %28x86%29 - true - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - false - - - False - .NET Framework 3.5 SP1 - false - - - - - {c76bf5b3-985e-4d39-95fe-97c9c879b83a} - osu.Framework - - - {d9a367c9-4c1a-489f-9b05-a0cea2b53b58} - osu.Game.Resources - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 20171019041408_InitialCreate.cs - - - - 20171025071459_AddMissingIndexRules.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/osu.sln b/osu.sln index 356ec4cc7b..86a0e4818b 100644 --- a/osu.sln +++ b/osu.sln @@ -3,19 +3,19 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.27004.2006 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game", "osu.Game\osu.Game.csproj", "{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game", "osu.Game\osu.Game.csproj", "{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Framework", "osu-framework\osu.Framework\osu.Framework.csproj", "{C76BF5B3-985E-4D39-95FE-97C9C879B83A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Framework", "osu-framework\osu.Framework\osu.Framework.csproj", "{C76BF5B3-985E-4D39-95FE-97C9C879B83A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Resources", "osu-resources\osu.Game.Resources\osu.Game.Resources.csproj", "{D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Resources", "osu-resources\osu.Game.Resources\osu.Game.Resources.csproj", "{D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Osu", "osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj", "{C92A607B-1FDD-4954-9F92-03FF547D9080}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Osu", "osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj", "{C92A607B-1FDD-4954-9F92-03FF547D9080}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Catch", "osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj", "{58F6C80C-1253-4A0E-A465-B8C85EBEADF3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Catch", "osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj", "{58F6C80C-1253-4A0E-A465-B8C85EBEADF3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Taiko", "osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj", "{F167E17A-7DE6-4AF5-B920-A5112296C695}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Taiko", "osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj", "{F167E17A-7DE6-4AF5-B920-A5112296C695}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Mania", "osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj", "{48F4582B-7687-4621-9CBE-5C24197CB536}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Mania", "osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj", "{48F4582B-7687-4621-9CBE-5C24197CB536}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Desktop.Deploy", "osu.Desktop.Deploy\osu.Desktop.Deploy.csproj", "{BAEA2F74-0315-4667-84E0-ACAC0B4BF785}" EndProject From 440c1a9f83fca54efc8db58cc7bec66e964f5aba Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 19 Nov 2017 14:30:56 +0900 Subject: [PATCH 003/109] Make osu.Desktop and osu.Game.Tests compile under net461+netstandard --- osu.Desktop/OpenTK.dll.config | 25 -- osu.Desktop/OsuGameDesktop.cs | 2 + osu.Desktop/Overlays/VersionManager.cs | 13 ++ osu.Desktop/Properties/AssemblyInfo.cs | 28 --- osu.Desktop/Properties/app.manifest | 57 ----- osu.Desktop/app.config | 44 ---- osu.Desktop/osu.Desktop.csproj | 303 ++----------------------- osu.Game.Tests/osu.Game.Tests.csproj | 166 ++------------ osu.sln | 4 +- 9 files changed, 64 insertions(+), 578 deletions(-) delete mode 100644 osu.Desktop/OpenTK.dll.config delete mode 100644 osu.Desktop/Properties/AssemblyInfo.cs delete mode 100644 osu.Desktop/Properties/app.manifest delete mode 100644 osu.Desktop/app.config diff --git a/osu.Desktop/OpenTK.dll.config b/osu.Desktop/OpenTK.dll.config deleted file mode 100644 index 5620e3d9e2..0000000000 --- a/osu.Desktop/OpenTK.dll.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index 3eaa23f4c7..b8eeeb1a5b 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -47,6 +47,7 @@ namespace osu.Desktop string stableInstallPath; +#if NET461 try { using (RegistryKey key = Registry.ClassesRoot.OpenSubKey("osu")) @@ -58,6 +59,7 @@ namespace osu.Desktop catch { } +#endif stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); if (checkExists(stableInstallPath)) diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 8c17e18ed8..8bb9d596d1 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -21,13 +21,19 @@ using osu.Game.Overlays; using osu.Game.Overlays.Notifications; using OpenTK; using OpenTK.Graphics; + +#if NET461 using Squirrel; +#endif namespace osu.Desktop.Overlays { public class VersionManager : OverlayContainer { +#if NET461 private UpdateManager updateManager; +#endif + private NotificationOverlay notificationOverlay; private OsuConfigManager config; private OsuGameBase game; @@ -138,11 +144,15 @@ namespace osu.Desktop.Overlays protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); + +#if NET461 updateManager?.Dispose(); +#endif } private async void checkForUpdateAsync(bool useDeltaPatching = true, UpdateProgressNotification notification = null) { +#if NET461 //should we schedule a retry on completion of this check? bool scheduleRetry = true; @@ -213,6 +223,7 @@ namespace osu.Desktop.Overlays notification.State = ProgressNotificationState.Cancelled; } } +#endif } protected override void PopIn() @@ -234,7 +245,9 @@ namespace osu.Desktop.Overlays Activated = () => { // Squirrel returns execution to us after the update process is started, so it's safe to use Wait() here +#if NET461 UpdateManager.RestartAppWhenExited().Wait(); +#endif game.GracefullyExit(); return true; } diff --git a/osu.Desktop/Properties/AssemblyInfo.cs b/osu.Desktop/Properties/AssemblyInfo.cs deleted file mode 100644 index 2ed304ebd7..0000000000 --- a/osu.Desktop/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("osu!lazer")] -[assembly: AssemblyDescription("click the circles. to the beat.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("ppy Pty Ltd")] -[assembly: AssemblyProduct("osu!lazer")] -[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("b0cb1d48-e4c2-4612-a347-beea7b1a71e7")] - -[assembly: AssemblyVersion("0.0.0")] -[assembly: AssemblyFileVersion("0.0.0")] diff --git a/osu.Desktop/Properties/app.manifest b/osu.Desktop/Properties/app.manifest deleted file mode 100644 index 555db8513d..0000000000 --- a/osu.Desktop/Properties/app.manifest +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - diff --git a/osu.Desktop/app.config b/osu.Desktop/app.config deleted file mode 100644 index ea1576b3d8..0000000000 --- a/osu.Desktop/app.config +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index dd328858e0..fd0644bc5d 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -1,287 +1,32 @@ - - - - {419659FD-72EA-4678-9EB8-B22A746CED70} - Debug - AnyCPU - WinExe - Properties - osu.Desktop - osu! - 3CF060CD28877D0E3112948951A64B2A7CEEC909 - codesigning.pfx - false - false - false - - - 3.5 - - - osu.Desktop.Program - OnOutputUpdated - false - LocalIntranet - v4.6.1 - true - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 2 - 1.0.0.%2a - false - true - 12.0.0 - 2.0 - - - - - - - true - full - false - bin\Debug\ - DEBUG - prompt - 0 - true - false + + + + + netcoreapp2.0;net461 + Exe AnyCPU true - false - false - false - - - 6 + ppy Pty Ltd + 0.0.0.0 + click the circles. to the beat. + ppy Pty Ltd 2007-2017 + osu!lazer + osu!lazer - - none - true - bin\Release\ - CuttingEdge NoUpdate - prompt - 4 - true - false - AnyCPU - true - false - false - - - - - - - lazer.ico - - - Properties\app.manifest - - - true - bin\Debug\ - DEBUG - true - 0 - true - full - AnyCPU - false - 6 - prompt - --tests - - - - $(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.dll - True - - - $(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.MsDelta.dll - True - - - $(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.PatchApi.dll - True - - - $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.dll - True - - - $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Mdb.dll - True - - - $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Pdb.dll - True - - - $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Rocks.dll - True - - - - $(SolutionDir)\packages\squirrel.windows.1.7.8\lib\Net45\NuGet.Squirrel.dll - True - - - True - - - $(SolutionDir)\packages\SharpCompress.0.18.1\lib\net45\SharpCompress.dll - True - - - $(SolutionDir)\packages\Splat.2.0.0\lib\Net45\Splat.dll - True - - - $(SolutionDir)\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\net45\SQLitePCLRaw.batteries_green.dll - - - $(SolutionDir)\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\net45\SQLitePCLRaw.batteries_v2.dll - - - $(SolutionDir)\packages\SQLitePCLRaw.core.1.1.8\lib\net45\SQLitePCLRaw.core.dll - - - $(SolutionDir)\packages\SQLitePCLRaw.provider.e_sqlite3.net45.1.1.8\lib\net45\SQLitePCLRaw.provider.e_sqlite3.dll - - - $(SolutionDir)\packages\squirrel.windows.1.7.8\lib\Net45\Squirrel.dll - True - - - - - - $(SolutionDir)\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll - True - - + + + + + + + + - - - osu.licenseheader - - - - - - + + + - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 2.0 %28x86%29 - true - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - false - - - False - .NET Framework 3.5 SP1 - false - - - - - - - - - - + - - - {c76bf5b3-985e-4d39-95fe-97c9c879b83a} - osu.Framework - - - {d9a367c9-4c1a-489f-9b05-a0cea2b53b58} - osu.Game.Resources - - - {58f6c80c-1253-4a0e-a465-b8c85ebeadf3} - osu.Game.Rulesets.Catch - - - {48f4582b-7687-4621-9cbe-5c24197cb536} - osu.Game.Rulesets.Mania - - - {c92a607b-1fdd-4954-9f92-03ff547d9080} - osu.Game.Rulesets.Osu - - - {f167e17a-7de6-4af5-b920-a5112296c695} - osu.Game.Rulesets.Taiko - - - {54377672-20b1-40af-8087-5cf73bf3953a} - osu.Game.Tests - - - {2a66dd92-adb1-4994-89e2-c94e04acda0d} - osu.Game - - - - - - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - \ No newline at end of file diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 3d134f79bf..e34fb4638f 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -1,150 +1,30 @@ - - - - Debug - AnyCPU - {54377672-20B1-40AF-8087-5CF73BF3953A} + + + + + netstandard2.0;net461 Library - osu.Game.Tests - osu.Game.Tests - v4.6.1 + AnyCPU + true + ppy Pty Ltd + 1.0.0.0 + ppy Pty Ltd 2007-2017 + osu.Game.Tests + osu.Game.Tests - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - false - false - 6 - - - true - bin\Release - prompt - 4 - false - false - - - - $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll - True - - - True - - - - $(SolutionDir)\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll - True - + + + + + + + + - - - osu.licenseheader - - - - + + - - - {c76bf5b3-985e-4d39-95fe-97c9c879b83a} - osu.Framework - - - {c92a607b-1fdd-4954-9f92-03ff547d9080} - osu.Game.Rulesets.Osu - - - {58f6c80c-1253-4a0e-a465-b8c85ebeadf3} - osu.Game.Rulesets.Catch - - - {48f4582b-7687-4621-9cbe-5c24197cb536} - osu.Game.Rulesets.Mania - - - {f167e17a-7de6-4af5-b920-a5112296c695} - osu.Game.Rulesets.Taiko - - - {2a66dd92-adb1-4994-89e2-c94e04acda0d} - osu.Game - - - {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58} - osu.Game.Resources - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - \ No newline at end of file diff --git a/osu.sln b/osu.sln index 86a0e4818b..c75ff78f2d 100644 --- a/osu.sln +++ b/osu.sln @@ -19,9 +19,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Mania", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Desktop.Deploy", "osu.Desktop.Deploy\osu.Desktop.Deploy.csproj", "{BAEA2F74-0315-4667-84E0-ACAC0B4BF785}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Tests", "osu.Game.Tests\osu.Game.Tests.csproj", "{54377672-20B1-40AF-8087-5CF73BF3953A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Tests", "osu.Game.Tests\osu.Game.Tests.csproj", "{54377672-20B1-40AF-8087-5CF73BF3953A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Desktop", "osu.Desktop\osu.Desktop.csproj", "{419659FD-72EA-4678-9EB8-B22A746CED70}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Desktop", "osu.Desktop\osu.Desktop.csproj", "{419659FD-72EA-4678-9EB8-B22A746CED70}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution From db4c912e1e8fd93443790a57a905ef1647b461af Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 19 Nov 2017 14:46:51 +0900 Subject: [PATCH 004/109] Fix up assembly name --- osu.Desktop/osu.Desktop.csproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index fd0644bc5d..e1ab0e1476 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -10,7 +10,8 @@ 0.0.0.0 click the circles. to the beat. ppy Pty Ltd 2007-2017 - osu!lazer + osu! + osu!lazer osu!lazer From 5fd16c62682f2b6c8f84b752f52758315339a1d1 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 19 Nov 2017 16:30:41 +0900 Subject: [PATCH 005/109] Make osu.Desktop.Deploy work --- osu.Desktop.Deploy/App.config | 19 --- osu.Desktop.Deploy/Program.cs | 23 ++- osu.Desktop.Deploy/Properties/AssemblyInfo.cs | 38 ----- osu.Desktop.Deploy/osu.Desktop.Deploy.csproj | 146 +++--------------- osu.Desktop/osu.Desktop.csproj | 3 +- osu.sln | 5 +- 6 files changed, 41 insertions(+), 193 deletions(-) delete mode 100644 osu.Desktop.Deploy/Properties/AssemblyInfo.cs diff --git a/osu.Desktop.Deploy/App.config b/osu.Desktop.Deploy/App.config index 2fae7a5e1c..42b2d34097 100644 --- a/osu.Desktop.Deploy/App.config +++ b/osu.Desktop.Deploy/App.config @@ -18,23 +18,4 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Desktop.Deploy/Program.cs b/osu.Desktop.Deploy/Program.cs index 54fb50d0f8..e13b63f602 100644 --- a/osu.Desktop.Deploy/Program.cs +++ b/osu.Desktop.Deploy/Program.cs @@ -299,18 +299,27 @@ namespace osu.Desktop.Deploy private static void updateAssemblyInfo(string version) { - string file = Path.Combine(ProjectName, "Properties", "AssemblyInfo.cs"); + var toUpdate = new[] { "", "" }; + string file = Path.Combine(ProjectName, $"{ProjectName}.csproj"); var l1 = File.ReadAllLines(file); List l2 = new List(); foreach (var l in l1) { - if (l.StartsWith("[assembly: AssemblyVersion(")) - l2.Add($"[assembly: AssemblyVersion(\"{version}\")]"); - else if (l.StartsWith("[assembly: AssemblyFileVersion(")) - l2.Add($"[assembly: AssemblyFileVersion(\"{version}\")]"); - else - l2.Add(l); + string line = l; + + foreach (var tag in toUpdate) + { + int startIndex = l.IndexOf(tag); + if (startIndex == -1) + continue; + startIndex += tag.Length; + + int endIndex = l.IndexOf("<", startIndex); + line = $"{l.Substring(0, startIndex)}{version}{l.Substring(endIndex)}"; + } + + l2.Add(line); } File.WriteAllLines(file, l2); diff --git a/osu.Desktop.Deploy/Properties/AssemblyInfo.cs b/osu.Desktop.Deploy/Properties/AssemblyInfo.cs deleted file mode 100644 index 5841c1b082..0000000000 --- a/osu.Desktop.Deploy/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("osu.Desktop.Deploy")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("osu.Desktop.Deploy")] -[assembly: AssemblyCopyright("Copyright © 2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("baea2f74-0315-4667-84e0-acac0b4bf785")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj b/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj index 6727a86a91..ccbf351bda 100644 --- a/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj +++ b/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj @@ -1,127 +1,21 @@ - - - - - Debug - AnyCPU - {BAEA2F74-0315-4667-84E0-ACAC0B4BF785} - Exe - Properties - osu.Desktop.Deploy - osu.Desktop.Deploy - v4.6.1 - 512 - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - 6 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - osu.Desktop.Deploy.Program - - - - $(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.dll - True - - - $(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.MsDelta.dll - True - - - $(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.PatchApi.dll - True - - - $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.dll - True - - - $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Mdb.dll - True - - - $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Pdb.dll - True - - - $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Rocks.dll - True - - - $(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - True - - - $(SolutionDir)\packages\squirrel.windows.1.7.8\lib\Net45\NuGet.Squirrel.dll - True - - - $(SolutionDir)\packages\SharpCompress.0.18.1\lib\net45\SharpCompress.dll - True - - - $(SolutionDir)\packages\Splat.2.0.0\lib\Net45\Splat.dll - True - - - $(SolutionDir)\packages\squirrel.windows.1.7.8\lib\Net45\Squirrel.dll - True - - - - - - - - - - - - - - - - - - - - osu.licenseheader - - - PreserveNewest - - - - - - {C76BF5B3-985E-4D39-95FE-97C9C879B83A} - osu.Framework - - - - + + + + net461 + Exe + AnyCPU + true + ppy Pty Ltd + ppy Pty Ltd 2007-2017 + osu.Desktop.Deploy + osu.Desktop.Deploy + + + + + + + + + \ No newline at end of file diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index e1ab0e1476..34da4fe5a9 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -7,12 +7,13 @@ AnyCPU true ppy Pty Ltd - 0.0.0.0 click the circles. to the beat. ppy Pty Ltd 2007-2017 osu! osu!lazer osu!lazer + 0.0.0.0 + 0.0.0.0 diff --git a/osu.sln b/osu.sln index c75ff78f2d..934ea874d1 100644 --- a/osu.sln +++ b/osu.sln @@ -17,7 +17,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Taiko", " EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Mania", "osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj", "{48F4582B-7687-4621-9CBE-5C24197CB536}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Desktop.Deploy", "osu.Desktop.Deploy\osu.Desktop.Deploy.csproj", "{BAEA2F74-0315-4667-84E0-ACAC0B4BF785}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Desktop.Deploy", "osu.Desktop.Deploy\osu.Desktop.Deploy.csproj", "{BAEA2F74-0315-4667-84E0-ACAC0B4BF785}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Tests", "osu.Game.Tests\osu.Game.Tests.csproj", "{54377672-20B1-40AF-8087-5CF73BF3953A}" EndProject @@ -71,8 +71,9 @@ Global {48F4582B-7687-4621-9CBE-5C24197CB536}.Release|Any CPU.ActiveCfg = Release|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.Release|Any CPU.Build.0 = Release|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU - {48F4582B-7687-4621-9CBE-5C24197CB536}.VisualTests|Any CPU.Build.0 = Debug|Any CPU + {48F4582B-7687-4621-9CBE-5C24197CB536}.VisualTests|Any CPU.Build.0 = Debug|Any CPUı {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Debug|Any CPU.Build.0 = Debug|Any CPU {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Release|Any CPU.ActiveCfg = Release|Any CPU {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU {54377672-20B1-40AF-8087-5CF73BF3953A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU From 7f757123e51324c77f703b4f6ff3acc402fcfd27 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 19 Nov 2017 17:24:32 +0900 Subject: [PATCH 006/109] Update vscode launch configurations --- .vscode/launch.json | 86 ++++++++++++++++++++++++++++++++------------- 1 file changed, 62 insertions(+), 24 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 506915f462..6c0a8929f7 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,13 +1,10 @@ { "version": "0.2.0", "configurations": [{ - "name": "osu! VisualTests (Debug)", - "windows": { - "type": "clr" - }, - "type": "mono", + "name": "osu! VisualTests (Debug, .NETFramework)", "request": "launch", - "program": "${workspaceRoot}/osu.Desktop/bin/Debug/osu!.exe", + "type": "clr", + "program": "${workspaceRoot}/osu.Desktop/bin/Debug/net461/osu!.exe", "args": [ "--tests" ], @@ -18,13 +15,24 @@ "console": "internalConsole" }, { - "name": "osu! VisualTests (Release)", - "windows": { - "type": "clr" - }, - "type": "mono", + "name": "osu! VisualTests (Debug, .NETCore)", "request": "launch", - "program": "${workspaceRoot}/osu.Desktop/bin/Release/osu!.exe", + "type": "coreclr", + "program": "${workspaceRoot}/osu.Desktop/bin/Debug/netcoreapp2.0/osu!.dll", + "args": [ + "--tests" + ], + "cwd": "${workspaceRoot}", + "preLaunchTask": "Build (Debug)", + "runtimeExecutable": null, + "env": {}, + "console": "internalConsole" + }, + { + "name": "osu! VisualTests (Release, .NETFramework)", + "request": "launch", + "type": "clr", + "program": "${workspaceRoot}/osu.Desktop/bin/Release/net461/osu!.exe", "args": [ "--tests" ], @@ -35,13 +43,24 @@ "console": "internalConsole" }, { - "name": "osu! (Debug)", - "windows": { - "type": "clr" - }, - "type": "mono", + "name": "osu! VisualTests (Release, .NETCore)", "request": "launch", - "program": "${workspaceRoot}/osu.Desktop/bin/Debug/osu!.exe", + "type": "coreclr", + "program": "${workspaceRoot}/osu.Desktop/bin/Release/netcoreapp2.0/osu!.dll", + "args": [ + "--tests" + ], + "cwd": "${workspaceRoot}", + "preLaunchTask": "Build (Release)", + "runtimeExecutable": null, + "env": {}, + "console": "internalConsole" + }, + { + "name": "osu! (Debug, .NETFramework)", + "request": "launch", + "type": "clr", + "program": "${workspaceRoot}/osu.Desktop/bin/Debug/net461/osu!.exe", "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Debug)", "runtimeExecutable": null, @@ -49,13 +68,32 @@ "console": "internalConsole" }, { - "name": "osu! (Release)", - "windows": { - "type": "clr" - }, - "type": "mono", + "name": "osu! (Debug, .NETCore)", "request": "launch", - "program": "${workspaceRoot}/osu.Desktop/bin/Release/osu!.exe", + "type": "coreclr", + "program": "${workspaceRoot}/osu.Desktop/bin/Debug/netcoreapp2.0/osu!.dll", + "cwd": "${workspaceRoot}", + "preLaunchTask": "Build (Debug)", + "runtimeExecutable": null, + "env": {}, + "console": "internalConsole" + }, + { + "name": "osu! (Release, .NETFramework)", + "request": "launch", + "type": "clr", + "program": "${workspaceRoot}/osu.Desktop/bin/Release/net461/osu!.exe", + "cwd": "${workspaceRoot}", + "preLaunchTask": "Build (Release)", + "runtimeExecutable": null, + "env": {}, + "console": "internalConsole" + }, + { + "name": "osu! (Release, .NETCore)", + "request": "launch", + "type": "coreclr", + "program": "${workspaceRoot}/osu.Desktop/bin/Release/netcoreapp2.0/osu!.dll", "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Release)", "runtimeExecutable": null, From 067c018422abc5f4e7ad1a72e8b2c730c28a430d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 19 Nov 2017 17:31:35 +0900 Subject: [PATCH 007/109] Cleanups --- osu-framework | 2 +- osu.Desktop.Deploy/packages.config | 14 ---- osu.Desktop/packages.config | 20 ------ osu.Game.Rulesets.Catch/packages.config | 5 -- osu.Game.Rulesets.Mania/packages.config | 5 -- osu.Game.Rulesets.Osu/packages.config | 5 -- osu.Game.Rulesets.Taiko/packages.config | 5 -- osu.Game.Tests/OpenTK.dll.config | 25 ------- osu.Game.Tests/app.config | 15 ---- osu.Game.Tests/packages.config | 10 --- osu.Game/packages.config | 95 ------------------------- 11 files changed, 1 insertion(+), 200 deletions(-) delete mode 100644 osu.Desktop.Deploy/packages.config delete mode 100644 osu.Desktop/packages.config delete mode 100644 osu.Game.Rulesets.Catch/packages.config delete mode 100644 osu.Game.Rulesets.Mania/packages.config delete mode 100644 osu.Game.Rulesets.Osu/packages.config delete mode 100644 osu.Game.Rulesets.Taiko/packages.config delete mode 100644 osu.Game.Tests/OpenTK.dll.config delete mode 100644 osu.Game.Tests/app.config delete mode 100644 osu.Game.Tests/packages.config delete mode 100644 osu.Game/packages.config diff --git a/osu-framework b/osu-framework index 7d5df64338..90dbacf0c4 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 7d5df64338e3b3be7bdf3509e9c47a3e9b930430 +Subproject commit 90dbacf0c4f54a2076f1a0be98f8606b627cf947 diff --git a/osu.Desktop.Deploy/packages.config b/osu.Desktop.Deploy/packages.config deleted file mode 100644 index 7725be5f5e..0000000000 --- a/osu.Desktop.Deploy/packages.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Desktop/packages.config b/osu.Desktop/packages.config deleted file mode 100644 index 6b6361b578..0000000000 --- a/osu.Desktop/packages.config +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Catch/packages.config b/osu.Game.Rulesets.Catch/packages.config deleted file mode 100644 index cde428acea..0000000000 --- a/osu.Game.Rulesets.Catch/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania/packages.config b/osu.Game.Rulesets.Mania/packages.config deleted file mode 100644 index cde428acea..0000000000 --- a/osu.Game.Rulesets.Mania/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Osu/packages.config b/osu.Game.Rulesets.Osu/packages.config deleted file mode 100644 index cde428acea..0000000000 --- a/osu.Game.Rulesets.Osu/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko/packages.config b/osu.Game.Rulesets.Taiko/packages.config deleted file mode 100644 index cde428acea..0000000000 --- a/osu.Game.Rulesets.Taiko/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/osu.Game.Tests/OpenTK.dll.config b/osu.Game.Tests/OpenTK.dll.config deleted file mode 100644 index 5620e3d9e2..0000000000 --- a/osu.Game.Tests/OpenTK.dll.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/osu.Game.Tests/app.config b/osu.Game.Tests/app.config deleted file mode 100644 index 2f5b13a89d..0000000000 --- a/osu.Game.Tests/app.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Game.Tests/packages.config b/osu.Game.Tests/packages.config deleted file mode 100644 index ecc44f0c70..0000000000 --- a/osu.Game.Tests/packages.config +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/osu.Game/packages.config b/osu.Game/packages.config deleted file mode 100644 index 02ace918de..0000000000 --- a/osu.Game/packages.config +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 756f6f2d163b5b0f54ead7af7d1eda50c816ff2e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 20 Nov 2017 10:10:28 +0900 Subject: [PATCH 008/109] Remove net461 targets --- osu-framework | 2 +- osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj | 2 +- osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 2 +- osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 2 +- osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj | 2 +- osu.Game.Tests/osu.Game.Tests.csproj | 2 +- osu.Game/osu.Game.csproj | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu-framework b/osu-framework index 90dbacf0c4..56ca2152f3 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 90dbacf0c4f54a2076f1a0be98f8606b627cf947 +Subproject commit 56ca2152f3096217cd327721519cd1eb7e57fbee diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index 76396f1815..ce07b8c7ff 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -2,7 +2,7 @@ - netstandard2.0;net461 + netstandard2.0 Library AnyCPU true diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index ba9176c853..90d2ad05d4 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -2,7 +2,7 @@ - netstandard2.0;net461 + netstandard2.0 Library AnyCPU true diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index a28ee218b5..8cce2de1b4 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -2,7 +2,7 @@ - netstandard2.0;net461 + netstandard2.0 Library AnyCPU true diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index c4899d3c5c..f4672b913e 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -2,7 +2,7 @@ - netstandard2.0;net461 + netstandard2.0 Library AnyCPU true diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index e34fb4638f..adc96ae3cd 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -2,7 +2,7 @@ - netstandard2.0;net461 + netstandard2.0 Library AnyCPU true diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index f995fc76e1..dd591bcba8 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -2,7 +2,7 @@ - netstandard2.0;net461 + netstandard2.0 Library AnyCPU true From e608d2841bc4808ad932769ab978b357fedd0c93 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 20 Nov 2017 16:10:34 +0900 Subject: [PATCH 009/109] Prefer net461 --- osu.Desktop/osu.Desktop.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 34da4fe5a9..3b08715d2d 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -2,7 +2,7 @@ - netcoreapp2.0;net461 + net461;netcoreapp2.0 Exe AnyCPU true From f0966a2e1264712f5d4c983342685b09db838b21 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 20 Nov 2017 18:40:00 +0900 Subject: [PATCH 010/109] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 56ca2152f3..b77ceb37e6 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 56ca2152f3096217cd327721519cd1eb7e57fbee +Subproject commit b77ceb37e6186cbf6f5b8a72959d753fbb56f9a5 From aac41d2de63f154aa98dfa16f24cb3bcb6fa5466 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 20 Nov 2017 18:55:48 +0900 Subject: [PATCH 011/109] Disable resharper inspections on case-by-case basis --- osu.Desktop.Deploy/Program.cs | 4 ++-- osu.Desktop/OsuGameDesktop.cs | 11 +++++++++-- osu.Desktop/Overlays/VersionManager.cs | 12 +++++++----- osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs | 1 + osu.Game/Beatmaps/BeatmapManager.cs | 1 + osu.Game/Graphics/Cursor/MenuCursor.cs | 1 + osu.Game/IO/Legacy/SerializationReader.cs | 1 + osu.Game/Online/API/OAuth.cs | 1 + .../Online/API/Requests/GetUserBeatmapsRequest.cs | 1 + .../Online/API/Requests/GetUserScoresRequest.cs | 3 ++- .../API/Requests/SearchBeatmapSetsRequest.cs | 1 + osu.Game/Online/Chat/Message.cs | 1 + osu.Game/Overlays/ChatOverlay.cs | 2 ++ osu.Game/Overlays/MusicController.cs | 1 + .../Rulesets/Timing/MultiplierControlPoint.cs | 1 + osu.Game/Rulesets/UI/RulesetContainer.cs | 1 + osu.Game/Rulesets/UI/ScrollingPlayfield.cs | 1 + .../Select/Leaderboards/LeaderboardScore.cs | 1 + osu.Game/Screens/Tournament/Drawings.cs | 1 + .../Screens/Tournament/ScrollingTeamContainer.cs | 15 +++++++++------ .../Tournament/Teams/StorageBackedTeamList.cs | 1 + 21 files changed, 46 insertions(+), 16 deletions(-) diff --git a/osu.Desktop.Deploy/Program.cs b/osu.Desktop.Deploy/Program.cs index e13b63f602..3c1d532c0f 100644 --- a/osu.Desktop.Deploy/Program.cs +++ b/osu.Desktop.Deploy/Program.cs @@ -310,12 +310,12 @@ namespace osu.Desktop.Deploy foreach (var tag in toUpdate) { - int startIndex = l.IndexOf(tag); + int startIndex = l.IndexOf(tag, StringComparison.InvariantCulture); if (startIndex == -1) continue; startIndex += tag.Length; - int endIndex = l.IndexOf("<", startIndex); + int endIndex = l.IndexOf("<", startIndex, StringComparison.InvariantCulture); line = $"{l.Substring(0, startIndex)}{version}{l.Substring(endIndex)}"; } diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index b8eeeb1a5b..ff4b37a8fb 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -5,13 +5,16 @@ using System; using System.IO; using System.Linq; using System.Threading.Tasks; -using Microsoft.Win32; using osu.Desktop.Overlays; using osu.Framework.Graphics.Containers; using osu.Framework.Platform; using osu.Game; using OpenTK.Input; +#if NET461 +using Microsoft.Win32; +#endif + namespace osu.Desktop { internal class OsuGameDesktop : OsuGame @@ -45,9 +48,9 @@ namespace osu.Desktop { Func checkExists = p => Directory.Exists(Path.Combine(p, "Songs")); +#if NET461 string stableInstallPath; -#if NET461 try { using (RegistryKey key = Registry.ClassesRoot.OpenSubKey("osu")) @@ -61,7 +64,11 @@ namespace osu.Desktop } #endif +#if NET461 stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); +#else + var stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); +#endif if (checkExists(stableInstallPath)) return stableInstallPath; diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 8bb9d596d1..fef7e6d52a 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -1,9 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using System.Diagnostics; -using System.Net.Http; using osu.Framework.Allocation; using osu.Framework.Development; using osu.Framework.Graphics; @@ -12,7 +10,6 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; -using osu.Framework.Logging; using osu.Game; using osu.Game.Configuration; using osu.Game.Graphics; @@ -23,6 +20,9 @@ using OpenTK; using OpenTK.Graphics; #if NET461 +using System; +using System.Net.Http; +using osu.Framework.Logging; using Squirrel; #endif @@ -101,8 +101,10 @@ namespace osu.Desktop.Overlays } }; +#if NET461 if (game.IsDeployedBuild) checkForUpdateAsync(); +#endif } protected override void LoadComplete() @@ -150,9 +152,9 @@ namespace osu.Desktop.Overlays #endif } +#if NET461 private async void checkForUpdateAsync(bool useDeltaPatching = true, UpdateProgressNotification notification = null) { -#if NET461 //should we schedule a retry on completion of this check? bool scheduleRetry = true; @@ -223,8 +225,8 @@ namespace osu.Desktop.Overlays notification.State = ProgressNotificationState.Cancelled; } } -#endif } +#endif protected override void PopIn() { diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs index a5be6a7952..793a9b73ad 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs @@ -128,6 +128,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor { Trace.Assert(lastPosition.HasValue); + // ReSharper disable once PossibleInvalidOperationException Vector2 pos1 = lastPosition.Value; Vector2 diff = pos2 - pos1; float distance = diff.Length; diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 4bce2a96da..13cefc6a73 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -307,6 +307,7 @@ namespace osu.Game.Beatmaps context.ChangeTracker.AutoDetectChangesEnabled = false; // re-fetch the beatmap set on the import context. + // ReSharper disable once AccessToModifiedClosure beatmapSet = context.BeatmapSetInfo.Include(s => s.Files).ThenInclude(f => f.FileInfo).First(s => s.ID == beatmapSet.ID); // create local stores so we can isolate and thread safely, and share a context/transaction. diff --git a/osu.Game/Graphics/Cursor/MenuCursor.cs b/osu.Game/Graphics/Cursor/MenuCursor.cs index da117a94c1..451422038f 100644 --- a/osu.Game/Graphics/Cursor/MenuCursor.cs +++ b/osu.Game/Graphics/Cursor/MenuCursor.cs @@ -33,6 +33,7 @@ namespace osu.Game.Graphics.Cursor // don't start rotating until we're moved a minimum distance away from the mouse down location, // else it can have an annoying effect. + // ReSharper disable once PossibleInvalidOperationException startRotation |= Vector2Extensions.Distance(state.Mouse.Position, state.Mouse.PositionMouseDown.Value) > 30; if (startRotation) diff --git a/osu.Game/IO/Legacy/SerializationReader.cs b/osu.Game/IO/Legacy/SerializationReader.cs index e79eef4e2b..393a13448e 100644 --- a/osu.Game/IO/Legacy/SerializationReader.cs +++ b/osu.Game/IO/Legacy/SerializationReader.cs @@ -186,6 +186,7 @@ namespace osu.Game.IO.Legacy Debug.Assert(formatter != null, "formatter != null"); + // ReSharper disable once PossibleNullReferenceException return formatter.Deserialize(stream); } diff --git a/osu.Game/Online/API/OAuth.cs b/osu.Game/Online/API/OAuth.cs index ca38f72904..198c71f0c1 100644 --- a/osu.Game/Online/API/OAuth.cs +++ b/osu.Game/Online/API/OAuth.cs @@ -96,6 +96,7 @@ namespace osu.Game.Online.API // if not, let's try using our refresh token to request a new access token. if (!string.IsNullOrEmpty(Token?.RefreshToken)) + // ReSharper disable once PossibleNullReferenceException AuthenticateWithRefresh(Token.RefreshToken); return accessTokenValid; diff --git a/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs b/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs index a66799f404..923ae0e269 100644 --- a/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs @@ -19,6 +19,7 @@ namespace osu.Game.Online.API.Requests this.type = type; } + // ReSharper disable once ImpureMethodCallOnReadonlyValueField protected override string Target => $@"users/{userId}/beatmapsets/{type.ToString().Underscore()}?offset={offset}"; } diff --git a/osu.Game/Online/API/Requests/GetUserScoresRequest.cs b/osu.Game/Online/API/Requests/GetUserScoresRequest.cs index 98db234196..e30a449978 100644 --- a/osu.Game/Online/API/Requests/GetUserScoresRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserScoresRequest.cs @@ -18,6 +18,7 @@ namespace osu.Game.Online.API.Requests this.offset = offset; } + // ReSharper disable once ImpureMethodCallOnReadonlyValueField protected override string Target => $@"users/{userId}/scores/{type.ToString().ToLower()}?offset={offset}"; } @@ -27,4 +28,4 @@ namespace osu.Game.Online.API.Requests Firsts, Recent } -} \ No newline at end of file +} diff --git a/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs b/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs index 56858b3d56..b949bf35f0 100644 --- a/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs +++ b/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs @@ -27,6 +27,7 @@ namespace osu.Game.Online.API.Requests this.direction = direction; } + // ReSharper disable once ImpureMethodCallOnReadonlyValueField protected override string Target => $@"beatmapsets/search?q={query}&m={ruleset.ID ?? 0}&s={(int)rankStatus}&sort={sortCriteria.ToString().ToLower()}_{directionString}"; } } diff --git a/osu.Game/Online/Chat/Message.cs b/osu.Game/Online/Chat/Message.cs index 79b5c4fc1a..972e4755c9 100644 --- a/osu.Game/Online/Chat/Message.cs +++ b/osu.Game/Online/Chat/Message.cs @@ -57,6 +57,7 @@ namespace osu.Game.Online.Chat public virtual bool Equals(Message other) => Id == other?.Id; + // ReSharper disable once ImpureMethodCallOnReadonlyValueField public override int GetHashCode() => Id.GetHashCode(); } diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 24fc322199..ef514c95fd 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -207,6 +207,7 @@ namespace osu.Game.Overlays { Trace.Assert(state.Mouse.PositionMouseDown != null); + // ReSharper disable once PossibleInvalidOperationException double targetChatHeight = startDragChatHeight - (state.Mouse.Position.Y - state.Mouse.PositionMouseDown.Value.Y) / Parent.DrawSize.Y; // If the channel selection screen is shown, mind its minimum height @@ -380,6 +381,7 @@ namespace osu.Game.Overlays { if (channel == null) return; + // ReSharper disable once AccessToModifiedClosure var existing = careChannels.Find(c => c.Id == channel.Id); if (existing != null) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index a99ce89a36..cf8946e399 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -71,6 +71,7 @@ namespace osu.Game.Overlays { Trace.Assert(state.Mouse.PositionMouseDown != null, "state.Mouse.PositionMouseDown != null"); + // ReSharper disable once PossibleInvalidOperationException Vector2 change = state.Mouse.Position - state.Mouse.PositionMouseDown.Value; // Diminish the drag distance as we go further to simulate "rubber band" feeling. diff --git a/osu.Game/Rulesets/Timing/MultiplierControlPoint.cs b/osu.Game/Rulesets/Timing/MultiplierControlPoint.cs index 4f1a85cf2d..ba0e66e04c 100644 --- a/osu.Game/Rulesets/Timing/MultiplierControlPoint.cs +++ b/osu.Game/Rulesets/Timing/MultiplierControlPoint.cs @@ -60,6 +60,7 @@ namespace osu.Game.Rulesets.Timing DifficultyPoint = other.DifficultyPoint; } + // ReSharper disable once ImpureMethodCallOnReadonlyValueField public int CompareTo(MultiplierControlPoint other) => StartTime.CompareTo(other?.StartTime); } } diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 278814ea7e..b627db8aff 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -157,6 +157,7 @@ namespace osu.Game.Rulesets.UI WorkingBeatmap = workingBeatmap; IsForCurrentRuleset = isForCurrentRuleset; + // ReSharper disable once PossibleNullReferenceException Mods = workingBeatmap.Mods.Value; RelativeSizeAxes = Axes.Both; diff --git a/osu.Game/Rulesets/UI/ScrollingPlayfield.cs b/osu.Game/Rulesets/UI/ScrollingPlayfield.cs index 395248b2fd..cff3a029e6 100644 --- a/osu.Game/Rulesets/UI/ScrollingPlayfield.cs +++ b/osu.Game/Rulesets/UI/ScrollingPlayfield.cs @@ -255,6 +255,7 @@ namespace osu.Game.Rulesets.UI var sX = (SpeedAdjustmentContainer)x; var sY = (SpeedAdjustmentContainer)y; + // ReSharper disable once ImpureMethodCallOnReadonlyValueField int result = sY.ControlPoint.StartTime.CompareTo(sX.ControlPoint.StartTime); if (result != 0) return result; diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 9044938a75..6ddafe085e 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -123,6 +123,7 @@ namespace osu.Game.Screens.Select.Leaderboards Origin = Anchor.CentreLeft, Font = @"Exo2.0-MediumItalic", TextSize = 22, + // ReSharper disable once ImpureMethodCallOnReadonlyValueField Text = RankPosition.ToString(), }, }, diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game/Screens/Tournament/Drawings.cs index e540782fc1..269b206a78 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game/Screens/Tournament/Drawings.cs @@ -326,6 +326,7 @@ namespace osu.Game.Screens.Tournament if (line.ToUpper().StartsWith("GROUP")) continue; + // ReSharper disable once AccessToModifiedClosure DrawingsTeam teamToAdd = allTeams.FirstOrDefault(t => t.FullName == line); if (teamToAdd == null) diff --git a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs index 2eb0dacec3..5bae30458e 100644 --- a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs +++ b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs @@ -13,9 +13,9 @@ using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Framework.Threading; +using osu.Game.Screens.Tournament.Teams; using OpenTK; using OpenTK.Graphics; -using osu.Game.Screens.Tournament.Teams; namespace osu.Game.Screens.Tournament { @@ -118,16 +118,18 @@ namespace osu.Game.Screens.Tournament if (!Children.Any()) break; - Drawable closest = null; + ScrollingTeam closest = null; foreach (var c in Children) { - if (!(c is ScrollingTeam)) + var stc = c as ScrollingTeam; + + if (stc == null) continue; if (closest == null) { - closest = c; + closest = stc; continue; } @@ -135,14 +137,15 @@ namespace osu.Game.Screens.Tournament float lastOffset = Math.Abs(closest.Position.X + closest.DrawWidth / 2f - DrawWidth / 2f); if (o < lastOffset) - closest = c; + closest = stc; } Trace.Assert(closest != null, "closest != null"); + // ReSharper disable once PossibleNullReferenceException offset += DrawWidth / 2f - (closest.Position.X + closest.DrawWidth / 2f); - ScrollingTeam st = closest as ScrollingTeam; + ScrollingTeam st = closest; availableTeams.RemoveAll(at => at == st.Team); diff --git a/osu.Game/Screens/Tournament/Teams/StorageBackedTeamList.cs b/osu.Game/Screens/Tournament/Teams/StorageBackedTeamList.cs index 1b2d84a666..ce3b5ed941 100644 --- a/osu.Game/Screens/Tournament/Teams/StorageBackedTeamList.cs +++ b/osu.Game/Screens/Tournament/Teams/StorageBackedTeamList.cs @@ -38,6 +38,7 @@ namespace osu.Game.Screens.Tournament.Teams if (string.IsNullOrEmpty(line)) continue; + // ReSharper disable once PossibleNullReferenceException string[] split = line.Split(':'); if (split.Length < 2) From 7cfca866e20793efa0aae16cafefba4b8154b8d3 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 20 Nov 2017 19:43:46 +0900 Subject: [PATCH 012/109] Don't compile osu.Desktop.Deploy now --- osu.sln | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.sln b/osu.sln index 934ea874d1..3093c19868 100644 --- a/osu.sln +++ b/osu.sln @@ -73,7 +73,6 @@ Global {48F4582B-7687-4621-9CBE-5C24197CB536}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.VisualTests|Any CPU.Build.0 = Debug|Any CPUı {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Debug|Any CPU.Build.0 = Debug|Any CPU {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Release|Any CPU.ActiveCfg = Release|Any CPU {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU {54377672-20B1-40AF-8087-5CF73BF3953A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU From e98d9e8a8cd90b0b2e7c62917e516876453a8fac Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 20 Nov 2017 19:44:06 +0900 Subject: [PATCH 013/109] Explicitly define constant --- osu-framework | 2 +- osu.Desktop/OsuGameDesktop.cs | 6 +++--- osu.Desktop/Overlays/VersionManager.cs | 12 ++++++------ osu.Desktop/osu.Desktop.csproj | 3 +++ 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/osu-framework b/osu-framework index b77ceb37e6..6b305b3332 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit b77ceb37e6186cbf6f5b8a72959d753fbb56f9a5 +Subproject commit 6b305b3332cdc424ef7fc3c9499c21e174f9eec5 diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index ff4b37a8fb..d356fcf53d 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -11,7 +11,7 @@ using osu.Framework.Platform; using osu.Game; using OpenTK.Input; -#if NET461 +#if NET_FRAMEWORK using Microsoft.Win32; #endif @@ -48,7 +48,7 @@ namespace osu.Desktop { Func checkExists = p => Directory.Exists(Path.Combine(p, "Songs")); -#if NET461 +#if NET_FRAMEWORK string stableInstallPath; try @@ -64,7 +64,7 @@ namespace osu.Desktop } #endif -#if NET461 +#if NET_FRAMEWORK stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); #else var stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index fef7e6d52a..3db7297385 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -19,7 +19,7 @@ using osu.Game.Overlays.Notifications; using OpenTK; using OpenTK.Graphics; -#if NET461 +#if NET_FRAMEWORK using System; using System.Net.Http; using osu.Framework.Logging; @@ -30,7 +30,7 @@ namespace osu.Desktop.Overlays { public class VersionManager : OverlayContainer { -#if NET461 +#if NET_FRAMEWORK private UpdateManager updateManager; #endif @@ -101,7 +101,7 @@ namespace osu.Desktop.Overlays } }; -#if NET461 +#if NET_FRAMEWORK if (game.IsDeployedBuild) checkForUpdateAsync(); #endif @@ -147,12 +147,12 @@ namespace osu.Desktop.Overlays { base.Dispose(isDisposing); -#if NET461 +#if NET_FRAMEWORK updateManager?.Dispose(); #endif } -#if NET461 +#if NET_FRAMEWORK private async void checkForUpdateAsync(bool useDeltaPatching = true, UpdateProgressNotification notification = null) { //should we schedule a retry on completion of this check? @@ -247,7 +247,7 @@ namespace osu.Desktop.Overlays Activated = () => { // Squirrel returns execution to us after the update process is started, so it's safe to use Wait() here -#if NET461 +#if NET_FRAMEWORK UpdateManager.RestartAppWhenExited().Wait(); #endif game.GracefullyExit(); diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 3b08715d2d..9fed566703 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -15,6 +15,9 @@ 0.0.0.0 0.0.0.0 + + $(DefineConstants);NET_FRAMEWORK + From 538acadd230154db7390dbb01d6454fc7ff77b21 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 21 Nov 2017 15:29:15 +0900 Subject: [PATCH 014/109] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 6b305b3332..0c40800ad4 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 6b305b3332cdc424ef7fc3c9499c21e174f9eec5 +Subproject commit 0c40800ad40e2119ae9e68a815d677814490d55c From a66edea6dc281f6a24d21fa8943e13ea785d43ec Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 21 Nov 2017 15:33:05 +0900 Subject: [PATCH 015/109] Move sqlite batteries to osu.Desktop Fixes e_sqlite.dll not being copied to output on Windows --- osu.Desktop/Program.cs | 3 +++ osu.Desktop/osu.Desktop.csproj | 1 + osu.Game/Database/OsuDbContext.cs | 6 ------ osu.Game/osu.Game.csproj | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index 720b38144c..b7ecefe1ce 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -15,6 +15,9 @@ namespace osu.Desktop [STAThread] public static int Main(string[] args) { + // required to initialise native SQLite libraries on some platforms. + SQLitePCL.Batteries_V2.Init(); + // Back up the cwd before DesktopGameHost changes it var cwd = Environment.CurrentDirectory; diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 9fed566703..56a455e6b7 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -28,6 +28,7 @@ + diff --git a/osu.Game/Database/OsuDbContext.cs b/osu.Game/Database/OsuDbContext.cs index 928c355696..4208bad2d3 100644 --- a/osu.Game/Database/OsuDbContext.cs +++ b/osu.Game/Database/OsuDbContext.cs @@ -29,12 +29,6 @@ namespace osu.Game.Database private static readonly Lazy logger = new Lazy(() => new OsuDbLoggerFactory()); - static OsuDbContext() - { - // required to initialise native SQLite libraries on some platforms. - SQLitePCL.Batteries_V2.Init(); - } - /// /// Create a new in-memory OsuDbContext instance. /// diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index dd591bcba8..b8c1e0551c 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -19,7 +19,7 @@ - + From 465531116520191f45505190597f096fe7e46d02 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 21 Nov 2017 16:38:23 +0900 Subject: [PATCH 016/109] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 0c40800ad4..ec7d5532b1 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 0c40800ad40e2119ae9e68a815d677814490d55c +Subproject commit ec7d5532b16acf25d2e23a03324b6d99c77cbe01 From 44168b1654757b47aa80f997413ee1a5fcf2764b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 21 Nov 2017 16:42:54 +0900 Subject: [PATCH 017/109] Fix incorrect license --- osu.Game/Utils/ZipUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Utils/ZipUtils.cs b/osu.Game/Utils/ZipUtils.cs index c1e0d75a7b..c9a16eb84b 100644 --- a/osu.Game/Utils/ZipUtils.cs +++ b/osu.Game/Utils/ZipUtils.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using SharpCompress.Archives.Zip; From 05aa6faf5eb3a340b7d71b7acea3db98938d0a4b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 22 Nov 2017 19:46:52 +0900 Subject: [PATCH 018/109] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index ec7d5532b1..f6926e465d 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit ec7d5532b16acf25d2e23a03324b6d99c77cbe01 +Subproject commit f6926e465dfecc99f7b11013c7e2428b736bfea2 From d364603e4550faa77b295a0142d765b080d1f51f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 22 Nov 2017 20:02:31 +0900 Subject: [PATCH 019/109] Make registry checking work again --- osu-framework | 2 +- osu.Desktop/OsuGameDesktop.cs | 9 --------- osu.Desktop/osu.Desktop.csproj | 1 + 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/osu-framework b/osu-framework index f6926e465d..a4cbd332c4 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit f6926e465dfecc99f7b11013c7e2428b736bfea2 +Subproject commit a4cbd332c4fcdd682252f5a89d8c01052b405e86 diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index d356fcf53d..f2906f043c 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -10,10 +10,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Platform; using osu.Game; using OpenTK.Input; - -#if NET_FRAMEWORK using Microsoft.Win32; -#endif namespace osu.Desktop { @@ -48,7 +45,6 @@ namespace osu.Desktop { Func checkExists = p => Directory.Exists(Path.Combine(p, "Songs")); -#if NET_FRAMEWORK string stableInstallPath; try @@ -62,13 +58,8 @@ namespace osu.Desktop catch { } -#endif -#if NET_FRAMEWORK stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); -#else - var stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); -#endif if (checkExists(stableInstallPath)) return stableInstallPath; diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 56a455e6b7..a8f1a86a7a 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -26,6 +26,7 @@ + From 1456f98aff503040eaa563e4c1f282c11f065495 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 22 Nov 2017 21:04:14 +0900 Subject: [PATCH 020/109] Ensure that osu.Desktop.Deploy works Closes https://github.com/ppy/osu/issues/1545. --- osu.Desktop.Deploy/.vscode/launch.json | 29 ++++++++++++ osu.Desktop.Deploy/.vscode/tasks.json | 64 ++++++++++++++++++++++++++ osu.Desktop.Deploy/Program.cs | 10 ++-- 3 files changed, 98 insertions(+), 5 deletions(-) create mode 100644 osu.Desktop.Deploy/.vscode/launch.json create mode 100644 osu.Desktop.Deploy/.vscode/tasks.json diff --git a/osu.Desktop.Deploy/.vscode/launch.json b/osu.Desktop.Deploy/.vscode/launch.json new file mode 100644 index 0000000000..82cd6b4c13 --- /dev/null +++ b/osu.Desktop.Deploy/.vscode/launch.json @@ -0,0 +1,29 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [{ + "name": "Deploy (Debug)", + "request": "launch", + "type": "mono", + "program": "${workspaceRoot}/bin/Debug/net461/osu.Desktop.Deploy.exe", + "cwd": "${workspaceRoot}", + "preLaunchTask": "Build (Debug)", + "runtimeExecutable": null, + "env": {}, + "console": "internalConsole" + }, + { + "name": "Deploy (Release)", + "request": "launch", + "type": "clr", + "program": "${workspaceRoot}/bin/Release/net461/osu.Desktop.Deploy.exe", + "cwd": "${workspaceRoot}", + "preLaunchTask": "Build (Release)", + "runtimeExecutable": null, + "env": {}, + "console": "internalConsole" + } + ] +} \ No newline at end of file diff --git a/osu.Desktop.Deploy/.vscode/tasks.json b/osu.Desktop.Deploy/.vscode/tasks.json new file mode 100644 index 0000000000..35bf9e7a0e --- /dev/null +++ b/osu.Desktop.Deploy/.vscode/tasks.json @@ -0,0 +1,64 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "command": "msbuild", + "type": "shell", + "suppressTaskName": true, + "args": [ + "/property:GenerateFullPaths=true", + "/property:DebugType=portable", + "/verbosity:minimal", + "/m" //parallel compiling support. + ], + "tasks": [{ + "taskName": "Build (Debug)", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [ + "$msCompile" + ] + }, + { + "taskName": "Build (Release)", + "group": "build", + "args": [ + "/property:Configuration=Release" + ], + "problemMatcher": [ + "$msCompile" + ] + }, + { + "taskName": "Clean (Debug)", + "args": [ + "/target:Clean" + ], + "problemMatcher": [ + "$msCompile" + ] + }, + { + "taskName": "Clean (Release)", + "args": [ + "/target:Clean", + "/property:Configuration=Release" + ], + "problemMatcher": [ + "$msCompile" + ] + }, + { + "taskName": "Clean All", + "dependsOn": [ + "Clean (Debug)", + "Clean (Release)" + ], + "problemMatcher": [ + "$msCompile" + ] + } + ] +} \ No newline at end of file diff --git a/osu.Desktop.Deploy/Program.cs b/osu.Desktop.Deploy/Program.cs index 3c1d532c0f..1be4bdeb0c 100644 --- a/osu.Desktop.Deploy/Program.cs +++ b/osu.Desktop.Deploy/Program.cs @@ -96,7 +96,7 @@ namespace osu.Desktop.Deploy runCommand(nuget_path, "restore " + solutionPath); write("Updating AssemblyInfo..."); - updateAssemblyInfo(version); + updateCsprojVersion(version); write("Running build process..."); foreach (string targetName in TargetNames.Split(',')) @@ -123,7 +123,7 @@ namespace osu.Desktop.Deploy uploadBuild(version); //reset assemblyinfo. - updateAssemblyInfo("0.0.0"); + updateCsprojVersion("0.0.0"); write("Done!", ConsoleColor.White); Console.ReadLine(); @@ -297,7 +297,7 @@ namespace osu.Desktop.Deploy Directory.CreateDirectory(directory); } - private static void updateAssemblyInfo(string version) + private static void updateCsprojVersion(string version) { var toUpdate = new[] { "", "" }; string file = Path.Combine(ProjectName, $"{ProjectName}.csproj"); @@ -336,8 +336,8 @@ namespace osu.Desktop.Deploy path = Environment.CurrentDirectory; while (!File.Exists(Path.Combine(path, $"{SolutionName}.sln"))) - path = path.Remove(path.LastIndexOf('\\')); - path += "\\"; + path = path.Remove(path.LastIndexOf(Path.DirectorySeparatorChar)); + path += Path.DirectorySeparatorChar; Environment.CurrentDirectory = path; } From 6003282e663c31b51173e1f5a024502073a76bb6 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 22 Nov 2017 22:07:55 +0900 Subject: [PATCH 021/109] Give osu!lazer an application icon again Fixes https://github.com/ppy/osu/issues/1548. --- osu.Desktop/osu.Desktop.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index a8f1a86a7a..ca2b1c2bbe 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -12,6 +12,7 @@ osu! osu!lazer osu!lazer + lazer.ico 0.0.0.0 0.0.0.0 From 6e50fa29147f0fd75c4d0460ab0b7431541c8caa Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 29 Nov 2017 23:47:42 +0900 Subject: [PATCH 022/109] Update submodules --- osu-framework | 2 +- osu-resources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index a4cbd332c4..d830e87aaf 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit a4cbd332c4fcdd682252f5a89d8c01052b405e86 +Subproject commit d830e87aafd666aa0a42bd42351b17b05157dcaf diff --git a/osu-resources b/osu-resources index c3def1cf00..c79d917605 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit c3def1cf0038c5a8bcbe35a56914ffeebb25b10b +Subproject commit c79d917605fa792a5f046fd70d7aa75e58dc9fbc From ec04871abd756dc6fe39d23c500014f943c7e72e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 30 Nov 2017 00:02:10 +0900 Subject: [PATCH 023/109] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index d830e87aaf..92fd14146f 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit d830e87aafd666aa0a42bd42351b17b05157dcaf +Subproject commit 92fd14146f41c63df29032684d66be40a34fad6b From 49f0a7ff36af98b768fe866f0d5ad598c363b0b4 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 30 Nov 2017 00:02:22 +0900 Subject: [PATCH 024/109] Add LangVer to osu.Game.props --- osu.Game.props | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.props b/osu.Game.props index c352fa2b06..61d5bea511 100644 --- a/osu.Game.props +++ b/osu.Game.props @@ -1,5 +1,6 @@ + osu.licenseheader From 0ec10ba32d9ecfc9fec949a38aa6a514bd817df5 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 30 Nov 2017 00:11:00 +0900 Subject: [PATCH 025/109] CI fixes --- osu.Desktop/Overlays/VersionManager.cs | 1 - osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs | 4 ++-- osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs | 2 +- osu.Game/Overlays/Settings/SidebarButton.cs | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 9f2f79f1df..0780ed9cce 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -21,7 +21,6 @@ using OpenTK.Graphics; #if NET_FRAMEWORK using System; -using System.Net.Http; using osu.Framework.Logging; using Squirrel; #endif diff --git a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs index 95b691e07f..53989c8775 100644 --- a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs @@ -126,7 +126,7 @@ namespace osu.Game.Tests.Beatmaps.Formats var beatmap = decoder.Decode(new StreamReader(stream)); var curveData = beatmap.HitObjects[0] as IHasCurve; - var positionData = beatmap.HitObjects[0] as IHasPosition; + var positionData = (IHasPosition)beatmap.HitObjects[0]; Assert.IsNotNull(positionData); Assert.IsNotNull(curveData); @@ -134,7 +134,7 @@ namespace osu.Game.Tests.Beatmaps.Formats Assert.AreEqual(956, beatmap.HitObjects[0].StartTime); Assert.IsTrue(beatmap.HitObjects[0].Samples.Any(s => s.Name == SampleInfo.HIT_NORMAL)); - positionData = beatmap.HitObjects[1] as IHasPosition; + positionData = (IHasPosition)beatmap.HitObjects[1]; Assert.IsNotNull(positionData); Assert.AreEqual(new Vector2(304, 56), positionData.Position); diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs index 8a835634b8..b59df1214a 100644 --- a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs +++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs @@ -75,7 +75,7 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu { private readonly OsuSpriteText valueText; - public int Count + public new int Count { set { valueText.Text = value.ToString(); } } diff --git a/osu.Game/Overlays/Settings/SidebarButton.cs b/osu.Game/Overlays/Settings/SidebarButton.cs index 4b8366f0fc..bc5357f05a 100644 --- a/osu.Game/Overlays/Settings/SidebarButton.cs +++ b/osu.Game/Overlays/Settings/SidebarButton.cs @@ -22,7 +22,7 @@ namespace osu.Game.Overlays.Settings private readonly SpriteText headerText; private readonly Box selectionIndicator; private readonly Container text; - public Action Action; + public new Action Action; private SettingsSection section; public SettingsSection Section From 599a86a69a2d06460755ad45ae6356ebb0e22d23 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 1 Dec 2017 18:50:59 +0900 Subject: [PATCH 026/109] Remove LangVer.props --- LangVer.props | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 LangVer.props diff --git a/LangVer.props b/LangVer.props deleted file mode 100644 index 6b1d1dae73..0000000000 --- a/LangVer.props +++ /dev/null @@ -1,6 +0,0 @@ - - - - 6 - - \ No newline at end of file From 741153e1a283cdca1ded7a2d9ce1ec8510ca4de3 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 1 Dec 2017 18:51:20 +0900 Subject: [PATCH 027/109] Remove unnecessary properties --- osu.Game.props | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game.props b/osu.Game.props index 60a5e97944..07abeb5539 100644 --- a/osu.Game.props +++ b/osu.Game.props @@ -1,7 +1,5 @@ - - - + 7 From 1b83f2e3d452e6790e6599c4ef503d44b245258c Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 1 Dec 2017 18:53:36 +0900 Subject: [PATCH 028/109] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 92fd14146f..19e8161046 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 92fd14146f41c63df29032684d66be40a34fad6b +Subproject commit 19e81610469455c4531e0a58574d58bca9ae4cc7 From ce8c5deab94cb539007dd118c1484cc246bb1807 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 27 Dec 2017 20:48:59 +0900 Subject: [PATCH 029/109] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 19e8161046..3f3cb3b662 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 19e81610469455c4531e0a58574d58bca9ae4cc7 +Subproject commit 3f3cb3b66215a3b00802b5abf9b0a43e4a0f932e From 6dfc596319eaf5c118911dce9a348c02f56d46be Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 27 Dec 2017 20:59:26 +0900 Subject: [PATCH 030/109] Post-merge fixes --- osu.Game.Tests/osu.Game.Tests.csproj | 1 + osu.Game/Rulesets/Edit/Layers/Selection/Handle.cs | 2 +- .../Rulesets/Edit/Layers/Selection/HitObjectSelectionBox.cs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 4507d3d7f3..1c9b0503c0 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -23,6 +23,7 @@ + diff --git a/osu.Game/Rulesets/Edit/Layers/Selection/Handle.cs b/osu.Game/Rulesets/Edit/Layers/Selection/Handle.cs index 2982a68b3b..b1ed5bc8b5 100644 --- a/osu.Game/Rulesets/Edit/Layers/Selection/Handle.cs +++ b/osu.Game/Rulesets/Edit/Layers/Selection/Handle.cs @@ -5,12 +5,12 @@ using System; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Shapes; using osu.Framework.Input; using osu.Game.Graphics; using OpenTK; using OpenTK.Graphics; +using RectangleF = osu.Framework.Graphics.Primitives.RectangleF; namespace osu.Game.Rulesets.Edit.Layers.Selection { diff --git a/osu.Game/Rulesets/Edit/Layers/Selection/HitObjectSelectionBox.cs b/osu.Game/Rulesets/Edit/Layers/Selection/HitObjectSelectionBox.cs index 6f73d6b916..8f380b77c3 100644 --- a/osu.Game/Rulesets/Edit/Layers/Selection/HitObjectSelectionBox.cs +++ b/osu.Game/Rulesets/Edit/Layers/Selection/HitObjectSelectionBox.cs @@ -6,13 +6,13 @@ using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Rulesets.Objects.Drawables; using OpenTK; using OpenTK.Graphics; using osu.Framework.Configuration; +using RectangleF = osu.Framework.Graphics.Primitives.RectangleF; namespace osu.Game.Rulesets.Edit.Layers.Selection { From bec1c80c7aaaedabdd43616b184acf07b9796994 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 27 Dec 2017 21:06:41 +0900 Subject: [PATCH 031/109] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 3f3cb3b662..4b819607f3 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 3f3cb3b66215a3b00802b5abf9b0a43e4a0f932e +Subproject commit 4b819607f36f6a87472c7d654e02f2c8e83fac70 From 36e9232472ba3627875a3a32b3a99a524bcae388 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 5 Jan 2018 00:42:48 +0900 Subject: [PATCH 032/109] Merge master into netstandard --- COMPILING.md | 36 ++++ NuGet.config | 6 - README.md | 7 +- osu.Desktop/Overlays/VersionManager.cs | 2 +- .../Drawable/DrawableCatchHitObject.cs | 1 + .../Scoring/CatchScoreProcessor.cs | 1 - .../Judgements/HitWindows.cs | 2 +- .../Judgements/HoldNoteTailJudgement.cs | 4 +- .../Judgements/HoldNoteTickJudgement.cs | 4 +- .../Judgements/ManiaJudgement.cs | 2 +- osu.Game.Rulesets.Mania/Mods/ManiaMod.cs | 2 + .../Objects/Drawables/DrawableHoldNote.cs | 1 + .../Objects/Drawables/DrawableHoldNoteTick.cs | 3 +- .../Objects/Drawables/DrawableNote.cs | 1 + .../Scoring/ManiaScoreProcessor.cs | 1 - .../Tests/TestCaseManiaPlayfield.cs | 2 +- .../Judgements/OsuJudgement.cs | 4 +- osu.Game.Rulesets.Osu/Mods/OsuMod.cs | 88 ++++++++- .../Objects/Drawables/DrawableHitCircle.cs | 22 ++- .../Objects/Drawables/DrawableOsuHitObject.cs | 13 +- .../Objects/Drawables/DrawableOsuJudgement.cs | 4 +- .../Objects/Drawables/DrawableRepeatPoint.cs | 11 +- .../Objects/Drawables/DrawableSlider.cs | 81 ++++---- .../Objects/Drawables/DrawableSliderTick.cs | 1 + .../Objects/Drawables/DrawableSpinner.cs | 65 +++---- .../Objects/Drawables/Pieces/SliderBall.cs | 27 +-- .../Objects/Drawables/Pieces/SpinnerDisc.cs | 2 + .../Objects/ISliderProgress.cs | 10 + osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs | 2 +- osu.Game.Rulesets.Osu/Objects/Slider.cs | 30 ++- .../Replays/OsuAutoGenerator.cs | 2 +- .../Scoring/OsuPerformanceCalculator.cs | 8 +- .../Scoring/OsuScoreProcessor.cs | 12 +- .../Tests/TestCaseHitCircle.cs | 117 ++++++++++++ .../Tests/TestCaseHitCircleHidden.cs | 22 +++ .../Tests/TestCaseHitObjects.cs | 129 ------------- osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs | 152 +++++++++++++++ .../Tests/TestCaseSliderHidden.cs | 22 +++ .../Tests/TestCaseSpinner.cs | 88 +++++++++ .../Tests/TestCaseSpinnerHidden.cs | 22 +++ .../UI/OsuRulesetContainer.cs | 9 +- .../Audio/DrumSampleMapping.cs | 13 +- .../Judgements/TaikoDrumRollTickJudgement.cs | 4 +- .../Judgements/TaikoJudgement.cs | 2 +- .../Objects/Drawables/DrawableDrumRoll.cs | 1 + .../Objects/Drawables/DrawableDrumRollTick.cs | 1 + .../Objects/Drawables/DrawableHit.cs | 1 + .../Objects/Drawables/DrawableHitStrong.cs | 2 +- .../Objects/Drawables/DrawableSwell.cs | 1 + .../Drawables/DrawableTaikoHitObject.cs | 2 + osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs | 11 +- .../Replays/TaikoAutoGenerator.cs | 2 +- .../Scoring/TaikoScoreProcessor.cs | 1 - .../Tests/TestCaseInputDrum.cs | 44 +++++ .../Tests/TestCaseTaikoPlayfield.cs | 1 + .../UI/DrawableTaikoJudgement.cs | 3 +- osu.Game.Rulesets.Taiko/UI/InputDrum.cs | 4 +- .../Formats/LegacyStoryboardDecoderTest.cs | 4 +- .../Visual/TestCaseBeatmapScoresContainer.cs | 18 +- .../Visual/TestCaseGameplayMenuOverlay.cs | 8 +- osu.Game.Tests/Visual/TestCaseMods.cs | 30 ++- .../Visual/TestCaseNotificationOverlay.cs | 49 ++++- .../Visual/TestCasePlaySongSelect.cs | 13 +- osu.Game.Tests/Visual/TestCaseResults.cs | 19 +- osu.Game/Audio/SampleInfo.cs | 16 +- osu.Game/Beatmaps/BeatmapManager.cs | 37 ++-- .../ControlPoints/SampleControlPoint.cs | 2 +- .../Formats/LegacyStoryboardDecoder.cs | 2 +- osu.Game/Graphics/Backgrounds/Background.cs | 5 +- .../Containers/OsuFocusedOverlayContainer.cs | 44 +++++ .../Graphics/Textures/LargeTextureStore.cs | 18 ++ .../Online/API/Requests/GetScoresRequest.cs | 14 +- osu.Game/OsuGame.cs | 63 ++++--- osu.Game/OsuGameBase.cs | 4 + .../BeatmapSet/Scores/DrawableScore.cs | 5 +- .../BeatmapSet/Scores/DrawableTopScore.cs | 4 +- osu.Game/Overlays/ChatOverlay.cs | 2 - osu.Game/Overlays/Mods/ModButton.cs | 175 ++++++++++-------- osu.Game/Overlays/Mods/ModSection.cs | 25 ++- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 15 +- osu.Game/Overlays/MusicController.cs | 6 +- osu.Game/Overlays/NotificationOverlay.cs | 51 ++++- .../Notifications/NotificationSection.cs | 14 +- .../Notifications/ProgressNotification.cs | 2 +- osu.Game/Overlays/Profile/ProfileHeader.cs | 4 +- osu.Game/Overlays/Profile/SupporterIcon.cs | 7 +- .../Settings/Sections/AudioSection.cs | 4 +- osu.Game/Overlays/SettingsOverlay.cs | 2 - osu.Game/Overlays/Toolbar/Toolbar.cs | 8 +- osu.Game/Overlays/UserProfileOverlay.cs | 10 - .../Rulesets/Judgements/DrawableJudgement.cs | 2 +- osu.Game/Rulesets/Judgements/Judgement.cs | 1 + .../Rulesets/Mods/IApplicableFailOverride.cs | 16 ++ osu.Game/Rulesets/Mods/IApplicableMod.cs | 13 ++ osu.Game/Rulesets/Mods/IApplicableToClock.cs | 4 +- .../Rulesets/Mods/IApplicableToDifficulty.cs | 4 +- .../Mods/IApplicableToDrawableHitObject.cs | 20 ++ .../Rulesets/Mods/IApplicableToHitObject.cs | 2 +- .../Mods/IApplicableToRulesetContainer.cs | 2 +- .../Mods/IApplicableToScoreProcessor.cs | 2 +- osu.Game/Rulesets/Mods/Mod.cs | 10 +- osu.Game/Rulesets/Mods/ModAutoplay.cs | 3 +- osu.Game/Rulesets/Mods/ModNoFail.cs | 6 +- .../Objects/Drawables/DrawableHitObject.cs | 15 +- osu.Game/Rulesets/RulesetStore.cs | 7 + .../Drawables => Scoring}/HitResult.cs | 2 +- osu.Game/Rulesets/Scoring/Score.cs | 2 +- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 1 - osu.Game/Rulesets/UI/ModIcon.cs | 2 +- osu.Game/Rulesets/UI/RulesetContainer.cs | 3 + .../Backgrounds/BackgroundScreenDefault.cs | 13 +- osu.Game/Screens/Edit/Editor.cs | 2 +- osu.Game/Screens/Loader.cs | 2 +- osu.Game/Screens/Menu/ButtonSystem.cs | 14 +- osu.Game/Screens/Menu/Disclaimer.cs | 2 +- osu.Game/Screens/Menu/Intro.cs | 2 +- osu.Game/Screens/Menu/MainMenu.cs | 2 +- .../Screens/Multiplayer/ParticipantInfo.cs | 2 +- osu.Game/Screens/OsuScreen.cs | 14 +- osu.Game/Screens/Play/GameplayMenuOverlay.cs | 8 + .../Screens/Play/HUD/StandardHealthDisplay.cs | 2 +- osu.Game/Screens/Play/Player.cs | 13 +- osu.Game/Screens/Play/PlayerLoader.cs | 2 +- osu.Game/Screens/Ranking/ResultsPageScore.cs | 17 +- osu.Game/Screens/Select/BeatmapCarousel.cs | 31 +++- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 23 ++- .../Carousel/DrawableCarouselBeatmap.cs | 2 +- osu.Game/Screens/Select/EditSongSelect.cs | 6 +- .../Screens/Select/ImportFromStablePopup.cs | 2 +- .../Select/Leaderboards/Leaderboard.cs | 18 +- .../Select/Leaderboards/LeaderboardScore.cs | 2 +- osu.Game/Screens/Select/MatchSongSelect.cs | 6 +- .../Select/Options/BeatmapOptionsOverlay.cs | 2 + osu.Game/Screens/Select/PlaySongSelect.cs | 19 +- osu.Game/Screens/Select/SongSelect.cs | 27 ++- osu.Game/Screens/Tournament/Drawings.cs | 2 +- osu.Game/Tests/Beatmaps/TestWorkingBeatmap.cs | 2 +- .../Tests/Visual/TestCasePerformancePoints.cs | 8 +- osu.Game/Tests/Visual/TestCasePlayer.cs | 17 +- osu.Game/Users/Country.cs | 43 +++-- osu.Game/Users/UserPanel.cs | 2 +- 141 files changed, 1555 insertions(+), 660 deletions(-) create mode 100644 COMPILING.md delete mode 100644 NuGet.config create mode 100644 osu.Game.Rulesets.Osu/Objects/ISliderProgress.cs create mode 100644 osu.Game.Rulesets.Osu/Tests/TestCaseHitCircle.cs create mode 100644 osu.Game.Rulesets.Osu/Tests/TestCaseHitCircleHidden.cs delete mode 100644 osu.Game.Rulesets.Osu/Tests/TestCaseHitObjects.cs create mode 100644 osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs create mode 100644 osu.Game.Rulesets.Osu/Tests/TestCaseSliderHidden.cs create mode 100644 osu.Game.Rulesets.Osu/Tests/TestCaseSpinner.cs create mode 100644 osu.Game.Rulesets.Osu/Tests/TestCaseSpinnerHidden.cs create mode 100644 osu.Game.Rulesets.Taiko/Tests/TestCaseInputDrum.cs create mode 100644 osu.Game/Graphics/Textures/LargeTextureStore.cs create mode 100644 osu.Game/Rulesets/Mods/IApplicableFailOverride.cs create mode 100644 osu.Game/Rulesets/Mods/IApplicableMod.cs create mode 100644 osu.Game/Rulesets/Mods/IApplicableToDrawableHitObject.cs rename osu.Game/Rulesets/{Objects/Drawables => Scoring}/HitResult.cs (91%) diff --git a/COMPILING.md b/COMPILING.md new file mode 100644 index 0000000000..bfcbf6bc2c --- /dev/null +++ b/COMPILING.md @@ -0,0 +1,36 @@ +# Linux +### 1. Requirements: +Mono >= 5.4.0 (>= 5.8.0 recommended) +Please check [here](http://www.mono-project.com/download/) for stable or [here](http://www.mono-project.com/download/alpha/) for an alpha release. +NuGet >= 4.4.0 +msbuild +git + +### 2. Cloning project +Clone the entire repository with submodules using +``` +git clone https://github.com/ppy/osu --recursive +``` +Then restore NuGet packages from the repository +``` +nuget restore +``` +### 3. Compiling +Simply run `msbuild` where `osu.sln` is located, this will create all binaries in `osu/osu.Desktop/bin/Debug`. +### 4. Optimizing +If you want additional performance you can change build type to Release with +``` +msbuild -p:Configuration=Release +``` +Additionally, mono provides an AOT utility which attempts to precompile binaries. You can utilize that by running +``` +mono --aot ./osu\!.exe +``` +### 5. Troubleshooting +You may run into trouble with NuGet versioning, as the one in packaging system is almost always out of date. Simply run +``` +nuget +sudo nuget update -self +``` +**Warning** NuGet creates few config files when it's run for the first time. +Do not run NuGet as root on the first run or you might run into very peculiar issues. diff --git a/NuGet.config b/NuGet.config deleted file mode 100644 index 95f993e510..0000000000 --- a/NuGet.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index 856536d22d..47df86f57e 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,11 @@ This is still heavily under development and is not intended for end-user use. Th # Requirements -- A desktop platform which can compile .NET 4.5 (tested on macOS, linux and windows). We recommend using [Visual Studio Code](https://code.visualstudio.com/) (all platforms) or [Visual Studio Community Edition](https://www.visualstudio.com/) (windows only), both of which are free. -- Make sure you initialise and keep submodules up-to-date. +- A desktop platform that can compile .NET 4.6.1. We recommend using [Visual Studio Community Edition](https://www.visualstudio.com/) (Windows), [Visual Studio for Mac](https://www.visualstudio.com/vs/visual-studio-mac/) (macOS) or [MonoDevelop](http://www.monodevelop.com/download/) (Linux), all of which are free. [Visual Studio Code](https://code.visualstudio.com/) may also be used but requires further setup steps which are not covered here. + +# Getting Started +- Clone the repository including submodules (`git clone --recurse-submodules https://github.com/ppy/osu`) +- Build in your IDE of choice (recommended IDEs automatically restore nuget packages; if you are using an alternative make sure to `nuget restore`) # Contributing diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 0780ed9cce..4bf0b76814 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -118,7 +118,7 @@ namespace osu.Desktop.Overlays // only show a notification if we've previously saved a version to the config file (ie. not the first run). if (!string.IsNullOrEmpty(lastVersion)) - Scheduler.AddDelayed(() => notificationOverlay.Post(new UpdateCompleteNotification(version)), 5000); + notificationOverlay.Post(new UpdateCompleteNotification(version)); } } diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs index b90a06b94e..a617b65676 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs @@ -6,6 +6,7 @@ using osu.Framework.Graphics; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects.Drawables; using OpenTK; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Catch.Objects.Drawable { diff --git a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs index 3826fd1129..3b9eacde9c 100644 --- a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs +++ b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs @@ -5,7 +5,6 @@ using System.Linq; using osu.Game.Beatmaps; using osu.Game.Rulesets.Catch.Judgements; using osu.Game.Rulesets.Catch.Objects; -using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; diff --git a/osu.Game.Rulesets.Mania/Judgements/HitWindows.cs b/osu.Game.Rulesets.Mania/Judgements/HitWindows.cs index d7bfa9caa1..ded1bc17af 100644 --- a/osu.Game.Rulesets.Mania/Judgements/HitWindows.cs +++ b/osu.Game.Rulesets.Mania/Judgements/HitWindows.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; -using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Mania.Judgements { diff --git a/osu.Game.Rulesets.Mania/Judgements/HoldNoteTailJudgement.cs b/osu.Game.Rulesets.Mania/Judgements/HoldNoteTailJudgement.cs index a8d1b079eb..e369df6ae1 100644 --- a/osu.Game.Rulesets.Mania/Judgements/HoldNoteTailJudgement.cs +++ b/osu.Game.Rulesets.Mania/Judgements/HoldNoteTailJudgement.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Mania.Judgements { @@ -24,4 +24,4 @@ namespace osu.Game.Rulesets.Mania.Judgements } } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs b/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs index d326c6fc0a..4787a4977b 100644 --- a/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs +++ b/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Mania.Judgements { @@ -11,4 +11,4 @@ namespace osu.Game.Rulesets.Mania.Judgements protected override int NumericResultFor(HitResult result) => 20; } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs b/osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs index 1f3b352da4..4762a98c40 100644 --- a/osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs +++ b/osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Judgements; -using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Mania.Judgements { diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs index dfc9993bde..61e11f7610 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs @@ -105,6 +105,8 @@ namespace osu.Game.Rulesets.Mania.Mods public abstract class ManiaKeyMod : Mod { + // TODO: implement using the IApplicable interface. Haven't done so yet because KeyCount isn't even hooked up at the moment. + public override string ShortenedName => Name; public abstract int KeyCount { get; } public override double ScoreMultiplier => 1; // TODO: Implement the mania key mod score multiplier diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index 7b207ca229..41d817a746 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -12,6 +12,7 @@ using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Mania.Judgements; using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Input.Bindings; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Mania.Objects.Drawables { diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs index 557fbf6ea8..8ed5d2b924 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs @@ -10,6 +10,7 @@ using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Rulesets.Objects.Drawables; using osu.Framework.Graphics.Shapes; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Mania.Objects.Drawables { @@ -113,4 +114,4 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables UpdateJudgement(true); } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs index 537246509b..aabfcafa85 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs @@ -8,6 +8,7 @@ using osu.Framework.Input.Bindings; using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces; using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Mania.Objects.Drawables { diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index 012137f555..140bab2225 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -6,7 +6,6 @@ using osu.Game.Beatmaps; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Rulesets.Mania.Objects; -using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs index 1932038411..b5890b289f 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs @@ -13,7 +13,7 @@ using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Mania.Timing; using osu.Game.Rulesets.Mania.UI; -using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Timing; using osu.Game.Tests.Visual; diff --git a/osu.Game.Rulesets.Osu/Judgements/OsuJudgement.cs b/osu.Game.Rulesets.Osu/Judgements/OsuJudgement.cs index 28b6a04376..cd9c3888df 100644 --- a/osu.Game.Rulesets.Osu/Judgements/OsuJudgement.cs +++ b/osu.Game.Rulesets.Osu/Judgements/OsuJudgement.cs @@ -4,7 +4,7 @@ using OpenTK; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Osu.Objects.Drawables; -using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu.Judgements { @@ -34,4 +34,4 @@ namespace osu.Game.Rulesets.Osu.Judgements public ComboResult Combo; } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs index 71349285b3..7b1f80f439 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs @@ -11,8 +11,11 @@ using System.Collections.Generic; using System.Linq; using osu.Game.Rulesets.Osu.UI; using osu.Game.Rulesets.Scoring; -using osu.Game.Rulesets.UI; using OpenTK; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Osu.Objects.Drawables; +using osu.Framework.Graphics; +using osu.Game.Rulesets.Objects.Types; namespace osu.Game.Rulesets.Osu.Mods { @@ -23,13 +26,86 @@ namespace osu.Game.Rulesets.Osu.Mods public class OsuModEasy : ModEasy { - } - public class OsuModHidden : ModHidden + public class OsuModHidden : ModHidden, IApplicableToDrawableHitObjects { public override string Description => @"Play with no approach circles and fading notes for a slight score advantage."; public override double ScoreMultiplier => 1.06; + + private const double fade_in_duration_multiplier = 0.4; + private const double fade_out_duration_multiplier = 0.3; + + private float preEmpt => DrawableOsuHitObject.TIME_PREEMPT; + + public void ApplyToDrawableHitObjects(IEnumerable drawables) + { + foreach (var d in drawables.OfType()) + { + d.ApplyCustomUpdateState += ApplyHiddenState; + d.FadeInDuration = preEmpt * fade_in_duration_multiplier; + } + } + + protected void ApplyHiddenState(DrawableHitObject drawable, ArmedState state) + { + if (!(drawable is DrawableOsuHitObject d)) + return; + + var fadeOutStartTime = d.HitObject.StartTime - preEmpt + d.FadeInDuration; + var fadeOutDuration = preEmpt * fade_out_duration_multiplier; + + // new duration from completed fade in to end (before fading out) + var longFadeDuration = ((d.HitObject as IHasEndTime)?.EndTime ?? d.HitObject.StartTime) - fadeOutStartTime; + + switch (drawable) + { + case DrawableHitCircle circle: + // we don't want to see the approach circle + circle.ApproachCircle.Hide(); + + // fade out immediately after fade in. + using (drawable.BeginAbsoluteSequence(fadeOutStartTime, true)) + circle.FadeOut(fadeOutDuration); + break; + case DrawableSlider slider: + using (slider.BeginAbsoluteSequence(fadeOutStartTime, true)) + { + slider.Body.FadeOut(longFadeDuration, Easing.Out); + + // delay a bit less to let the sliderball fade out peacefully instead of having a hard cut + using (slider.BeginDelayedSequence(longFadeDuration - fadeOutDuration, true)) + slider.Ball.FadeOut(fadeOutDuration); + } + + break; + case DrawableSpinner spinner: + // hide elements we don't care about. + spinner.Disc.Hide(); + spinner.Ticks.Hide(); + spinner.Background.Hide(); + + using (spinner.BeginAbsoluteSequence(fadeOutStartTime + longFadeDuration, true)) + { + spinner.FadeOut(fadeOutDuration); + + // speed up the end sequence accordingly + switch (state) + { + case ArmedState.Hit: + spinner.ScaleTo(spinner.Scale * 1.2f, fadeOutDuration * 2, Easing.Out); + break; + case ArmedState.Miss: + spinner.ScaleTo(spinner.Scale * 0.8f, fadeOutDuration * 2, Easing.In); + break; + } + + spinner.Expire(); + } + + break; + } + } } public class OsuModHardRock : ModHardRock, IApplicableToHitObject @@ -51,11 +127,6 @@ namespace osu.Game.Rulesets.Osu.Mods slider.ControlPoints = newControlPoints; slider.Curve?.Calculate(); // Recalculate the slider curve } - - public void ApplyToHitObjects(RulesetContainer rulesetContainer) - { - - } } public class OsuModSuddenDeath : ModSuddenDeath @@ -96,7 +167,6 @@ namespace osu.Game.Rulesets.Osu.Mods public class OsuModPerfect : ModPerfect { - } public class OsuModSpunOut : Mod diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs index a973d2b580..72ca9b37a8 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -6,8 +6,8 @@ using osu.Framework.Graphics; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; using OpenTK; -using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Osu.Judgements; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu.Objects.Drawables { @@ -21,12 +21,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private readonly NumberPiece number; private readonly GlowPiece glow; - public DrawableHitCircle(OsuHitObject h) : base(h) + public DrawableHitCircle(HitCircle h) : base(h) { Origin = Anchor.Centre; Position = HitObject.StackedPosition; - Scale = new Vector2(HitObject.Scale); + Scale = new Vector2(h.Scale); Children = new Drawable[] { @@ -48,7 +48,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables }, number = new NumberPiece { - Text = h is Spinner ? "S" : (HitObject.ComboIndex + 1).ToString(), + Text = (HitObject.ComboIndex + 1).ToString(), }, ring = new RingPiece(), flash = new FlashPiece(), @@ -88,25 +88,27 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { base.UpdatePreemptState(); - ApproachCircle.FadeIn(Math.Min(TIME_FADEIN * 2, TIME_PREEMPT)); + ApproachCircle.FadeIn(Math.Min(FadeInDuration * 2, TIME_PREEMPT)); ApproachCircle.ScaleTo(1.1f, TIME_PREEMPT); } protected override void UpdateCurrentState(ArmedState state) { - double duration = ((HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime) - HitObject.StartTime; - - glow.Delay(duration).FadeOut(400); + glow.FadeOut(400); switch (state) { case ArmedState.Idle: - this.Delay(duration + TIME_PREEMPT).FadeOut(TIME_FADEOUT); + this.Delay(TIME_PREEMPT).FadeOut(500); + Expire(true); + + // override lifetime end as FadeIn may have been changed externally, causing out expiration to be too early. + LifetimeEnd = HitObject.StartTime + HitObject.HitWindowFor(HitResult.Miss); break; case ArmedState.Miss: ApproachCircle.FadeOut(50); - this.FadeOut(TIME_FADEOUT / 5); + this.FadeOut(100); Expire(); break; case ArmedState.Hit: diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs index 3e0c23a1ab..f5f0300ae1 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -12,7 +12,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { public const float TIME_PREEMPT = 600; public const float TIME_FADEIN = 400; - public const float TIME_FADEOUT = 500; + + /// + /// The number of milliseconds used to fade in. + /// + public virtual double FadeInDuration { get; set; } = TIME_FADEIN; + + public override bool IsPresent => base.IsPresent || State.Value == ArmedState.Idle && Time.Current >= HitObject.StartTime - TIME_PREEMPT; protected DrawableOsuHitObject(OsuHitObject hitObject) : base(hitObject) @@ -37,10 +43,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } } - protected virtual void UpdatePreemptState() - { - this.FadeIn(TIME_FADEIN); - } + protected virtual void UpdatePreemptState() => this.FadeIn(FadeInDuration); protected virtual void UpdateCurrentState(ArmedState state) { diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs index 7755a54e88..f16a41519e 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs @@ -2,10 +2,10 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; -using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Osu.Judgements; using OpenTK; using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu.Objects.Drawables { @@ -24,4 +24,4 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables base.LoadComplete(); } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index a9b63ea642..477ced01c6 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -7,6 +7,7 @@ using osu.Game.Rulesets.Objects.Drawables; using OpenTK; using osu.Game.Graphics; using osu.Game.Rulesets.Osu.Judgements; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu.Objects.Drawables { @@ -24,19 +25,17 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables this.repeatPoint = repeatPoint; this.drawableSlider = drawableSlider; - AutoSizeAxes = Axes.Both; + Size = new Vector2(32 * repeatPoint.Scale); + Blending = BlendingMode.Additive; Origin = Anchor.Centre; - Scale = new Vector2(0.5f); Children = new Drawable[] { new SpriteIcon { - Icon = FontAwesome.fa_eercast, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Size = new Vector2(32), + RelativeSizeAxes = Axes.Both, + Icon = FontAwesome.fa_eercast } }; } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index befe84e3e9..f32a027f2e 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -10,6 +10,7 @@ using System.Linq; using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Osu.Judgements; using osu.Framework.Graphics.Primitives; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu.Objects.Drawables { @@ -17,23 +18,24 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { private readonly Slider slider; - private readonly DrawableHitCircle initialCircle; + public readonly DrawableHitCircle InitialCircle; private readonly List components = new List(); private readonly Container ticks; private readonly Container repeatPoints; - private readonly SliderBody body; - private readonly SliderBall ball; + public readonly SliderBody Body; + public readonly SliderBall Ball; - public DrawableSlider(Slider s) : base(s) + public DrawableSlider(Slider s) + : base(s) { slider = s; Children = new Drawable[] { - body = new SliderBody(s) + Body = new SliderBody(s) { AccentColour = AccentColour, Position = s.StackedPosition, @@ -41,16 +43,15 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables }, ticks = new Container(), repeatPoints = new Container(), - ball = new SliderBall(s) + Ball = new SliderBall(s) { Scale = new Vector2(s.Scale), AccentColour = AccentColour, AlwaysPresent = true, Alpha = 0 }, - initialCircle = new DrawableHitCircle(new HitCircle + InitialCircle = new DrawableHitCircle(new HitCircle { - //todo: avoid creating this temporary HitCircle. StartTime = s.StartTime, Position = s.StackedPosition, ComboIndex = s.ComboIndex, @@ -61,16 +62,16 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables }) }; - components.Add(body); - components.Add(ball); + components.Add(Body); + components.Add(Ball); - AddNested(initialCircle); + AddNested(InitialCircle); var repeatDuration = s.Curve.Distance / s.Velocity; foreach (var tick in s.NestedHitObjects.OfType()) { var repeatStartTime = s.StartTime + tick.RepeatIndex * repeatDuration; - var fadeInTime = repeatStartTime + (tick.StartTime - repeatStartTime) / 2 - (tick.RepeatIndex == 0 ? TIME_FADEIN : TIME_FADEIN / 2); + var fadeInTime = repeatStartTime + (tick.StartTime - repeatStartTime) / 2 - (tick.RepeatIndex == 0 ? FadeInDuration : FadeInDuration / 2); var fadeOutTime = repeatStartTime + repeatDuration; var drawableTick = new DrawableSliderTick(tick) @@ -87,7 +88,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables foreach (var repeatPoint in s.NestedHitObjects.OfType()) { var repeatStartTime = s.StartTime + repeatPoint.RepeatIndex * repeatDuration; - var fadeInTime = repeatStartTime + (repeatPoint.StartTime - repeatStartTime) / 2 - (repeatPoint.RepeatIndex == 0 ? TIME_FADEIN : TIME_FADEIN / 2); + var fadeInTime = repeatStartTime + (repeatPoint.StartTime - repeatStartTime) / 2 - (repeatPoint.RepeatIndex == 0 ? FadeInDuration : FadeInDuration / 2); var fadeOutTime = repeatStartTime + repeatDuration; var drawableRepeatPoint = new DrawableRepeatPoint(repeatPoint, this) @@ -105,11 +106,17 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private int currentRepeat; public bool Tracking; + public override double FadeInDuration + { + get { return base.FadeInDuration; } + set { InitialCircle.FadeInDuration = base.FadeInDuration = value; } + } + protected override void Update() { base.Update(); - Tracking = ball.Tracking; + Tracking = Ball.Tracking; double progress = MathHelper.Clamp((Time.Current - slider.StartTime) / slider.Duration, 0, 1); @@ -117,18 +124,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables progress = slider.ProgressAt(progress); if (repeat > currentRepeat) - { - if (repeat < slider.RepeatCount && ball.Tracking) - PlaySamples(); currentRepeat = repeat; - } //todo: we probably want to reconsider this before adding scoring, but it looks and feels nice. - if (!initialCircle.Judgements.Any(j => j.IsHit)) - initialCircle.Position = slider.Curve.PositionAt(progress); + if (!InitialCircle.Judgements.Any(j => j.IsHit)) + InitialCircle.Position = slider.Curve.PositionAt(progress); foreach (var c in components) c.UpdateProgress(progress, repeat); - foreach (var t in ticks.Children) t.Tracking = ball.Tracking; + foreach (var t in ticks.Children) t.Tracking = Ball.Tracking; } protected override void CheckForJudgements(bool userTriggered, double timeOffset) @@ -137,13 +140,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { var judgementsCount = ticks.Children.Count + repeatPoints.Children.Count + 1; var judgementsHit = ticks.Children.Count(t => t.Judgements.Any(j => j.IsHit)) + repeatPoints.Children.Count(t => t.Judgements.Any(j => j.IsHit)); - if (initialCircle.Judgements.Any(j => j.IsHit)) + if (InitialCircle.Judgements.Any(j => j.IsHit)) judgementsHit++; var hitFraction = (double)judgementsHit / judgementsCount; - if (hitFraction == 1 && initialCircle.Judgements.Any(j => j.Result == HitResult.Great)) + if (hitFraction == 1 && InitialCircle.Judgements.Any(j => j.Result == HitResult.Great)) AddJudgement(new OsuJudgement { Result = HitResult.Great }); - else if (hitFraction >= 0.5 && initialCircle.Judgements.Any(j => j.Result >= HitResult.Good)) + else if (hitFraction >= 0.5 && InitialCircle.Judgements.Any(j => j.Result >= HitResult.Good)) AddJudgement(new OsuJudgement { Result = HitResult.Good }); else if (hitFraction > 0) AddJudgement(new OsuJudgement { Result = HitResult.Meh }); @@ -154,26 +157,30 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables protected override void UpdateCurrentState(ArmedState state) { - ball.FadeIn(); + Ball.FadeIn(); + Ball.ScaleTo(HitObject.Scale); using (BeginDelayedSequence(slider.Duration, true)) { - body.FadeOut(160); - ball.FadeOut(160); + const float fade_out_time = 450; - this.FadeOut(800) - .Expire(); + // intentionally pile on an extra FadeOut to make it happen much faster. + Ball.FadeOut(fade_out_time / 4, Easing.Out); + + switch (state) + { + case ArmedState.Hit: + Ball.ScaleTo(HitObject.Scale * 1.4f, fade_out_time, Easing.Out); + break; + } + + this.FadeOut(fade_out_time, Easing.OutQuint).Expire(); } } - public Drawable ProxiedLayer => initialCircle.ApproachCircle; + public Drawable ProxiedLayer => InitialCircle.ApproachCircle; - public override Vector2 SelectionPoint => ToScreenSpace(body.Position); - public override Quad SelectionQuad => body.PathDrawQuad; - } - - internal interface ISliderProgress - { - void UpdateProgress(double progress, int repeat); + public override Vector2 SelectionPoint => ToScreenSpace(Body.Position); + public override Quad SelectionQuad => Body.PathDrawQuad; } } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs index 7199691ae6..bce7ef6141 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -8,6 +8,7 @@ using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics.Shapes; using osu.Game.Rulesets.Osu.Judgements; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu.Objects.Drawables { diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index 054a2067ec..bbe6b3a0a0 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -13,20 +13,21 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Allocation; using osu.Game.Rulesets.Osu.Judgements; using osu.Game.Screens.Ranking; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu.Objects.Drawables { public class DrawableSpinner : DrawableOsuHitObject { - private readonly Spinner spinner; + protected readonly Spinner Spinner; - private readonly SpinnerDisc disc; - private readonly SpinnerTicks ticks; + public readonly SpinnerDisc Disc; + public readonly SpinnerTicks Ticks; private readonly SpinnerSpmCounter spmCounter; private readonly Container mainContainer; - private readonly SpinnerBackground background; + public readonly SpinnerBackground Background; private readonly Container circleContainer; private readonly CirclePiece circle; private readonly GlowPiece glow; @@ -49,7 +50,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables // we are slightly bigger than our parent, to clip the top and bottom of the circle Height = 1.3f; - spinner = s; + Spinner = s; Children = new Drawable[] { @@ -84,20 +85,20 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables RelativeSizeAxes = Axes.Y, Children = new Drawable[] { - background = new SpinnerBackground + Background = new SpinnerBackground { Alpha = 0.6f, Anchor = Anchor.Centre, Origin = Anchor.Centre, }, - disc = new SpinnerDisc(spinner) + Disc = new SpinnerDisc(Spinner) { Scale = Vector2.Zero, Anchor = Anchor.Centre, Origin = Anchor.Centre, }, circleContainer.CreateProxy(), - ticks = new SpinnerTicks + Ticks = new SpinnerTicks { Anchor = Anchor.Centre, Origin = Anchor.Centre, @@ -114,28 +115,28 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables }; } - public float Progress => MathHelper.Clamp(disc.RotationAbsolute / 360 / spinner.SpinsRequired, 0, 1); + public float Progress => MathHelper.Clamp(Disc.RotationAbsolute / 360 / Spinner.SpinsRequired, 0, 1); protected override void CheckForJudgements(bool userTriggered, double timeOffset) { if (Time.Current < HitObject.StartTime) return; - if (Progress >= 1 && !disc.Complete) + if (Progress >= 1 && !Disc.Complete) { - disc.Complete = true; + Disc.Complete = true; const float duration = 200; - disc.FadeAccent(completeColour, duration); + Disc.FadeAccent(completeColour, duration); - background.FadeAccent(completeColour, duration); - background.FadeOut(duration); + Background.FadeAccent(completeColour, duration); + Background.FadeOut(duration); circle.FadeColour(completeColour, duration); glow.FadeColour(completeColour, duration); } - if (!userTriggered && Time.Current >= spinner.EndTime) + if (!userTriggered && Time.Current >= Spinner.EndTime) { if (Progress >= 1) AddJudgement(new OsuJudgement { Result = HitResult.Great }); @@ -143,7 +144,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables AddJudgement(new OsuJudgement { Result = HitResult.Good }); else if (Progress > .75) AddJudgement(new OsuJudgement { Result = HitResult.Meh }); - else if (Time.Current >= spinner.EndTime) + else if (Time.Current >= Spinner.EndTime) AddJudgement(new OsuJudgement { Result = HitResult.Miss }); } } @@ -153,20 +154,20 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { normalColour = baseColour; - background.AccentColour = normalColour; + Background.AccentColour = normalColour; completeColour = colours.YellowLight.Opacity(0.75f); - disc.AccentColour = fillColour; + Disc.AccentColour = fillColour; circle.Colour = colours.BlueDark; glow.Colour = colours.BlueDark; } protected override void Update() { - disc.Tracking = OsuActionInputManager.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton); - if (!spmCounter.IsPresent && disc.Tracking) - spmCounter.FadeIn(TIME_FADEIN); + Disc.Tracking = OsuActionInputManager.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton); + if (!spmCounter.IsPresent && Disc.Tracking) + spmCounter.FadeIn(FadeInDuration); base.Update(); } @@ -175,36 +176,36 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { base.UpdateAfterChildren(); - circle.Rotation = disc.Rotation; - ticks.Rotation = disc.Rotation; - spmCounter.SetRotation(disc.RotationAbsolute); + circle.Rotation = Disc.Rotation; + Ticks.Rotation = Disc.Rotation; + spmCounter.SetRotation(Disc.RotationAbsolute); - float relativeCircleScale = spinner.Scale * circle.DrawHeight / mainContainer.DrawHeight; - disc.ScaleTo(relativeCircleScale + (1 - relativeCircleScale) * Progress, 200, Easing.OutQuint); + float relativeCircleScale = Spinner.Scale * circle.DrawHeight / mainContainer.DrawHeight; + Disc.ScaleTo(relativeCircleScale + (1 - relativeCircleScale) * Progress, 200, Easing.OutQuint); - symbol.RotateTo(disc.Rotation / 2, 500, Easing.OutQuint); + symbol.RotateTo(Disc.Rotation / 2, 500, Easing.OutQuint); } protected override void UpdatePreemptState() { base.UpdatePreemptState(); - circleContainer.ScaleTo(spinner.Scale * 0.3f); - circleContainer.ScaleTo(spinner.Scale, TIME_PREEMPT / 1.4f, Easing.OutQuint); + circleContainer.ScaleTo(Spinner.Scale * 0.3f); + circleContainer.ScaleTo(Spinner.Scale, TIME_PREEMPT / 1.4f, Easing.OutQuint); - disc.RotateTo(-720); + Disc.RotateTo(-720); symbol.RotateTo(-720); mainContainer .ScaleTo(0) - .ScaleTo(spinner.Scale * circle.DrawHeight / DrawHeight * 1.4f, TIME_PREEMPT - 150, Easing.OutQuint) + .ScaleTo(Spinner.Scale * circle.DrawHeight / DrawHeight * 1.4f, TIME_PREEMPT - 150, Easing.OutQuint) .Then() .ScaleTo(1, 500, Easing.OutQuint); } protected override void UpdateCurrentState(ArmedState state) { - var sequence = this.Delay(spinner.Duration).FadeOut(160); + var sequence = this.Delay(Spinner.Duration).FadeOut(160); switch (state) { diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs index 2068ad9205..46b4353f9a 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces } private readonly Slider slider; - private readonly Box follow; + public readonly Box FollowCircle; private readonly Box ball; public SliderBall(Slider slider) @@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces Children = new Drawable[] { - follow = new Box + FollowCircle = new Box { Origin = Anchor.Centre, Anchor = Anchor.Centre, @@ -101,11 +101,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces // If the current time is between the start and end of the slider, we should track mouse input regardless of the cursor position. public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => canCurrentlyTrack || base.ReceiveMouseInputAt(screenSpacePos); - public override void ClearTransforms(bool propagateChildren = false, string targetMember = null) + public override void ClearTransformsAfter(double time, bool propagateChildren = false, string targetMember = null) { // Consider the case of rewinding - children's transforms are handled internally, so propagating down // any further will cause weirdness with the Tracking bool below. Let's not propagate further at this point. - base.ClearTransforms(false, targetMember); + base.ClearTransformsAfter(time, false, targetMember); } private bool tracking; @@ -118,8 +118,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces return; tracking = value; - follow.ScaleTo(tracking ? 2.8f : 1, 300, Easing.OutQuint); - follow.FadeTo(tracking ? 0.2f : 0, 300, Easing.OutQuint); + FollowCircle.ScaleTo(tracking ? 2.8f : 1, 300, Easing.OutQuint); + FollowCircle.FadeTo(tracking ? 0.2f : 0, 300, Easing.OutQuint); } } @@ -129,11 +129,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { base.Update(); - // Make sure to use the base version of ReceiveMouseInputAt so that we correctly check the position. - Tracking = canCurrentlyTrack - && lastState != null - && base.ReceiveMouseInputAt(lastState.Mouse.NativeState.Position) - && ((Parent as DrawableSlider)?.OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false); + if (Time.Current < slider.EndTime) + { + // Make sure to use the base version of ReceiveMouseInputAt so that we correctly check the position. + Tracking = canCurrentlyTrack + && lastState != null + && base.ReceiveMouseInputAt(lastState.Mouse.NativeState.Position) + && ((Parent as DrawableSlider)?.OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false); + } } public void UpdateProgress(double progress, int repeat) @@ -141,4 +144,4 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces Position = slider.Curve.PositionAt(progress); } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs index ca75a61738..9f54ce3fa3 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs @@ -26,6 +26,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces private const float idle_alpha = 0.2f; private const float tracking_alpha = 0.4f; + public override bool IsPresent => true; // handle input when hidden + public SpinnerDisc(Spinner s) { spinner = s; diff --git a/osu.Game.Rulesets.Osu/Objects/ISliderProgress.cs b/osu.Game.Rulesets.Osu/Objects/ISliderProgress.cs new file mode 100644 index 0000000000..cb0d177a60 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Objects/ISliderProgress.cs @@ -0,0 +1,10 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Osu.Objects +{ + public interface ISliderProgress + { + void UpdateProgress(double progress, int repeat); + } +} diff --git a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs index 7532387aa2..a3a6527b31 100644 --- a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs @@ -7,7 +7,7 @@ using OpenTK; using osu.Game.Rulesets.Objects.Types; using OpenTK.Graphics; using osu.Game.Beatmaps.ControlPoints; -using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu.Objects { diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 5f9f11c783..ec51a10345 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -151,28 +151,22 @@ namespace osu.Game.Rulesets.Osu.Objects private void createRepeatPoints() { - var length = Curve.Distance; - var repeatPointDistance = Math.Min(Distance, length); - var repeatDuration = length / Velocity; + var repeatDuration = Distance / Velocity; for (var repeat = 1; repeat < RepeatCount; repeat++) { - for (var d = repeatPointDistance; d <= length; d += repeatPointDistance) - { - var repeatStartTime = StartTime + repeat * repeatDuration; - var distanceProgress = d / length; + var repeatStartTime = StartTime + repeat * repeatDuration; - AddNested(new RepeatPoint - { - RepeatIndex = repeat, - StartTime = repeatStartTime, - Position = Curve.PositionAt(distanceProgress), - StackHeight = StackHeight, - Scale = Scale, - ComboColour = ComboColour, - Samples = new List(RepeatSamples[repeat]) - }); - } + AddNested(new RepeatPoint + { + RepeatIndex = repeat, + StartTime = repeatStartTime, + Position = Curve.PositionAt(repeat % 2), + StackHeight = StackHeight, + Scale = Scale, + ComboColour = ComboColour, + Samples = new List(RepeatSamples[repeat]) + }); } } } diff --git a/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs b/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs index f82c6ce3b2..ba774e887f 100644 --- a/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs +++ b/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs @@ -9,9 +9,9 @@ using osu.Game.Rulesets.Osu.Objects.Drawables; using System; using System.Diagnostics; using osu.Framework.Graphics; -using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Replays; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu.Replays { diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs index 2cf321da50..38c602bc42 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs @@ -41,10 +41,10 @@ namespace osu.Game.Rulesets.Osu.Scoring mods = Score.Mods; accuracy = Score.Accuracy; scoreMaxCombo = Score.MaxCombo; - count300 = Convert.ToInt32(Score.Statistics["300"]); - count100 = Convert.ToInt32(Score.Statistics["100"]); - count50 = Convert.ToInt32(Score.Statistics["50"]); - countMiss = Convert.ToInt32(Score.Statistics["x"]); + count300 = Convert.ToInt32(Score.Statistics[HitResult.Great]); + count100 = Convert.ToInt32(Score.Statistics[HitResult.Good]); + count50 = Convert.ToInt32(Score.Statistics[HitResult.Meh]); + countMiss = Convert.ToInt32(Score.Statistics[HitResult.Miss]); // Don't count scores made with supposedly unranked mods if (mods.Any(m => !m.Ranked)) diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs index ad9737af52..7520e1801c 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs @@ -6,7 +6,6 @@ using System.Linq; using osu.Framework.Extensions; using osu.Game.Beatmaps; using osu.Game.Rulesets.Judgements; -using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Osu.Judgements; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Objects.Drawables; @@ -33,8 +32,7 @@ namespace osu.Game.Rulesets.Osu.Scoring foreach (var obj in beatmap.HitObjects) { - var slider = obj as Slider; - if (slider != null) + if (obj is Slider slider) { // Head AddJudgement(new OsuJudgement { Result = HitResult.Great }); @@ -64,10 +62,10 @@ namespace osu.Game.Rulesets.Osu.Scoring { base.PopulateScore(score); - score.Statistics[@"300"] = scoreResultCounts.GetOrDefault(HitResult.Great); - score.Statistics[@"100"] = scoreResultCounts.GetOrDefault(HitResult.Good); - score.Statistics[@"50"] = scoreResultCounts.GetOrDefault(HitResult.Meh); - score.Statistics[@"x"] = scoreResultCounts.GetOrDefault(HitResult.Miss); + score.Statistics[HitResult.Great] = scoreResultCounts.GetOrDefault(HitResult.Great); + score.Statistics[HitResult.Good] = scoreResultCounts.GetOrDefault(HitResult.Good); + score.Statistics[HitResult.Meh] = scoreResultCounts.GetOrDefault(HitResult.Meh); + score.Statistics[HitResult.Miss] = scoreResultCounts.GetOrDefault(HitResult.Miss); } protected override void OnNewJudgement(Judgement judgement) diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircle.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircle.cs new file mode 100644 index 0000000000..f307ff7c70 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircle.cs @@ -0,0 +1,117 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using NUnit.Framework; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Beatmaps; +using osu.Game.Beatmaps.ControlPoints; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.Objects.Drawables; +using osu.Game.Tests.Visual; +using OpenTK; +using OpenTK.Graphics; +using osu.Game.Rulesets.Osu.Judgements; +using System.Collections.Generic; +using System; +using osu.Game.Rulesets.Mods; +using System.Linq; +using osu.Game.Rulesets.Scoring; + +namespace osu.Game.Rulesets.Osu.Tests +{ + [Ignore("getting CI working")] + public class TestCaseHitCircle : OsuTestCase + { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(DrawableHitCircle) + }; + + private readonly Container content; + protected override Container Content => content; + + private int depthIndex; + protected readonly List Mods = new List(); + + public TestCaseHitCircle() + { + base.Content.Add(content = new OsuInputManager(new RulesetInfo { ID = 0 })); + + AddStep("Miss Big Single", () => testSingle(2)); + AddStep("Miss Medium Single", () => testSingle(5)); + AddStep("Miss Small Single", () => testSingle(7)); + AddStep("Hit Big Single", () => testSingle(2, true)); + AddStep("Hit Medium Single", () => testSingle(5, true)); + AddStep("Hit Small Single", () => testSingle(7, true)); + AddStep("Miss Big Stream", () => testStream(2)); + AddStep("Miss Medium Stream", () => testStream(5)); + AddStep("Miss Small Stream", () => testStream(7)); + AddStep("Hit Big Stream", () => testStream(2, true)); + AddStep("Hit Medium Stream", () => testStream(5, true)); + AddStep("Hit Small Stream", () => testStream(7, true)); + } + + private void testSingle(float circleSize, bool auto = false, double timeOffset = 0, Vector2? positionOffset = null) + { + positionOffset = positionOffset ?? Vector2.Zero; + + var circle = new HitCircle + { + StartTime = Time.Current + 1000 + timeOffset, + Position = positionOffset.Value, + ComboColour = Color4.LightSeaGreen + }; + + circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = circleSize }); + + var drawable = new TestDrawableHitCircle(circle, auto) + { + Anchor = Anchor.Centre, + Depth = depthIndex++ + }; + + foreach (var mod in Mods.OfType()) + mod.ApplyToDrawableHitObjects(new[] { drawable }); + + Add(drawable); + } + + private void testStream(float circleSize, bool auto = false) + { + Vector2 pos = new Vector2(-250, 0); + + for (int i = 0; i <= 1000; i += 100) + { + testSingle(circleSize, auto, i, pos); + pos.X += 50; + } + } + + private class TestDrawableHitCircle : DrawableHitCircle + { + private readonly bool auto; + + public TestDrawableHitCircle(HitCircle h, bool auto) : base(h) + { + this.auto = auto; + } + + protected override void CheckForJudgements(bool userTriggered, double timeOffset) + { + if (auto && !userTriggered && timeOffset > 0) + { + // force success + AddJudgement(new OsuJudgement + { + Result = HitResult.Great + }); + State.Value = ArmedState.Hit; + } + else + base.CheckForJudgements(userTriggered, timeOffset); + } + } + } +} diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircleHidden.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircleHidden.cs new file mode 100644 index 0000000000..7cc0c343a2 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircleHidden.cs @@ -0,0 +1,22 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Linq; +using NUnit.Framework; +using osu.Game.Rulesets.Osu.Mods; + +namespace osu.Game.Rulesets.Osu.Tests +{ + [Ignore("getting CI working")] + public class TestCaseHitCircleHidden : TestCaseHitCircle + { + public override IReadOnlyList RequiredTypes => base.RequiredTypes.Concat(new[] { typeof(OsuModHidden) }).ToList(); + + public TestCaseHitCircleHidden() + { + Mods.Add(new OsuModHidden()); + } + } +} diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseHitObjects.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseHitObjects.cs deleted file mode 100644 index c4932d7803..0000000000 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseHitObjects.cs +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System.Collections.Generic; -using NUnit.Framework; -using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Timing; -using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Rulesets.Osu.Objects; -using osu.Game.Rulesets.Osu.Objects.Drawables; -using osu.Game.Tests.Visual; -using OpenTK; - -namespace osu.Game.Rulesets.Osu.Tests -{ - [TestFixture] - [Ignore("getting CI working")] - public class TestCaseHitObjects : OsuTestCase - { - private FramedClock framedClock; - - private bool auto; - - [BackgroundDependencyLoader] - private void load(RulesetStore rulesets) - { - var rateAdjustClock = new StopwatchClock(true); - framedClock = new FramedClock(rateAdjustClock); - - AddStep(@"circles", () => loadHitobjects(HitObjectType.Circle)); - AddStep(@"slider", () => loadHitobjects(HitObjectType.Slider)); - AddStep(@"spinner", () => loadHitobjects(HitObjectType.Spinner)); - - AddToggleStep("Auto", state => { auto = state; loadHitobjects(mode); }); - AddSliderStep("Playback speed", 0.0, 2.0, 0.5, v => rateAdjustClock.Rate = v); - - framedClock.ProcessFrame(); - - var clockAdjustContainer = new Container - { - RelativeSizeAxes = Axes.Both, - Clock = framedClock, - Children = new[] - { - playfieldContainer = new OsuInputManager(rulesets.GetRuleset(0)) { RelativeSizeAxes = Axes.Both }, - approachContainer = new Container { RelativeSizeAxes = Axes.Both } - } - }; - - Add(clockAdjustContainer); - } - - private HitObjectType mode = HitObjectType.Slider; - - private Container playfieldContainer; - private Container approachContainer; - - private void loadHitobjects(HitObjectType mode) - { - this.mode = mode; - - switch (mode) - { - case HitObjectType.Circle: - const int count = 10; - - for (int i = 0; i < count; i++) - { - var h = new HitCircle - { - StartTime = framedClock.CurrentTime + 600 + i * 80, - Position = new Vector2((i - count / 2) * 14), - }; - - add(new DrawableHitCircle(h)); - } - break; - case HitObjectType.Slider: - add(new DrawableSlider(new Slider - { - StartTime = framedClock.CurrentTime + 600, - ControlPoints = new List - { - new Vector2(-200, 0), - new Vector2(400, 0), - }, - Distance = 400, - Position = new Vector2(-200, 0), - Velocity = 1, - TickDistance = 100, - })); - break; - case HitObjectType.Spinner: - add(new DrawableSpinner(new Spinner - { - StartTime = framedClock.CurrentTime + 600, - EndTime = framedClock.CurrentTime + 1600, - Position = new Vector2(0, 0), - })); - break; - } - } - - private int depth; - - private void add(DrawableOsuHitObject h) - { - h.Anchor = Anchor.Centre; - h.Depth = depth++; - - if (auto) - h.State.Value = ArmedState.Hit; - - playfieldContainer.Add(h); - var proxyable = h as IDrawableHitObjectWithProxiedApproach; - if (proxyable != null) - approachContainer.Add(proxyable.ProxiedLayer.CreateProxy()); - } - - private enum HitObjectType - { - Circle, - Slider, - Spinner - } - } -} diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs new file mode 100644 index 0000000000..1238572484 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs @@ -0,0 +1,152 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using NUnit.Framework; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Audio; +using osu.Game.Beatmaps; +using osu.Game.Beatmaps.ControlPoints; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.Objects.Drawables; +using osu.Game.Tests.Visual; +using OpenTK; +using OpenTK.Graphics; +using osu.Game.Rulesets.Mods; +using System.Linq; +using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; + +namespace osu.Game.Rulesets.Osu.Tests +{ + [Ignore("getting CI working")] + public class TestCaseSlider : OsuTestCase + { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(SliderBall), + typeof(SliderBody), + typeof(DrawableSlider), + typeof(DrawableRepeatPoint), + typeof(DrawableOsuHitObject) + }; + + private readonly Container content; + protected override Container Content => content; + + private int depthIndex; + protected readonly List Mods = new List(); + + public TestCaseSlider() + { + base.Content.Add(content = new OsuInputManager(new RulesetInfo { ID = 0 })); + + AddStep("Big Single", () => testSimpleBig()); + AddStep("Medium Single", () => testSimpleMedium()); + AddStep("Small Single", () => testSimpleSmall()); + AddStep("Big 1 Repeat", () => testSimpleBig(1)); + AddStep("Medium 1 Repeat", () => testSimpleMedium(1)); + AddStep("Small 1 Repeat", () => testSimpleSmall(1)); + AddStep("Big 2 Repeats", () => testSimpleBig(2)); + AddStep("Medium 2 Repeats", () => testSimpleMedium(2)); + AddStep("Small 2 Repeats", () => testSimpleSmall(2)); + + AddStep("Slow Slider", testSlowSpeed); // slow long sliders take ages already so no repeat steps + AddStep("Slow Short Slider", () => testShortSlowSpeed()); + AddStep("Slow Short Slider 1 Repeats", () => testShortSlowSpeed(1)); + AddStep("Slow Short Slider 2 Repeats", () => testShortSlowSpeed(2)); + + AddStep("Fast Slider", () => testHighSpeed()); + AddStep("Fast Slider 1 Repeat", () => testHighSpeed(1)); + AddStep("Fast Slider 2 Repeats", () => testHighSpeed(2)); + AddStep("Fast Short Slider", () => testShortHighSpeed()); + AddStep("Fast Short Slider 1 Repeat", () => testShortHighSpeed(1)); + AddStep("Fast Short Slider 2 Repeats", () => testShortHighSpeed(2)); + + AddStep("Perfect Curve", testCurve); + // TODO more curve types? + } + + private void testSimpleBig(int repeats = 0) => createSlider(2, repeats: repeats); + + private void testSimpleMedium(int repeats = 0) => createSlider(5, repeats: repeats); + + private void testSimpleSmall(int repeats = 0) => createSlider(7, repeats: repeats); + + private void testSlowSpeed() => createSlider(speedMultiplier: 0.5); + + private void testShortSlowSpeed(int repeats = 0) => createSlider(distance: 100, repeats: repeats, speedMultiplier: 0.5); + + private void testHighSpeed(int repeats = 0) => createSlider(repeats: repeats, speedMultiplier: 15); + + private void testShortHighSpeed(int repeats = 0) => createSlider(distance: 100, repeats: repeats, speedMultiplier: 15); + + private void createSlider(float circleSize = 2, float distance = 400, int repeats = 0, double speedMultiplier = 2) + { + repeats++; // The first run through the slider is considered a repeat + + var repeatSamples = new List>(); + if (repeats > 1) + { + for (int i = 0; i < repeats; i++) + repeatSamples.Add(new List()); + } + + var slider = new Slider + { + StartTime = Time.Current + 1000, + Position = new Vector2(-(distance / 2), 0), + ComboColour = Color4.LightSeaGreen, + ControlPoints = new List + { + new Vector2(-(distance / 2), 0), + new Vector2(distance / 2, 0), + }, + Distance = distance, + RepeatCount = repeats, + RepeatSamples = repeatSamples + }; + + addSlider(slider, circleSize, speedMultiplier); + } + + private void testCurve() + { + var slider = new Slider + { + StartTime = Time.Current + 1000, + Position = new Vector2(-200, 0), + ComboColour = Color4.LightSeaGreen, + ControlPoints = new List + { + new Vector2(-200, 0), + new Vector2(0, 200), + new Vector2(200, 0) + }, + Distance = 600 + }; + + addSlider(slider, 2, 3); + } + + private void addSlider(Slider slider, float circleSize, double speedMultiplier) + { + var cpi = new ControlPointInfo(); + cpi.DifficultyPoints.Add(new DifficultyControlPoint { SpeedMultiplier = speedMultiplier }); + + slider.ApplyDefaults(cpi, new BeatmapDifficulty { CircleSize = circleSize }); + + var drawable = new DrawableSlider(slider) + { + Anchor = Anchor.Centre, + Depth = depthIndex++ + }; + + foreach (var mod in Mods.OfType()) + mod.ApplyToDrawableHitObjects(new[] { drawable }); + + Add(drawable); + } + } +} diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSliderHidden.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSliderHidden.cs new file mode 100644 index 0000000000..016909ad73 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSliderHidden.cs @@ -0,0 +1,22 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Linq; +using NUnit.Framework; +using osu.Game.Rulesets.Osu.Mods; + +namespace osu.Game.Rulesets.Osu.Tests +{ + [Ignore("getting CI working")] + public class TestCaseSliderHidden : TestCaseSlider + { + public override IReadOnlyList RequiredTypes => base.RequiredTypes.Concat(new[] { typeof(OsuModHidden) }).ToList(); + + public TestCaseSliderHidden() + { + Mods.Add(new OsuModHidden()); + } + } +} diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSpinner.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSpinner.cs new file mode 100644 index 0000000000..752574018c --- /dev/null +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSpinner.cs @@ -0,0 +1,88 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Linq; +using NUnit.Framework; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Beatmaps; +using osu.Game.Beatmaps.ControlPoints; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.Objects.Drawables; +using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; +using osu.Game.Tests.Visual; + +namespace osu.Game.Rulesets.Osu.Tests +{ + [Ignore("getting CI working")] + public class TestCaseSpinner : OsuTestCase + { + public override IReadOnlyList RequiredTypes => new[] +{ + typeof(SpinnerDisc), + typeof(DrawableSpinner), + typeof(DrawableOsuHitObject) + }; + + private readonly Container content; + protected override Container Content => content; + + private int depthIndex; + protected readonly List Mods = new List(); + + public TestCaseSpinner() + { + base.Content.Add(content = new OsuInputManager(new RulesetInfo { ID = 0 })); + + AddStep("Miss Big", () => testSingle(2)); + AddStep("Miss Medium", () => testSingle(5)); + AddStep("Miss Small", () => testSingle(7)); + AddStep("Hit Big", () => testSingle(2, true)); + AddStep("Hit Medium", () => testSingle(5, true)); + AddStep("Hit Small", () => testSingle(7, true)); + } + + private void testSingle(float circleSize, bool auto = false) + { + var spinner = new Spinner { StartTime = Time.Current + 1000, EndTime = Time.Current + 4000 }; + + spinner.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = circleSize }); + + var drawable = new TestDrawableSpinner(spinner, auto) + { + Anchor = Anchor.Centre, + Depth = depthIndex++ + }; + + foreach (var mod in Mods.OfType()) + mod.ApplyToDrawableHitObjects(new[] { drawable }); + + Add(drawable); + } + + private class TestDrawableSpinner : DrawableSpinner + { + private bool auto; + + public TestDrawableSpinner(Spinner s, bool auto) : base(s) + { + this.auto = auto; + } + + protected override void CheckForJudgements(bool userTriggered, double timeOffset) + { + if (auto && !userTriggered && Time.Current > Spinner.StartTime + Spinner.Duration / 2 && Progress < 1) + { + // force completion only once to not break human interaction + Disc.RotationAbsolute = Spinner.SpinsRequired * 360; + auto = false; + } + + base.CheckForJudgements(userTriggered, timeOffset); + } + } + } +} diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSpinnerHidden.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSpinnerHidden.cs new file mode 100644 index 0000000000..9ef94b308f --- /dev/null +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSpinnerHidden.cs @@ -0,0 +1,22 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Linq; +using NUnit.Framework; +using osu.Game.Rulesets.Osu.Mods; + +namespace osu.Game.Rulesets.Osu.Tests +{ + [Ignore("getting CI working")] + public class TestCaseSpinnerHidden : TestCaseSpinner + { + public override IReadOnlyList RequiredTypes => base.RequiredTypes.Concat(new[] { typeof(OsuModHidden) }).ToList(); + + public TestCaseSpinnerHidden() + { + Mods.Add(new OsuModHidden()); + } + } +} diff --git a/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs b/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs index 7c9cbd63fc..f37b87e533 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs @@ -35,16 +35,13 @@ namespace osu.Game.Rulesets.Osu.UI protected override DrawableHitObject GetVisualRepresentation(OsuHitObject h) { - var circle = h as HitCircle; - if (circle != null) + if (h is HitCircle circle) return new DrawableHitCircle(circle); - var slider = h as Slider; - if (slider != null) + if (h is Slider slider) return new DrawableSlider(slider); - var spinner = h as Spinner; - if (spinner != null) + if (h is Spinner spinner) return new DrawableSpinner(spinner); return null; } diff --git a/osu.Game.Rulesets.Taiko/Audio/DrumSampleMapping.cs b/osu.Game.Rulesets.Taiko/Audio/DrumSampleMapping.cs index 9d0037b97a..982b339d3a 100644 --- a/osu.Game.Rulesets.Taiko/Audio/DrumSampleMapping.cs +++ b/osu.Game.Rulesets.Taiko/Audio/DrumSampleMapping.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; -using System.Linq; using osu.Framework.Audio; using osu.Framework.Audio.Sample; using osu.Game.Audio; @@ -13,7 +12,7 @@ namespace osu.Game.Rulesets.Taiko.Audio public class DrumSampleMapping { private readonly ControlPointInfo controlPoints; - private readonly Dictionary mappings = new Dictionary(); + private readonly Dictionary mappings = new Dictionary(); public DrumSampleMapping(ControlPointInfo controlPoints, AudioManager audio) { @@ -26,17 +25,17 @@ namespace osu.Game.Rulesets.Taiko.Audio else samplePoints = controlPoints.SamplePoints; - foreach (var s in samplePoints.Distinct()) + foreach (var s in samplePoints) { - mappings[s] = new DrumSample + mappings[s.Time] = new DrumSample { - Centre = s.GetSampleInfo().GetChannel(audio.Sample), - Rim = s.GetSampleInfo(SampleInfo.HIT_CLAP).GetChannel(audio.Sample) + Centre = s.GetSampleInfo().GetChannel(audio.Sample, "Taiko"), + Rim = s.GetSampleInfo(SampleInfo.HIT_CLAP).GetChannel(audio.Sample, "Taiko") }; } } - public DrumSample SampleAt(double time) => mappings[controlPoints.SamplePointAt(time)]; + public DrumSample SampleAt(double time) => mappings[controlPoints.SamplePointAt(time).Time]; public class DrumSample { diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs index c9daef8c99..ce5be8d148 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Taiko.Judgements { @@ -20,4 +20,4 @@ namespace osu.Game.Rulesets.Taiko.Judgements } } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs index 3cd134f3f7..70cdd1fe0e 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Judgements; -using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Taiko.Judgements { diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs index 75e988ced6..f5bafefd0b 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs @@ -13,6 +13,7 @@ using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Taiko.Objects.Drawables { diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs index e662f61bbe..a741e35963 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs @@ -4,6 +4,7 @@ using System; using osu.Framework.Graphics; using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Taiko.Judgements; using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index fd35f0eaec..0c10c7142e 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -5,6 +5,7 @@ using System; using System.Linq; using osu.Framework.Graphics; using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Taiko.Judgements; using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHitStrong.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHitStrong.cs index cda82afe0e..249bb41d91 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHitStrong.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHitStrong.cs @@ -3,7 +3,7 @@ using System; using System.Linq; -using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Taiko.Judgements; namespace osu.Game.Rulesets.Taiko.Objects.Drawables diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs index 5ca33aaea2..26e6585fb9 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs @@ -14,6 +14,7 @@ using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics.Shapes; using osu.Game.Rulesets.Taiko.Judgements; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Taiko.Objects.Drawables { diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs index 92da3fe09e..cc7dd2fa0f 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs @@ -41,6 +41,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables // Normal and clap samples are handled by the drum protected override IEnumerable GetSamples() => HitObject.Samples.Where(s => s.Name != SampleInfo.HIT_NORMAL && s.Name != SampleInfo.HIT_CLAP); + protected override string SampleNamespace => "Taiko"; + protected virtual TaikoPiece CreateMainPiece() => new CirclePiece(); public abstract bool OnPressed(TaikoAction action); diff --git a/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs index 5a566fd091..a39d627cc4 100644 --- a/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs +++ b/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs @@ -3,9 +3,6 @@ using osu.Game.Rulesets.Objects.Types; using System; -using System.Collections.Generic; -using System.Linq; -using osu.Game.Audio; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; @@ -75,13 +72,7 @@ namespace osu.Game.Rulesets.Taiko.Objects FirstTick = first, TickSpacing = tickSpacing, StartTime = t, - IsStrong = IsStrong, - Samples = new List(Samples.Select(s => new SampleInfo - { - Bank = s.Bank, - Name = @"slidertick", - Volume = s.Volume - })) + IsStrong = IsStrong }); first = false; diff --git a/osu.Game.Rulesets.Taiko/Replays/TaikoAutoGenerator.cs b/osu.Game.Rulesets.Taiko/Replays/TaikoAutoGenerator.cs index df1a19267f..c43899ebf1 100644 --- a/osu.Game.Rulesets.Taiko/Replays/TaikoAutoGenerator.cs +++ b/osu.Game.Rulesets.Taiko/Replays/TaikoAutoGenerator.cs @@ -86,7 +86,7 @@ namespace osu.Game.Rulesets.Taiko.Replays { foreach (var tick in drumRoll.NestedHitObjects.OfType()) { - Frames.Add(new ReplayFrame(tick.StartTime, null, null, hitButton ? ReplayButtonState.Left1 : ReplayButtonState.Left2)); + Frames.Add(new ReplayFrame(tick.StartTime, null, null, hitButton ? ReplayButtonState.Right1 : ReplayButtonState.Right2)); hitButton = !hitButton; } } diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index df9ce5e2eb..3848e36fc9 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -4,7 +4,6 @@ using System.Linq; using osu.Game.Beatmaps; using osu.Game.Rulesets.Judgements; -using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Taiko.Judgements; using osu.Game.Rulesets.Taiko.Objects; diff --git a/osu.Game.Rulesets.Taiko/Tests/TestCaseInputDrum.cs b/osu.Game.Rulesets.Taiko/Tests/TestCaseInputDrum.cs new file mode 100644 index 0000000000..172c6e9d84 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Tests/TestCaseInputDrum.cs @@ -0,0 +1,44 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using NUnit.Framework; +using OpenTK; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Audio; +using osu.Game.Beatmaps.ControlPoints; +using osu.Game.Rulesets.Taiko.Audio; +using osu.Game.Rulesets.Taiko.UI; +using osu.Game.Tests.Visual; + +namespace osu.Game.Rulesets.Taiko.Tests +{ + [Ignore("getting CI working")] + public class TestCaseInputDrum : OsuTestCase + { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(InputDrum), + typeof(DrumSampleMapping), + typeof(SampleInfo), + typeof(SampleControlPoint) + }; + + public TestCaseInputDrum() + { + Add(new TaikoInputManager(new RulesetInfo { ID = 1 }) + { + RelativeSizeAxes = Axes.Both, + Child = new Container + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Size = new Vector2(200), + Child = new InputDrum(new ControlPointInfo()) + } + }); + } + } +} diff --git a/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs index b1e6e9c4ce..1f13864c2a 100644 --- a/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs @@ -20,6 +20,7 @@ using osu.Game.Rulesets.Taiko.UI; using osu.Game.Tests.Beatmaps; using osu.Game.Tests.Visual; using OpenTK; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Taiko.Tests { diff --git a/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs b/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs index 41b66c286b..0b67613ec3 100644 --- a/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs +++ b/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs @@ -6,6 +6,7 @@ using osu.Framework.Allocation; using osu.Game.Graphics; using osu.Game.Rulesets.Judgements; using osu.Framework.Graphics; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Taiko.UI { @@ -49,4 +50,4 @@ namespace osu.Game.Rulesets.Taiko.UI base.LoadComplete(); } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Taiko/UI/InputDrum.cs b/osu.Game.Rulesets.Taiko/UI/InputDrum.cs index bf1274256b..9b2ea095d2 100644 --- a/osu.Game.Rulesets.Taiko/UI/InputDrum.cs +++ b/osu.Game.Rulesets.Taiko/UI/InputDrum.cs @@ -152,14 +152,14 @@ namespace osu.Game.Rulesets.Taiko.UI target = centreHit; back = centre; - drumSample.Centre.Play(); + drumSample.Centre?.Play(); } else if (action == RimAction) { target = rimHit; back = rim; - drumSample.Rim.Play(); + drumSample.Rim?.Play(); } if (target != null) diff --git a/osu.Game.Tests/Beatmaps/Formats/LegacyStoryboardDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/LegacyStoryboardDecoderTest.cs index 839932c640..a0904ee446 100644 --- a/osu.Game.Tests/Beatmaps/Formats/LegacyStoryboardDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/LegacyStoryboardDecoderTest.cs @@ -70,7 +70,7 @@ namespace osu.Game.Tests.Beatmaps.Formats Assert.AreEqual(new Vector2(320, 240), sprite.InitialPosition); Assert.IsTrue(sprite.IsDrawable); Assert.AreEqual(Anchor.Centre, sprite.Origin); - Assert.AreEqual("SB/lyric/ja-21.png", sprite.Path); + Assert.AreEqual(Path.Combine("SB", "lyric", "ja-21.png"), sprite.Path); var animation = background.Elements.ElementAt(12) as StoryboardAnimation; Assert.NotNull(animation); @@ -82,7 +82,7 @@ namespace osu.Game.Tests.Beatmaps.Formats Assert.IsTrue(animation.IsDrawable); Assert.AreEqual(AnimationLoopType.LoopForever, animation.LoopType); Assert.AreEqual(Anchor.Centre, animation.Origin); - Assert.AreEqual("SB/red jitter/red_0000.jpg", animation.Path); + Assert.AreEqual(Path.Combine("SB", "red jitter", "red_0000.jpg"), animation.Path); Assert.AreEqual(78993, animation.StartTime); } } diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs index cef8797f20..ad15833569 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs @@ -160,9 +160,9 @@ namespace osu.Game.Tests.Visual }; foreach(var s in scores) { - s.Statistics.Add("300", RNG.Next(2000)); - s.Statistics.Add("100", RNG.Next(2000)); - s.Statistics.Add("50", RNG.Next(2000)); + s.Statistics.Add(HitResult.Great, RNG.Next(2000)); + s.Statistics.Add(HitResult.Good, RNG.Next(2000)); + s.Statistics.Add(HitResult.Meh, RNG.Next(2000)); } anotherScores = new[] @@ -272,9 +272,9 @@ namespace osu.Game.Tests.Visual }; foreach (var s in anotherScores) { - s.Statistics.Add("300", RNG.Next(2000)); - s.Statistics.Add("100", RNG.Next(2000)); - s.Statistics.Add("50", RNG.Next(2000)); + s.Statistics.Add(HitResult.Great, RNG.Next(2000)); + s.Statistics.Add(HitResult.Good, RNG.Next(2000)); + s.Statistics.Add(HitResult.Meh, RNG.Next(2000)); } topScore = new OnlineScore @@ -299,9 +299,9 @@ namespace osu.Game.Tests.Visual TotalScore = 987654321, Accuracy = 0.8487, }; - topScore.Statistics.Add("300", RNG.Next(2000)); - topScore.Statistics.Add("100", RNG.Next(2000)); - topScore.Statistics.Add("50", RNG.Next(2000)); + topScore.Statistics.Add(HitResult.Great, RNG.Next(2000)); + topScore.Statistics.Add(HitResult.Good, RNG.Next(2000)); + topScore.Statistics.Add(HitResult.Meh, RNG.Next(2000)); } [BackgroundDependencyLoader] diff --git a/osu.Game.Tests/Visual/TestCaseGameplayMenuOverlay.cs b/osu.Game.Tests/Visual/TestCaseGameplayMenuOverlay.cs index bd5772d3bb..87552c3f17 100644 --- a/osu.Game.Tests/Visual/TestCaseGameplayMenuOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseGameplayMenuOverlay.cs @@ -73,7 +73,7 @@ namespace osu.Game.Tests.Visual { AddStep("Show overlay", () => failOverlay.Show()); - AddStep("Hover first button", () => failOverlay.Buttons.First().TriggerOnHover(null)); + AddStep("Hover first button", () => failOverlay.Buttons.First().TriggerOnMouseMove(null)); AddStep("Hide overlay", () => failOverlay.Hide()); AddAssert("Overlay state is reset", () => !failOverlay.Buttons.Any(b => b.Selected)); @@ -162,7 +162,7 @@ namespace osu.Game.Tests.Visual var secondButton = pauseOverlay.Buttons.Skip(1).First(); AddStep("Down arrow", () => pauseOverlay.TriggerOnKeyDown(null, new KeyDownEventArgs { Key = Key.Down })); - AddStep("Hover second button", () => secondButton.TriggerOnHover(null)); + AddStep("Hover second button", () => secondButton.TriggerOnMouseMove(null)); AddAssert("First button not selected", () => !pauseOverlay.Buttons.First().Selected); AddAssert("Second button selected", () => secondButton.Selected); @@ -178,7 +178,7 @@ namespace osu.Game.Tests.Visual var secondButton = pauseOverlay.Buttons.Skip(1).First(); - AddStep("Hover second button", () => secondButton.TriggerOnHover(null)); + AddStep("Hover second button", () => secondButton.TriggerOnMouseMove(null)); AddStep("Up arrow", () => pauseOverlay.TriggerOnKeyDown(null, new KeyDownEventArgs { Key = Key.Up })); AddAssert("Second button not selected", () => !secondButton.Selected); AddAssert("First button selected", () => pauseOverlay.Buttons.First().Selected); @@ -195,7 +195,7 @@ namespace osu.Game.Tests.Visual var secondButton = pauseOverlay.Buttons.Skip(1).First(); - AddStep("Hover second button", () => secondButton.TriggerOnHover(null)); + AddStep("Hover second button", () => secondButton.TriggerOnMouseMove(null)); AddStep("Unhover second button", () => secondButton.TriggerOnHoverLost(null)); AddStep("Down arrow", () => pauseOverlay.TriggerOnKeyDown(null, new KeyDownEventArgs { Key = Key.Down })); AddAssert("First button selected", () => pauseOverlay.Buttons.First().Selected); // Initial state condition diff --git a/osu.Game.Tests/Visual/TestCaseMods.cs b/osu.Game.Tests/Visual/TestCaseMods.cs index e535da3fcc..c78d3b1f9f 100644 --- a/osu.Game.Tests/Visual/TestCaseMods.cs +++ b/osu.Game.Tests/Visual/TestCaseMods.cs @@ -15,6 +15,8 @@ using System.Collections.Generic; using osu.Game.Rulesets.Osu; using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.Sprites; +using osu.Game.Rulesets.Mania; +using osu.Game.Rulesets.Mania.Mods; using OpenTK.Graphics; namespace osu.Game.Tests.Visual @@ -68,6 +70,9 @@ namespace osu.Game.Tests.Visual case OsuRuleset or: testOsuMods(or); break; + case ManiaRuleset mr: + testManiaMods(mr); + break; } } } @@ -80,16 +85,27 @@ namespace osu.Game.Tests.Visual var noFailMod = easierMods.FirstOrDefault(m => m is OsuModNoFail); var hiddenMod = harderMods.FirstOrDefault(m => m is OsuModHidden); + var doubleTimeMod = harderMods.OfType().FirstOrDefault(m => m.Mods.Any(a => a is OsuModDoubleTime)); + var autoPilotMod = assistMods.FirstOrDefault(m => m is OsuModAutopilot); + var easy = easierMods.FirstOrDefault(m => m is OsuModEasy); + var hardRock = harderMods.FirstOrDefault(m => m is OsuModHardRock); + testSingleMod(noFailMod); testMultiMod(doubleTimeMod); - testIncompatibleMods(noFailMod, autoPilotMod); + testIncompatibleMods(easy, hardRock); testDeselectAll(easierMods.Where(m => !(m is MultiMod))); testMultiplierTextColour(noFailMod, modSelect.LowMultiplierColour); testMultiplierTextColour(hiddenMod, modSelect.HighMultiplierColour); - testMultiplierTextUnranked(autoPilotMod); + + testUnimplmentedMod(autoPilotMod); + } + + private void testManiaMods(ManiaRuleset ruleset) + { + testMultiplierTextUnranked(ruleset.GetModsFor(ModType.Special).First(m => m is ManiaModRandom)); } private void testSingleMod(Mod mod) @@ -124,6 +140,12 @@ namespace osu.Game.Tests.Visual checkNotSelected(mod); } + private void testUnimplmentedMod(Mod mod) + { + selectNext(mod); + checkNotSelected(mod); + } + private void testIncompatibleMods(Mod modA, Mod modB) { selectNext(modA); @@ -169,9 +191,9 @@ namespace osu.Game.Tests.Visual AddAssert("check for ranked", () => !modSelect.MultiplierLabel.Text.EndsWith(unranked_suffix)); } - private void selectNext(Mod mod) => AddStep($"left click {mod.Name}", () => modSelect.GetModButton(mod)?.SelectNext()); + private void selectNext(Mod mod) => AddStep($"left click {mod.Name}", () => modSelect.GetModButton(mod)?.SelectNext(1)); - private void selectPrevious(Mod mod) => AddStep($"right click {mod.Name}", () => modSelect.GetModButton(mod)?.SelectPrevious()); + private void selectPrevious(Mod mod) => AddStep($"right click {mod.Name}", () => modSelect.GetModButton(mod)?.SelectNext(-1)); private void checkSelected(Mod mod) { diff --git a/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs b/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs index a83cead213..46deca073f 100644 --- a/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Linq; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.MathUtils; using osu.Game.Overlays; @@ -19,11 +20,12 @@ namespace osu.Game.Tests.Visual public override IReadOnlyList RequiredTypes => new[] { - typeof(Notification), + typeof(NotificationSection), + typeof(SimpleNotification), typeof(ProgressNotification), typeof(ProgressCompletionNotification), - typeof(SimpleNotification), typeof(IHasCompletionTarget), + typeof(Notification) }; public TestCaseNotificationOverlay() @@ -40,17 +42,44 @@ namespace osu.Game.Tests.Visual Content.Add(displayedCount); + void setState(Visibility state) => AddStep(state.ToString(), () => manager.State = state); + void checkProgressingCount(int expected) => AddAssert($"progressing count is {expected}", () => progressingNotifications.Count == expected); + manager.UnreadCount.ValueChanged += count => { displayedCount.Text = $"displayed count: {count}"; }; - AddStep(@"toggle", manager.ToggleVisibility); + + setState(Visibility.Visible); AddStep(@"simple #1", sendHelloNotification); AddStep(@"simple #2", sendAmazingNotification); AddStep(@"progress #1", sendUploadProgress); AddStep(@"progress #2", sendDownloadProgress); - AddStep(@"barrage", () => sendBarrage()); + + checkProgressingCount(2); + + setState(Visibility.Hidden); + + AddRepeatStep(@"add many simple", sendManyNotifications, 3); + AddWaitStep(5); + + checkProgressingCount(0); + + AddStep(@"progress #3", sendUploadProgress); + + checkProgressingCount(1); + + AddAssert("Displayed count is 33", () => manager.UnreadCount.Value == 33); + + AddWaitStep(10); + + checkProgressingCount(0); + + + setState(Visibility.Visible); + + //AddStep(@"barrage", () => sendBarrage()); } - private void sendBarrage(int remaining = 100) + private void sendBarrage(int remaining = 10) { switch (RNG.Next(0, 4)) { @@ -80,7 +109,7 @@ namespace osu.Game.Tests.Visual if (progressingNotifications.Count(n => n.State == ProgressNotificationState.Active) < 3) { - var p = progressingNotifications.FirstOrDefault(n => n.IsAlive && n.State == ProgressNotificationState.Queued); + var p = progressingNotifications.FirstOrDefault(n => n.State == ProgressNotificationState.Queued); if (p != null) p.State = ProgressNotificationState.Active; } @@ -88,7 +117,7 @@ namespace osu.Game.Tests.Visual foreach (var n in progressingNotifications.FindAll(n => n.State == ProgressNotificationState.Active)) { if (n.Progress < 1) - n.Progress += (float)(Time.Elapsed / 2000) * RNG.NextSingle(); + n.Progress += (float)(Time.Elapsed / 400) * RNG.NextSingle(); else n.State = ProgressNotificationState.Completed; } @@ -125,5 +154,11 @@ namespace osu.Game.Tests.Visual { manager.Post(new SimpleNotification { Text = @"Welcome to osu!. Enjoy your stay!" }); } + + private void sendManyNotifications() + { + for (int i = 0; i < 10; i++) + manager.Post(new SimpleNotification { Text = @"Spam incoming!!" }); + } } } diff --git a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs index 18e40db064..3be4a18ec5 100644 --- a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs @@ -51,11 +51,12 @@ namespace osu.Game.Tests.Visual private class TestSongSelect : PlaySongSelect { public WorkingBeatmap CurrentBeatmap => Beatmap.Value; + public WorkingBeatmap CurrentBeatmapDetailsBeatmap => BeatmapDetails.Beatmap; public new BeatmapCarousel Carousel => base.Carousel; } [BackgroundDependencyLoader] - private void load(BeatmapManager baseManager) + private void load(OsuGameBase game) { TestSongSelect songSelect = null; @@ -69,12 +70,16 @@ namespace osu.Game.Tests.Visual dependencies.Cache(rulesets = new RulesetStore(contextFactory)); dependencies.Cache(manager = new BeatmapManager(storage, contextFactory, rulesets, null) { - DefaultBeatmap = defaultBeatmap = baseManager.GetWorkingBeatmap(null) + DefaultBeatmap = defaultBeatmap = game.Beatmap.Default }); void loadNewSongSelect(bool deleteMaps = false) => AddStep("reload song select", () => { - if (deleteMaps) manager.DeleteAll(); + if (deleteMaps) + { + manager.DeleteAll(); + game.Beatmap.SetDefault(); + } if (songSelect != null) { @@ -91,6 +96,8 @@ namespace osu.Game.Tests.Visual AddAssert("dummy selected", () => songSelect.CurrentBeatmap == defaultBeatmap); + AddAssert("dummy shown on wedge", () => songSelect.CurrentBeatmapDetailsBeatmap == defaultBeatmap); + AddStep("import test maps", () => { for (int i = 0; i < 100; i += 10) diff --git a/osu.Game.Tests/Visual/TestCaseResults.cs b/osu.Game.Tests/Visual/TestCaseResults.cs index d0c5aa4939..28ce9524e0 100644 --- a/osu.Game.Tests/Visual/TestCaseResults.cs +++ b/osu.Game.Tests/Visual/TestCaseResults.cs @@ -15,6 +15,15 @@ namespace osu.Game.Tests.Visual { private BeatmapManager beatmaps; + public override IReadOnlyList RequiredTypes => new[] + { + typeof(Score), + typeof(Results), + typeof(ResultsPage), + typeof(ResultsPageScore), + typeof(ResultsPageRanking) + }; + [BackgroundDependencyLoader] private void load(BeatmapManager beatmaps) { @@ -41,12 +50,12 @@ namespace osu.Game.Tests.Visual MaxCombo = 123, Rank = ScoreRank.A, Date = DateTimeOffset.Now, - Statistics = new Dictionary + Statistics = new Dictionary { - { "300", 50 }, - { "100", 20 }, - { "50", 50 }, - { "x", 1 } + { HitResult.Great, 50 }, + { HitResult.Good, 20 }, + { HitResult.Meh, 50 }, + { HitResult.Miss, 1 } }, User = new User { diff --git a/osu.Game/Audio/SampleInfo.cs b/osu.Game/Audio/SampleInfo.cs index 64a9aa50a0..71975bf0fa 100644 --- a/osu.Game/Audio/SampleInfo.cs +++ b/osu.Game/Audio/SampleInfo.cs @@ -14,10 +14,20 @@ namespace osu.Game.Audio public const string HIT_NORMAL = @"hitnormal"; public const string HIT_CLAP = @"hitclap"; - public SampleChannel GetChannel(SampleManager manager) + public SampleChannel GetChannel(SampleManager manager, string resourceNamespace = null) { - var channel = manager.Get($"Gameplay/{Bank}-{Name}"); - channel.Volume.Value = Volume / 100.0; + SampleChannel channel = null; + + if (resourceNamespace != null) + channel = manager.Get($"Gameplay/{resourceNamespace}/{Bank}-{Name}"); + + // try without namespace as a fallback. + if (channel == null) + channel = manager.Get($"Gameplay/{Bank}-{Name}"); + + if (channel != null) + channel.Volume.Value = Volume / 100.0; + return channel; } diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index f586e0862d..ea7c4bd954 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -18,6 +18,7 @@ using osu.Game.Beatmaps.Formats; using osu.Game.Beatmaps.IO; using osu.Game.Database; using osu.Game.Graphics; +using osu.Game.Graphics.Textures; using osu.Game.IO; using osu.Game.IPC; using osu.Game.Online.API; @@ -101,15 +102,26 @@ namespace osu.Game.Beatmaps /// public Func GetStableStorage { private get; set; } + private void refreshImportContext() + { + lock (importContextLock) + { + importContext?.Value?.Dispose(); + + importContext = new Lazy(() => + { + var c = createContext(); + c.Database.AutoTransactionsEnabled = false; + return c; + }); + } + } + public BeatmapManager(Storage storage, Func context, RulesetStore rulesets, APIAccess api, IIpcHost importHost = null) { createContext = context; - importContext = new Lazy(() => - { - var c = createContext(); - c.Database.AutoTransactionsEnabled = false; - return c; - }); + + refreshImportContext(); beatmaps = createBeatmapStore(context); files = new FileStore(context, storage); @@ -174,13 +186,16 @@ namespace osu.Game.Beatmaps { e = e.InnerException ?? e; Logger.Error(e, $@"Could not import beatmap set ({Path.GetFileName(path)})"); + refreshImportContext(); } } notification.State = ProgressNotificationState.Completed; } - private readonly Lazy importContext; + private readonly object importContextLock = new object(); + + private Lazy importContext; /// /// Import a beatmap from an . @@ -189,7 +204,7 @@ namespace osu.Game.Beatmaps public BeatmapSetInfo Import(ArchiveReader archiveReader) { // let's only allow one concurrent import at a time for now. - lock (importContext) + lock (importContextLock) { var context = importContext.Value; @@ -314,7 +329,7 @@ namespace osu.Game.Beatmaps /// The beatmap set to delete. public void Delete(BeatmapSetInfo beatmapSet) { - lock (importContext) + lock (importContextLock) { var context = importContext.Value; @@ -378,7 +393,7 @@ namespace osu.Game.Beatmaps if (beatmapSet.Protected) return; - lock (importContext) + lock (importContextLock) { var context = importContext.Value; @@ -652,7 +667,7 @@ namespace osu.Game.Beatmaps try { - return new TextureStore(new RawTextureLoaderStore(store), false).Get(getPathForFile(Metadata.BackgroundFile)); + return new LargeTextureStore(new RawTextureLoaderStore(store)).Get(getPathForFile(Metadata.BackgroundFile)); } catch { diff --git a/osu.Game/Beatmaps/ControlPoints/SampleControlPoint.cs b/osu.Game/Beatmaps/ControlPoints/SampleControlPoint.cs index 40e45da13c..c2c13e1909 100644 --- a/osu.Game/Beatmaps/ControlPoints/SampleControlPoint.cs +++ b/osu.Game/Beatmaps/ControlPoints/SampleControlPoint.cs @@ -17,7 +17,7 @@ namespace osu.Game.Beatmaps.ControlPoints /// /// The default sample volume at this control point. /// - public int SampleVolume; + public int SampleVolume = 100; /// /// Create a SampleInfo based on the sample settings in this control point. diff --git a/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs index 8da6a0cefb..168f37e44e 100644 --- a/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs @@ -266,6 +266,6 @@ namespace osu.Game.Beatmaps.Formats throw new InvalidDataException($@"Unknown origin: {value}"); } - private string cleanFilename(string path) => FileSafety.PathStandardise(path.Trim('\"')); + private string cleanFilename(string path) => FileSafety.PathSanitise(path.Trim('\"')); } } diff --git a/osu.Game/Graphics/Backgrounds/Background.cs b/osu.Game/Graphics/Backgrounds/Background.cs index 8eb2ddc0ab..4fb08a41f3 100644 --- a/osu.Game/Graphics/Backgrounds/Background.cs +++ b/osu.Game/Graphics/Backgrounds/Background.cs @@ -5,8 +5,8 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.Textures; using OpenTK.Graphics; +using osu.Game.Graphics.Textures; namespace osu.Game.Graphics.Backgrounds { @@ -22,7 +22,6 @@ namespace osu.Game.Graphics.Backgrounds this.textureName = textureName; RelativeSizeAxes = Axes.Both; - Depth = float.MaxValue; Add(Sprite = new Sprite { @@ -35,7 +34,7 @@ namespace osu.Game.Graphics.Backgrounds } [BackgroundDependencyLoader] - private void load(TextureStore textures) + private void load(LargeTextureStore textures) { if (!string.IsNullOrEmpty(textureName)) Sprite.Texture = textures.Get(textureName); diff --git a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs index c788df3066..f67da52fc0 100644 --- a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs +++ b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs @@ -5,6 +5,8 @@ using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Sample; using osu.Framework.Graphics.Containers; +using osu.Framework.Input; +using OpenTK; namespace osu.Game.Graphics.Containers { @@ -22,6 +24,48 @@ namespace osu.Game.Graphics.Containers StateChanged += onStateChanged; } + /// + /// Whether mouse input should be blocked screen-wide while this overlay is visible. + /// Performing mouse actions outside of the valid extents will hide the overlay but pass the events through. + /// + public virtual bool BlockScreenWideMouse => BlockPassThroughMouse; + + // receive input outside our bounds so we can trigger a close event on ourselves. + public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => BlockScreenWideMouse || base.ReceiveMouseInputAt(screenSpacePos); + + protected override bool OnWheel(InputState state) + { + // always allow wheel to pass through to stuff outside our DrawRectangle. + if (!base.ReceiveMouseInputAt(state.Mouse.NativeState.Position)) + return false; + + return BlockPassThroughMouse; + } + + protected override bool OnClick(InputState state) + { + if (!base.ReceiveMouseInputAt(state.Mouse.NativeState.Position)) + { + State = Visibility.Hidden; + return true; + } + + return base.OnClick(state); + } + + protected override bool OnDragStart(InputState state) + { + if (!base.ReceiveMouseInputAt(state.Mouse.NativeState.Position)) + { + State = Visibility.Hidden; + return true; + } + + return base.OnDragStart(state); + } + + protected override bool OnDrag(InputState state) => State == Visibility.Hidden; + private void onStateChanged(Visibility visibility) { switch (visibility) diff --git a/osu.Game/Graphics/Textures/LargeTextureStore.cs b/osu.Game/Graphics/Textures/LargeTextureStore.cs new file mode 100644 index 0000000000..166364c8dd --- /dev/null +++ b/osu.Game/Graphics/Textures/LargeTextureStore.cs @@ -0,0 +1,18 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics.Textures; +using osu.Framework.IO.Stores; + +namespace osu.Game.Graphics.Textures +{ + /// + /// A texture store that bypasses atlasing. + /// + public class LargeTextureStore : TextureStore + { + public LargeTextureStore(IResourceStore store = null) : base(store, false) + { + } + } +} diff --git a/osu.Game/Online/API/Requests/GetScoresRequest.cs b/osu.Game/Online/API/Requests/GetScoresRequest.cs index 065c770738..14605081b6 100644 --- a/osu.Game/Online/API/Requests/GetScoresRequest.cs +++ b/osu.Game/Online/API/Requests/GetScoresRequest.cs @@ -122,26 +122,26 @@ namespace osu.Game.Online.API.Requests { foreach (var kvp in value) { - string key = kvp.Key; - switch (key) + HitResult newKey; + switch (kvp.Key) { case @"count_300": - key = @"300"; + newKey = HitResult.Great; break; case @"count_100": - key = @"100"; + newKey = HitResult.Good; break; case @"count_50": - key = @"50"; + newKey = HitResult.Meh; break; case @"count_miss": - key = @"x"; + newKey = HitResult.Miss; break; default: continue; } - Statistics.Add(key, kvp.Value); + Statistics.Add(newKey, kvp.Value); } } } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 1dc4c487f3..257b78ea0a 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -27,6 +27,7 @@ using osu.Game.Overlays.Notifications; using osu.Game.Rulesets; using osu.Game.Screens.Play; using osu.Game.Input.Bindings; +using OpenTK.Graphics; namespace osu.Game { @@ -65,6 +66,8 @@ namespace osu.Game public float ToolbarOffset => Toolbar.Position.Y + Toolbar.DrawHeight; + public readonly BindableBool ShowOverlays = new BindableBool(); + private OsuScreen screenStack; private VolumeControl volume; @@ -280,6 +283,21 @@ namespace osu.Game settings.StateChanged += _ => updateScreenOffset(); notifications.StateChanged += _ => updateScreenOffset(); + notifications.Enabled.BindTo(ShowOverlays); + + ShowOverlays.ValueChanged += show => + { + //central game screen change logic. + if (!show) + { + hideAllOverlays(); + musicController.State = Visibility.Hidden; + Toolbar.State = Visibility.Hidden; + } + else + Toolbar.State = Visibility.Visible; + }; + Cursor.State = Visibility.Hidden; } @@ -314,10 +332,21 @@ namespace osu.Game } private Task asyncLoadStream; + private int visibleOverlayCount; private void loadComponentSingleFile(T d, Action add) where T : Drawable { + var focused = d as FocusedOverlayContainer; + if (focused != null) + { + focused.StateChanged += s => + { + visibleOverlayCount += s == Visibility.Visible ? 1 : -1; + screenStack.FadeColour(visibleOverlayCount > 0 ? OsuColour.Gray(0.5f) : Color4.White, 500, Easing.OutQuint); + }; + } + // schedule is here to ensure that all component loads are done after LoadComplete is run (and thus all dependencies are cached). // with some better organisation of LoadComplete to do construction and dependency caching in one step, followed by calls to loadComponentSingleFile, // we could avoid the need for scheduling altogether. @@ -361,8 +390,6 @@ namespace osu.Game public bool OnReleased(GlobalAction action) => false; - public event Action ScreenChanged; - private Container mainContent; private Container overlayContent; @@ -380,29 +407,6 @@ namespace osu.Game notifications.State = Visibility.Hidden; } - private void screenChanged(Screen newScreen) - { - currentScreen = newScreen as OsuScreen; - - if (currentScreen == null) - { - Exit(); - return; - } - - //central game screen change logic. - if (!currentScreen.ShowOverlays) - { - hideAllOverlays(); - musicController.State = Visibility.Hidden; - Toolbar.State = Visibility.Hidden; - } - else - Toolbar.State = Visibility.Visible; - - ScreenChanged?.Invoke(newScreen); - } - protected override bool OnExiting() { if (screenStack.ChildScreen == null) return false; @@ -448,15 +452,18 @@ namespace osu.Game private void screenAdded(Screen newScreen) { + currentScreen = (OsuScreen)newScreen; + newScreen.ModePushed += screenAdded; newScreen.Exited += screenRemoved; - - screenChanged(newScreen); } private void screenRemoved(Screen newScreen) { - screenChanged(newScreen); + currentScreen = (OsuScreen)newScreen; + + if (newScreen == null) + Exit(); } } } diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index ea0bf22112..e311aea8e4 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -18,8 +18,10 @@ using osu.Game.Graphics; using osu.Game.Graphics.Cursor; using osu.Game.Online.API; using osu.Framework.Graphics.Performance; +using osu.Framework.Graphics.Textures; using osu.Framework.Logging; using osu.Game.Database; +using osu.Game.Graphics.Textures; using osu.Game.Input; using osu.Game.Input.Bindings; using osu.Game.IO; @@ -89,6 +91,8 @@ namespace osu.Game { dependencies.Cache(contextFactory = new DatabaseContextFactory(Host)); + dependencies.Cache(new LargeTextureStore(new RawTextureLoaderStore(new NamespacedResourceStore(Resources, @"Textures")))); + dependencies.Cache(this); dependencies.Cache(LocalConfig); diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs index 5a3aba7b43..2d5913d8ca 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs @@ -12,6 +12,7 @@ using osu.Game.Graphics.Sprites; using osu.Game.Online.API.Requests; using osu.Game.Overlays.Profile.Sections.Ranks; using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; using osu.Game.Screens.Select.Leaderboards; using osu.Game.Users; @@ -48,7 +49,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores Font = @"Exo2.0-RegularItalic", Margin = new MarginPadding { Left = side_margin } }, - new DrawableFlag(score.User.Country?.FlagName) + new DrawableFlag(score.User.Country) { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, @@ -104,7 +105,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, - Text = $"{score.Statistics["300"]}/{score.Statistics["100"]}/{score.Statistics["50"]}", + Text = $"{score.Statistics[HitResult.Great]}/{score.Statistics[HitResult.Good]}/{score.Statistics[HitResult.Meh]}", Font = @"Exo2.0-RegularItalic", Margin = new MarginPadding { Right = side_margin } }, diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs index 833ed94c0f..e3b878587d 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs @@ -52,13 +52,13 @@ namespace osu.Game.Overlays.BeatmapSet.Scores score = value; avatar.User = username.User = score.User; - flag.FlagName = score.User.Country?.FlagName; + flag.Country = score.User.Country; date.Text = $@"achieved {score.Date:MMM d, yyyy}"; rank.UpdateRank(score.Rank); totalScore.Value = $@"{score.TotalScore:N0}"; accuracy.Value = $@"{score.Accuracy:P2}"; - statistics.Value = $"{score.Statistics["300"]}/{score.Statistics["100"]}/{score.Statistics["50"]}"; + statistics.Value = $"{score.Statistics[HitResult.Great]}/{score.Statistics[HitResult.Good]}/{score.Statistics[HitResult.Meh]}"; modsContainer.Clear(); foreach (Mod mod in score.Mods) diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index dcabad8ed6..20c1cf9332 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -241,8 +241,6 @@ namespace osu.Game.Overlays public override bool AcceptsFocus => true; - protected override bool OnClick(InputState state) => true; - protected override void OnFocus(InputState state) { //this is necessary as textbox is masked away and therefore can't get focus :( diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs index 77b7c3add2..21f07bb0a4 100644 --- a/osu.Game/Overlays/Mods/ModButton.cs +++ b/osu.Game/Overlays/Mods/ModButton.cs @@ -32,7 +32,10 @@ namespace osu.Game.Overlays.Mods private readonly Container iconsContainer; private SampleChannel sampleOn, sampleOff; - public Action Action; // Passed the selected mod or null if none + /// + /// Fired when the selection changes. + /// + public Action SelectionChanged; public string TooltipText => (SelectedMod?.Description ?? Mods.FirstOrDefault()?.Description) ?? string.Empty; @@ -42,71 +45,73 @@ namespace osu.Game.Overlays.Mods // A selected index of -1 means not selected. private int selectedIndex = -1; - protected int SelectedIndex + /// + /// Change the selected mod index of this button. + /// + /// The new index. + /// Whether the selection changed. + private bool changeSelectedIndex(int newIndex) { - get + if (newIndex == selectedIndex) return false; + + int direction = newIndex < selectedIndex ? -1 : 1; + bool beforeSelected = Selected; + + Mod modBefore = SelectedMod ?? Mods[0]; + + if (newIndex >= Mods.Length) + newIndex = -1; + else if (newIndex < -1) + newIndex = Mods.Length - 1; + + if (newIndex >= 0 && !Mods[newIndex].HasImplementation) + return false; + + selectedIndex = newIndex; + Mod modAfter = SelectedMod ?? Mods[0]; + + if (beforeSelected != Selected) { - return selectedIndex; + iconsContainer.RotateTo(Selected ? 5f : 0f, 300, Easing.OutElastic); + iconsContainer.ScaleTo(Selected ? 1.1f : 1f, 300, Easing.OutElastic); } - set + + if (modBefore != modAfter) { - if (value == selectedIndex) return; + const float rotate_angle = 16; - int direction = value < selectedIndex ? -1 : 1; - bool beforeSelected = Selected; + foregroundIcon.RotateTo(rotate_angle * direction, mod_switch_duration, mod_switch_easing); + backgroundIcon.RotateTo(-rotate_angle * direction, mod_switch_duration, mod_switch_easing); - Mod modBefore = SelectedMod ?? Mods[0]; - - if (value >= Mods.Length) - selectedIndex = -1; - else if (value < -1) - selectedIndex = Mods.Length - 1; - else - selectedIndex = value; - - Mod modAfter = SelectedMod ?? Mods[0]; - - if (beforeSelected != Selected) + backgroundIcon.Icon = modAfter.Icon; + using (BeginDelayedSequence(mod_switch_duration, true)) { - iconsContainer.RotateTo(Selected ? 5f : 0f, 300, Easing.OutElastic); - iconsContainer.ScaleTo(Selected ? 1.1f : 1f, 300, Easing.OutElastic); + foregroundIcon + .RotateTo(-rotate_angle * direction) + .RotateTo(0f, mod_switch_duration, mod_switch_easing); + + backgroundIcon + .RotateTo(rotate_angle * direction) + .RotateTo(0f, mod_switch_duration, mod_switch_easing); + + Schedule(() => displayMod(modAfter)); } - - if (modBefore != modAfter) - { - const float rotate_angle = 16; - - foregroundIcon.RotateTo(rotate_angle * direction, mod_switch_duration, mod_switch_easing); - backgroundIcon.RotateTo(-rotate_angle * direction, mod_switch_duration, mod_switch_easing); - - backgroundIcon.Icon = modAfter.Icon; - using (BeginDelayedSequence(mod_switch_duration, true)) - { - foregroundIcon - .RotateTo(-rotate_angle * direction) - .RotateTo(0f, mod_switch_duration, mod_switch_easing); - - backgroundIcon - .RotateTo(rotate_angle * direction) - .RotateTo(0f, mod_switch_duration, mod_switch_easing); - - Schedule(() => displayMod(modAfter)); - } - } - - foregroundIcon.Highlighted = Selected; } + + foregroundIcon.Highlighted = Selected; + + (selectedIndex == -1 ? sampleOff : sampleOn).Play(); + SelectionChanged?.Invoke(SelectedMod); + return true; } - public bool Selected => SelectedIndex != -1; + public bool Selected => selectedIndex != -1; private Color4 selectedColour; + public Color4 SelectedColour { - get - { - return selectedColour; - } + get { return selectedColour; } set { if (value == selectedColour) return; @@ -116,12 +121,10 @@ namespace osu.Game.Overlays.Mods } private Mod mod; + public Mod Mod { - get - { - return mod; - } + get { return mod; } set { mod = value; @@ -147,9 +150,7 @@ namespace osu.Game.Overlays.Mods public Mod[] Mods { get; private set; } - // the mods from Mod, only multiple if Mod is a MultiMod - - public virtual Mod SelectedMod => Mods.ElementAtOrDefault(SelectedIndex); + public virtual Mod SelectedMod => Mods.ElementAtOrDefault(selectedIndex); [BackgroundDependencyLoader] private void load(AudioManager audio) @@ -163,31 +164,42 @@ namespace osu.Game.Overlays.Mods switch (args.Button) { case MouseButton.Left: - SelectNext(); + SelectNext(1); break; case MouseButton.Right: - SelectPrevious(); + SelectNext(-1); break; } + return true; } - public void SelectNext() + /// + /// Select the next available mod in a specified direction. + /// + /// 1 for forwards, -1 for backwards. + public void SelectNext(int direction) { - (++SelectedIndex == Mods.Length ? sampleOff : sampleOn).Play(); - Action?.Invoke(SelectedMod); + int start = selectedIndex + direction; + // wrap around if we are at an extremity. + if (start >= Mods.Length) + start = -1; + else if (start < -1) + start = Mods.Length - 1; + + for (int i = start; i < Mods.Length && i >= 0; i += direction) + { + if (Mods[i].HasImplementation) + { + changeSelectedIndex(i); + return; + } + } + + Deselect(); } - public void SelectPrevious() - { - (--SelectedIndex == -1 ? sampleOff : sampleOn).Play(); - Action?.Invoke(SelectedMod); - } - - public void Deselect() - { - SelectedIndex = -1; - } + public void Deselect() => changeSelectedIndex(-1); private void displayMod(Mod mod) { @@ -195,6 +207,7 @@ namespace osu.Game.Overlays.Mods backgroundIcon.Icon = foregroundIcon.Icon; foregroundIcon.Icon = mod.Icon; text.Text = mod.Name; + Colour = mod.HasImplementation ? Color4.White : Color4.Gray; } private void createIcons() @@ -204,13 +217,13 @@ namespace osu.Game.Overlays.Mods { iconsContainer.AddRange(new[] { - backgroundIcon = new ModIcon(Mods[1]) + backgroundIcon = new PassThroughTooltipModIcon(Mods[1]) { Origin = Anchor.BottomRight, Anchor = Anchor.BottomRight, Position = new Vector2(1.5f), }, - foregroundIcon = new ModIcon(Mods[0]) + foregroundIcon = new PassThroughTooltipModIcon(Mods[0]) { Origin = Anchor.BottomRight, Anchor = Anchor.BottomRight, @@ -220,7 +233,7 @@ namespace osu.Game.Overlays.Mods } else { - iconsContainer.Add(foregroundIcon = new ModIcon(Mod) + iconsContainer.Add(foregroundIcon = new PassThroughTooltipModIcon(Mod) { Origin = Anchor.Centre, Anchor = Anchor.Centre, @@ -259,5 +272,15 @@ namespace osu.Game.Overlays.Mods Mod = mod; } + + private class PassThroughTooltipModIcon : ModIcon + { + public override string TooltipText => null; + + public PassThroughTooltipModIcon(Mod mod) + : base(mod) + { + } + } } } diff --git a/osu.Game/Overlays/Mods/ModSection.cs b/osu.Game/Overlays/Mods/ModSection.cs index aac8a72dd7..50310d1b27 100644 --- a/osu.Game/Overlays/Mods/ModSection.cs +++ b/osu.Game/Overlays/Mods/ModSection.cs @@ -51,7 +51,7 @@ namespace osu.Game.Overlays.Mods return new ModButton(m) { SelectedColour = selectedColour, - Action = Action, + SelectionChanged = Action, }; }).ToArray(); @@ -83,26 +83,33 @@ namespace osu.Game.Overlays.Mods { var index = Array.IndexOf(ToggleKeys, args.Key); if (index > -1 && index < buttons.Length) - buttons[index].SelectNext(); + buttons[index].SelectNext(state.Keyboard.ShiftPressed ? -1 : 1); return base.OnKeyDown(state, args); } - public void DeselectAll() - { - foreach (ModButton button in buttons) - button.Deselect(); - } + public void DeselectAll() => DeselectTypes(buttons.Select(b => b.SelectedMod?.GetType()).Where(t => t != null)); - public void DeselectTypes(Type[] modTypes) + /// + /// Deselect one or more mods in this section. + /// + /// The types of s which should be deselected. + /// Set to true to bypass animations and update selections immediately. + public void DeselectTypes(IEnumerable modTypes, bool immediate = false) { + int delay = 0; foreach (var button in buttons) { Mod selected = button.SelectedMod; if (selected == null) continue; foreach (Type type in modTypes) if (type.IsInstanceOfType(selected)) - button.Deselect(); + { + if (immediate) + button.Deselect(); + else + Scheduler.AddDelayed(() => button.Deselect(), delay += 50); + } } } diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 9639907914..cc5a17358d 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -100,17 +100,22 @@ namespace osu.Game.Overlays.Mods refreshSelectedMods(); } - public void DeselectTypes(Type[] modTypes) + /// + /// Deselect one or more mods. + /// + /// The types of s which should be deselected. + /// Set to true to bypass animations and update selections immediately. + public void DeselectTypes(Type[] modTypes, bool immediate = false) { if (modTypes.Length == 0) return; foreach (ModSection section in ModSectionsContainer.Children) - section.DeselectTypes(modTypes); + section.DeselectTypes(modTypes, immediate); } private void modButtonPressed(Mod selectedMod) { if (selectedMod != null) - DeselectTypes(selectedMod.IncompatibleMods); + DeselectTypes(selectedMod.IncompatibleMods, true); refreshSelectedMods(); } @@ -127,10 +132,6 @@ namespace osu.Game.Overlays.Mods ranked &= mod.Ranked; } - // 1.00x - // 1.05x - // 1.20x - MultiplierLabel.Text = $"{multiplier:N2}x"; if (!ranked) MultiplierLabel.Text += " (Unranked)"; diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index d7c553aa7d..685fb5c6ab 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -65,10 +65,10 @@ namespace osu.Game.Overlays AlwaysPresent = true; } - protected override bool OnDragStart(InputState state) => true; - protected override bool OnDrag(InputState state) { + if (base.OnDrag(state)) return true; + Trace.Assert(state.Mouse.PositionMouseDown != null, "state.Mouse.PositionMouseDown != null"); // ReSharper disable once PossibleInvalidOperationException @@ -78,7 +78,7 @@ namespace osu.Game.Overlays change *= change.Length <= 0 ? 0 : (float)Math.Pow(change.Length, 0.7f) / change.Length; dragContainer.MoveTo(change); - return base.OnDrag(state); + return true; } protected override bool OnDragEnd(InputState state) diff --git a/osu.Game/Overlays/NotificationOverlay.cs b/osu.Game/Overlays/NotificationOverlay.cs index 2f1c3285ef..5744e8c189 100644 --- a/osu.Game/Overlays/NotificationOverlay.cs +++ b/osu.Game/Overlays/NotificationOverlay.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; -using osu.Framework.Allocation; using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -11,7 +10,9 @@ using OpenTK.Graphics; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics.Containers; using System; +using osu.Framework.Allocation; using osu.Framework.Configuration; +using osu.Framework.Threading; namespace osu.Game.Overlays { @@ -21,6 +22,11 @@ namespace osu.Game.Overlays public const float TRANSITION_LENGTH = 600; + /// + /// Whether posted notifications should be processed. + /// + public readonly BindableBool Enabled = new BindableBool(true); + private FlowContainer sections; /// @@ -28,6 +34,27 @@ namespace osu.Game.Overlays /// public Func GetToolbarHeight; + public NotificationOverlay() + { + ScheduledDelegate notificationsEnabler = null; + Enabled.ValueChanged += v => + { + if (!IsLoaded) + { + processingPosts = v; + return; + } + + notificationsEnabler?.Cancel(); + + if (v) + // we want a slight delay before toggling notifications on to avoid the user becoming overwhelmed. + notificationsEnabler = Scheduler.AddDelayed(() => processingPosts = true, 1000); + else + processingPosts = false; + }; + } + [BackgroundDependencyLoader] private void load() { @@ -85,14 +112,21 @@ namespace osu.Game.Overlays private void notificationClosed() { - // hide ourselves if all notifications have been dismissed. - if (totalCount == 0) - State = Visibility.Hidden; + Schedule(() => + { + // hide ourselves if all notifications have been dismissed. + if (totalCount == 0) + State = Visibility.Hidden; + }); updateCounts(); } - public void Post(Notification notification) => Schedule(() => + private readonly Scheduler postScheduler = new Scheduler(); + + private bool processingPosts = true; + + public void Post(Notification notification) => postScheduler.Add(() => { ++runningDepth; notification.Depth = notification.DisplayOnTop ? runningDepth : -runningDepth; @@ -109,6 +143,13 @@ namespace osu.Game.Overlays updateCounts(); }); + protected override void Update() + { + base.Update(); + if (processingPosts) + postScheduler.Update(); + } + protected override void PopIn() { base.PopIn(); diff --git a/osu.Game/Overlays/Notifications/NotificationSection.cs b/osu.Game/Overlays/Notifications/NotificationSection.cs index 2bd0321d12..42fcc3aa0f 100644 --- a/osu.Game/Overlays/Notifications/NotificationSection.cs +++ b/osu.Game/Overlays/Notifications/NotificationSection.cs @@ -15,7 +15,7 @@ using osu.Game.Graphics.Containers; namespace osu.Game.Overlays.Notifications { - public class NotificationSection : FillFlowContainer + public class NotificationSection : AlwaysUpdateFillFlowContainer { private OsuSpriteText titleText; private OsuSpriteText countText; @@ -33,6 +33,7 @@ namespace osu.Game.Overlays.Notifications public IEnumerable AcceptTypes; private string clearText; + public string ClearText { get { return clearText; } @@ -110,7 +111,7 @@ namespace osu.Game.Overlays.Notifications }, }, }, - notifications = new FillFlowContainer + notifications = new AlwaysUpdateFillFlowContainer { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, @@ -159,4 +160,13 @@ namespace osu.Game.Overlays.Notifications notifications?.Children.ForEach(n => n.Read = true); } } + + public class AlwaysUpdateFillFlowContainer : FillFlowContainer + where T : Drawable + { + // this is required to ensure correct layout and scheduling on children. + // the layout portion of this is being tracked as a framework issue (https://github.com/ppy/osu-framework/issues/1297). + protected override bool RequiresChildrenUpdate => true; + } + } diff --git a/osu.Game/Overlays/Notifications/ProgressNotification.cs b/osu.Game/Overlays/Notifications/ProgressNotification.cs index c39c630858..d797372390 100644 --- a/osu.Game/Overlays/Notifications/ProgressNotification.cs +++ b/osu.Game/Overlays/Notifications/ProgressNotification.cs @@ -95,8 +95,8 @@ namespace osu.Game.Overlays.Notifications protected virtual void Completed() { - base.Close(); CompletionTarget?.Invoke(CreateCompletionNotification()); + base.Close(); } public override bool DisplayOnTop => false; diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index 18e77cf186..960bb60287 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -109,7 +109,7 @@ namespace osu.Game.Overlays.Profile Origin = Anchor.BottomLeft, Y = -48, }, - countryFlag = new DrawableFlag(user.Country?.FlagName) + countryFlag = new DrawableFlag(user.Country) { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, @@ -333,7 +333,7 @@ namespace osu.Game.Overlays.Profile { infoTextLeft.AddText("from "); infoTextLeft.AddText(user.Country.FullName, boldItalic); - countryFlag.FlagName = user.Country.FlagName; + countryFlag.Country = user.Country; } infoTextLeft.NewParagraph(); diff --git a/osu.Game/Overlays/Profile/SupporterIcon.cs b/osu.Game/Overlays/Profile/SupporterIcon.cs index 570d5a13bb..b5cd94e54b 100644 --- a/osu.Game/Overlays/Profile/SupporterIcon.cs +++ b/osu.Game/Overlays/Profile/SupporterIcon.cs @@ -1,20 +1,23 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.Backgrounds; namespace osu.Game.Overlays.Profile { - public class SupporterIcon : CircularContainer + public class SupporterIcon : CircularContainer, IHasTooltip { private readonly Box background; + public string TooltipText => "osu!supporter"; + public SupporterIcon() { Masking = true; diff --git a/osu.Game/Overlays/Settings/Sections/AudioSection.cs b/osu.Game/Overlays/Settings/Sections/AudioSection.cs index c994a6296c..738c9e94d7 100644 --- a/osu.Game/Overlays/Settings/Sections/AudioSection.cs +++ b/osu.Game/Overlays/Settings/Sections/AudioSection.cs @@ -10,7 +10,7 @@ namespace osu.Game.Overlays.Settings.Sections public class AudioSection : SettingsSection { public override string Header => "Audio"; - public override FontAwesome Icon => FontAwesome.fa_headphones; + public override FontAwesome Icon => FontAwesome.fa_volume_up; public AudioSection() { @@ -23,4 +23,4 @@ namespace osu.Game.Overlays.Settings.Sections }; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/SettingsOverlay.cs b/osu.Game/Overlays/SettingsOverlay.cs index a80f6d4da8..f798d63e5a 100644 --- a/osu.Game/Overlays/SettingsOverlay.cs +++ b/osu.Game/Overlays/SettingsOverlay.cs @@ -177,8 +177,6 @@ namespace osu.Game.Overlays public override bool AcceptsFocus => true; - protected override bool OnClick(InputState state) => true; - protected override void OnFocus(InputState state) { GetContainingInputManager().ChangeFocus(searchTextBox); diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index e36db1f9da..ef1f7c8c70 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -62,10 +62,10 @@ namespace osu.Game.Overlays.Toolbar new ToolbarChatButton(), new ToolbarSocialButton(), new ToolbarMusicButton(), - new ToolbarButton - { - Icon = FontAwesome.fa_search - }, + //new ToolbarButton + //{ + // Icon = FontAwesome.fa_search + //}, userArea = new ToolbarUserArea(), new ToolbarNotificationButton(), } diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index 9aa660147a..c2e7fc5b44 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -10,7 +10,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.UserInterface; @@ -34,15 +33,6 @@ namespace osu.Game.Overlays public const float CONTENT_X_MARGIN = 50; - // receive input outside our bounds so we can trigger a close event on ourselves. - public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; - - protected override bool OnClick(InputState state) - { - State = Visibility.Hidden; - return true; - } - public UserProfileOverlay() { FirstWaveColour = OsuColour.Gray(0.4f); diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs index 5ab4b7636b..3d7880f56f 100644 --- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs @@ -9,7 +9,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Judgements { diff --git a/osu.Game/Rulesets/Judgements/Judgement.cs b/osu.Game/Rulesets/Judgements/Judgement.cs index d804111a7f..f8c9b9734f 100644 --- a/osu.Game/Rulesets/Judgements/Judgement.cs +++ b/osu.Game/Rulesets/Judgements/Judgement.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Judgements { diff --git a/osu.Game/Rulesets/Mods/IApplicableFailOverride.cs b/osu.Game/Rulesets/Mods/IApplicableFailOverride.cs new file mode 100644 index 0000000000..2d7cda5f1f --- /dev/null +++ b/osu.Game/Rulesets/Mods/IApplicableFailOverride.cs @@ -0,0 +1,16 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Mods +{ + /// + /// Represents a mod which can override (and block) a fail. + /// + public interface IApplicableFailOverride : IApplicableMod + { + /// + /// Whether we should allow failing at the current point in time. + /// + bool AllowFail { get; } + } +} diff --git a/osu.Game/Rulesets/Mods/IApplicableMod.cs b/osu.Game/Rulesets/Mods/IApplicableMod.cs new file mode 100644 index 0000000000..ed2b652598 --- /dev/null +++ b/osu.Game/Rulesets/Mods/IApplicableMod.cs @@ -0,0 +1,13 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Mods +{ + /// + /// The base interface for a mod which can be applied in some way. + /// If this is not implemented by a mod, it will not be available for use in-game. + /// + public interface IApplicableMod + { + } +} diff --git a/osu.Game/Rulesets/Mods/IApplicableToClock.cs b/osu.Game/Rulesets/Mods/IApplicableToClock.cs index f0502cf346..8bb4e2b97d 100644 --- a/osu.Game/Rulesets/Mods/IApplicableToClock.cs +++ b/osu.Game/Rulesets/Mods/IApplicableToClock.cs @@ -8,8 +8,8 @@ namespace osu.Game.Rulesets.Mods /// /// An interface for mods that make adjustments to the track. /// - public interface IApplicableToClock + public interface IApplicableToClock : IApplicableMod { void ApplyToClock(IAdjustableClock clock); } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Mods/IApplicableToDifficulty.cs b/osu.Game/Rulesets/Mods/IApplicableToDifficulty.cs index 58f5defb5e..a95aa4370c 100644 --- a/osu.Game/Rulesets/Mods/IApplicableToDifficulty.cs +++ b/osu.Game/Rulesets/Mods/IApplicableToDifficulty.cs @@ -8,8 +8,8 @@ namespace osu.Game.Rulesets.Mods /// /// An interface for mods that make general adjustments to difficulty. /// - public interface IApplicableToDifficulty + public interface IApplicableToDifficulty : IApplicableMod { void ApplyToDifficulty(BeatmapDifficulty difficulty); } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Mods/IApplicableToDrawableHitObject.cs b/osu.Game/Rulesets/Mods/IApplicableToDrawableHitObject.cs new file mode 100644 index 0000000000..66dbc85095 --- /dev/null +++ b/osu.Game/Rulesets/Mods/IApplicableToDrawableHitObject.cs @@ -0,0 +1,20 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using osu.Game.Rulesets.Objects.Drawables; + +namespace osu.Game.Rulesets.Mods +{ + /// + /// An interface for s that can be applied to s. + /// + public interface IApplicableToDrawableHitObjects : IApplicableMod + { + /// + /// Applies this to a list of s. + /// + /// The list of s to apply to. + void ApplyToDrawableHitObjects(IEnumerable drawables); + } +} diff --git a/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs b/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs index 7f39def343..1964ad728f 100644 --- a/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs +++ b/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs @@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Mods /// /// An interface for s that can be applied to s. /// - public interface IApplicableToHitObject + public interface IApplicableToHitObject : IApplicableMod where TObject : HitObject { /// diff --git a/osu.Game/Rulesets/Mods/IApplicableToRulesetContainer.cs b/osu.Game/Rulesets/Mods/IApplicableToRulesetContainer.cs index 9b23dd58f9..eae8c9d15c 100644 --- a/osu.Game/Rulesets/Mods/IApplicableToRulesetContainer.cs +++ b/osu.Game/Rulesets/Mods/IApplicableToRulesetContainer.cs @@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Mods /// /// An interface for s that can be applied to s. /// - public interface IApplicableToRulesetContainer + public interface IApplicableToRulesetContainer : IApplicableMod where TObject : HitObject { /// diff --git a/osu.Game/Rulesets/Mods/IApplicableToScoreProcessor.cs b/osu.Game/Rulesets/Mods/IApplicableToScoreProcessor.cs index db9b713c59..2314999d4f 100644 --- a/osu.Game/Rulesets/Mods/IApplicableToScoreProcessor.cs +++ b/osu.Game/Rulesets/Mods/IApplicableToScoreProcessor.cs @@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Mods /// /// An interface for mods that make general adjustments to score processor. /// - public interface IApplicableToScoreProcessor + public interface IApplicableToScoreProcessor : IApplicableMod { void ApplyToScoreProcessor(ScoreProcessor scoreProcessor); } diff --git a/osu.Game/Rulesets/Mods/Mod.cs b/osu.Game/Rulesets/Mods/Mod.cs index 7b0034863e..68ed545701 100644 --- a/osu.Game/Rulesets/Mods/Mod.cs +++ b/osu.Game/Rulesets/Mods/Mod.cs @@ -41,6 +41,11 @@ namespace osu.Game.Rulesets.Mods /// public abstract double ScoreMultiplier { get; } + /// + /// Returns true if this mod is implemented (and playable). + /// + public virtual bool HasImplementation => this is IApplicableMod; + /// /// Returns if this mod is ranked. /// @@ -50,10 +55,5 @@ namespace osu.Game.Rulesets.Mods /// The mods this mod cannot be enabled with. /// public virtual Type[] IncompatibleMods => new Type[] { }; - - /// - /// Whether we should allow failing at the current point in time. - /// - public virtual bool AllowFail => true; } } diff --git a/osu.Game/Rulesets/Mods/ModAutoplay.cs b/osu.Game/Rulesets/Mods/ModAutoplay.cs index d94d4ba0db..bddb97f374 100644 --- a/osu.Game/Rulesets/Mods/ModAutoplay.cs +++ b/osu.Game/Rulesets/Mods/ModAutoplay.cs @@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Mods } } - public class ModAutoplay : Mod + public class ModAutoplay : Mod, IApplicableFailOverride { public override string Name => "Autoplay"; public override string ShortenedName => "AT"; @@ -29,5 +29,6 @@ namespace osu.Game.Rulesets.Mods public override string Description => "Watch a perfect automated play through the song"; public override double ScoreMultiplier => 0; public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail) }; + public bool AllowFail => false; } } diff --git a/osu.Game/Rulesets/Mods/ModNoFail.cs b/osu.Game/Rulesets/Mods/ModNoFail.cs index 3a3878d77e..8aefd1b88e 100644 --- a/osu.Game/Rulesets/Mods/ModNoFail.cs +++ b/osu.Game/Rulesets/Mods/ModNoFail.cs @@ -6,7 +6,7 @@ using osu.Game.Graphics; namespace osu.Game.Rulesets.Mods { - public abstract class ModNoFail : Mod + public abstract class ModNoFail : Mod, IApplicableFailOverride { public override string Name => "NoFail"; public override string ShortenedName => "NF"; @@ -20,6 +20,6 @@ namespace osu.Game.Rulesets.Mods /// /// We never fail, 'yo. /// - public override bool AllowFail => false; + public bool AllowFail => false; } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index ab4c04be3f..45a7275c53 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -16,6 +16,7 @@ using osu.Game.Graphics; using osu.Framework.Configuration; using OpenTK; using osu.Framework.Graphics.Primitives; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Objects.Drawables { @@ -74,6 +75,9 @@ namespace osu.Game.Rulesets.Objects.Drawables protected List Samples = new List(); protected virtual IEnumerable GetSamples() => HitObject.Samples; + // Todo: Rulesets should be overriding the resources instead, but we need to figure out where/when to apply overrides first + protected virtual string SampleNamespace => null; + public readonly Bindable State = new Bindable(); protected DrawableHitObject(TObject hitObject) @@ -101,7 +105,7 @@ namespace osu.Game.Rulesets.Objects.Drawables Volume = s.Volume > 0 ? s.Volume : HitObject.SampleControlPoint.SampleVolume }; - SampleChannel channel = localSampleInfo.GetChannel(audio.Sample); + SampleChannel channel = localSampleInfo.GetChannel(audio.Sample, SampleNamespace); if (channel == null) continue; @@ -119,6 +123,9 @@ namespace osu.Game.Rulesets.Objects.Drawables { UpdateState(state); + // apply any custom state overrides + ApplyCustomUpdateState?.Invoke(this, state); + if (State == ArmedState.Hit) PlaySamples(); }; @@ -240,9 +247,15 @@ namespace osu.Game.Rulesets.Objects.Drawables h.OnJudgement += (d, j) => OnJudgement?.Invoke(d, j); h.OnJudgementRemoved += (d, j) => OnJudgementRemoved?.Invoke(d, j); + h.ApplyCustomUpdateState += (d, s) => ApplyCustomUpdateState?.Invoke(d, s); nestedHitObjects.Add(h); } + /// + /// Bind to apply a custom state which can override the default implementation. + /// + public event Action ApplyCustomUpdateState; + protected abstract void UpdateState(ArmedState state); } } diff --git a/osu.Game/Rulesets/RulesetStore.cs b/osu.Game/Rulesets/RulesetStore.cs index 5cdf46ee46..3038c51e64 100644 --- a/osu.Game/Rulesets/RulesetStore.cs +++ b/osu.Game/Rulesets/RulesetStore.cs @@ -38,6 +38,13 @@ namespace osu.Game.Rulesets /// A ruleset, if available, else null. public RulesetInfo GetRuleset(int id) => AvailableRulesets.FirstOrDefault(r => r.ID == id); + /// + /// Retrieve a ruleset using a known short name. + /// + /// The ruleset's short name. + /// A ruleset, if available, else null. + public RulesetInfo GetRuleset(string shortName) => AvailableRulesets.FirstOrDefault(r => r.ShortName == shortName); + /// /// All available rulesets. /// diff --git a/osu.Game/Rulesets/Objects/Drawables/HitResult.cs b/osu.Game/Rulesets/Scoring/HitResult.cs similarity index 91% rename from osu.Game/Rulesets/Objects/Drawables/HitResult.cs rename to osu.Game/Rulesets/Scoring/HitResult.cs index 961843cbd7..49ab9fd2f0 100644 --- a/osu.Game/Rulesets/Objects/Drawables/HitResult.cs +++ b/osu.Game/Rulesets/Scoring/HitResult.cs @@ -3,7 +3,7 @@ using System.ComponentModel; -namespace osu.Game.Rulesets.Objects.Drawables +namespace osu.Game.Rulesets.Scoring { public enum HitResult { diff --git a/osu.Game/Rulesets/Scoring/Score.cs b/osu.Game/Rulesets/Scoring/Score.cs index 6a06f364c6..025335ba55 100644 --- a/osu.Game/Rulesets/Scoring/Score.cs +++ b/osu.Game/Rulesets/Scoring/Score.cs @@ -40,6 +40,6 @@ namespace osu.Game.Rulesets.Scoring public DateTimeOffset Date; - public Dictionary Statistics = new Dictionary(); + public Dictionary Statistics = new Dictionary(); } } diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index e129a81116..23c4464bb1 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -8,7 +8,6 @@ using osu.Game.Beatmaps; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.UI; -using osu.Game.Rulesets.Objects.Drawables; namespace osu.Game.Rulesets.Scoring { diff --git a/osu.Game/Rulesets/UI/ModIcon.cs b/osu.Game/Rulesets/UI/ModIcon.cs index 5ca3d9521b..90f63aeab6 100644 --- a/osu.Game/Rulesets/UI/ModIcon.cs +++ b/osu.Game/Rulesets/UI/ModIcon.cs @@ -28,7 +28,7 @@ namespace osu.Game.Rulesets.UI private readonly ModType type; - public string TooltipText { get; } + public virtual string TooltipText { get; } public ModIcon(Mod mod) { diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 8d09b554dd..3706033b68 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -261,6 +261,9 @@ namespace osu.Game.Rulesets.UI } Playfield.PostProcess(); + + foreach (var mod in Mods.OfType()) + mod.ApplyToDrawableHitObjects(Playfield.HitObjects.Objects); } protected override void Update() diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs index de84e90baf..36867a84d5 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs @@ -3,6 +3,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Framework.Threading; using osu.Game.Graphics.Backgrounds; namespace osu.Game.Screens.Backgrounds @@ -24,16 +25,22 @@ namespace osu.Game.Screens.Backgrounds private void display(Background newBackground) { - current?.FadeOut(800, Easing.OutQuint); + current?.FadeOut(800, Easing.InOutSine); current?.Expire(); Add(current = newBackground); + currentDisplay++; } + private ScheduledDelegate nextTask; + public void Next() { - currentDisplay++; - LoadComponentAsync(new Background(backgroundName) { Depth = currentDisplay }, display); + nextTask?.Cancel(); + nextTask = Scheduler.AddDelayed(() => + { + LoadComponentAsync(new Background(backgroundName) { Depth = currentDisplay }, display); + }, 100); } } } diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 19d00f3477..76f51d1c33 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -24,7 +24,7 @@ namespace osu.Game.Screens.Edit { protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg4"); - public override bool ShowOverlays => false; + public override bool ShowOverlaysOnEnter => false; private readonly Box bottomBackground; private readonly Container screenContainer; diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index ec2e8e0cb1..c96194f63d 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -17,7 +17,7 @@ namespace osu.Game.Screens { private bool showDisclaimer; - public override bool ShowOverlays => false; + public override bool ShowOverlaysOnEnter => false; public Loader() { diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index ce7856c5a9..c82d90d16c 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -11,12 +11,12 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Input; using osu.Game.Graphics; -using osu.Game.Overlays.Toolbar; using OpenTK; using OpenTK.Graphics; using OpenTK.Input; using osu.Framework.Audio.Sample; using osu.Framework.Audio; +using osu.Framework.Configuration; using osu.Framework.Threading; namespace osu.Game.Screens.Menu @@ -25,6 +25,8 @@ namespace osu.Game.Screens.Menu { public event Action StateChanged; + private readonly BindableBool showOverlays = new BindableBool(); + public Action OnEdit; public Action OnExit; public Action OnDirect; @@ -34,8 +36,6 @@ namespace osu.Game.Screens.Menu public Action OnChart; public Action OnTest; - private Toolbar toolbar; - private readonly FlowContainerWithOrigin buttonFlow; //todo: make these non-internal somehow. @@ -131,9 +131,9 @@ namespace osu.Game.Screens.Menu } [BackgroundDependencyLoader(true)] - private void load(AudioManager audio, OsuGame game = null) + private void load(AudioManager audio, OsuGame game) { - toolbar = game?.Toolbar; + if (game != null) showOverlays.BindTo(game.ShowOverlays); sampleBack = audio.Sample.Get(@"Menu/button-back-select"); } @@ -300,7 +300,7 @@ namespace osu.Game.Screens.Menu logoDelayedAction = Scheduler.AddDelayed(() => { - toolbar?.Hide(); + showOverlays.Value = false; logo.ClearTransforms(targetMember: nameof(Position)); logo.RelativePositionAxes = Axes.Both; @@ -329,7 +329,7 @@ namespace osu.Game.Screens.Menu logoTracking = true; logo.Impact(); - toolbar?.Show(); + showOverlays.Value = true; }, 200); break; default: diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index 532ee71b72..d0ad613640 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -18,7 +18,7 @@ namespace osu.Game.Screens.Menu private readonly SpriteIcon icon; private Color4 iconColour; - public override bool ShowOverlays => false; + public override bool ShowOverlaysOnEnter => false; public override bool HasLocalCursorDisplayed => true; diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index d7beb34a2f..a6a1afa320 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -33,7 +33,7 @@ namespace osu.Game.Screens.Menu public override bool HasLocalCursorDisplayed => true; - public override bool ShowOverlays => false; + public override bool ShowOverlaysOnEnter => false; protected override BackgroundScreen CreateBackground() => new BackgroundScreenEmpty(); diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 90f68ba9f1..fac0ec1422 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -24,7 +24,7 @@ namespace osu.Game.Screens.Menu { private readonly ButtonSystem buttons; - public override bool ShowOverlays => buttons.State != MenuState.Initial; + public override bool ShowOverlaysOnEnter => buttons.State != MenuState.Initial; private readonly BackgroundScreenDefault background; private Screen songSelect; diff --git a/osu.Game/Screens/Multiplayer/ParticipantInfo.cs b/osu.Game/Screens/Multiplayer/ParticipantInfo.cs index fa48287ce1..2197b7477c 100644 --- a/osu.Game/Screens/Multiplayer/ParticipantInfo.cs +++ b/osu.Game/Screens/Multiplayer/ParticipantInfo.cs @@ -27,7 +27,7 @@ namespace osu.Game.Screens.Multiplayer set { host.Text = value.Username; - flagContainer.Children = new[] { new DrawableFlag(value.Country?.FlagName) { RelativeSizeAxes = Axes.Both } }; + flagContainer.Children = new[] { new DrawableFlag(value.Country) { RelativeSizeAxes = Axes.Both } }; } } diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 4a27c7f1ea..0013d1a882 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -28,7 +28,12 @@ namespace osu.Game.Screens /// protected virtual BackgroundScreen CreateBackground() => null; - public virtual bool ShowOverlays => true; + protected BindableBool ShowOverlays = new BindableBool(); + + /// + /// Whether overlays should be shown when this screen is entered or resumed. + /// + public virtual bool ShowOverlaysOnEnter => true; protected new OsuGameBase Game => base.Game as OsuGameBase; @@ -70,7 +75,10 @@ namespace osu.Game.Screens } if (osuGame != null) + { Ruleset.BindTo(osuGame.Ruleset); + ShowOverlays.BindTo(osuGame.ShowOverlays); + } sampleExit = audio.Sample.Get(@"UI/screen-back"); } @@ -94,6 +102,8 @@ namespace osu.Game.Screens base.OnResuming(last); logo.AppendAnimatingAction(() => LogoArriving(logo, true), true); sampleExit?.Play(); + + ShowOverlays.Value = ShowOverlaysOnEnter; } protected override void OnSuspending(Screen next) @@ -139,6 +149,8 @@ namespace osu.Game.Screens logo.AppendAnimatingAction(() => LogoArriving(logo, false), true); base.OnEntering(last); + + ShowOverlays.Value = ShowOverlaysOnEnter; } protected override bool OnExiting(Screen next) diff --git a/osu.Game/Screens/Play/GameplayMenuOverlay.cs b/osu.Game/Screens/Play/GameplayMenuOverlay.cs index 6969cd915b..094c0331f4 100644 --- a/osu.Game/Screens/Play/GameplayMenuOverlay.cs +++ b/osu.Game/Screens/Play/GameplayMenuOverlay.cs @@ -263,6 +263,14 @@ namespace osu.Game.Screens.Play private class Button : DialogButton { + protected override bool OnHover(InputState state) => true; + + protected override bool OnMouseMove(InputState state) + { + Selected.Value = true; + return base.OnMouseMove(state); + } + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) { if (args.Repeat || args.Key != Key.Enter || !Selected) diff --git a/osu.Game/Screens/Play/HUD/StandardHealthDisplay.cs b/osu.Game/Screens/Play/HUD/StandardHealthDisplay.cs index 06ef87276a..351db533f3 100644 --- a/osu.Game/Screens/Play/HUD/StandardHealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/StandardHealthDisplay.cs @@ -7,10 +7,10 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics; using osu.Game.Rulesets.Judgements; -using osu.Game.Rulesets.Objects.Drawables; using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics.Shapes; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Screens.Play.HUD { diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 2cbb203c37..d4cfa0b3d4 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -35,7 +35,7 @@ namespace osu.Game.Screens.Play { protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap); - public override bool ShowOverlays => false; + public override bool ShowOverlaysOnEnter => false; public override bool HasLocalCursorDisplayed => !pauseContainer.IsPaused && !HasFailed && RulesetContainer.ProvidingUserCursor; @@ -46,6 +46,8 @@ namespace osu.Game.Screens.Play public bool HasFailed { get; private set; } public bool AllowPause { get; set; } = true; + public bool AllowLeadIn { get; set; } = true; + public bool AllowResults { get; set; } = true; public int RestartCount; @@ -136,7 +138,10 @@ namespace osu.Game.Screens.Play decoupledClock = new DecoupleableInterpolatingFramedClock { IsCoupled = false }; var firstObjectTime = RulesetContainer.Objects.First().StartTime; - decoupledClock.Seek(Math.Min(0, firstObjectTime - Math.Max(beatmap.ControlPointInfo.TimingPointAt(firstObjectTime).BeatLength * 4, beatmap.BeatmapInfo.AudioLeadIn))); + decoupledClock.Seek(AllowLeadIn + ? Math.Min(0, firstObjectTime - Math.Max(beatmap.ControlPointInfo.TimingPointAt(firstObjectTime).BeatLength * 4, beatmap.BeatmapInfo.AudioLeadIn)) + : firstObjectTime); + decoupledClock.ProcessFrame(); offsetClock = new FramedOffsetClock(decoupledClock); @@ -273,6 +278,8 @@ namespace osu.Game.Screens.Play ValidForResume = false; + if (!AllowResults) return; + using (BeginDelayedSequence(1000)) { onCompletionEvent = Schedule(delegate @@ -291,7 +298,7 @@ namespace osu.Game.Screens.Play private bool onFail() { - if (Beatmap.Value.Mods.Value.Any(m => !m.AllowFail)) + if (Beatmap.Value.Mods.Value.OfType().Any(m => !m.AllowFail)) return false; decoupledClock.Stop(); diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index a220dcee0e..15a97096e7 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -23,7 +23,7 @@ namespace osu.Game.Screens.Play private BeatmapMetadataDisplay info; private bool showOverlays = true; - public override bool ShowOverlays => showOverlays; + public override bool ShowOverlaysOnEnter => showOverlays; public override bool AllowBeatmapRulesetChange => false; diff --git a/osu.Game/Screens/Ranking/ResultsPageScore.cs b/osu.Game/Screens/Ranking/ResultsPageScore.cs index 25a42cae1c..0d29b74dfd 100644 --- a/osu.Game/Screens/Ranking/ResultsPageScore.cs +++ b/osu.Game/Screens/Ranking/ResultsPageScore.cs @@ -23,6 +23,7 @@ using osu.Game.Screens.Play; using osu.Game.Screens.Select.Leaderboards; using osu.Game.Users; using osu.Framework.Graphics.Shapes; +using osu.Framework.Extensions; namespace osu.Game.Screens.Ranking { @@ -163,7 +164,7 @@ namespace osu.Game.Screens.Ranking } }; - statisticsContainer.ChildrenEnumerable = Score.Statistics.Select(s => new DrawableScoreStatistic(s)); + statisticsContainer.ChildrenEnumerable = Score.Statistics.OrderByDescending(p => p.Key).Select(s => new DrawableScoreStatistic(s)); } protected override void LoadComplete() @@ -186,9 +187,9 @@ namespace osu.Game.Screens.Ranking private class DrawableScoreStatistic : Container { - private readonly KeyValuePair statistic; + private readonly KeyValuePair statistic; - public DrawableScoreStatistic(KeyValuePair statistic) + public DrawableScoreStatistic(KeyValuePair statistic) { this.statistic = statistic; @@ -209,7 +210,7 @@ namespace osu.Game.Screens.Ranking Origin = Anchor.TopCentre, }, new OsuSpriteText { - Text = statistic.Key, + Text = statistic.Key.GetDescription(), Colour = colours.Gray7, Font = @"Exo2.0-Bold", Y = 26, @@ -250,16 +251,16 @@ namespace osu.Game.Screens.Ranking { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, - Text = datetime.ToString("HH:mm"), - Padding = new MarginPadding { Left = 10, Right = 10, Top = 5, Bottom = 5 }, + Text = datetime.ToShortDateString(), + Padding = new MarginPadding { Horizontal = 10, Vertical = 5 }, Colour = Color4.White, }, new OsuSpriteText { Origin = Anchor.CentreRight, Anchor = Anchor.CentreRight, - Text = datetime.ToString("yyyy/MM/dd"), - Padding = new MarginPadding { Left = 10, Right = 10, Top = 5, Bottom = 5 }, + Text = datetime.ToShortTimeString(), + Padding = new MarginPadding { Horizontal = 10, Vertical = 5 }, Colour = Color4.White, } }; diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 9d7867659d..98acd0815d 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -53,6 +53,11 @@ namespace osu.Game.Screens.Select public override bool HandleInput => AllowSelection; + /// + /// Used to avoid firing null selections before the initial beatmaps have been loaded via . + /// + private bool initialLoadComplete; + private IEnumerable beatmapSets => root.Children.OfType(); public IEnumerable BeatmapSets @@ -76,7 +81,11 @@ namespace osu.Game.Screens.Select itemsCache.Invalidate(); scrollPositionCache.Invalidate(); - Schedule(() => BeatmapSetsChanged?.Invoke()); + Schedule(() => + { + BeatmapSetsChanged?.Invoke(); + initialLoadComplete = true; + }); })); } } @@ -185,7 +194,14 @@ namespace osu.Game.Screens.Select if (!Items.Any()) return; - int originalIndex = Items.IndexOf(selectedBeatmap?.Drawables.First()); + DrawableCarouselItem drawable = null; + + if (selectedBeatmap != null && (drawable = selectedBeatmap.Drawables.FirstOrDefault()) == null) + // if the selected beatmap isn't present yet, we can't correctly change selection. + // we can fix this by changing this method to not reference drawables / Items in the first place. + return; + + int originalIndex = Items.IndexOf(drawable); int currentIndex = originalIndex; // local function to increment the index in the required direction, wrapping over extremities. @@ -213,11 +229,15 @@ namespace osu.Game.Screens.Select } } - public void SelectNextRandom() + /// + /// Select the next beatmap in the random sequence. + /// + /// True if a selection could be made, else False. + public bool SelectNextRandom() { var visible = beatmapSets.Where(s => !s.Filtered).ToList(); if (!visible.Any()) - return; + return false; if (selectedBeatmap != null) { @@ -247,6 +267,7 @@ namespace osu.Game.Screens.Select set = visible.ElementAt(RNG.Next(visible.Count)); select(set.Beatmaps.Skip(RNG.Next(set.Beatmaps.Count())).FirstOrDefault()); + return true; } public void SelectPreviousRandom() @@ -513,7 +534,7 @@ namespace osu.Game.Screens.Select currentY += DrawHeight / 2; scrollableContent.Height = currentY; - if (selectedBeatmapSet == null || selectedBeatmap == null || selectedBeatmapSet.State.Value != CarouselItemState.Selected) + if (initialLoadComplete && (selectedBeatmapSet == null || selectedBeatmap == null || selectedBeatmapSet.State.Value != CarouselItemState.Selected)) { selectedBeatmapSet = null; SelectionChanged?.Invoke(null); diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index fa1326de8c..c25ba66475 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -20,6 +20,7 @@ using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Cursor; +using osu.Framework.Localisation; namespace osu.Game.Screens.Select { @@ -71,10 +72,6 @@ namespace osu.Game.Screens.Select { State = beatmap == null ? Visibility.Hidden : Visibility.Visible; - // ensure we ourselves are visible if not already. - if (!IsPresent) - State = Visibility.Visible; - Info?.FadeOut(250); Info?.Expire(); @@ -90,6 +87,8 @@ namespace osu.Game.Screens.Select public OsuSpriteText ArtistLabel { get; private set; } public FillFlowContainer MapperContainer { get; private set; } public FillFlowContainer InfoLabelContainer { get; private set; } + private UnicodeBindableString titleBinding; + private UnicodeBindableString artistBinding; public BufferedWedgeInfo(WorkingBeatmap working) { @@ -97,7 +96,7 @@ namespace osu.Game.Screens.Select } [BackgroundDependencyLoader] - private void load() + private void load(LocalisationEngine localisation) { var beatmapInfo = working.BeatmapInfo; var metadata = beatmapInfo.Metadata ?? working.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata(); @@ -106,6 +105,9 @@ namespace osu.Game.Screens.Select CacheDrawnFrameBuffer = true; RelativeSizeAxes = Axes.Both; + titleBinding = localisation.GetUnicodePreference(metadata.TitleUnicode, metadata.Title); + artistBinding = localisation.GetUnicodePreference(metadata.ArtistUnicode, metadata.Artist); + Children = new Drawable[] { // We will create the white-to-black gradient by modulating transparency and having @@ -171,13 +173,11 @@ namespace osu.Game.Screens.Select TitleLabel = new OsuSpriteText { Font = @"Exo2.0-MediumItalic", - Text = string.IsNullOrEmpty(metadata.Source) ? metadata.Title : metadata.Source + " — " + metadata.Title, TextSize = 28, }, ArtistLabel = new OsuSpriteText { Font = @"Exo2.0-MediumItalic", - Text = metadata.Artist, TextSize = 17, }, MapperContainer = new FillFlowContainer @@ -197,6 +197,15 @@ namespace osu.Game.Screens.Select } } }; + artistBinding.ValueChanged += value => setMetadata(metadata.Source); + artistBinding.TriggerChange(); + } + + private void setMetadata(string source) + { + ArtistLabel.Text = artistBinding.Value; + TitleLabel.Text = string.IsNullOrEmpty(source) ? titleBinding.Value : source + " — " + titleBinding.Value; + ForceRedraw(); } private InfoLabel[] getInfoLabels() diff --git a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs index 6c0cc341fd..cea658b06c 100644 --- a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs +++ b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs @@ -46,7 +46,7 @@ namespace osu.Game.Screens.Select.Carousel { if (songSelect != null) { - startRequested = songSelect.Start; + startRequested = songSelect.FinaliseSelection; editRequested = songSelect.Edit; } diff --git a/osu.Game/Screens/Select/EditSongSelect.cs b/osu.Game/Screens/Select/EditSongSelect.cs index f02d25501e..37f2663d91 100644 --- a/osu.Game/Screens/Select/EditSongSelect.cs +++ b/osu.Game/Screens/Select/EditSongSelect.cs @@ -7,6 +7,10 @@ namespace osu.Game.Screens.Select { protected override bool ShowFooter => false; - protected override void Start() => Exit(); + protected override bool OnSelectionFinalised() + { + Exit(); + return true; + } } } diff --git a/osu.Game/Screens/Select/ImportFromStablePopup.cs b/osu.Game/Screens/Select/ImportFromStablePopup.cs index 489ab79fa4..03e9462636 100644 --- a/osu.Game/Screens/Select/ImportFromStablePopup.cs +++ b/osu.Game/Screens/Select/ImportFromStablePopup.cs @@ -14,7 +14,7 @@ namespace osu.Game.Screens.Select HeaderText = @"You have no beatmaps!"; BodyText = "An existing copy of osu! was found, though.\nWould you like to import your beatmaps?"; - Icon = FontAwesome.fa_trash_o; + Icon = FontAwesome.fa_plane; Buttons = new PopupDialogButton[] { diff --git a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs index c15a179e8c..ac47fade48 100644 --- a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs @@ -109,6 +109,13 @@ namespace osu.Game.Screens.Select.Leaderboards { if (value == placeholderState) return; + if (value != PlaceholderState.Successful) + { + getScoresRequest?.Cancel(); + getScoresRequest = null; + Scores = null; + } + switch (placeholderState = value) { case PlaceholderState.NetworkFailure: @@ -211,10 +218,6 @@ namespace osu.Game.Screens.Select.Leaderboards private void updateScores() { - getScoresRequest?.Cancel(); - getScoresRequest = null; - Scores = null; - if (Scope == LeaderboardScope.Local) { // TODO: get local scores from wherever here. @@ -234,16 +237,15 @@ namespace osu.Game.Screens.Select.Leaderboards return; } - PlaceholderState = PlaceholderState.Retrieving; - loading.Show(); - if (Scope != LeaderboardScope.Global && !api.LocalUser.Value.IsSupporter) { - loading.Hide(); PlaceholderState = PlaceholderState.NotSupporter; return; } + PlaceholderState = PlaceholderState.Retrieving; + loading.Show(); + getScoresRequest = new GetScoresRequest(Beatmap, osuGame?.Ruleset.Value ?? Beatmap.Ruleset, Scope); getScoresRequest.Success += r => { diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 377f32184d..857a716ab7 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -146,7 +146,7 @@ namespace osu.Game.Screens.Select.Leaderboards Masking = true, Children = new Drawable[] { - new DrawableFlag(Score.User?.Country?.FlagName) + new DrawableFlag(Score.User?.Country) { Width = 30, RelativeSizeAxes = Axes.Y, diff --git a/osu.Game/Screens/Select/MatchSongSelect.cs b/osu.Game/Screens/Select/MatchSongSelect.cs index 898c195432..9143da326d 100644 --- a/osu.Game/Screens/Select/MatchSongSelect.cs +++ b/osu.Game/Screens/Select/MatchSongSelect.cs @@ -5,6 +5,10 @@ namespace osu.Game.Screens.Select { public class MatchSongSelect : SongSelect { - protected override void Start() => Exit(); + protected override bool OnSelectionFinalised() + { + Exit(); + return true; + } } } diff --git a/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs b/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs index c66cc7beff..789064a5f1 100644 --- a/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs +++ b/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs @@ -25,6 +25,8 @@ namespace osu.Game.Screens.Select.Options private readonly Box holder; private readonly FillFlowContainer buttonsContainer; + public override bool BlockScreenWideMouse => false; + protected override void PopIn() { base.PopIn(); diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 727cdb9959..a3997640ba 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -23,7 +23,7 @@ namespace osu.Game.Screens.Select { private OsuScreen player; private readonly ModSelectOverlay modSelect; - private readonly BeatmapDetailArea beatmapDetails; + protected readonly BeatmapDetailArea BeatmapDetails; private bool removeAutoModOnResume; public PlaySongSelect() @@ -35,13 +35,13 @@ namespace osu.Game.Screens.Select Anchor = Anchor.BottomCentre, }); - LeftContent.Add(beatmapDetails = new BeatmapDetailArea + LeftContent.Add(BeatmapDetails = new BeatmapDetailArea { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Top = 10, Right = 5 }, }); - beatmapDetails.Leaderboard.ScoreSelected += s => Push(new Results(s)); + BeatmapDetails.Leaderboard.ScoreSelected += s => Push(new Results(s)); } private SampleChannel sampleConfirm; @@ -78,7 +78,7 @@ namespace osu.Game.Screens.Select beatmap.Mods.BindTo(modSelect.SelectedMods); - beatmapDetails.Beatmap = beatmap; + BeatmapDetails.Beatmap = beatmap; if (beatmap.Track != null) beatmap.Track.Looping = true; @@ -124,9 +124,9 @@ namespace osu.Game.Screens.Select return false; } - protected override void Start() + protected override bool OnSelectionFinalised() { - if (player != null) return; + if (player != null) return false; // Ctrl+Enter should start map with autoplay enabled. if (GetContainingInputManager().CurrentState?.Keyboard.ControlPressed == true) @@ -147,7 +147,12 @@ namespace osu.Game.Screens.Select sampleConfirm?.Play(); - LoadComponentAsync(player = new PlayerLoader(new Player()), l => Push(player)); + LoadComponentAsync(player = new PlayerLoader(new Player()), l => + { + if (IsCurrentScreen) Push(player); + }); + + return true; } } } diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 9e5a2fa633..919cfcfbe4 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -227,13 +227,18 @@ namespace osu.Game.Screens.Select Push(new Editor()); } - public void Start(BeatmapInfo beatmap) + /// + /// Call to make a selection and perform the default action for this SongSelect. + /// + /// An optional beatmap to override the current carousel selection. + public void FinaliseSelection(BeatmapInfo beatmap = null) { // if we have a pending filter operation, we want to run it now. // it could change selection (ie. if the ruleset has been changed). Carousel.FlushPendingFilterOperations(); - Carousel.SelectBeatmap(beatmap); + if (beatmap != null) + Carousel.SelectBeatmap(beatmap); if (selectionChangedDebounce?.Completed == false) { @@ -242,13 +247,14 @@ namespace osu.Game.Screens.Select selectionChangedDebounce = null; } - Start(); + OnSelectionFinalised(); } /// /// Called when a selection is made. /// - protected abstract void Start(); + /// If a resultant action occurred that takes the user away from SongSelect. + protected abstract bool OnSelectionFinalised(); private ScheduledDelegate selectionChangedDebounce; @@ -339,7 +345,7 @@ namespace osu.Game.Screens.Select logo.Action = () => { - Start(); + FinaliseSelection(); return false; }; } @@ -443,9 +449,16 @@ namespace osu.Game.Screens.Select private void carouselBeatmapsLoaded() { if (!Beatmap.IsDefault && Beatmap.Value.BeatmapSetInfo?.DeletePending == false) + { Carousel.SelectBeatmap(Beatmap.Value.BeatmapInfo); + } else if (Carousel.SelectedBeatmapSet == null) - Carousel.SelectNextRandom(); + { + if (!Carousel.SelectNextRandom()) + // in the case random selection failed, we want to trigger selectionChanged + // to show the dummy beatmap (we have nothing else to display). + carouselSelectionChanged(null); + } } private void delete(BeatmapSetInfo beatmap) @@ -462,7 +475,7 @@ namespace osu.Game.Screens.Select { case Key.KeypadEnter: case Key.Enter: - Start(); + FinaliseSelection(); return true; case Key.Delete: if (state.Keyboard.ShiftPressed) diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game/Screens/Tournament/Drawings.cs index 6a8a361ea0..08f27dfde9 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game/Screens/Tournament/Drawings.cs @@ -29,7 +29,7 @@ namespace osu.Game.Screens.Tournament { private const string results_filename = "drawings_results.txt"; - public override bool ShowOverlays => false; + public override bool ShowOverlaysOnEnter => false; protected override BackgroundScreen CreateBackground() => new BackgroundScreenDefault(); diff --git a/osu.Game/Tests/Beatmaps/TestWorkingBeatmap.cs b/osu.Game/Tests/Beatmaps/TestWorkingBeatmap.cs index da139775b1..82248c2cb8 100644 --- a/osu.Game/Tests/Beatmaps/TestWorkingBeatmap.cs +++ b/osu.Game/Tests/Beatmaps/TestWorkingBeatmap.cs @@ -19,6 +19,6 @@ namespace osu.Game.Tests.Beatmaps protected override Beatmap GetBeatmap() => beatmap; protected override Texture GetBackground() => null; - protected override Track GetTrack() => null; + protected override Track GetTrack() => new TrackVirtual(); } } diff --git a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs index 8984fc843f..8b93be9bb5 100644 --- a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs +++ b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs @@ -7,6 +7,7 @@ using OpenTK; using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Caching; +using osu.Framework.Configuration; using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -203,6 +204,8 @@ namespace osu.Game.Tests.Visual private readonly FillFlowContainer scores; private APIAccess api; + private readonly Bindable currentBeatmap = new Bindable(); + public PerformanceList() { RelativeSizeAxes = Axes.X; @@ -231,12 +234,15 @@ namespace osu.Game.Tests.Visual }; } - osuGame.Beatmap.ValueChanged += beatmapChanged; + currentBeatmap.ValueChanged += beatmapChanged; + currentBeatmap.BindTo(osuGame.Beatmap); } private GetScoresRequest lastRequest; private void beatmapChanged(WorkingBeatmap newBeatmap) { + if (!IsAlive) return; + lastRequest?.Cancel(); scores.Clear(); diff --git a/osu.Game/Tests/Visual/TestCasePlayer.cs b/osu.Game/Tests/Visual/TestCasePlayer.cs index 106f0fa8f3..933781890f 100644 --- a/osu.Game/Tests/Visual/TestCasePlayer.cs +++ b/osu.Game/Tests/Visual/TestCasePlayer.cs @@ -22,6 +22,8 @@ namespace osu.Game.Tests.Visual protected Player Player; + private TestWorkingBeatmap working; + /// /// Create a TestCase which runs through the Player screen. /// @@ -75,7 +77,7 @@ namespace osu.Game.Tests.Visual var instance = r.CreateInstance(); - WorkingBeatmap working = new TestWorkingBeatmap(beatmap); + working = new TestWorkingBeatmap(beatmap); working.Mods.Value = new[] { instance.GetAllMods().First(m => m is ModNoFail) }; if (Player != null) @@ -88,10 +90,21 @@ namespace osu.Game.Tests.Visual return player; } + protected override void Update() + { + base.Update(); + + if (working != null) + // note that this will override any mod rate application + working.Track.Rate = Clock.Rate; + } + protected virtual Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset) => new Player { InitialBeatmap = beatmap, - AllowPause = false + AllowPause = false, + AllowLeadIn = false, + AllowResults = false, }; private const string test_beatmap_data = diff --git a/osu.Game/Users/Country.cs b/osu.Game/Users/Country.cs index 0c0d12c1cc..46ddaee637 100644 --- a/osu.Game/Users/Country.cs +++ b/osu.Game/Users/Country.cs @@ -6,6 +6,7 @@ using Newtonsoft.Json; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; @@ -26,36 +27,30 @@ namespace osu.Game.Users public string FlagName; } - public class DrawableFlag : Container + public class DrawableFlag : Container, IHasTooltip { private readonly Sprite sprite; private TextureStore textures; - private string flagName; - public string FlagName + private Country country; + public Country Country { - get { return flagName; } + get { return country; } set { - if (value == flagName) return; - flagName = value; - sprite.Texture = textures.Get($@"Flags/{flagName}"); + if (value == country) + return; + + country = value; + sprite.Texture = getFlagTexture(); } } - [BackgroundDependencyLoader] - private void load(TextureStore ts) - { - if (ts == null) - throw new ArgumentNullException(nameof(ts)); + public string TooltipText => country?.FullName; - textures = ts; - sprite.Texture = textures.Get($@"Flags/{flagName}"); - } - - public DrawableFlag(string name = null) + public DrawableFlag(Country country = null) { - flagName = name ?? @"__"; + this.country = country; Children = new Drawable[] { @@ -65,5 +60,17 @@ namespace osu.Game.Users }, }; } + + [BackgroundDependencyLoader] + private void load(TextureStore ts) + { + if (ts == null) + throw new ArgumentNullException(nameof(ts)); + + textures = ts; + sprite.Texture = getFlagTexture(); + } + + private Texture getFlagTexture() => textures.Get($@"Flags/{country?.FlagName ?? @"__"}"); } } diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index a2cc8e8d49..e0a4e3184d 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -114,7 +114,7 @@ namespace osu.Game.Users Spacing = new Vector2(5f, 0f), Children = new Drawable[] { - new DrawableFlag(user.Country?.FlagName) + new DrawableFlag(user.Country) { Width = 30f, RelativeSizeAxes = Axes.Y, From e8ef21c0a441778a5f0a5e3bdc8c44c47abd67cb Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 5 Jan 2018 12:09:33 +0900 Subject: [PATCH 033/109] Update submodules --- osu-framework | 2 +- osu-resources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 4b819607f3..15fd489d2b 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 4b819607f36f6a87472c7d654e02f2c8e83fac70 +Subproject commit 15fd489d2b4dc1d71a6b98b3001c84f1e60c7c10 diff --git a/osu-resources b/osu-resources index c79d917605..4cc3e92d55 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit c79d917605fa792a5f046fd70d7aa75e58dc9fbc +Subproject commit 4cc3e92d5576c706060e3d1589bd2a81cf20bfdb From 1d3e1bdc1da3b88980ba83a70292c00c1b8f4bbe Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 8 Feb 2018 23:37:16 +0900 Subject: [PATCH 034/109] Update submodules --- osu-framework | 2 +- osu-resources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 15fd489d2b..6febfb7329 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 15fd489d2b4dc1d71a6b98b3001c84f1e60c7c10 +Subproject commit 6febfb7329cd8092c1e9425f0190d3d91b7a2ba6 diff --git a/osu-resources b/osu-resources index 4cc3e92d55..883ff04e79 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 4cc3e92d5576c706060e3d1589bd2a81cf20bfdb +Subproject commit 883ff04e79a76f5eb1f89c4f59bd7476a803b42b From 6fe62de26471fffed4365c999033a2fd1c368f78 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 9 Feb 2018 12:44:41 +0900 Subject: [PATCH 035/109] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 6febfb7329..86079714a5 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 6febfb7329cd8092c1e9425f0190d3d91b7a2ba6 +Subproject commit 86079714a5f5c2678c4cc91df6c0257f33c43bcf From 0dab70cc05be0711ba0f4efa6ebcf89f8ca9888b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 9 Feb 2018 12:48:22 +0900 Subject: [PATCH 036/109] Fix license header --- osu.Game/Utils/ZipUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Utils/ZipUtils.cs b/osu.Game/Utils/ZipUtils.cs index c9a16eb84b..ad22359c20 100644 --- a/osu.Game/Utils/ZipUtils.cs +++ b/osu.Game/Utils/ZipUtils.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; From 65b6a2faad7437e4d14a9084b91e90e3611c4b5e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 21 Mar 2018 18:40:45 +0900 Subject: [PATCH 037/109] Fix mod button sounds playing when mod overlay is not visible Resolves #2240. --- osu.Game/Overlays/Mods/ModButton.cs | 12 ------------ osu.Game/Overlays/Mods/ModSelectOverlay.cs | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs index 91063bfa38..a4cc79bca6 100644 --- a/osu.Game/Overlays/Mods/ModButton.cs +++ b/osu.Game/Overlays/Mods/ModButton.cs @@ -4,9 +4,6 @@ using OpenTK; using OpenTK.Graphics; using OpenTK.Input; -using osu.Framework.Allocation; -using osu.Framework.Audio; -using osu.Framework.Audio.Sample; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; @@ -30,7 +27,6 @@ namespace osu.Game.Overlays.Mods private ModIcon backgroundIcon; private readonly SpriteText text; private readonly Container iconsContainer; - private SampleChannel sampleOn, sampleOff; /// /// Fired when the selection changes. @@ -100,7 +96,6 @@ namespace osu.Game.Overlays.Mods foregroundIcon.Highlighted = Selected; - (selectedIndex == -1 ? sampleOff : sampleOn).Play(); SelectionChanged?.Invoke(SelectedMod); return true; } @@ -152,13 +147,6 @@ namespace osu.Game.Overlays.Mods public virtual Mod SelectedMod => Mods.ElementAtOrDefault(selectedIndex); - [BackgroundDependencyLoader] - private void load(AudioManager audio) - { - sampleOn = audio.Sample.Get(@"UI/check-on"); - sampleOff = audio.Sample.Get(@"UI/check-off"); - } - protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) { switch (args.Button) diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index fe7b7bae99..d8c95da94f 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -15,6 +15,8 @@ using osu.Game.Rulesets.Mods; using System; using System.Collections.Generic; using System.Linq; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; using osu.Framework.Graphics.Shapes; using osu.Game.Rulesets; using osu.Game.Graphics.UserInterface; @@ -49,7 +51,7 @@ namespace osu.Game.Overlays.Mods } [BackgroundDependencyLoader(permitNulls: true)] - private void load(OsuColour colours, OsuGame osu, RulesetStore rulesets) + private void load(OsuColour colours, OsuGame osu, RulesetStore rulesets, AudioManager audio) { SelectedMods.ValueChanged += selectedModsChanged; @@ -63,6 +65,9 @@ namespace osu.Game.Overlays.Mods Ruleset.ValueChanged += rulesetChanged; Ruleset.TriggerChange(); + + sampleOn = audio.Sample.Get(@"UI/check-on"); + sampleOff = audio.Sample.Get(@"UI/check-off"); } protected override void Dispose(bool isDisposing) @@ -154,10 +159,21 @@ namespace osu.Game.Overlays.Mods section.DeselectTypes(modTypes, immediate); } + + private SampleChannel sampleOn, sampleOff; + private void modButtonPressed(Mod selectedMod) { if (selectedMod != null) + { + if (State == Visibility.Visible) sampleOn?.Play(); DeselectTypes(selectedMod.IncompatibleMods, true); + } + else + { + if (State == Visibility.Visible) sampleOff?.Play(); + } + refreshSelectedMods(); } From d909cce8d6b1f5e47da00d762d795c701b28e4af Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 21 Mar 2018 20:06:10 +0900 Subject: [PATCH 038/109] Add the ability to skin the gameplay cursor --- .../UI/Cursor/GameplayCursor.cs | 117 +++++++++--------- 1 file changed, 59 insertions(+), 58 deletions(-) diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs index 34940a084a..ac81d93309 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs @@ -11,6 +11,7 @@ using osu.Framework.Graphics.Shapes; using osu.Framework.Input.Bindings; using osu.Game.Beatmaps; using osu.Game.Configuration; +using osu.Game.Skinning; using OpenTK; using OpenTK.Graphics; @@ -82,7 +83,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor public class OsuCursor : Container { - private Container cursorContainer; + private Drawable cursorContainer; private Bindable cursorScale; private Bindable autoCursorScale; @@ -97,66 +98,66 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor [BackgroundDependencyLoader] private void load(OsuConfigManager config, OsuGameBase game) { - Children = new Drawable[] + Child = cursorContainer = new SkinnableDrawable("cursor", _ => new CircularContainer { - cursorContainer = new CircularContainer + RelativeSizeAxes = Axes.Both, + Masking = true, + BorderThickness = Size.X / 6, + BorderColour = Color4.White, + EdgeEffect = new EdgeEffectParameters { - Origin = Anchor.Centre, - Anchor = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - Masking = true, - BorderThickness = Size.X / 6, - BorderColour = Color4.White, - EdgeEffect = new EdgeEffectParameters - { - Type = EdgeEffectType.Shadow, - Colour = Color4.Pink.Opacity(0.5f), - Radius = 5, - }, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Alpha = 0, - AlwaysPresent = true, - }, - new CircularContainer - { - Origin = Anchor.Centre, - Anchor = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - Masking = true, - BorderThickness = Size.X / 3, - BorderColour = Color4.White.Opacity(0.5f), - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Alpha = 0, - AlwaysPresent = true, - }, - }, - }, - new CircularContainer - { - Origin = Anchor.Centre, - Anchor = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - Scale = new Vector2(0.1f), - Masking = true, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.White, - }, - }, - }, - } + Type = EdgeEffectType.Shadow, + Colour = Color4.Pink.Opacity(0.5f), + Radius = 5, }, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0, + AlwaysPresent = true, + }, + new CircularContainer + { + Origin = Anchor.Centre, + Anchor = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Masking = true, + BorderThickness = Size.X / 3, + BorderColour = Color4.White.Opacity(0.5f), + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0, + AlwaysPresent = true, + }, + }, + }, + new CircularContainer + { + Origin = Anchor.Centre, + Anchor = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Scale = new Vector2(0.1f), + Masking = true, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White, + }, + }, + }, + } + }, restrictSize: false) + { + Origin = Anchor.Centre, + Anchor = Anchor.Centre, + RelativeSizeAxes = Axes.Both, }; beatmap = game.Beatmap.GetBoundCopy(); From d4aeb3d00bb021dde49b742ed1aad3a0c69ed6f9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 23 Mar 2018 01:06:05 +0900 Subject: [PATCH 039/109] Fix BeatmapCarousel's flush not correctly applying selection changes They may have been delayed until the next Update, which is too late in this case. --- osu.Game/Screens/Select/BeatmapCarousel.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index c2bb155753..aed8fb110f 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -328,7 +328,10 @@ namespace osu.Game.Screens.Select public void FlushPendingFilterOperations() { if (FilterTask?.Completed == false) + { applyActiveCriteria(false, false); + Update(); + } } public void Filter(FilterCriteria newCriteria, bool debounce = true) From f77dad280972b7286e58ad45feb4c2a2ed287265 Mon Sep 17 00:00:00 2001 From: Joseph Madamba <35318437+Joehuu@users.noreply.github.com> Date: Thu, 22 Mar 2018 22:49:14 -0700 Subject: [PATCH 040/109] Add perfect mod icon --- osu.Game/Graphics/SpriteIcon.cs | 2 +- osu.Game/Rulesets/Mods/ModPerfect.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/SpriteIcon.cs b/osu.Game/Graphics/SpriteIcon.cs index a93cb4c6cd..4324119481 100644 --- a/osu.Game/Graphics/SpriteIcon.cs +++ b/osu.Game/Graphics/SpriteIcon.cs @@ -988,7 +988,7 @@ namespace osu.Game.Graphics fa_osu_expert_mania = 0xe028, // mod icons - fa_osu_mod_perfect = 0xe02d, + fa_osu_mod_perfect = 0xe049, fa_osu_mod_autopilot = 0xe03a, fa_osu_mod_auto = 0xe03b, fa_osu_mod_cinema = 0xe03c, diff --git a/osu.Game/Rulesets/Mods/ModPerfect.cs b/osu.Game/Rulesets/Mods/ModPerfect.cs index 08942fbe12..116d13bf0a 100644 --- a/osu.Game/Rulesets/Mods/ModPerfect.cs +++ b/osu.Game/Rulesets/Mods/ModPerfect.cs @@ -10,7 +10,7 @@ namespace osu.Game.Rulesets.Mods { public override string Name => "Perfect"; public override string ShortenedName => "PF"; - public override FontAwesome Icon => FontAwesome.fa_question; + public override FontAwesome Icon => FontAwesome.fa_osu_mod_perfect; public override string Description => "SS or quit."; protected override bool FailCondition(ScoreProcessor scoreProcessor) => scoreProcessor.Accuracy.Value != 1; From b56eee1927f6c80bf777f2529687537fc9699e36 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 23 Mar 2018 15:04:40 +0900 Subject: [PATCH 041/109] Fix background loaded player never being disposed if early exit occurs --- osu.Game/Screens/Play/PlayerLoader.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index 89082cfbd5..6d55cdb9ca 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -27,6 +28,8 @@ namespace osu.Game.Screens.Play private bool showOverlays = true; public override bool ShowOverlaysOnEnter => showOverlays; + private Task loadTask; + public PlayerLoader(Player player) { this.player = player; @@ -55,7 +58,7 @@ namespace osu.Game.Screens.Play Margin = new MarginPadding(25) }); - LoadComponentAsync(player); + loadTask = LoadComponentAsync(player); } protected override void OnResuming(Screen last) @@ -65,7 +68,7 @@ namespace osu.Game.Screens.Play contentIn(); //we will only be resumed if the player has requested a re-run (see ValidForResume setting above) - LoadComponentAsync(player = new Player + loadTask = LoadComponentAsync(player = new Player { RestartCount = player.RestartCount + 1, RestartRequested = player.RestartRequested, @@ -154,6 +157,8 @@ namespace osu.Game.Screens.Play { if (!IsCurrentScreen) return; + loadTask = null; + if (!Push(player)) Exit(); else @@ -192,6 +197,14 @@ namespace osu.Game.Screens.Play return base.OnExiting(next); } + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + + // if the player never got pushed, we should explicitly dispose it. + loadTask?.ContinueWith(_ => player.Dispose()); + } + private class BeatmapMetadataDisplay : Container { private class MetadataLine : Container From eb751fa607d25c187947cb53bd4d7988f8824114 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 23 Mar 2018 15:05:28 +0900 Subject: [PATCH 042/109] Fix event unbind not being unbound correctly --- osu.Game/Skinning/LocalSkinOverrideContainer.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Skinning/LocalSkinOverrideContainer.cs b/osu.Game/Skinning/LocalSkinOverrideContainer.cs index b7e2bd0daf..d000127859 100644 --- a/osu.Game/Skinning/LocalSkinOverrideContainer.cs +++ b/osu.Game/Skinning/LocalSkinOverrideContainer.cs @@ -48,13 +48,15 @@ namespace osu.Game.Skinning this.source = source; } + private void onSourceChanged() => SourceChanged?.Invoke(); + protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) { var dependencies = new DependencyContainer(base.CreateLocalDependencies(parent)); fallbackSource = dependencies.Get(); if (fallbackSource != null) - fallbackSource.SourceChanged += () => SourceChanged?.Invoke(); + fallbackSource.SourceChanged += onSourceChanged; dependencies.CacheAs(this); @@ -66,7 +68,7 @@ namespace osu.Game.Skinning base.Dispose(isDisposing); if (fallbackSource != null) - fallbackSource.SourceChanged -= SourceChanged; + fallbackSource.SourceChanged -= onSourceChanged; } } } From 6c4e719e0f675af3724a45862a9338c4038681e0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 23 Mar 2018 15:20:19 +0900 Subject: [PATCH 043/109] Fix API never stopping its thread --- osu.Game/Online/API/APIAccess.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/osu.Game/Online/API/APIAccess.cs b/osu.Game/Online/API/APIAccess.cs index 2cb8424bcc..39ecde55bc 100644 --- a/osu.Game/Online/API/APIAccess.cs +++ b/osu.Game/Online/API/APIAccess.cs @@ -44,7 +44,6 @@ namespace osu.Game.Online.API protected bool HasLogin => Token != null || !string.IsNullOrEmpty(ProvidedUsername) && !string.IsNullOrEmpty(password); - // ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable (should dispose of this or at very least keep a reference). private readonly Thread thread; private readonly Logger log; @@ -267,10 +266,7 @@ namespace osu.Game.Online.API public bool IsLoggedIn => LocalUser.Value.Id > 1; - public void Queue(APIRequest request) - { - queue.Enqueue(request); - } + public void Queue(APIRequest request) => queue.Enqueue(request); public event StateChangeDelegate OnStateChange; @@ -312,6 +308,9 @@ namespace osu.Game.Online.API config.Set(OsuSetting.Token, config.Get(OsuSetting.SavePassword) ? Token : string.Empty); config.Save(); + + flushQueue(); + thread?.Abort(); } } From 52fa837447ba745843331a11e36d3a908115fd03 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 23 Mar 2018 18:17:14 +0900 Subject: [PATCH 044/109] Fix volume glow being cut off Fixes #2285. --- osu.Game/Overlays/Volume/VolumeMeter.cs | 27 ++++++++++++++++--------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/osu.Game/Overlays/Volume/VolumeMeter.cs b/osu.Game/Overlays/Volume/VolumeMeter.cs index 64b9e513c4..b1951f4d72 100644 --- a/osu.Game/Overlays/Volume/VolumeMeter.cs +++ b/osu.Game/Overlays/Volume/VolumeMeter.cs @@ -12,6 +12,7 @@ using osu.Framework.Graphics.Effects; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input.Bindings; +using osu.Framework.MathUtils; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Input.Bindings; @@ -93,19 +94,25 @@ namespace osu.Game.Overlays.Volume Colour = colours.Gray2, Size = new Vector2(0.8f) }, - (volumeCircle = new CircularProgress + new Container { - RelativeSizeAxes = Axes.Both, - InnerRadius = 0.05f, - Rotation = 180, Anchor = Anchor.Centre, Origin = Anchor.Centre, - Size = new Vector2(0.8f) - }).WithEffect(new GlowEffect - { - Colour = meterColour, - Strength = 2 - }), + RelativeSizeAxes = Axes.Both, + Size = new Vector2(0.8f), + Padding = new MarginPadding(-Blur.KernelSize(5)), + Rotation = 180, + Child = (volumeCircle = new CircularProgress + { + RelativeSizeAxes = Axes.Both, + InnerRadius = 0.05f, + }).WithEffect(new GlowEffect + { + Colour = meterColour, + Strength = 2, + PadExtent = true + }), + }, maxGlow = (text = new OsuSpriteText { Anchor = Anchor.Centre, From afdab7895aa3fa3cff46529ef7b164342fda7202 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 23 Mar 2018 20:41:38 +0900 Subject: [PATCH 045/109] Fix beatmap background fade not being updated on retry Fixes #2287 --- osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs index 8e963a94a8..964267cc17 100644 --- a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs +++ b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs @@ -46,6 +46,12 @@ namespace osu.Game.Screens.Play UpdateBackgroundElements(); } + protected override void OnResuming(Screen last) + { + base.OnResuming(last); + UpdateBackgroundElements(); + } + protected virtual void UpdateBackgroundElements() { if (!IsCurrentScreen) return; From f0c0a5110819716e9bfffcaf7f22a681f5e4e88d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 23 Mar 2018 20:57:04 +0900 Subject: [PATCH 046/109] Convert APIAccess to use cancellation tokens --- osu.Game/Online/API/APIAccess.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game/Online/API/APIAccess.cs b/osu.Game/Online/API/APIAccess.cs index 39ecde55bc..957aeac3cd 100644 --- a/osu.Game/Online/API/APIAccess.cs +++ b/osu.Game/Online/API/APIAccess.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Net; using System.Threading; +using System.Threading.Tasks; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Logging; @@ -44,7 +45,7 @@ namespace osu.Game.Online.API protected bool HasLogin => Token != null || !string.IsNullOrEmpty(ProvidedUsername) && !string.IsNullOrEmpty(password); - private readonly Thread thread; + private readonly CancellationTokenSource cancellationToken = new CancellationTokenSource(); private readonly Logger log; @@ -58,8 +59,7 @@ namespace osu.Game.Online.API ProvidedUsername = config.Get(OsuSetting.Username); Token = config.Get(OsuSetting.Token); - thread = new Thread(run) { IsBackground = true }; - thread.Start(); + Task.Factory.StartNew(run, cancellationToken.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default); } private readonly List components = new List(); @@ -92,7 +92,7 @@ namespace osu.Game.Online.API private void run() { - while (thread.IsAlive) + while (!cancellationToken.IsCancellationRequested) { switch (State) { @@ -310,7 +310,7 @@ namespace osu.Game.Online.API config.Save(); flushQueue(); - thread?.Abort(); + cancellationToken.Cancel(); } } From b593c478096b8919aa7078d5e9607e039c7f72ae Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 24 Mar 2018 05:07:48 +0900 Subject: [PATCH 047/109] Add setting to toggle performance logging --- .../Settings/Sections/Debug/GeneralSettings.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs b/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs index 867410b178..ba591b9456 100644 --- a/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs @@ -18,14 +18,19 @@ namespace osu.Game.Overlays.Settings.Sections.Debug { new SettingsCheckbox { - LabelText = "Bypass caching", - Bindable = config.GetBindable(DebugSetting.BypassCaching) + LabelText = "Show log overlay", + Bindable = frameworkConfig.GetBindable(FrameworkSetting.ShowLogOverlay) }, new SettingsCheckbox { - LabelText = "Debug logs", - Bindable = frameworkConfig.GetBindable(FrameworkSetting.ShowLogOverlay) - } + LabelText = "Performance logging", + Bindable = frameworkConfig.GetBindable(FrameworkSetting.PerformanceLogging) + }, + new SettingsCheckbox + { + LabelText = "Bypass caching (slow)", + Bindable = config.GetBindable(DebugSetting.BypassCaching) + }, }; } } From 256baf6d60f10fe2187ba45bfc24d634e9fb2b52 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 24 Mar 2018 05:40:26 +0900 Subject: [PATCH 048/109] Move binding to LoadComplete Previously there was a chance that it would still never get disposed, as the event was bound in async load, before it was in a state it can be recursively disposed via the PlayerLoader call. --- osu.Game/Skinning/LocalSkinOverrideContainer.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/osu.Game/Skinning/LocalSkinOverrideContainer.cs b/osu.Game/Skinning/LocalSkinOverrideContainer.cs index d000127859..95cdde2f48 100644 --- a/osu.Game/Skinning/LocalSkinOverrideContainer.cs +++ b/osu.Game/Skinning/LocalSkinOverrideContainer.cs @@ -55,14 +55,19 @@ namespace osu.Game.Skinning var dependencies = new DependencyContainer(base.CreateLocalDependencies(parent)); fallbackSource = dependencies.Get(); - if (fallbackSource != null) - fallbackSource.SourceChanged += onSourceChanged; - dependencies.CacheAs(this); return dependencies; } + protected override void LoadComplete() + { + base.LoadComplete(); + + if (fallbackSource != null) + fallbackSource.SourceChanged += onSourceChanged; + } + protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); From 3844e95656a756286f8c31106bea35026b3af904 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 24 Mar 2018 05:55:56 +0900 Subject: [PATCH 049/109] Fix one more instance of the same thing happening --- osu.Game/Input/Bindings/DatabasedKeyBindingContainer.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Input/Bindings/DatabasedKeyBindingContainer.cs b/osu.Game/Input/Bindings/DatabasedKeyBindingContainer.cs index b6bc348a52..2b53f77d62 100644 --- a/osu.Game/Input/Bindings/DatabasedKeyBindingContainer.cs +++ b/osu.Game/Input/Bindings/DatabasedKeyBindingContainer.cs @@ -45,6 +45,11 @@ namespace osu.Game.Input.Bindings private void load(KeyBindingStore keyBindings) { store = keyBindings; + } + + protected override void LoadComplete() + { + base.LoadComplete(); store.KeyBindingChanged += ReloadMappings; } From ade97f8c0c2ca3a93b2e3ebec01b6e1847416148 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 24 Mar 2018 05:58:59 +0900 Subject: [PATCH 050/109] Increase deploy delta keep --- osu.Desktop.Deploy/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Desktop.Deploy/Program.cs b/osu.Desktop.Deploy/Program.cs index d8ff2bfd82..3a716468c9 100644 --- a/osu.Desktop.Deploy/Program.cs +++ b/osu.Desktop.Deploy/Program.cs @@ -39,7 +39,7 @@ namespace osu.Desktop.Deploy /// /// How many previous build deltas we want to keep when publishing. /// - private const int keep_delta_count = 3; + private const int keep_delta_count = 4; private static string codeSigningCmd => string.IsNullOrEmpty(codeSigningPassword) ? "" : $"-n \"/a /f {codeSigningCertPath} /p {codeSigningPassword} /t http://timestamp.comodoca.com/authenticode\""; From 7115e4390eabb3f408cc7d623c2b85798a0deaae Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 24 Mar 2018 11:18:24 +0900 Subject: [PATCH 051/109] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index d8d4f55e10..99140d9d79 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit d8d4f55e10ac553223db75874bae6ae4894b739a +Subproject commit 99140d9d79909d1a5474e01c60e54cbdc27f6b19 From 19966988170f93c3469341cc7ff664994e0a8941 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 24 Mar 2018 11:40:45 +0900 Subject: [PATCH 052/109] Fix @1x skin elements not being used --- osu.Game/Skinning/LegacySkin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index 66e8cb8f9f..1b52507688 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -63,7 +63,7 @@ namespace osu.Game.Skinning if (texture == null) { ratio *= 2; - GetTexture(componentName); + texture = GetTexture(componentName); } if (texture == null) return null; From ffa712dccbd5bdef12d69a90d54e7dd723303932 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 24 Mar 2018 15:19:45 +0900 Subject: [PATCH 053/109] Fix post-merge issues --- osu-framework | 2 +- osu-resources | 2 +- osu.Desktop/Program.cs | 6 +- osu.Game/Beatmaps/BeatmapManager.cs | 92 ------------------- osu.Game/Database/ArchiveModelManager.cs | 4 +- .../Screens/Compose/Layers/SelectionLayer.cs | 1 + 6 files changed, 10 insertions(+), 97 deletions(-) diff --git a/osu-framework b/osu-framework index 86079714a5..9b628d7f51 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 86079714a5f5c2678c4cc91df6c0257f33c43bcf +Subproject commit 9b628d7f51104ac94af2a4739480be0113ad551b diff --git a/osu-resources b/osu-resources index 883ff04e79..db406143da 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 883ff04e79a76f5eb1f89c4f59bd7476a803b42b +Subproject commit db406143da9e791efa04cdac4418c85a6831b739 diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index e878167536..5e6b5cc701 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -4,10 +4,12 @@ using System; using System.IO; using System.Linq; -using System.Runtime; using osu.Framework; using osu.Framework.Platform; using osu.Game.IPC; +#if NET_FRAMEWORK +using System.Runtime; +#endif namespace osu.Desktop { @@ -58,9 +60,11 @@ namespace osu.Desktop private static void useMulticoreJit() { +#if NET_FRAMEWORK var directory = Directory.CreateDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Profiles")); ProfileOptimization.SetProfileRoot(directory.FullName); ProfileOptimization.StartProfile("Startup.Profile"); +#endif } } } diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 46fef78c4e..1113e38d7a 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -20,8 +20,6 @@ using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Overlays.Notifications; using osu.Game.Rulesets; -using osu.Game.Utils; -using osu.Game.Storyboards; namespace osu.Game.Beatmaps { @@ -197,96 +195,6 @@ namespace osu.Game.Beatmaps /// The object if it exists, or null. public DownloadBeatmapSetRequest GetExistingDownload(BeatmapSetInfo beatmap) => currentDownloads.Find(d => d.BeatmapSet.OnlineBeatmapSetID == beatmap.OnlineBeatmapSetID); - /// - /// Delete a beatmap from the manager. - /// Is a no-op for already deleted beatmaps. - /// - /// The beatmap set to delete. - public void Delete(BeatmapSetInfo beatmapSet) - { - lock (importContextLock) - { - var context = importContext.Value; - - using (var transaction = context.BeginTransaction()) - { - context.ChangeTracker.AutoDetectChangesEnabled = false; - - // re-fetch the beatmap set on the import context. - // ReSharper disable once AccessToModifiedClosure - beatmapSet = context.BeatmapSetInfo.Include(s => s.Files).ThenInclude(f => f.FileInfo).First(s => s.ID == beatmapSet.ID); - - // create local stores so we can isolate and thread safely, and share a context/transaction. - var iFiles = new FileStore(() => context, storage); - var iBeatmaps = createBeatmapStore(() => context); - - if (iBeatmaps.Delete(beatmapSet)) - { - if (!beatmapSet.Protected) - iFiles.Dereference(beatmapSet.Files.Select(f => f.FileInfo).ToArray()); - } - - context.ChangeTracker.AutoDetectChangesEnabled = true; - context.SaveChanges(transaction); - } - } - } - - public void UndeleteAll() - { - var deleteMaps = QueryBeatmapSets(bs => bs.DeletePending).ToList(); - - if (!deleteMaps.Any()) return; - - var notification = new ProgressNotification - { - CompletionText = "Restored all deleted beatmaps!", - Progress = 0, - State = ProgressNotificationState.Active, - }; - - PostNotification?.Invoke(notification); - - int i = 0; - - foreach (var bs in deleteMaps) - { - if (notification.State == ProgressNotificationState.Cancelled) - // user requested abort - return; - - notification.Text = $"Restoring ({i} of {deleteMaps.Count})"; - notification.Progress = (float)++i / deleteMaps.Count; - Undelete(bs); - } - - notification.State = ProgressNotificationState.Completed; - } - - public void Undelete(BeatmapSetInfo beatmapSet) - { - if (beatmapSet.Protected) - return; - - lock (importContextLock) - { - var context = importContext.Value; - - using (var transaction = context.BeginTransaction()) - { - context.ChangeTracker.AutoDetectChangesEnabled = false; - - var iFiles = new FileStore(() => context, storage); - var iBeatmaps = createBeatmapStore(() => context); - - undelete(iBeatmaps, iFiles, beatmapSet); - - context.ChangeTracker.AutoDetectChangesEnabled = true; - context.SaveChanges(transaction); - } - } - } - /// /// Delete a beatmap difficulty. /// diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index f0e67a7185..7050e34712 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using Ionic.Zip; using Microsoft.EntityFrameworkCore; using osu.Framework.Logging; using osu.Framework.Platform; @@ -13,6 +12,7 @@ using osu.Game.IO; using osu.Game.IO.Archives; using osu.Game.IPC; using osu.Game.Overlays.Notifications; +using osu.Game.Utils; using SharpCompress.Common; using FileInfo = osu.Game.IO.FileInfo; @@ -336,7 +336,7 @@ namespace osu.Game.Database /// A reader giving access to the archive's content. private ArchiveReader getReaderFrom(string path) { - if (ZipFile.IsZipFile(path)) + if (ZipUtils.IsZipArchive(path)) return new ZipArchiveReader(Files.Storage.GetStream(path), Path.GetFileName(path)); if (Directory.Exists(path)) return new LegacyFilesystemReader(path); diff --git a/osu.Game/Screens/Edit/Screens/Compose/Layers/SelectionLayer.cs b/osu.Game/Screens/Edit/Screens/Compose/Layers/SelectionLayer.cs index 8c66007bb7..ab51385980 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Layers/SelectionLayer.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Layers/SelectionLayer.cs @@ -14,6 +14,7 @@ using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI; using OpenTK; using OpenTK.Graphics; +using RectangleF = osu.Framework.Graphics.Primitives.RectangleF; namespace osu.Game.Screens.Edit.Screens.Compose.Layers { From 9d9b9d50bc2a26416a514aec8d14d31bbd9a2c70 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 24 Mar 2018 17:48:40 +0900 Subject: [PATCH 054/109] User nuget OpenTK package --- OpenTK.props | 5 +---- osu-framework | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/OpenTK.props b/OpenTK.props index 0876c52b66..6ab847b6cc 100644 --- a/OpenTK.props +++ b/OpenTK.props @@ -1,9 +1,6 @@ - - - PreserveNewest - + \ No newline at end of file diff --git a/osu-framework b/osu-framework index 9b628d7f51..7eb292e9ec 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 9b628d7f51104ac94af2a4739480be0113ad551b +Subproject commit 7eb292e9ec09a18a50c0619e34a4a06ae155b49b From 0e669c9a3fb81a292affc5202def3c3dd9688714 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 24 Mar 2018 18:22:55 +0900 Subject: [PATCH 055/109] Fix many warnings --- osu-framework | 2 +- osu.Game/Beatmaps/IBeatmapConverter.cs | 2 +- osu.Game/Database/DatabaseBackedStore.cs | 3 --- osu.Game/Database/DatabaseContextFactory.cs | 2 +- osu.Game/Graphics/DrawableDate.cs | 3 +-- osu.Game/Online/API/APIAccess.cs | 2 +- osu.Game/Rulesets/Judgements/DrawableJudgement.cs | 1 + osu.Game/Rulesets/Replays/Types/IConvertibleReplayFrame.cs | 1 - osu.Game/Screens/Edit/Screens/Compose/BeatDivisorControl.cs | 1 - osu.Game/Screens/Select/BeatmapCarousel.cs | 1 + osu.Game/Screens/Select/BeatmapInfoWedge.cs | 2 +- osu.Game/Screens/Select/PlaySongSelect.cs | 4 +++- osu.Game/Skinning/SkinManager.cs | 2 -- osu.Game/Skinning/SkinReloadableDrawable.cs | 2 +- osu.Game/Skinning/SkinnableDrawable.cs | 2 +- osu.sln.DotSettings | 1 + 16 files changed, 14 insertions(+), 17 deletions(-) diff --git a/osu-framework b/osu-framework index 7eb292e9ec..ae633287dc 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 7eb292e9ec09a18a50c0619e34a4a06ae155b49b +Subproject commit ae633287dc44517f3f5fc66f1d0f5333f76cc261 diff --git a/osu.Game/Beatmaps/IBeatmapConverter.cs b/osu.Game/Beatmaps/IBeatmapConverter.cs index ebd900b97e..096ba345a1 100644 --- a/osu.Game/Beatmaps/IBeatmapConverter.cs +++ b/osu.Game/Beatmaps/IBeatmapConverter.cs @@ -19,7 +19,7 @@ namespace osu.Game.Beatmaps /// /// Converts a Beatmap using this Beatmap Converter. /// - /// The un-converted Beatmap. + /// The un-converted Beatmap. void Convert(Beatmap beatmap); } } diff --git a/osu.Game/Database/DatabaseBackedStore.cs b/osu.Game/Database/DatabaseBackedStore.cs index 0fafb77339..4b582bdfea 100644 --- a/osu.Game/Database/DatabaseBackedStore.cs +++ b/osu.Game/Database/DatabaseBackedStore.cs @@ -11,9 +11,6 @@ namespace osu.Game.Database { protected readonly Storage Storage; - /// - /// Create a new instance (separate from the shared context via for performing isolated operations. - /// protected readonly IDatabaseContextFactory ContextFactory; /// diff --git a/osu.Game/Database/DatabaseContextFactory.cs b/osu.Game/Database/DatabaseContextFactory.cs index 712ed2d0cc..06737e61eb 100644 --- a/osu.Game/Database/DatabaseContextFactory.cs +++ b/osu.Game/Database/DatabaseContextFactory.cs @@ -17,7 +17,7 @@ namespace osu.Game.Database private readonly object writeLock = new object(); private bool currentWriteDidWrite; - private volatile int currentWriteUsages; + private int currentWriteUsages; public DatabaseContextFactory(GameHost host) { diff --git a/osu.Game/Graphics/DrawableDate.cs b/osu.Game/Graphics/DrawableDate.cs index a912f989e0..d2a7250aaa 100644 --- a/osu.Game/Graphics/DrawableDate.cs +++ b/osu.Game/Graphics/DrawableDate.cs @@ -6,7 +6,6 @@ using Humanizer; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Cursor; -using osu.Framework.Threading; using osu.Game.Graphics.Sprites; namespace osu.Game.Graphics @@ -14,7 +13,6 @@ namespace osu.Game.Graphics public class DrawableDate : OsuSpriteText, IHasTooltip { private readonly DateTimeOffset date; - private ScheduledDelegate updateTask; public DrawableDate(DateTimeOffset date) { @@ -61,6 +59,7 @@ namespace osu.Game.Graphics public override bool HandleMouseInput => true; private void updateTime() => Text = date.Humanize(); + public string TooltipText => date.ToString(); } } diff --git a/osu.Game/Online/API/APIAccess.cs b/osu.Game/Online/API/APIAccess.cs index 957aeac3cd..798ed1b9b3 100644 --- a/osu.Game/Online/API/APIAccess.cs +++ b/osu.Game/Online/API/APIAccess.cs @@ -64,7 +64,7 @@ namespace osu.Game.Online.API private readonly List components = new List(); - internal void Schedule(Action action) => base.Schedule(action); + internal new void Schedule(Action action) => base.Schedule(action); public void Register(IOnlineComponent component) { diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs index 0f0c43bc88..ca203e1cdb 100644 --- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs @@ -33,6 +33,7 @@ namespace osu.Game.Rulesets.Judgements /// Creates a drawable which visualises a . /// /// The judgement to visualise. + /// The object which was judged. public DrawableJudgement(Judgement judgement, DrawableHitObject judgedObject) { Judgement = judgement; diff --git a/osu.Game/Rulesets/Replays/Types/IConvertibleReplayFrame.cs b/osu.Game/Rulesets/Replays/Types/IConvertibleReplayFrame.cs index ac1e5e29ec..892f5ca2fe 100644 --- a/osu.Game/Rulesets/Replays/Types/IConvertibleReplayFrame.cs +++ b/osu.Game/Rulesets/Replays/Types/IConvertibleReplayFrame.cs @@ -15,7 +15,6 @@ namespace osu.Game.Rulesets.Replays.Types /// Populates this using values from a . /// /// The to extract values from. - /// The score. /// The beatmap. void ConvertFrom(LegacyReplayFrame legacyFrame, Beatmap beatmap); } diff --git a/osu.Game/Screens/Edit/Screens/Compose/BeatDivisorControl.cs b/osu.Game/Screens/Edit/Screens/Compose/BeatDivisorControl.cs index a7be3c1eb5..0b30aeef8d 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/BeatDivisorControl.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/BeatDivisorControl.cs @@ -24,7 +24,6 @@ namespace osu.Game.Screens.Edit.Screens.Compose public class BeatDivisorControl : CompositeDrawable { private readonly BindableBeatDivisor beatDivisor = new BindableBeatDivisor(); - private int currentDivisorIndex; public BeatDivisorControl(BindableBeatDivisor beatDivisor) { diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index aed8fb110f..15f4d5cf96 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -547,6 +547,7 @@ namespace osu.Game.Screens.Select float? setY = null; if (!d.IsLoaded || beatmap.Alpha == 0) // can't use IsPresent due to DrawableCarouselItem override. + // ReSharper disable once PossibleNullReferenceException (resharper broken?) setY = lastSet.Y + lastSet.DrawHeight + 5; if (d.IsLoaded) diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 7476df4955..5cde0d2751 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -254,7 +254,7 @@ namespace osu.Game.Screens.Select private OsuSpriteText[] getMapper(BeatmapMetadata metadata) { - if (string.IsNullOrEmpty(metadata.Author?.Username)) + if (metadata.Author == null || string.IsNullOrEmpty(metadata.Author.Username)) return Array.Empty(); return new[] diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 09524d2eac..d5a91e1a6b 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using OpenTK.Input; using osu.Framework.Allocation; using osu.Framework.Audio; @@ -75,7 +76,8 @@ namespace osu.Game.Screens.Select { // if we have no beatmaps but osu-stable is found, let's prompt the user to import. if (!beatmaps.GetAllUsableBeatmapSets().Any() && beatmaps.StableInstallationAvailable) - dialogOverlay.Push(new ImportFromStablePopup(() => beatmaps.ImportFromStable())); + dialogOverlay.Push(new ImportFromStablePopup(() => + Task.Factory.StartNew(beatmaps.ImportFromStable, TaskCreationOptions.LongRunning))); }); } } diff --git a/osu.Game/Skinning/SkinManager.cs b/osu.Game/Skinning/SkinManager.cs index f965a77cce..24d7155b53 100644 --- a/osu.Game/Skinning/SkinManager.cs +++ b/osu.Game/Skinning/SkinManager.cs @@ -80,8 +80,6 @@ namespace osu.Game.Skinning return new LegacySkin(skinInfo, Files.Store, audio); } - private SkinStore store; - public SkinManager(Storage storage, DatabaseContextFactory contextFactory, IIpcHost importHost, AudioManager audio) : base(storage, contextFactory, new SkinStore(contextFactory, storage), importHost) { diff --git a/osu.Game/Skinning/SkinReloadableDrawable.cs b/osu.Game/Skinning/SkinReloadableDrawable.cs index 36f33e746a..5007a9d325 100644 --- a/osu.Game/Skinning/SkinReloadableDrawable.cs +++ b/osu.Game/Skinning/SkinReloadableDrawable.cs @@ -23,7 +23,7 @@ namespace osu.Game.Skinning /// /// Create a new /// - /// Whether fallback to default skin should be allowed if the custom skin is missing this resource. + /// A conditional to decide whether to allow fallback to the default implementation if a skinned element is not present. protected SkinReloadableDrawable(Func allowFallback = null) { this.allowFallback = allowFallback; diff --git a/osu.Game/Skinning/SkinnableDrawable.cs b/osu.Game/Skinning/SkinnableDrawable.cs index 09d2e6a3ed..7ed796d433 100644 --- a/osu.Game/Skinning/SkinnableDrawable.cs +++ b/osu.Game/Skinning/SkinnableDrawable.cs @@ -29,7 +29,7 @@ namespace osu.Game.Skinning /// /// The namespace-complete resource name for this skinnable element. /// A function to create the default skin implementation of this element. - /// Whther to fallback to the default implementation when a custom skin is specified but not implementation is present. + /// A conditional to decide whether to allow fallback to the default implementation if a skinned element is not present. /// Whether a user-skin drawable should be limited to the size of our parent. public SkinnableDrawable(string name, Func defaultImplementation, Func allowFallback = null, bool restrictSize = true) : base(allowFallback) { diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index 3b62dbe579..0b631d008b 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -43,6 +43,7 @@ DO_NOT_SHOW WARNING WARNING + HINT ERROR HINT HINT From d28de89e5059299e228cbd92069fc9c80df0fb4e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 25 Mar 2018 01:34:59 +0900 Subject: [PATCH 056/109] Add net461 target to test projects for nunit discovery Nunit "by design" will not run tests for NETStandard projects (see: https://github.com/nunit/dotnet-test-nunit/issues/122#issuecomment-329531632). --- osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj | 2 +- osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 2 +- osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 2 +- osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj | 2 +- osu.Game.Tests/osu.Game.Tests.csproj | 2 +- osu.Game/osu.Game.csproj | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index 6bd96b5d87..79f5b76bf0 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net461;netstandard2.0 Library AnyCPU true diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 8092af65ce..75cc9d1583 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net461;netstandard2.0 Library AnyCPU true diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 53d444d0d9..6ba4902d0a 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net461;netstandard2.0 Library AnyCPU true diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index bcceb03042..ecd6d05e13 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net461;netstandard2.0 Library AnyCPU true diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 1c9b0503c0..adedbd6f8a 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net461;netstandard2.0 Library AnyCPU true diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index f763d2527e..d7dfac2afc 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net461;netstandard2.0 Library AnyCPU true From 097ab66182b79d2bb8ec51534e2d792f622207b4 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 25 Mar 2018 01:54:25 +0900 Subject: [PATCH 057/109] Fix resharper error --- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 5cde0d2751..8e045b9fb7 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -254,7 +254,7 @@ namespace osu.Game.Screens.Select private OsuSpriteText[] getMapper(BeatmapMetadata metadata) { - if (metadata.Author == null || string.IsNullOrEmpty(metadata.Author.Username)) + if (string.IsNullOrEmpty(metadata.Author?.Username)) return Array.Empty(); return new[] @@ -268,6 +268,7 @@ namespace osu.Game.Screens.Select new OsuSpriteText { Font = @"Exo2.0-Bold", + // ReSharper disable once PossibleNullReferenceException (resharper broken?) Text = metadata.Author.Username, TextSize = 15, } From 31920f1866a5632432649404c3d6779753f92dd3 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 25 Mar 2018 02:12:01 +0900 Subject: [PATCH 058/109] Fix ruleset resources not getting included in build --- osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj | 3 +++ osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 3 +++ osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 3 +++ osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj | 3 +++ 4 files changed, 12 insertions(+) diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index 79f5b76bf0..335638f10b 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -20,4 +20,7 @@ + + + \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 75cc9d1583..c44ae0416d 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -20,4 +20,7 @@ + + + \ No newline at end of file diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 6ba4902d0a..2b055fb047 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -20,4 +20,7 @@ + + + \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index ecd6d05e13..e9a4a4e79a 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -20,4 +20,7 @@ + + + \ No newline at end of file From 0b2c1930bdc796e2a019790644f0317dab8b8c5b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 25 Mar 2018 02:28:10 +0900 Subject: [PATCH 059/109] Reference osu.Game.Tests in the desktop project --- osu.Desktop/osu.Desktop.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 6822b7be51..201ba47cae 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -27,6 +27,7 @@ + From c21e820a45169762de7a655d72ebca848d813f44 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 25 Mar 2018 02:43:45 +0900 Subject: [PATCH 060/109] One more level of nesting (we can do this better in the future) --- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 6428881b54..4f5eae85c8 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -18,7 +18,7 @@ namespace osu.Game.Tests.Beatmaps.IO [TestFixture] public class ImportBeatmapTest { - private const string osz_path = @"../../../osu-resources/osu.Game.Resources/Beatmaps/241526 Soleily - Renatus.osz"; + private const string osz_path = @"../../../../osu-resources/osu.Game.Resources/Beatmaps/241526 Soleily - Renatus.osz"; [Test] public void TestImportWhenClosed() From 4dc317d4df095acd2dad531581f2d1d708698c27 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 25 Mar 2018 03:01:48 +0900 Subject: [PATCH 061/109] Fix msbuild warnings --- osu.Desktop/osu.Desktop.csproj | 3 +++ osu.Game.Tests/osu.Game.Tests.csproj | 2 ++ osu.Game/osu.Game.csproj | 1 + 3 files changed, 6 insertions(+) diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 201ba47cae..9c2a1713cb 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -15,6 +15,9 @@ lazer.ico 0.0.0.0 0.0.0.0 + + NU1701 $(DefineConstants);NET_FRAMEWORK diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index adedbd6f8a..3a351a63a8 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -11,6 +11,8 @@ ppy Pty Ltd 2007-2017 osu.Game.Tests osu.Game.Tests + + NU1701 diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index d7dfac2afc..893456034d 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -12,6 +12,7 @@ osu.Game click the circles. to the beat. osu.Game + 0 From 96901b649826e293ee99caf5029c50c99760fbe4 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 26 Mar 2018 10:52:54 +0900 Subject: [PATCH 062/109] Add msbuild/dotnet build + launch targets --- .vscode/launch.json | 131 ++++++++++-------- .vscode/tasks.json | 94 +++++++------ osu-framework | 2 +- osu-resources | 2 +- .../osu.Game.Rulesets.Catch.csproj | 2 +- .../osu.Game.Rulesets.Mania.csproj | 2 +- .../osu.Game.Rulesets.Osu.csproj | 2 +- .../osu.Game.Rulesets.Taiko.csproj | 2 +- osu.Game.Tests/osu.Game.Tests.csproj | 2 +- osu.Game/osu.Game.csproj | 2 +- 10 files changed, 135 insertions(+), 106 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 6c0a8929f7..8c8255db71 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,102 +1,119 @@ { "version": "0.2.0", - "configurations": [{ - "name": "osu! VisualTests (Debug, .NETFramework)", + "configurations": [ + { + "name": "VisualTests (Debug, net461)", + "windows": { + "type": "clr" + }, + "type": "mono", "request": "launch", - "type": "clr", "program": "${workspaceRoot}/osu.Desktop/bin/Debug/net461/osu!.exe", "args": [ "--tests" ], "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Debug)", + "preLaunchTask": "Build (Debug, msbuild)", "runtimeExecutable": null, "env": {}, "console": "internalConsole" }, { - "name": "osu! VisualTests (Debug, .NETCore)", + "name": "VisualTests (Release, net461)", + "windows": { + "type": "clr" + }, + "type": "mono", "request": "launch", - "type": "coreclr", - "program": "${workspaceRoot}/osu.Desktop/bin/Debug/netcoreapp2.0/osu!.dll", - "args": [ - "--tests" - ], - "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Debug)", - "runtimeExecutable": null, - "env": {}, - "console": "internalConsole" - }, - { - "name": "osu! VisualTests (Release, .NETFramework)", - "request": "launch", - "type": "clr", "program": "${workspaceRoot}/osu.Desktop/bin/Release/net461/osu!.exe", "args": [ "--tests" ], "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Release)", + "preLaunchTask": "Build (Release, msbuild)", "runtimeExecutable": null, "env": {}, "console": "internalConsole" }, { - "name": "osu! VisualTests (Release, .NETCore)", + "name": "osu! (Debug, net461)", + "windows": { + "type": "clr" + }, + "type": "mono", "request": "launch", - "type": "coreclr", - "program": "${workspaceRoot}/osu.Desktop/bin/Release/netcoreapp2.0/osu!.dll", - "args": [ - "--tests" - ], - "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Release)", - "runtimeExecutable": null, - "env": {}, - "console": "internalConsole" - }, - { - "name": "osu! (Debug, .NETFramework)", - "request": "launch", - "type": "clr", "program": "${workspaceRoot}/osu.Desktop/bin/Debug/net461/osu!.exe", "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Debug)", + "preLaunchTask": "Build (Debug, msbuild)", "runtimeExecutable": null, "env": {}, "console": "internalConsole" }, { - "name": "osu! (Debug, .NETCore)", + "name": "osu! (Release, net461)", + "windows": { + "type": "clr" + }, + "type": "mono", "request": "launch", - "type": "coreclr", - "program": "${workspaceRoot}/osu.Desktop/bin/Debug/netcoreapp2.0/osu!.dll", - "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Debug)", - "runtimeExecutable": null, - "env": {}, - "console": "internalConsole" - }, - { - "name": "osu! (Release, .NETFramework)", - "request": "launch", - "type": "clr", "program": "${workspaceRoot}/osu.Desktop/bin/Release/net461/osu!.exe", "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Release)", + "preLaunchTask": "Build (Release, msbuild)", "runtimeExecutable": null, "env": {}, "console": "internalConsole" }, { - "name": "osu! (Release, .NETCore)", - "request": "launch", + "name": "VisualTests (Debug, netcoreapp2.0)", "type": "coreclr", - "program": "${workspaceRoot}/osu.Desktop/bin/Release/netcoreapp2.0/osu!.dll", + "request": "launch", + "program": "dotnet", + "args": [ + "${workspaceRoot}/osu.Desktop/bin/Debug/netcoreapp2.0/osu!.dll", + "--tests" + ], "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Release)", - "runtimeExecutable": null, + "preLaunchTask": "Build (Debug, dotnet)", + "env": {}, + "console": "internalConsole" + }, + { + "name": "VisualTests (Release, netcoreapp2.0)", + "type": "coreclr", + "request": "launch", + "program": "dotnet", + "args": [ + "${workspaceRoot}/osu.Desktop/bin/Release/netcoreapp2.0/osu!.dll", + "--tests" + ], + "cwd": "${workspaceRoot}", + "preLaunchTask": "Build (Release, dotnet)", + "env": {}, + "console": "internalConsole" + }, + { + "name": "osu! (Debug, netcoreapp2.0)", + "type": "coreclr", + "request": "launch", + "program": "dotnet", + "args": [ + "${workspaceRoot}/osu.Desktop/bin/Debug/netcoreapp2.0/osu!.dll", + ], + "cwd": "${workspaceRoot}", + "preLaunchTask": "Build (Debug, dotnet)", + "env": {}, + "console": "internalConsole" + }, + { + "name": "osu! (Release, netcoreapp2.0)", + "type": "coreclr", + "request": "launch", + "program": "dotnet", + "args": [ + "${workspaceRoot}/osu.Desktop/bin/Release/netcoreapp2.0/osu!.dll", + ], + "cwd": "${workspaceRoot}", + "preLaunchTask": "Build (Release, dotnet)", "env": {}, "console": "internalConsole" } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index f67d7a8c4e..3378a83616 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -2,70 +2,82 @@ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", - "tasks": [{ - "label": "Build (Debug)", - "type": "shell", - "command": "msbuild", - "args": [ - "/p:GenerateFullPaths=true", - "/p:DebugType=portable", - "/m", - "/v:m" - ], - "group": { - "kind": "build", - "isDefault": true - }, - "problemMatcher": "$msCompile" - }, + "tasks": [ { - "label": "Build (Release)", + "label": "Build (Debug, msbuild)", "type": "shell", "command": "msbuild", "args": [ - "/p:Configuration=Release", - "/p:DebugType=portable", + "/p:TargetFramework=net461", "/p:GenerateFullPaths=true", "/m", - "/v:m" + "/verbosity:m" ], "group": "build", "problemMatcher": "$msCompile" }, { - "label": "Clean (Debug)", - "type": "shell", - "command": "msbuild", - "args": [ - "/p:DebugType=portable", - "/p:GenerateFullPaths=true", - "/m", - "/t:Clean", - "/v:m" - ], - "problemMatcher": "$msCompile" - }, - { - "label": "Clean (Release)", + "label": "Build (Release, msbuild)", "type": "shell", "command": "msbuild", "args": [ "/p:Configuration=Release", + "/p:TargetFramework=net461", "/p:GenerateFullPaths=true", - "/p:DebugType=portable", "/m", - "/t:Clean", - "/v:m" + "/verbosity:m" ], + "group": "build", "problemMatcher": "$msCompile" }, { - "label": "Clean All", - "dependsOn": [ - "Clean (Debug)", - "Clean (Release)" + "label": "Build (Debug, dotnet)", + "type": "shell", + "command": "dotnet", + "args": [ + "build", + "--no-restore", + "/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", + "/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": [] } ] } \ No newline at end of file diff --git a/osu-framework b/osu-framework index ae633287dc..1ba94a8f0b 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit ae633287dc44517f3f5fc66f1d0f5333f76cc261 +Subproject commit 1ba94a8f0b0f1c43488356bf4a5cd5892f01f7da diff --git a/osu-resources b/osu-resources index db406143da..dca651b26f 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit db406143da9e791efa04cdac4418c85a6831b739 +Subproject commit dca651b26fbdfa92fad9bc537497fd47ebcd4130 diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index 335638f10b..4db4904fb7 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -2,7 +2,7 @@ - net461;netstandard2.0 + net461;netstandard2.0;netcoreapp2.0 Library AnyCPU true diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index c44ae0416d..0b4dca31c0 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -2,7 +2,7 @@ - net461;netstandard2.0 + net461;netstandard2.0;netcoreapp2.0 Library AnyCPU true diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 2b055fb047..d966a2f8ee 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -2,7 +2,7 @@ - net461;netstandard2.0 + net461;netstandard2.0;;netcoreapp2.0 Library AnyCPU true diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index e9a4a4e79a..9fbfe7f604 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -2,7 +2,7 @@ - net461;netstandard2.0 + net461;netstandard2.0;netcoreapp2.0 Library AnyCPU true diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 3a351a63a8..e92b2d6a0a 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -2,7 +2,7 @@ - net461;netstandard2.0 + net461;netstandard2.0;netcoreapp2.0 Library AnyCPU true diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 893456034d..bf5c26fbff 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -2,7 +2,7 @@ - net461;netstandard2.0 + net461;netstandard2.0;netcoreapp2.0 Library AnyCPU true From 3f9b14704e4c5fed9427b386280195b5f1b715b9 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 26 Mar 2018 13:30:43 +0900 Subject: [PATCH 063/109] Fix extra semicolon --- osu-framework | 2 +- osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 1ba94a8f0b..08ea2cf894 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 1ba94a8f0b0f1c43488356bf4a5cd5892f01f7da +Subproject commit 08ea2cf8943a22c168856f70ecdf172b43194af0 diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index d966a2f8ee..6162fe93d0 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -2,7 +2,7 @@ - net461;netstandard2.0;;netcoreapp2.0 + net461;netstandard2.0;netcoreapp2.0 Library AnyCPU true From 76588a1029547b852d7a763ccf93deaaa1253a57 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 26 Mar 2018 15:12:13 +0900 Subject: [PATCH 064/109] Target WinExe to remove console window --- osu-framework | 2 +- osu.Desktop/osu.Desktop.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 08ea2cf894..9a2679b406 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 08ea2cf8943a22c168856f70ecdf172b43194af0 +Subproject commit 9a2679b406daa4a605b5d8e1c4a9cde1cd9aa891 diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 9c2a1713cb..eae61da304 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -3,7 +3,7 @@ net461;netcoreapp2.0 - Exe + WinExe AnyCPU true ppy Pty Ltd From 35ef9d99c679eb05b40cbd3a59dccf2313252bff Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 26 Mar 2018 15:44:55 +0900 Subject: [PATCH 065/109] Only compile with net461 in visual studio --- osu.Desktop/osu.Desktop.csproj | 3 ++- osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj | 3 ++- osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 3 ++- osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 3 ++- osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj | 3 ++- osu.Game.Tests/osu.Game.Tests.csproj | 3 ++- osu.Game/osu.Game.csproj | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index eae61da304..c7ffbd78de 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -2,7 +2,8 @@ - net461;netcoreapp2.0 + net461 + net461;netcoreapp2.0 WinExe AnyCPU true diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index 4db4904fb7..62d3fc008e 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -2,7 +2,8 @@ - net461;netstandard2.0;netcoreapp2.0 + net461 + net461;netstandard2.0;netcoreapp2.0 Library AnyCPU true diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 0b4dca31c0..09bbce1893 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -2,7 +2,8 @@ - net461;netstandard2.0;netcoreapp2.0 + net461 + net461;netstandard2.0;netcoreapp2.0 Library AnyCPU true diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 6162fe93d0..6f16197856 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -2,7 +2,8 @@ - net461;netstandard2.0;netcoreapp2.0 + net461 + net461;netstandard2.0;netcoreapp2.0 Library AnyCPU true diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index 9fbfe7f604..90efa4d615 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -2,7 +2,8 @@ - net461;netstandard2.0;netcoreapp2.0 + net461 + net461;netstandard2.0;netcoreapp2.0 Library AnyCPU true diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index e92b2d6a0a..52a41c23f2 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -2,7 +2,8 @@ - net461;netstandard2.0;netcoreapp2.0 + net461 + net461;netstandard2.0;netcoreapp2.0 Library AnyCPU true diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index bf5c26fbff..64176ab706 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -2,7 +2,8 @@ - net461;netstandard2.0;netcoreapp2.0 + net461 + net461;netstandard2.0;netcoreapp2.0 Library AnyCPU true From e5df2946aac1160b1c6e6c4cada882f55a946e2b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 26 Mar 2018 15:49:16 +0900 Subject: [PATCH 066/109] Bump OpenTK version + update submodules --- OpenTK.props | 2 +- osu-framework | 2 +- osu-resources | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenTK.props b/OpenTK.props index 6ab847b6cc..8828f76cb1 100644 --- a/OpenTK.props +++ b/OpenTK.props @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/osu-framework b/osu-framework index 9a2679b406..dffaee9d66 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 9a2679b406daa4a605b5d8e1c4a9cde1cd9aa891 +Subproject commit dffaee9d66ec15d1e0a6d8561867ff3853624bd9 diff --git a/osu-resources b/osu-resources index dca651b26f..3958127d95 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit dca651b26fbdfa92fad9bc537497fd47ebcd4130 +Subproject commit 3958127d95ee230021e9946c989400e71c9dbb3c From d2c5fa72dcb949e021d975cbdc2c7cb8d4610b53 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 26 Mar 2018 16:03:25 +0900 Subject: [PATCH 067/109] Make appveyor only compile net461 --- appveyor.yml | 2 ++ osu-framework | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index e63f6ea55c..6388b54db5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,6 +16,8 @@ install: before_build: - cmd: CodeFileSanity.exe - cmd: nuget restore -verbosity quiet +environment: + TargetFramework: net461 build: project: osu.sln parallel: true diff --git a/osu-framework b/osu-framework index dffaee9d66..f0ed38258b 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit dffaee9d66ec15d1e0a6d8561867ff3853624bd9 +Subproject commit f0ed38258b61622fa2e500f010a8a6ff1200995a From 5159127bcea889b394295efd1d9c6debbaac2565 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 26 Mar 2018 18:07:09 +0900 Subject: [PATCH 068/109] Fix SQLite failing to initialize on test projects --- osu.Desktop/Program.cs | 1 - osu.Desktop/osu.Desktop.csproj | 1 - osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj | 1 + osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 1 + osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 1 + osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj | 1 + osu.Game.Tests/osu.Game.Tests.csproj | 1 + osu.Game/Database/OsuDbContext.cs | 6 ++++++ osu.Game/osu.Game.csproj | 1 + 9 files changed, 12 insertions(+), 2 deletions(-) diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index 5e6b5cc701..25beb9a7d4 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -19,7 +19,6 @@ namespace osu.Desktop public static int Main(string[] args) { // required to initialise native SQLite libraries on some platforms. - SQLitePCL.Batteries_V2.Init(); if (!RuntimeInfo.IsMono) useMulticoreJit(); diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index c7ffbd78de..cca7e70632 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -35,7 +35,6 @@ - diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index 62d3fc008e..37702fad56 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -19,6 +19,7 @@ + diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 09bbce1893..ebe78a039c 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -19,6 +19,7 @@ + diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 6f16197856..6b741ef3c9 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -19,6 +19,7 @@ + diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index 90efa4d615..b4e7ab0658 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -19,6 +19,7 @@ + diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 52a41c23f2..30104dee7f 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -25,6 +25,7 @@ + diff --git a/osu.Game/Database/OsuDbContext.cs b/osu.Game/Database/OsuDbContext.cs index aa1f523a80..a4b0c30478 100644 --- a/osu.Game/Database/OsuDbContext.cs +++ b/osu.Game/Database/OsuDbContext.cs @@ -33,6 +33,12 @@ namespace osu.Game.Database private static readonly Lazy logger = new Lazy(() => new OsuDbLoggerFactory()); + static OsuDbContext() + { + // required to initialise native SQLite libraries on some platforms. + SQLitePCL.Batteries_V2.Init(); + } + /// /// Create a new in-memory OsuDbContext instance. /// diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 64176ab706..dd4b0c0e02 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -21,6 +21,7 @@ + From c6b9c4b58857eb07be49826d4ff1f8d2e18df56e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 26 Mar 2018 18:40:59 +0900 Subject: [PATCH 069/109] Fix startup failures --- osu.Desktop/osu.Desktop.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index cca7e70632..c7ffbd78de 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -35,6 +35,7 @@ + From b9f456402addea12ac0a35659636ed5a02c6f5fa Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 26 Mar 2018 18:55:55 +0900 Subject: [PATCH 070/109] Re-implement OsuGameDesktop icon --- osu-framework | 2 +- osu.Desktop/OsuGameDesktop.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index f0ed38258b..8be3928da8 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit f0ed38258b61622fa2e500f010a8a6ff1200995a +Subproject commit 8be3928da807b4bddb0557308f8e223cc0a12663 diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index d8c1d47efb..fddc6af2f4 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -2,8 +2,10 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Drawing; using System.IO; using System.Linq; +using System.Reflection; using System.Threading.Tasks; using osu.Desktop.Overlays; using osu.Framework.Graphics.Containers; @@ -98,7 +100,7 @@ namespace osu.Desktop { desktopWindow.CursorState |= CursorState.Hidden; - // desktopWindow.Icon = new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico")); + desktopWindow.Icon = new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico")); desktopWindow.Title = Name; desktopWindow.FileDrop += fileDrop; From 0b38c8ec4fc25dac94bce0945ae8433df0f7107a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 26 Mar 2018 18:58:19 +0900 Subject: [PATCH 071/109] Fix some VS specific issues --- osu.Desktop/Properties/launchSettings.json | 9 +++++++++ osu.Desktop/osu.Desktop.csproj | 3 +++ 2 files changed, 12 insertions(+) create mode 100644 osu.Desktop/Properties/launchSettings.json diff --git a/osu.Desktop/Properties/launchSettings.json b/osu.Desktop/Properties/launchSettings.json new file mode 100644 index 0000000000..3842c10a4e --- /dev/null +++ b/osu.Desktop/Properties/launchSettings.json @@ -0,0 +1,9 @@ +{ + "profiles": { + "osu.Desktop": { + // this avoids an ugly command window appearing when running without debugger attached from VS2017 + "commandName": "Executable", + "executablePath": ".\\osu!.exe" + } + } +} \ No newline at end of file diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index cca7e70632..7dfb2aa6cb 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -23,6 +23,9 @@ $(DefineConstants);NET_FRAMEWORK + + osu.Desktop.Program + From dd5bbbbd9fe1db66a86c7c20cbbe39755fabf795 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 26 Mar 2018 19:11:23 +0900 Subject: [PATCH 072/109] Define testable projects --- TestableProject.props | 8 ++++++++ osu-framework | 2 +- osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj | 2 +- osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 2 +- osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 2 +- osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj | 2 +- osu.Game.Tests/osu.Game.Tests.csproj | 2 +- osu.Game/osu.Game.csproj | 1 + 8 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 TestableProject.props diff --git a/TestableProject.props b/TestableProject.props new file mode 100644 index 0000000000..40b3fde99e --- /dev/null +++ b/TestableProject.props @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/osu-framework b/osu-framework index 8be3928da8..0b0f756c73 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 8be3928da807b4bddb0557308f8e223cc0a12663 +Subproject commit 0b0f756c7383685cf7a279b38a6eb92131739f03 diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index 37702fad56..9d011e2de2 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -1,6 +1,7 @@  + net461 net461;netstandard2.0;netcoreapp2.0 @@ -20,7 +21,6 @@ - diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index ebe78a039c..cc6c770bbf 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -1,6 +1,7 @@  + net461 net461;netstandard2.0;netcoreapp2.0 @@ -20,7 +21,6 @@ - diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 6b741ef3c9..3d512ad53e 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -1,6 +1,7 @@  + net461 net461;netstandard2.0;netcoreapp2.0 @@ -20,7 +21,6 @@ - diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index b4e7ab0658..dc08e71446 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -1,6 +1,7 @@  + net461 net461;netstandard2.0;netcoreapp2.0 @@ -20,7 +21,6 @@ - diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 30104dee7f..5717066f45 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -1,6 +1,7 @@  + net461 net461;netstandard2.0;netcoreapp2.0 @@ -26,7 +27,6 @@ - diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index dd4b0c0e02..643ada16aa 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -1,6 +1,7 @@  + net461 net461;netstandard2.0;netcoreapp2.0 From 868a221b6c31fc18a2c5e5434a19c014d4aab5b8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 26 Mar 2018 19:42:33 +0900 Subject: [PATCH 073/109] Fix VisualTests build configuration --- osu.Desktop/Properties/launchSettings.json | 9 --------- osu.Desktop/osu.Desktop.csproj | 8 ++++++-- osu.sln | 1 - 3 files changed, 6 insertions(+), 12 deletions(-) delete mode 100644 osu.Desktop/Properties/launchSettings.json diff --git a/osu.Desktop/Properties/launchSettings.json b/osu.Desktop/Properties/launchSettings.json deleted file mode 100644 index 3842c10a4e..0000000000 --- a/osu.Desktop/Properties/launchSettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "profiles": { - "osu.Desktop": { - // this avoids an ugly command window appearing when running without debugger attached from VS2017 - "commandName": "Executable", - "executablePath": ".\\osu!.exe" - } - } -} \ No newline at end of file diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 1e0d98620c..5d346603db 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -14,6 +14,7 @@ osu!lazer osu!lazer lazer.ico + $(CONFIGURATIONS);VisualTests 0.0.0.0 0.0.0.0 - + \ No newline at end of file diff --git a/osu-framework b/osu-framework index 0b0f756c73..857b1c4e6d 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 0b0f756c7383685cf7a279b38a6eb92131739f03 +Subproject commit 857b1c4e6d8e8fa4c674cd5bff34df2d16978f06 From 28c737ad7290d65b3c411458e8cee95574f36866 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 27 Mar 2018 14:36:54 +0900 Subject: [PATCH 076/109] Update opentk + framework --- OpenTK.props | 2 +- osu-framework | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenTK.props b/OpenTK.props index f4456cd6eb..8708670f2c 100644 --- a/OpenTK.props +++ b/OpenTK.props @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/osu-framework b/osu-framework index 857b1c4e6d..b32a4ad740 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 857b1c4e6d8e8fa4c674cd5bff34df2d16978f06 +Subproject commit b32a4ad740e8f03c5069c246a1269774f90fe972 From 9674e8d197565d1c9721220ada73eba0ed23ab7b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 27 Mar 2018 15:05:41 +0900 Subject: [PATCH 077/109] Add back mania to VisualTests configuration --- osu.sln | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.sln b/osu.sln index 5e99e838eb..43a7fdf6c3 100644 --- a/osu.sln +++ b/osu.sln @@ -71,6 +71,7 @@ Global {48F4582B-7687-4621-9CBE-5C24197CB536}.Release|Any CPU.ActiveCfg = Release|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.Release|Any CPU.Build.0 = Release|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU + {48F4582B-7687-4621-9CBE-5C24197CB536}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Release|Any CPU.ActiveCfg = Release|Any CPU {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU From b290d2d03911d080905120753a81396f9ba113d7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 27 Mar 2018 15:06:02 +0900 Subject: [PATCH 078/109] Move NUnit includes to individual projects --- TestableProject.props | 8 -------- osu-framework | 2 +- osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj | 5 ++++- osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 5 ++++- osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 5 ++++- osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj | 5 ++++- osu.Game.Tests/osu.Game.Tests.csproj | 5 ++++- osu.Game/osu.Game.csproj | 5 ++++- 8 files changed, 25 insertions(+), 15 deletions(-) delete mode 100644 TestableProject.props diff --git a/TestableProject.props b/TestableProject.props deleted file mode 100644 index 40b3fde99e..0000000000 --- a/TestableProject.props +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/osu-framework b/osu-framework index b32a4ad740..5ab18a48f9 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit b32a4ad740e8f03c5069c246a1269774f90fe972 +Subproject commit 5ab18a48f9a83d2316526f87db3158ca638d42c5 diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index 9d011e2de2..00933445c9 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -1,7 +1,6 @@  - net461 net461;netstandard2.0;netcoreapp2.0 @@ -15,12 +14,16 @@ catch the fruit. to the beat. osu.Game.Rulesets.Catch + + + + diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index cc6c770bbf..155dd8b4f6 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -1,7 +1,6 @@  - net461 net461;netstandard2.0;netcoreapp2.0 @@ -15,12 +14,16 @@ smash the keys. to the beat. osu.Game.Rulests.Mania + + + + diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 3d512ad53e..af32f48b36 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -1,7 +1,6 @@  - net461 net461;netstandard2.0;netcoreapp2.0 @@ -15,12 +14,16 @@ click the circles. to the beat. osu.Game.Rulesets.Osu + + + + diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index dc08e71446..9c5353c4fe 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -1,7 +1,6 @@  - net461 net461;netstandard2.0;netcoreapp2.0 @@ -15,12 +14,16 @@ bash the drum. to the beat. osu.Game.Rulesets.Taiko + + + + diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 5717066f45..0f09d97f0f 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -1,7 +1,6 @@  - net461 net461;netstandard2.0;netcoreapp2.0 @@ -16,6 +15,9 @@ NU1701 + + + @@ -28,6 +30,7 @@ + diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 643ada16aa..014694ffef 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -1,7 +1,6 @@  - net461 net461;netstandard2.0;netcoreapp2.0 @@ -16,6 +15,9 @@ osu.Game 0 + + + @@ -26,6 +28,7 @@ + \ No newline at end of file From 988141408f9f3879efca39bbab623f82a7d942a6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 27 Mar 2018 15:25:56 +0900 Subject: [PATCH 079/109] Update copyright year --- osu-framework | 2 +- osu.Game/osu.Game.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 5ab18a48f9..a6cea54d05 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 5ab18a48f9a83d2316526f87db3158ca638d42c5 +Subproject commit a6cea54d056ef6f565752f45e8a0a28a00e99030 diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 014694ffef..34a5944e7f 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -9,7 +9,7 @@ true ppy Pty Ltd 1.0.0.0 - ppy Pty Ltd 2007-2017 + ppy Pty Ltd 2007-2018 osu.Game click the circles. to the beat. osu.Game From 1a8aa8746972f55a1f9247304538a3fdc963cb66 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 27 Mar 2018 18:55:27 +0900 Subject: [PATCH 080/109] Make everything better --- .vscode/tasks.json | 2 ++ OpenTK.props | 6 ------ osu-framework | 2 +- osu-resources | 2 +- osu.Desktop/OsuGameDesktop.cs | 3 +-- osu.Desktop/osu.Desktop.csproj | 4 +--- osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj | 4 +--- osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 4 +--- osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 4 +--- osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj | 4 +--- osu.Game.Tests/osu.Game.Tests.csproj | 4 +--- osu.Game/osu.Game.csproj | 4 +--- 12 files changed, 12 insertions(+), 31 deletions(-) delete mode 100644 OpenTK.props diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 3378a83616..b1d2c6b57d 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -37,6 +37,7 @@ "args": [ "build", "--no-restore", + "osu.Desktop", "/p:TargetFramework=netcoreapp2.0", "/p:GenerateFullPaths=true", "/m", @@ -52,6 +53,7 @@ "args": [ "build", "--no-restore", + "osu.Desktop", "/p:TargetFramework=netcoreapp2.0", "/p:Configuration=Release", "/p:GenerateFullPaths=true", diff --git a/OpenTK.props b/OpenTK.props deleted file mode 100644 index 8708670f2c..0000000000 --- a/OpenTK.props +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/osu-framework b/osu-framework index a6cea54d05..ced746ac27 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit a6cea54d056ef6f565752f45e8a0a28a00e99030 +Subproject commit ced746ac27b30019ef2cdc3a15e6df4a18ac9585 diff --git a/osu-resources b/osu-resources index 3958127d95..b335a7195d 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 3958127d95ee230021e9946c989400e71c9dbb3c +Subproject commit b335a7195d60ab8d83ae9eba1150ee022163f3ba diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index fddc6af2f4..3704d2d5d8 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using System.Drawing; using System.IO; using System.Linq; using System.Reflection; @@ -100,7 +99,7 @@ namespace osu.Desktop { desktopWindow.CursorState |= CursorState.Hidden; - desktopWindow.Icon = new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico")); + desktopWindow.SetIconFromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico")); desktopWindow.Title = Name; desktopWindow.FileDrop += fileDrop; diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 5d346603db..2262bbc515 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -1,9 +1,7 @@  - - net461 - net461;netcoreapp2.0 + net461;netcoreapp2.0 WinExe AnyCPU true diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index 00933445c9..aa4d06cf64 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -1,9 +1,7 @@  - - net461 - net461;netstandard2.0;netcoreapp2.0 + netstandard2.0 Library AnyCPU true diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 155dd8b4f6..a1f08e9299 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -1,9 +1,7 @@  - - net461 - net461;netstandard2.0;netcoreapp2.0 + netstandard2.0 Library AnyCPU true diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index af32f48b36..a58d3b6795 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -1,9 +1,7 @@  - - net461 - net461;netstandard2.0;netcoreapp2.0 + netstandard2.0 Library AnyCPU true diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index 9c5353c4fe..d7794aaafd 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -1,9 +1,7 @@  - - net461 - net461;netstandard2.0;netcoreapp2.0 + netstandard2.0 Library AnyCPU true diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 0f09d97f0f..5b9a1f11e4 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -1,9 +1,7 @@  - - net461 - net461;netstandard2.0;netcoreapp2.0 + netstandard2.0 Library AnyCPU true diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 34a5944e7f..b42d76e331 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -1,9 +1,7 @@  - - net461 - net461;netstandard2.0;netcoreapp2.0 + netstandard2.0 Library AnyCPU true From 04a7754049f9a2635aa35dfc7a917aa405be5398 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 27 Mar 2018 18:57:20 +0900 Subject: [PATCH 081/109] Make squirrel local so ifdef is nicer --- osu.Desktop/Overlays/SquirrelUpdateManager.cs | 158 ++++++++++++++++++ osu.Desktop/Overlays/VersionManager.cs | 143 +--------------- 2 files changed, 160 insertions(+), 141 deletions(-) create mode 100644 osu.Desktop/Overlays/SquirrelUpdateManager.cs diff --git a/osu.Desktop/Overlays/SquirrelUpdateManager.cs b/osu.Desktop/Overlays/SquirrelUpdateManager.cs new file mode 100644 index 0000000000..1c1ba6a3ad --- /dev/null +++ b/osu.Desktop/Overlays/SquirrelUpdateManager.cs @@ -0,0 +1,158 @@ +#if NET_FRAMEWORK +using System; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Colour; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Logging; +using osu.Game; +using osu.Game.Graphics; +using osu.Game.Overlays; +using osu.Game.Overlays.Notifications; +using OpenTK; +using OpenTK.Graphics; +using Squirrel; + +namespace osu.Desktop.Overlays +{ + public class SquirrelUpdateManager : Component + { + private UpdateManager updateManager; + private NotificationOverlay notificationOverlay; + + public void PrepareUpdate() + { + // Squirrel returns execution to us after the update process is started, so it's safe to use Wait() here + UpdateManager.RestartAppWhenExited().Wait(); + } + + [BackgroundDependencyLoader] + private void load(NotificationOverlay notification, OsuGameBase game) + { + notificationOverlay = notification; + + if (game.IsDeployedBuild) + Schedule(() => checkForUpdateAsync()); + } + + private async void checkForUpdateAsync(bool useDeltaPatching = true, UpdateProgressNotification notification = null) + { + //should we schedule a retry on completion of this check? + bool scheduleRetry = true; + + try + { + if (updateManager == null) updateManager = await UpdateManager.GitHubUpdateManager(@"https://github.com/ppy/osu", @"osulazer", null, null, true); + + var info = await updateManager.CheckForUpdate(!useDeltaPatching); + if (info.ReleasesToApply.Count == 0) + //no updates available. bail and retry later. + return; + + if (notification == null) + { + notification = new UpdateProgressNotification(this) { State = ProgressNotificationState.Active }; + Schedule(() => notificationOverlay.Post(notification)); + } + + notification.Progress = 0; + notification.Text = @"Downloading update..."; + + try + { + await updateManager.DownloadReleases(info.ReleasesToApply, p => notification.Progress = p / 100f); + + notification.Progress = 0; + notification.Text = @"Installing update..."; + + await updateManager.ApplyReleases(info, p => notification.Progress = p / 100f); + + notification.State = ProgressNotificationState.Completed; + } + catch (Exception e) + { + if (useDeltaPatching) + { + Logger.Error(e, @"delta patching failed!"); + + //could fail if deltas are unavailable for full update path (https://github.com/Squirrel/Squirrel.Windows/issues/959) + //try again without deltas. + checkForUpdateAsync(false, notification); + scheduleRetry = false; + } + else + { + Logger.Error(e, @"update failed!"); + } + } + } + catch (Exception) + { + // we'll ignore this and retry later. can be triggered by no internet connection or thread abortion. + } + finally + { + if (scheduleRetry) + { + if (notification != null) + notification.State = ProgressNotificationState.Cancelled; + + //check again in 30 minutes. + Scheduler.AddDelayed(() => checkForUpdateAsync(), 60000 * 30); + } + } + } + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + updateManager?.Dispose(); + } + + private class UpdateProgressNotification : ProgressNotification + { + private readonly SquirrelUpdateManager updateManager; + private OsuGame game; + + public UpdateProgressNotification(SquirrelUpdateManager updateManager) + { + this.updateManager = updateManager; + } + + protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification + { + Text = @"Update ready to install. Click to restart!", + Activated = () => + { + updateManager.PrepareUpdate(); + game.GracefullyExit(); + return true; + } + }; + + [BackgroundDependencyLoader] + private void load(OsuColour colours, OsuGame game) + { + this.game = game; + + IconContent.AddRange(new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = ColourInfo.GradientVertical(colours.YellowDark, colours.Yellow) + }, + new SpriteIcon + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Icon = FontAwesome.fa_upload, + Colour = Color4.White, + Size = new Vector2(20), + } + }); + } + } + } +} +#endif diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 357cd49a5c..b61603dcc5 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -5,9 +5,7 @@ using System.Diagnostics; using osu.Framework.Allocation; using osu.Framework.Development; using osu.Framework.Graphics; -using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Game; @@ -19,23 +17,13 @@ using osu.Game.Overlays.Notifications; using OpenTK; using OpenTK.Graphics; -#if NET_FRAMEWORK -using System; -using osu.Framework.Logging; -using Squirrel; -#endif - namespace osu.Desktop.Overlays { public class VersionManager : OverlayContainer { -#if NET_FRAMEWORK - private UpdateManager updateManager; -#endif - - private NotificationOverlay notificationOverlay; private OsuConfigManager config; private OsuGameBase game; + private NotificationOverlay notificationOverlay; public override bool HandleKeyboardInput => false; public override bool HandleMouseInput => false; @@ -102,8 +90,7 @@ namespace osu.Desktop.Overlays }; #if NET_FRAMEWORK - if (game.IsDeployedBuild) - checkForUpdateAsync(); + Add(new SquirrelUpdateManager()); #endif } @@ -143,90 +130,6 @@ namespace osu.Desktop.Overlays } } - protected override void Dispose(bool isDisposing) - { - base.Dispose(isDisposing); - -#if NET_FRAMEWORK - updateManager?.Dispose(); -#endif - } - -#if NET_FRAMEWORK - private async void checkForUpdateAsync(bool useDeltaPatching = true, UpdateProgressNotification notification = null) - { - //should we schedule a retry on completion of this check? - bool scheduleRetry = true; - - try - { - if (updateManager == null) updateManager = await UpdateManager.GitHubUpdateManager(@"https://github.com/ppy/osu", @"osulazer", null, null, true); - - var info = await updateManager.CheckForUpdate(!useDeltaPatching); - if (info.ReleasesToApply.Count == 0) - //no updates available. bail and retry later. - return; - - if (notification == null) - { - notification = new UpdateProgressNotification { State = ProgressNotificationState.Active }; - Schedule(() => notificationOverlay.Post(notification)); - } - - Schedule(() => - { - notification.Progress = 0; - notification.Text = @"Downloading update..."; - }); - - try - { - await updateManager.DownloadReleases(info.ReleasesToApply, p => Schedule(() => notification.Progress = p / 100f)); - - Schedule(() => - { - notification.Progress = 0; - notification.Text = @"Installing update..."; - }); - - await updateManager.ApplyReleases(info, p => Schedule(() => notification.Progress = p / 100f)); - - Schedule(() => notification.State = ProgressNotificationState.Completed); - } - catch (Exception e) - { - if (useDeltaPatching) - { - Logger.Error(e, @"delta patching failed!"); - - //could fail if deltas are unavailable for full update path (https://github.com/Squirrel/Squirrel.Windows/issues/959) - //try again without deltas. - checkForUpdateAsync(false, notification); - scheduleRetry = false; - } - else - { - Logger.Error(e, @"update failed!"); - } - } - } - catch (Exception) - { - // we'll ignore this and retry later. can be triggered by no internet connection or thread abortion. - } - finally - { - if (scheduleRetry) - { - //check again in 30 minutes. - Scheduler.AddDelayed(() => checkForUpdateAsync(), 60000 * 30); - if (notification != null) - notification.State = ProgressNotificationState.Cancelled; - } - } - } -#endif - protected override void PopIn() { this.FadeIn(1000); @@ -235,47 +138,5 @@ namespace osu.Desktop.Overlays protected override void PopOut() { } - - private class UpdateProgressNotification : ProgressNotification - { - private OsuGame game; - - protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification - { - Text = @"Update ready to install. Click to restart!", - Activated = () => - { - // Squirrel returns execution to us after the update process is started, so it's safe to use Wait() here -#if NET_FRAMEWORK - UpdateManager.RestartAppWhenExited().Wait(); -#endif - game.GracefullyExit(); - return true; - } - }; - - [BackgroundDependencyLoader] - private void load(OsuColour colours, OsuGame game) - { - this.game = game; - - IconContent.AddRange(new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = ColourInfo.GradientVertical(colours.YellowDark, colours.Yellow) - }, - new SpriteIcon - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Icon = FontAwesome.fa_upload, - Colour = Color4.White, - Size = new Vector2(20), - } - }); - } - } } } From 75a413a40e705defa1c0cc719869fd57fbecaaf0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 27 Mar 2018 19:19:09 +0900 Subject: [PATCH 082/109] Move NoWarns --- osu-framework | 2 +- osu.Desktop/osu.Desktop.csproj | 3 --- osu.Game.Tests/osu.Game.Tests.csproj | 6 +++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/osu-framework b/osu-framework index ced746ac27..bef78377e7 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit ced746ac27b30019ef2cdc3a15e6df4a18ac9585 +Subproject commit bef78377e74056b2b36611b74ece21d18935fcbf diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 2262bbc515..6125ec82c3 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -15,9 +15,6 @@ $(CONFIGURATIONS);VisualTests 0.0.0.0 0.0.0.0 - - NU1701 $(DefineConstants);NET_FRAMEWORK diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 5b9a1f11e4..0a3bd4b417 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -10,8 +10,6 @@ ppy Pty Ltd 2007-2017 osu.Game.Tests osu.Game.Tests - - NU1701 @@ -27,7 +25,9 @@ - + + NU1701 + From 524044d4876e1a39b151988457fd97b7f5c22b0e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 27 Mar 2018 19:19:28 +0900 Subject: [PATCH 083/109] Add licence header to SquirrelUpdateManager --- osu.Desktop/Overlays/SquirrelUpdateManager.cs | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/osu.Desktop/Overlays/SquirrelUpdateManager.cs b/osu.Desktop/Overlays/SquirrelUpdateManager.cs index 1c1ba6a3ad..61d8a75ae3 100644 --- a/osu.Desktop/Overlays/SquirrelUpdateManager.cs +++ b/osu.Desktop/Overlays/SquirrelUpdateManager.cs @@ -1,4 +1,7 @@ -#if NET_FRAMEWORK +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +#if NET_FRAMEWORK using System; using osu.Framework.Allocation; using osu.Framework.Graphics; @@ -119,16 +122,19 @@ namespace osu.Desktop.Overlays this.updateManager = updateManager; } - protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification + protected override Notification CreateCompletionNotification() { - Text = @"Update ready to install. Click to restart!", - Activated = () => + return new ProgressCompletionNotification { - updateManager.PrepareUpdate(); - game.GracefullyExit(); - return true; - } - }; + Text = @"Update ready to install. Click to restart!", + Activated = () => + { + updateManager.PrepareUpdate(); + game.GracefullyExit(); + return true; + } + }; + } [BackgroundDependencyLoader] private void load(OsuColour colours, OsuGame game) From d76bc1a8ad01bbf266f0790b97e1c829683185b3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 27 Mar 2018 19:19:09 +0900 Subject: [PATCH 084/109] Revert "Move NoWarns" This reverts commit 75a413a40e705defa1c0cc719869fd57fbecaaf0. --- osu-framework | 2 +- osu.Desktop/osu.Desktop.csproj | 3 +++ osu.Game.Tests/osu.Game.Tests.csproj | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/osu-framework b/osu-framework index bef78377e7..5bad477858 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit bef78377e74056b2b36611b74ece21d18935fcbf +Subproject commit 5bad47785877250f0589f02396f5dc7c9bd2b8f0 diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 6125ec82c3..2262bbc515 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -15,6 +15,9 @@ $(CONFIGURATIONS);VisualTests 0.0.0.0 0.0.0.0 + + NU1701 $(DefineConstants);NET_FRAMEWORK diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 0a3bd4b417..5b9a1f11e4 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -10,6 +10,8 @@ ppy Pty Ltd 2007-2017 osu.Game.Tests osu.Game.Tests + + NU1701 @@ -25,9 +27,7 @@ - - NU1701 - + From efac68a8f5073a55de1e50f890ab15c3af6b0348 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 27 Mar 2018 22:36:43 +0900 Subject: [PATCH 085/109] Update deploy script --- osu.Desktop.Deploy/Program.cs | 12 +++++------- osu.Desktop.Deploy/osu.Desktop.Deploy.csproj | 11 ++++++----- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/osu.Desktop.Deploy/Program.cs b/osu.Desktop.Deploy/Program.cs index e5e0702e6d..3c1451d555 100644 --- a/osu.Desktop.Deploy/Program.cs +++ b/osu.Desktop.Deploy/Program.cs @@ -16,8 +16,9 @@ namespace osu.Desktop.Deploy { internal static class Program { - private const string nuget_path = @"packages\NuGet.CommandLine.4.3.0\tools\NuGet.exe"; - private const string squirrel_path = @"packages\squirrel.windows.1.7.8\tools\Squirrel.exe"; + private static string packages => Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "packages"); + private static string nugetPath => Path.Combine(packages, @"nuget.commandline\4.5.1\tools\NuGet.exe"); + private static string squirrelPath => Path.Combine(packages, @"squirrel.windows\1.7.8\tools\Squirrel.exe"); private const string msbuild_path = @"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe"; public static string StagingFolder = ConfigurationManager.AppSettings["StagingFolder"]; @@ -92,9 +93,6 @@ namespace osu.Desktop.Deploy codeSigningPassword = readLineMasked(); } - write("Restoring NuGet packages..."); - runCommand(nuget_path, "restore " + solutionPath); - write("Updating AssemblyInfo..."); updateCsprojVersion(version); @@ -103,7 +101,7 @@ namespace osu.Desktop.Deploy runCommand(msbuild_path, $"/v:quiet /m /t:{targetName.Replace('.', '_')} /p:OutputPath={stagingPath};Targets=\"Clean;Build\";Configuration=Release {SolutionName}.sln"); write("Creating NuGet deployment package..."); - runCommand(nuget_path, $"pack {NuSpecName} -Version {version} -Properties Configuration=Deploy -OutputDirectory {stagingPath} -BasePath {stagingPath}"); + runCommand(nugetPath, $"pack {NuSpecName} -Version {version} -Properties Configuration=Deploy -OutputDirectory {stagingPath} -BasePath {stagingPath}"); //prune once before checking for files so we can avoid erroring on files which aren't even needed for this build. pruneReleases(); @@ -111,7 +109,7 @@ namespace osu.Desktop.Deploy checkReleaseFiles(); write("Running squirrel build..."); - runCommand(squirrel_path, $"--releasify {stagingPath}\\{nupkgFilename(version)} --setupIcon {iconPath} --icon {iconPath} {codeSigningCmd} --no-msi"); + runCommand(squirrelPath, $"--releasify {stagingPath}\\{nupkgFilename(version)} --setupIcon {iconPath} --icon {iconPath} {codeSigningCmd} --no-msi"); //prune again to clean up before upload. pruneReleases(); diff --git a/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj b/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj index ccbf351bda..eab54bd10b 100644 --- a/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj +++ b/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj @@ -1,5 +1,5 @@ - + net461 Exe @@ -11,11 +11,12 @@ osu.Desktop.Deploy - + - - - + + + + \ No newline at end of file From d47d7a3dd461f5a7ff0e64b881c5abd7ad50b36a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 27 Mar 2018 22:47:01 +0900 Subject: [PATCH 086/109] Update submodules --- osu-framework | 2 +- osu-resources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 5bad477858..b59149e1ce 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 5bad47785877250f0589f02396f5dc7c9bd2b8f0 +Subproject commit b59149e1cebe28675dcd2ebd014e5793d9626c09 diff --git a/osu-resources b/osu-resources index b335a7195d..c3848d8b1c 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit b335a7195d60ab8d83ae9eba1150ee022163f3ba +Subproject commit c3848d8b1c84966abe851d915bcca878415614b4 From 506e27a30e65e5ecf18124bf9f7b188c4228d992 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Tue, 27 Mar 2018 17:59:58 -0300 Subject: [PATCH 087/109] Cleanup. --- osu.Game/Beatmaps/BeatmapSetOnlineStatus.cs | 2 +- osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/BeatmapSetOnlineStatus.cs b/osu.Game/Beatmaps/BeatmapSetOnlineStatus.cs index 712c7a34d6..c7f767d3b2 100644 --- a/osu.Game/Beatmaps/BeatmapSetOnlineStatus.cs +++ b/osu.Game/Beatmaps/BeatmapSetOnlineStatus.cs @@ -5,7 +5,7 @@ namespace osu.Game.Beatmaps { public enum BeatmapSetOnlineStatus { - None, + None = -3, Graveyard = -2, WIP = -1, Pending = 0, diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs index 3c98ddc094..8ea7a538f9 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs @@ -20,6 +20,7 @@ namespace osu.Game.Beatmaps.Drawables get { return status; } set { + if (value == status) return; status = value; statusText.Text = Enum.GetName(typeof(BeatmapSetOnlineStatus), Status)?.ToUpper(); From 84bb96740f36294ac2098f769f2f40a1ebc88059 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Tue, 27 Mar 2018 18:27:30 -0300 Subject: [PATCH 088/109] Fix merge error. --- osu.Game/osu.Game.csproj | 62 ++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 0827768afe..b42d76e331 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -1,32 +1,32 @@ - - - - netstandard2.0 - Library - AnyCPU - true - ppy Pty Ltd - 1.0.0.0 - ppy Pty Ltd 2007-2018 - osu.Game - click the circles. to the beat. - osu.Game - 0 - - - - - - - - - - - - - - - - - + + + + netstandard2.0 + Library + AnyCPU + true + ppy Pty Ltd + 1.0.0.0 + ppy Pty Ltd 2007-2018 + osu.Game + click the circles. to the beat. + osu.Game + 0 + + + + + + + + + + + + + + + + + \ No newline at end of file From 94b1d3e4af91f9b34f7f32158c31da849cb24c06 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Mar 2018 12:33:01 +0900 Subject: [PATCH 089/109] Make VisualTests/nUnit work again --- osu-framework | 2 +- osu.Desktop/Program.cs | 3 -- osu.Game.Tests/osu.Game.Tests.csproj | 38 ++++++++----------- .../Tests}/OsuTestBrowser.cs | 5 +-- osu.Game/Tests/VisualTestRunner.cs | 22 +++++++++++ osu.TestProject.props | 26 +++++++++++++ 6 files changed, 66 insertions(+), 30 deletions(-) rename {osu.Desktop => osu.Game/Tests}/OsuTestBrowser.cs (87%) create mode 100644 osu.Game/Tests/VisualTestRunner.cs create mode 100644 osu.TestProject.props diff --git a/osu-framework b/osu-framework index b59149e1ce..71fe258bf2 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit b59149e1cebe28675dcd2ebd014e5793d9626c09 +Subproject commit 71fe258bf26dd2b8407729fd09f837ca26060d62 diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index 25beb9a7d4..7258610f90 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -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; diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 5b9a1f11e4..a5a78f6fc7 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -1,39 +1,31 @@  - - - netstandard2.0 - Library - AnyCPU - true - ppy Pty Ltd - 1.0.0.0 - ppy Pty Ltd 2007-2017 - osu.Game.Tests - osu.Game.Tests - - NU1701 - + + + net461;netcoreapp2.0 + WinExe + AnyCPU + true + ppy Pty Ltd + click the circles. to the beat. + ppy Pty Ltd 2007-2017 + + NU1701 + - - - + - - - - - - + \ No newline at end of file diff --git a/osu.Desktop/OsuTestBrowser.cs b/osu.Game/Tests/OsuTestBrowser.cs similarity index 87% rename from osu.Desktop/OsuTestBrowser.cs rename to osu.Game/Tests/OsuTestBrowser.cs index 7aae2604af..6d9b28b5a7 100644 --- a/osu.Desktop/OsuTestBrowser.cs +++ b/osu.Game/Tests/OsuTestBrowser.cs @@ -3,12 +3,11 @@ using osu.Framework.Platform; using osu.Framework.Testing; -using osu.Game; using osu.Game.Screens.Backgrounds; -namespace osu.Desktop +namespace osu.Game.Tests { - internal class OsuTestBrowser : OsuGameBase + public class OsuTestBrowser : OsuGameBase { protected override void LoadComplete() { diff --git a/osu.Game/Tests/VisualTestRunner.cs b/osu.Game/Tests/VisualTestRunner.cs new file mode 100644 index 0000000000..d8a4143368 --- /dev/null +++ b/osu.Game/Tests/VisualTestRunner.cs @@ -0,0 +1,22 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using osu.Framework; +using osu.Framework.Platform; + +namespace osu.Game.Tests +{ + public static class VisualTestRunner + { + [STAThread] + public static int Main(string[] args) + { + using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true)) + { + host.Run(new OsuTestBrowser()); + return 0; + } + } + } +} diff --git a/osu.TestProject.props b/osu.TestProject.props new file mode 100644 index 0000000000..50ee5848fc --- /dev/null +++ b/osu.TestProject.props @@ -0,0 +1,26 @@ + + + + $(DefineConstants);NET_FRAMEWORK + + + osu.Game.Tests.VisualTestRunner + + + + + + + + + + + + + VisualTestRunner.cs + + + + false + + \ No newline at end of file From 4907f14dbedb0a34c201840bfca155e85313b6ce Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Mar 2018 13:00:18 +0900 Subject: [PATCH 090/109] Add back resources --- osu.Game.Tests/osu.Game.Tests.csproj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index a5a78f6fc7..1c88cc49d4 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -21,6 +21,12 @@ + + + + + + From c355a0794c92b5d802f2a7e516250979cebf16b6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Mar 2018 13:12:32 +0900 Subject: [PATCH 091/109] Let appveyor do its own discovery --- appveyor.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 6388b54db5..4c4b70827f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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 \ No newline at end of file From 0026b94cd31dfd533e83ade1585b9994920b4b89 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Mar 2018 14:13:37 +0900 Subject: [PATCH 092/109] Consolidate and move ruleset test projects --- osu-framework | 2 +- .../CatchBeatmapConversionTest.cs | 0 .../TestCaseBananaShower.cs | 0 .../TestCaseCatchPlayer.cs | 0 .../TestCaseCatchStacker.cs | 0 .../TestCaseCatcherArea.cs | 0 .../TestCaseFruitObjects.cs | 0 .../TestCaseHyperdash.cs | 0 .../TestCasePerformancePoints.cs | 0 .../osu.Game.Rulesets.Catch.Tests.csproj | 6 ++++ .../Properties/AssemblyInfo.cs | 12 +++++++ .../osu.Game.Rulesets.Catch.csproj | 11 ------- .../ManiaBeatmapConversionTest.cs | 0 .../TestCaseAutoGeneration.cs | 0 .../TestCaseManiaHitObjects.cs | 0 .../TestCaseManiaPlayfield.cs | 0 .../TestCasePerformancePoints.cs | 0 .../osu.Game.Rulesets.Mania.Tests.csproj | 6 ++++ .../Properties/AssemblyInfo.cs | 12 +++++++ .../osu.Game.Rulesets.Mania.csproj | 11 ------- .../OsuBeatmapConversionTest.cs | 0 .../TestCaseEditor.cs | 0 .../TestCaseGameplayCursor.cs | 0 .../TestCaseHitCircle.cs | 0 .../TestCaseHitCircleHidden.cs | 0 .../TestCasePerformancePoints.cs | 0 .../TestCaseSlider.cs | 0 .../TestCaseSliderHidden.cs | 0 .../TestCaseSpinner.cs | 0 .../TestCaseSpinnerHidden.cs | 0 .../osu.Game.Rulesets.Osu.Tests.csproj | 6 ++++ .../Properties/AssemblyInfo.cs | 12 +++++++ .../osu.Game.Rulesets.Osu.csproj | 11 ------- .../TaikoBeatmapConversionTest.cs | 0 .../TestCaseInputDrum.cs | 0 .../TestCasePerformancePoints.cs | 0 .../TestCaseTaikoPlayfield.cs | 0 .../osu.Game.Rulesets.Taiko.Tests.csproj | 6 ++++ .../Properties/AssemblyInfo.cs | 12 +++++++ .../osu.Game.Rulesets.Taiko.csproj | 11 ------- osu.Game.Tests/osu.Game.Tests.csproj | 28 ---------------- osu.Game.props | 3 ++ osu.TestProject.props | 20 +++++++++--- osu.sln | 32 +++++++++++++++++++ 44 files changed, 124 insertions(+), 77 deletions(-) rename {osu.Game.Rulesets.Catch/Tests => osu.Game.Rulesets.Catch.Tests}/CatchBeatmapConversionTest.cs (100%) rename {osu.Game.Rulesets.Catch/Tests => osu.Game.Rulesets.Catch.Tests}/TestCaseBananaShower.cs (100%) rename {osu.Game.Rulesets.Catch/Tests => osu.Game.Rulesets.Catch.Tests}/TestCaseCatchPlayer.cs (100%) rename {osu.Game.Rulesets.Catch/Tests => osu.Game.Rulesets.Catch.Tests}/TestCaseCatchStacker.cs (100%) rename {osu.Game.Rulesets.Catch/Tests => osu.Game.Rulesets.Catch.Tests}/TestCaseCatcherArea.cs (100%) rename {osu.Game.Rulesets.Catch/Tests => osu.Game.Rulesets.Catch.Tests}/TestCaseFruitObjects.cs (100%) rename {osu.Game.Rulesets.Catch/Tests => osu.Game.Rulesets.Catch.Tests}/TestCaseHyperdash.cs (100%) rename {osu.Game.Rulesets.Catch/Tests => osu.Game.Rulesets.Catch.Tests}/TestCasePerformancePoints.cs (100%) create mode 100644 osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj create mode 100644 osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs rename {osu.Game.Rulesets.Mania/Tests => osu.Game.Rulesets.Mania.Tests}/ManiaBeatmapConversionTest.cs (100%) rename {osu.Game.Rulesets.Mania/Tests => osu.Game.Rulesets.Mania.Tests}/TestCaseAutoGeneration.cs (100%) rename {osu.Game.Rulesets.Mania/Tests => osu.Game.Rulesets.Mania.Tests}/TestCaseManiaHitObjects.cs (100%) rename {osu.Game.Rulesets.Mania/Tests => osu.Game.Rulesets.Mania.Tests}/TestCaseManiaPlayfield.cs (100%) rename {osu.Game.Rulesets.Mania/Tests => osu.Game.Rulesets.Mania.Tests}/TestCasePerformancePoints.cs (100%) create mode 100644 osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj create mode 100644 osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs rename {osu.Game.Rulesets.Osu/Tests => osu.Game.Rulesets.Osu.Tests}/OsuBeatmapConversionTest.cs (100%) rename {osu.Game.Rulesets.Osu/Tests => osu.Game.Rulesets.Osu.Tests}/TestCaseEditor.cs (100%) rename {osu.Game.Rulesets.Osu/Tests => osu.Game.Rulesets.Osu.Tests}/TestCaseGameplayCursor.cs (100%) rename {osu.Game.Rulesets.Osu/Tests => osu.Game.Rulesets.Osu.Tests}/TestCaseHitCircle.cs (100%) rename {osu.Game.Rulesets.Osu/Tests => osu.Game.Rulesets.Osu.Tests}/TestCaseHitCircleHidden.cs (100%) rename {osu.Game.Rulesets.Osu/Tests => osu.Game.Rulesets.Osu.Tests}/TestCasePerformancePoints.cs (100%) rename {osu.Game.Rulesets.Osu/Tests => osu.Game.Rulesets.Osu.Tests}/TestCaseSlider.cs (100%) rename {osu.Game.Rulesets.Osu/Tests => osu.Game.Rulesets.Osu.Tests}/TestCaseSliderHidden.cs (100%) rename {osu.Game.Rulesets.Osu/Tests => osu.Game.Rulesets.Osu.Tests}/TestCaseSpinner.cs (100%) rename {osu.Game.Rulesets.Osu/Tests => osu.Game.Rulesets.Osu.Tests}/TestCaseSpinnerHidden.cs (100%) create mode 100644 osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj create mode 100644 osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs rename {osu.Game.Rulesets.Taiko/Tests => osu.Game.Rulesets.Taiko.Tests}/TaikoBeatmapConversionTest.cs (100%) rename {osu.Game.Rulesets.Taiko/Tests => osu.Game.Rulesets.Taiko.Tests}/TestCaseInputDrum.cs (100%) rename {osu.Game.Rulesets.Taiko/Tests => osu.Game.Rulesets.Taiko.Tests}/TestCasePerformancePoints.cs (100%) rename {osu.Game.Rulesets.Taiko/Tests => osu.Game.Rulesets.Taiko.Tests}/TestCaseTaikoPlayfield.cs (100%) create mode 100644 osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj create mode 100644 osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs diff --git a/osu-framework b/osu-framework index 71fe258bf2..c69330f652 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 71fe258bf26dd2b8407729fd09f837ca26060d62 +Subproject commit c69330f652d34350a7bf3786016a3ce5f968c25f diff --git a/osu.Game.Rulesets.Catch/Tests/CatchBeatmapConversionTest.cs b/osu.Game.Rulesets.Catch.Tests/CatchBeatmapConversionTest.cs similarity index 100% rename from osu.Game.Rulesets.Catch/Tests/CatchBeatmapConversionTest.cs rename to osu.Game.Rulesets.Catch.Tests/CatchBeatmapConversionTest.cs diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs b/osu.Game.Rulesets.Catch.Tests/TestCaseBananaShower.cs similarity index 100% rename from osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs rename to osu.Game.Rulesets.Catch.Tests/TestCaseBananaShower.cs diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseCatchPlayer.cs b/osu.Game.Rulesets.Catch.Tests/TestCaseCatchPlayer.cs similarity index 100% rename from osu.Game.Rulesets.Catch/Tests/TestCaseCatchPlayer.cs rename to osu.Game.Rulesets.Catch.Tests/TestCaseCatchPlayer.cs diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs b/osu.Game.Rulesets.Catch.Tests/TestCaseCatchStacker.cs similarity index 100% rename from osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs rename to osu.Game.Rulesets.Catch.Tests/TestCaseCatchStacker.cs diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseCatcherArea.cs b/osu.Game.Rulesets.Catch.Tests/TestCaseCatcherArea.cs similarity index 100% rename from osu.Game.Rulesets.Catch/Tests/TestCaseCatcherArea.cs rename to osu.Game.Rulesets.Catch.Tests/TestCaseCatcherArea.cs diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs b/osu.Game.Rulesets.Catch.Tests/TestCaseFruitObjects.cs similarity index 100% rename from osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs rename to osu.Game.Rulesets.Catch.Tests/TestCaseFruitObjects.cs diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseHyperdash.cs b/osu.Game.Rulesets.Catch.Tests/TestCaseHyperdash.cs similarity index 100% rename from osu.Game.Rulesets.Catch/Tests/TestCaseHyperdash.cs rename to osu.Game.Rulesets.Catch.Tests/TestCaseHyperdash.cs diff --git a/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Catch.Tests/TestCasePerformancePoints.cs similarity index 100% rename from osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs rename to osu.Game.Rulesets.Catch.Tests/TestCasePerformancePoints.cs diff --git a/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj b/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj new file mode 100644 index 0000000000..561613a2e8 --- /dev/null +++ b/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..0470b31824 --- /dev/null +++ b/osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using System.Runtime.CompilerServices; +using osu.Framework.Testing; + +// 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(DynamicClassCompiler.DYNAMIC_ASSEMBLY_NAME)] diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index aa4d06cf64..1337617578 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -12,18 +12,7 @@ catch the fruit. to the beat. osu.Game.Rulesets.Catch - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania/Tests/ManiaBeatmapConversionTest.cs b/osu.Game.Rulesets.Mania.Tests/ManiaBeatmapConversionTest.cs similarity index 100% rename from osu.Game.Rulesets.Mania/Tests/ManiaBeatmapConversionTest.cs rename to osu.Game.Rulesets.Mania.Tests/ManiaBeatmapConversionTest.cs diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseAutoGeneration.cs b/osu.Game.Rulesets.Mania.Tests/TestCaseAutoGeneration.cs similarity index 100% rename from osu.Game.Rulesets.Mania/Tests/TestCaseAutoGeneration.cs rename to osu.Game.Rulesets.Mania.Tests/TestCaseAutoGeneration.cs diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs b/osu.Game.Rulesets.Mania.Tests/TestCaseManiaHitObjects.cs similarity index 100% rename from osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs rename to osu.Game.Rulesets.Mania.Tests/TestCaseManiaHitObjects.cs diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs b/osu.Game.Rulesets.Mania.Tests/TestCaseManiaPlayfield.cs similarity index 100% rename from osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs rename to osu.Game.Rulesets.Mania.Tests/TestCaseManiaPlayfield.cs diff --git a/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Mania.Tests/TestCasePerformancePoints.cs similarity index 100% rename from osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs rename to osu.Game.Rulesets.Mania.Tests/TestCasePerformancePoints.cs diff --git a/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj b/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj new file mode 100644 index 0000000000..c7ee19e14f --- /dev/null +++ b/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..e4f30e2679 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using System.Runtime.CompilerServices; +using osu.Framework.Testing; + +// 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(DynamicClassCompiler.DYNAMIC_ASSEMBLY_NAME)] diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index a1f08e9299..b1d0baa03b 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -12,18 +12,7 @@ smash the keys. to the beat. osu.Game.Rulests.Mania - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Osu/Tests/OsuBeatmapConversionTest.cs b/osu.Game.Rulesets.Osu.Tests/OsuBeatmapConversionTest.cs similarity index 100% rename from osu.Game.Rulesets.Osu/Tests/OsuBeatmapConversionTest.cs rename to osu.Game.Rulesets.Osu.Tests/OsuBeatmapConversionTest.cs diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseEditor.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseEditor.cs similarity index 100% rename from osu.Game.Rulesets.Osu/Tests/TestCaseEditor.cs rename to osu.Game.Rulesets.Osu.Tests/TestCaseEditor.cs diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseGameplayCursor.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseGameplayCursor.cs similarity index 100% rename from osu.Game.Rulesets.Osu/Tests/TestCaseGameplayCursor.cs rename to osu.Game.Rulesets.Osu.Tests/TestCaseGameplayCursor.cs diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircle.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseHitCircle.cs similarity index 100% rename from osu.Game.Rulesets.Osu/Tests/TestCaseHitCircle.cs rename to osu.Game.Rulesets.Osu.Tests/TestCaseHitCircle.cs diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircleHidden.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseHitCircleHidden.cs similarity index 100% rename from osu.Game.Rulesets.Osu/Tests/TestCaseHitCircleHidden.cs rename to osu.Game.Rulesets.Osu.Tests/TestCaseHitCircleHidden.cs diff --git a/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Osu.Tests/TestCasePerformancePoints.cs similarity index 100% rename from osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs rename to osu.Game.Rulesets.Osu.Tests/TestCasePerformancePoints.cs diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs similarity index 100% rename from osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs rename to osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSliderHidden.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseSliderHidden.cs similarity index 100% rename from osu.Game.Rulesets.Osu/Tests/TestCaseSliderHidden.cs rename to osu.Game.Rulesets.Osu.Tests/TestCaseSliderHidden.cs diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSpinner.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseSpinner.cs similarity index 100% rename from osu.Game.Rulesets.Osu/Tests/TestCaseSpinner.cs rename to osu.Game.Rulesets.Osu.Tests/TestCaseSpinner.cs diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSpinnerHidden.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseSpinnerHidden.cs similarity index 100% rename from osu.Game.Rulesets.Osu/Tests/TestCaseSpinnerHidden.cs rename to osu.Game.Rulesets.Osu.Tests/TestCaseSpinnerHidden.cs diff --git a/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj b/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj new file mode 100644 index 0000000000..c84eff2da1 --- /dev/null +++ b/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..435bfd6512 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using System.Runtime.CompilerServices; +using osu.Framework.Testing; + +// 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(DynamicClassCompiler.DYNAMIC_ASSEMBLY_NAME)] diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index a58d3b6795..1d29be1557 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -12,18 +12,7 @@ click the circles. to the beat. osu.Game.Rulesets.Osu - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko/Tests/TaikoBeatmapConversionTest.cs b/osu.Game.Rulesets.Taiko.Tests/TaikoBeatmapConversionTest.cs similarity index 100% rename from osu.Game.Rulesets.Taiko/Tests/TaikoBeatmapConversionTest.cs rename to osu.Game.Rulesets.Taiko.Tests/TaikoBeatmapConversionTest.cs diff --git a/osu.Game.Rulesets.Taiko/Tests/TestCaseInputDrum.cs b/osu.Game.Rulesets.Taiko.Tests/TestCaseInputDrum.cs similarity index 100% rename from osu.Game.Rulesets.Taiko/Tests/TestCaseInputDrum.cs rename to osu.Game.Rulesets.Taiko.Tests/TestCaseInputDrum.cs diff --git a/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Taiko.Tests/TestCasePerformancePoints.cs similarity index 100% rename from osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs rename to osu.Game.Rulesets.Taiko.Tests/TestCasePerformancePoints.cs diff --git a/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs b/osu.Game.Rulesets.Taiko.Tests/TestCaseTaikoPlayfield.cs similarity index 100% rename from osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs rename to osu.Game.Rulesets.Taiko.Tests/TestCaseTaikoPlayfield.cs diff --git a/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj b/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj new file mode 100644 index 0000000000..918dd90814 --- /dev/null +++ b/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..c2ced73872 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using System.Runtime.CompilerServices; +using osu.Framework.Testing; + +// 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(DynamicClassCompiler.DYNAMIC_ASSEMBLY_NAME)] diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index d7794aaafd..75e64012d0 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -12,18 +12,7 @@ bash the drum. to the beat. osu.Game.Rulesets.Taiko - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 1c88cc49d4..4a0b89817f 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -1,37 +1,9 @@  - - - - - net461;netcoreapp2.0 - WinExe - AnyCPU - true - ppy Pty Ltd - click the circles. to the beat. - ppy Pty Ltd 2007-2017 - - NU1701 - - - - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Game.props b/osu.Game.props index 07abeb5539..b8a340f1eb 100644 --- a/osu.Game.props +++ b/osu.Game.props @@ -8,4 +8,7 @@ osu.licenseheader + + + \ No newline at end of file diff --git a/osu.TestProject.props b/osu.TestProject.props index 50ee5848fc..c4b4a52a80 100644 --- a/osu.TestProject.props +++ b/osu.TestProject.props @@ -1,19 +1,31 @@ - - - $(DefineConstants);NET_FRAMEWORK - + osu.Game.Tests.VisualTestRunner + + + + + WinExe + AnyCPU + true + + NU1701 + netcoreapp2.0;net461 + + + + diff --git a/osu.sln b/osu.sln index 43a7fdf6c3..a440f456f5 100644 --- a/osu.sln +++ b/osu.sln @@ -23,6 +23,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Tests", "osu.Game. EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Desktop", "osu.Desktop\osu.Desktop.csproj", "{419659FD-72EA-4678-9EB8-B22A746CED70}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Catch.Tests", "osu.Game.Rulesets.Catch.Tests\osu.Game.Rulesets.Catch.Tests.csproj", "{3AD63355-D6B1-4365-8D31-5652C989BEF1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Mania.Tests", "osu.Game.Rulesets.Mania.Tests\osu.Game.Rulesets.Mania.Tests.csproj", "{7E9E9C34-B204-406B-82E2-E01E900699CD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Taiko.Tests", "osu.Game.Rulesets.Taiko.Tests\osu.Game.Rulesets.Taiko.Tests.csproj", "{B698561F-FB28-46B1-857E-3CA7B92F9D70}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Osu.Tests", "osu.Game.Rulesets.Osu.Tests\osu.Game.Rulesets.Osu.Tests.csproj", "{6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -87,6 +95,30 @@ Global {419659FD-72EA-4678-9EB8-B22A746CED70}.Release|Any CPU.Build.0 = Release|Any CPU {419659FD-72EA-4678-9EB8-B22A746CED70}.VisualTests|Any CPU.ActiveCfg = VisualTests|Any CPU {419659FD-72EA-4678-9EB8-B22A746CED70}.VisualTests|Any CPU.Build.0 = VisualTests|Any CPU + {3AD63355-D6B1-4365-8D31-5652C989BEF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3AD63355-D6B1-4365-8D31-5652C989BEF1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3AD63355-D6B1-4365-8D31-5652C989BEF1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3AD63355-D6B1-4365-8D31-5652C989BEF1}.Release|Any CPU.Build.0 = Release|Any CPU + {3AD63355-D6B1-4365-8D31-5652C989BEF1}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU + {3AD63355-D6B1-4365-8D31-5652C989BEF1}.VisualTests|Any CPU.Build.0 = Debug|Any CPU + {7E9E9C34-B204-406B-82E2-E01E900699CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7E9E9C34-B204-406B-82E2-E01E900699CD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E9E9C34-B204-406B-82E2-E01E900699CD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7E9E9C34-B204-406B-82E2-E01E900699CD}.Release|Any CPU.Build.0 = Release|Any CPU + {7E9E9C34-B204-406B-82E2-E01E900699CD}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU + {7E9E9C34-B204-406B-82E2-E01E900699CD}.VisualTests|Any CPU.Build.0 = Debug|Any CPU + {B698561F-FB28-46B1-857E-3CA7B92F9D70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B698561F-FB28-46B1-857E-3CA7B92F9D70}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B698561F-FB28-46B1-857E-3CA7B92F9D70}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B698561F-FB28-46B1-857E-3CA7B92F9D70}.Release|Any CPU.Build.0 = Release|Any CPU + {B698561F-FB28-46B1-857E-3CA7B92F9D70}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU + {B698561F-FB28-46B1-857E-3CA7B92F9D70}.VisualTests|Any CPU.Build.0 = Debug|Any CPU + {6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.Release|Any CPU.Build.0 = Release|Any CPU + {6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU + {6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.VisualTests|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 093bd7db3c0620b4b6cc2ed1be30c85e5a4ac357 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Mar 2018 14:41:37 +0900 Subject: [PATCH 093/109] Update vscode build configurations --- .vscode/launch.json | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 8c8255db71..624e584f10 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -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)", From 9667d54ecbe542e18634b49e66d3348b296995d8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Mar 2018 14:48:08 +0900 Subject: [PATCH 094/109] Add missing licence headers --- osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs | 2 +- osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs | 2 +- osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs | 2 +- osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs index 0470b31824..00fd8247d8 100644 --- a/osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs +++ b/osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Runtime.CompilerServices; using osu.Framework.Testing; diff --git a/osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs index e4f30e2679..c2c65433ec 100644 --- a/osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs +++ b/osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Runtime.CompilerServices; using osu.Framework.Testing; diff --git a/osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs index 435bfd6512..7532646a32 100644 --- a/osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs +++ b/osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Runtime.CompilerServices; using osu.Framework.Testing; diff --git a/osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs index c2ced73872..b7ed9f86b0 100644 --- a/osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs +++ b/osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Runtime.CompilerServices; using osu.Framework.Testing; From 81a8385c8c36bc6e72c91939159db888287a861a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Mar 2018 15:17:09 +0900 Subject: [PATCH 095/109] Remove lingering reference to tests --- osu.Desktop/osu.Desktop.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 2262bbc515..2f74157c6e 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -36,7 +36,6 @@ - From 9aae568bbefee8bb807d6d7b8c123cfc4060c7a6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Mar 2018 15:19:56 +0900 Subject: [PATCH 096/109] Tidy up csproj further --- osu.Desktop.Deploy/osu.Desktop.Deploy.csproj | 4 ---- osu.Desktop/osu.Desktop.csproj | 14 +------------- .../osu.Game.Rulesets.Catch.csproj | 5 ----- .../osu.Game.Rulesets.Mania.csproj | 5 ----- osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 5 ----- .../osu.Game.Rulesets.Taiko.csproj | 5 ----- osu.Game.props | 7 +++++++ osu.Game/osu.Game.csproj | 6 ------ osu.TestProject.props | 3 --- 9 files changed, 8 insertions(+), 46 deletions(-) diff --git a/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj b/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj index eab54bd10b..a18db9477a 100644 --- a/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj +++ b/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj @@ -5,10 +5,6 @@ Exe AnyCPU true - ppy Pty Ltd - ppy Pty Ltd 2007-2017 - osu.Desktop.Deploy - osu.Desktop.Deploy diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 2f74157c6e..1f17ca9696 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -5,19 +5,11 @@ WinExe AnyCPU true - ppy Pty Ltd click the circles. to the beat. - ppy Pty Ltd 2007-2017 osu! osu!lazer osu!lazer lazer.ico - $(CONFIGURATIONS);VisualTests - 0.0.0.0 - 0.0.0.0 - - NU1701 $(DefineConstants);NET_FRAMEWORK @@ -25,22 +17,18 @@ osu.Desktop.Program - - --tests - + - - diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index 1337617578..883cac67d1 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -5,12 +5,7 @@ Library AnyCPU true - ppy Pty Ltd - 1.0.0.0 - ppy Pty Ltd 2007-2017 - osu.Game.Rulesets.Catch catch the fruit. to the beat. - osu.Game.Rulesets.Catch diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index b1d0baa03b..a086da0565 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -5,12 +5,7 @@ Library AnyCPU true - ppy Pty Ltd - 1.0.0.0 - ppy Pty Ltd 2007-2017 - osu.Game.Rulests.Mania smash the keys. to the beat. - osu.Game.Rulests.Mania diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 1d29be1557..b0ca314551 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -5,12 +5,7 @@ Library AnyCPU true - ppy Pty Ltd - 1.0.0.0 - ppy Pty Ltd 2007-2017 - osu.Game.Rulesets.Osu click the circles. to the beat. - osu.Game.Rulesets.Osu diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index 75e64012d0..002d6a7e8d 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -5,12 +5,7 @@ Library AnyCPU true - ppy Pty Ltd - 1.0.0.0 - ppy Pty Ltd 2007-2017 - osu.Game.Rulesets.Taiko bash the drum. to the beat. - osu.Game.Rulesets.Taiko diff --git a/osu.Game.props b/osu.Game.props index b8a340f1eb..87edafb97f 100644 --- a/osu.Game.props +++ b/osu.Game.props @@ -11,4 +11,11 @@ + + ppy Pty Ltd + ppy Pty Ltd 2007-2018 + + NU1701 + \ No newline at end of file diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index b42d76e331..367c3490d6 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -5,12 +5,6 @@ Library AnyCPU true - ppy Pty Ltd - 1.0.0.0 - ppy Pty Ltd 2007-2018 - osu.Game - click the circles. to the beat. - osu.Game 0 diff --git a/osu.TestProject.props b/osu.TestProject.props index c4b4a52a80..9ffb2094a4 100644 --- a/osu.TestProject.props +++ b/osu.TestProject.props @@ -10,9 +10,6 @@ WinExe AnyCPU true - - NU1701 netcoreapp2.0;net461 From 59df02da0003cf5c99604bb236e8cf35b0706820 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Mar 2018 15:59:41 +0900 Subject: [PATCH 097/109] Update test projects to actually load in visual studio --- .../osu.Game.Rulesets.Catch.Tests.csproj | 4 ++++ .../osu.Game.Rulesets.Mania.Tests.csproj | 4 ++++ .../osu.Game.Rulesets.Osu.Tests.csproj | 4 ++++ .../osu.Game.Rulesets.Taiko.Tests.csproj | 4 ++++ osu.Game.Tests/osu.Game.Tests.csproj | 4 ++++ osu.TestProject.props | 6 ------ osu.sln | 4 ++-- 7 files changed, 22 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj b/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj index 561613a2e8..51c6d18f1f 100644 --- a/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj +++ b/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj @@ -1,5 +1,9 @@  + + WinExe + netcoreapp2.0;net461 + diff --git a/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj b/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj index c7ee19e14f..187d5e47b9 100644 --- a/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj +++ b/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj @@ -1,5 +1,9 @@  + + WinExe + netcoreapp2.0;net461 + diff --git a/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj b/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj index c84eff2da1..b2b524a71c 100644 --- a/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj +++ b/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj @@ -1,5 +1,9 @@  + + WinExe + netcoreapp2.0;net461 + diff --git a/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj b/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj index 918dd90814..df73fa61cb 100644 --- a/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj +++ b/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj @@ -1,5 +1,9 @@  + + WinExe + netcoreapp2.0;net461 + diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 4a0b89817f..2646e953cf 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -1,5 +1,9 @@  + + WinExe + netcoreapp2.0;net461 + diff --git a/osu.TestProject.props b/osu.TestProject.props index 9ffb2094a4..cb841f1940 100644 --- a/osu.TestProject.props +++ b/osu.TestProject.props @@ -6,12 +6,6 @@ - - WinExe - AnyCPU - true - netcoreapp2.0;net461 - diff --git a/osu.sln b/osu.sln index a440f456f5..835a2f8169 100644 --- a/osu.sln +++ b/osu.sln @@ -93,8 +93,8 @@ Global {419659FD-72EA-4678-9EB8-B22A746CED70}.Debug|Any CPU.Build.0 = Debug|Any CPU {419659FD-72EA-4678-9EB8-B22A746CED70}.Release|Any CPU.ActiveCfg = Release|Any CPU {419659FD-72EA-4678-9EB8-B22A746CED70}.Release|Any CPU.Build.0 = Release|Any CPU - {419659FD-72EA-4678-9EB8-B22A746CED70}.VisualTests|Any CPU.ActiveCfg = VisualTests|Any CPU - {419659FD-72EA-4678-9EB8-B22A746CED70}.VisualTests|Any CPU.Build.0 = VisualTests|Any CPU + {419659FD-72EA-4678-9EB8-B22A746CED70}.VisualTests|Any CPU.ActiveCfg = Release|Any CPU + {419659FD-72EA-4678-9EB8-B22A746CED70}.VisualTests|Any CPU.Build.0 = Release|Any CPU {3AD63355-D6B1-4365-8D31-5652C989BEF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3AD63355-D6B1-4365-8D31-5652C989BEF1}.Debug|Any CPU.Build.0 = Debug|Any CPU {3AD63355-D6B1-4365-8D31-5652C989BEF1}.Release|Any CPU.ActiveCfg = Release|Any CPU From e47276c6b00b52437499bc3e46bafd74b650d261 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Mar 2018 16:17:04 +0900 Subject: [PATCH 098/109] Remove VisualTests solution configuration --- osu.sln | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/osu.sln b/osu.sln index 835a2f8169..f017bf9eab 100644 --- a/osu.sln +++ b/osu.sln @@ -23,102 +23,74 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Tests", "osu.Game. EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Desktop", "osu.Desktop\osu.Desktop.csproj", "{419659FD-72EA-4678-9EB8-B22A746CED70}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Catch.Tests", "osu.Game.Rulesets.Catch.Tests\osu.Game.Rulesets.Catch.Tests.csproj", "{3AD63355-D6B1-4365-8D31-5652C989BEF1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Catch.Tests", "osu.Game.Rulesets.Catch.Tests\osu.Game.Rulesets.Catch.Tests.csproj", "{3AD63355-D6B1-4365-8D31-5652C989BEF1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Mania.Tests", "osu.Game.Rulesets.Mania.Tests\osu.Game.Rulesets.Mania.Tests.csproj", "{7E9E9C34-B204-406B-82E2-E01E900699CD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Mania.Tests", "osu.Game.Rulesets.Mania.Tests\osu.Game.Rulesets.Mania.Tests.csproj", "{7E9E9C34-B204-406B-82E2-E01E900699CD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Taiko.Tests", "osu.Game.Rulesets.Taiko.Tests\osu.Game.Rulesets.Taiko.Tests.csproj", "{B698561F-FB28-46B1-857E-3CA7B92F9D70}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Taiko.Tests", "osu.Game.Rulesets.Taiko.Tests\osu.Game.Rulesets.Taiko.Tests.csproj", "{B698561F-FB28-46B1-857E-3CA7B92F9D70}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Osu.Tests", "osu.Game.Rulesets.Osu.Tests\osu.Game.Rulesets.Osu.Tests.csproj", "{6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Osu.Tests", "osu.Game.Rulesets.Osu.Tests\osu.Game.Rulesets.Osu.Tests.csproj", "{6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU - VisualTests|Any CPU = VisualTests|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Debug|Any CPU.Build.0 = Debug|Any CPU {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Release|Any CPU.ActiveCfg = Release|Any CPU {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Release|Any CPU.Build.0 = Release|Any CPU - {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU - {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Debug|Any CPU.Build.0 = Debug|Any CPU {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Release|Any CPU.ActiveCfg = Release|Any CPU {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Release|Any CPU.Build.0 = Release|Any CPU - {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU - {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}.Debug|Any CPU.Build.0 = Debug|Any CPU {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}.Release|Any CPU.ActiveCfg = Release|Any CPU {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}.Release|Any CPU.Build.0 = Release|Any CPU - {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU - {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {C92A607B-1FDD-4954-9F92-03FF547D9080}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C92A607B-1FDD-4954-9F92-03FF547D9080}.Debug|Any CPU.Build.0 = Debug|Any CPU {C92A607B-1FDD-4954-9F92-03FF547D9080}.Release|Any CPU.ActiveCfg = Release|Any CPU {C92A607B-1FDD-4954-9F92-03FF547D9080}.Release|Any CPU.Build.0 = Release|Any CPU - {C92A607B-1FDD-4954-9F92-03FF547D9080}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU - {C92A607B-1FDD-4954-9F92-03FF547D9080}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {58F6C80C-1253-4A0E-A465-B8C85EBEADF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {58F6C80C-1253-4A0E-A465-B8C85EBEADF3}.Debug|Any CPU.Build.0 = Debug|Any CPU {58F6C80C-1253-4A0E-A465-B8C85EBEADF3}.Release|Any CPU.ActiveCfg = Release|Any CPU {58F6C80C-1253-4A0E-A465-B8C85EBEADF3}.Release|Any CPU.Build.0 = Release|Any CPU - {58F6C80C-1253-4A0E-A465-B8C85EBEADF3}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU - {58F6C80C-1253-4A0E-A465-B8C85EBEADF3}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {F167E17A-7DE6-4AF5-B920-A5112296C695}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F167E17A-7DE6-4AF5-B920-A5112296C695}.Debug|Any CPU.Build.0 = Debug|Any CPU {F167E17A-7DE6-4AF5-B920-A5112296C695}.Release|Any CPU.ActiveCfg = Release|Any CPU {F167E17A-7DE6-4AF5-B920-A5112296C695}.Release|Any CPU.Build.0 = Release|Any CPU - {F167E17A-7DE6-4AF5-B920-A5112296C695}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU - {F167E17A-7DE6-4AF5-B920-A5112296C695}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.Debug|Any CPU.Build.0 = Debug|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.Release|Any CPU.ActiveCfg = Release|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.Release|Any CPU.Build.0 = Release|Any CPU - {48F4582B-7687-4621-9CBE-5C24197CB536}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU - {48F4582B-7687-4621-9CBE-5C24197CB536}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU {54377672-20B1-40AF-8087-5CF73BF3953A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {54377672-20B1-40AF-8087-5CF73BF3953A}.Debug|Any CPU.Build.0 = Debug|Any CPU {54377672-20B1-40AF-8087-5CF73BF3953A}.Release|Any CPU.ActiveCfg = Release|Any CPU {54377672-20B1-40AF-8087-5CF73BF3953A}.Release|Any CPU.Build.0 = Release|Any CPU - {54377672-20B1-40AF-8087-5CF73BF3953A}.VisualTests|Any CPU.ActiveCfg = Release|Any CPU - {54377672-20B1-40AF-8087-5CF73BF3953A}.VisualTests|Any CPU.Build.0 = Release|Any CPU {419659FD-72EA-4678-9EB8-B22A746CED70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {419659FD-72EA-4678-9EB8-B22A746CED70}.Debug|Any CPU.Build.0 = Debug|Any CPU {419659FD-72EA-4678-9EB8-B22A746CED70}.Release|Any CPU.ActiveCfg = Release|Any CPU {419659FD-72EA-4678-9EB8-B22A746CED70}.Release|Any CPU.Build.0 = Release|Any CPU - {419659FD-72EA-4678-9EB8-B22A746CED70}.VisualTests|Any CPU.ActiveCfg = Release|Any CPU - {419659FD-72EA-4678-9EB8-B22A746CED70}.VisualTests|Any CPU.Build.0 = Release|Any CPU {3AD63355-D6B1-4365-8D31-5652C989BEF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3AD63355-D6B1-4365-8D31-5652C989BEF1}.Debug|Any CPU.Build.0 = Debug|Any CPU {3AD63355-D6B1-4365-8D31-5652C989BEF1}.Release|Any CPU.ActiveCfg = Release|Any CPU {3AD63355-D6B1-4365-8D31-5652C989BEF1}.Release|Any CPU.Build.0 = Release|Any CPU - {3AD63355-D6B1-4365-8D31-5652C989BEF1}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU - {3AD63355-D6B1-4365-8D31-5652C989BEF1}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {7E9E9C34-B204-406B-82E2-E01E900699CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7E9E9C34-B204-406B-82E2-E01E900699CD}.Debug|Any CPU.Build.0 = Debug|Any CPU {7E9E9C34-B204-406B-82E2-E01E900699CD}.Release|Any CPU.ActiveCfg = Release|Any CPU {7E9E9C34-B204-406B-82E2-E01E900699CD}.Release|Any CPU.Build.0 = Release|Any CPU - {7E9E9C34-B204-406B-82E2-E01E900699CD}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU - {7E9E9C34-B204-406B-82E2-E01E900699CD}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {B698561F-FB28-46B1-857E-3CA7B92F9D70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B698561F-FB28-46B1-857E-3CA7B92F9D70}.Debug|Any CPU.Build.0 = Debug|Any CPU {B698561F-FB28-46B1-857E-3CA7B92F9D70}.Release|Any CPU.ActiveCfg = Release|Any CPU {B698561F-FB28-46B1-857E-3CA7B92F9D70}.Release|Any CPU.Build.0 = Release|Any CPU - {B698561F-FB28-46B1-857E-3CA7B92F9D70}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU - {B698561F-FB28-46B1-857E-3CA7B92F9D70}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.Debug|Any CPU.Build.0 = Debug|Any CPU {6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.Release|Any CPU.ActiveCfg = Release|Any CPU {6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.Release|Any CPU.Build.0 = Release|Any CPU - {6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU - {6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.VisualTests|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 01116a73a3e898ed3eb70e2b6e9c113e911bd965 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Mar 2018 18:09:18 +0900 Subject: [PATCH 099/109] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index c69330f652..2ac5cb0464 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit c69330f652d34350a7bf3786016a3ce5f968c25f +Subproject commit 2ac5cb0464133b570adb1f3408e564691f08d12e From d83e4dfd24a34843f8ba81f5987bc166904edc84 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 29 Mar 2018 12:26:32 +0900 Subject: [PATCH 100/109] Add .vscode configurations for ruleset test projects --- .vscode/settings.json | 3 - .../.vscode/launch.json | 59 +++++++++++++ .../.vscode/tasks.json | 87 +++++++++++++++++++ .../.vscode/launch.json | 59 +++++++++++++ .../.vscode/tasks.json | 87 +++++++++++++++++++ .../.vscode/launch.json | 59 +++++++++++++ .../.vscode/tasks.json | 87 +++++++++++++++++++ .../.vscode/launch.json | 59 +++++++++++++ .../.vscode/tasks.json | 87 +++++++++++++++++++ 9 files changed, 584 insertions(+), 3 deletions(-) delete mode 100644 .vscode/settings.json create mode 100644 osu.Game.Rulesets.Catch.Tests/.vscode/launch.json create mode 100644 osu.Game.Rulesets.Catch.Tests/.vscode/tasks.json create mode 100644 osu.Game.Rulesets.Mania.Tests/.vscode/launch.json create mode 100644 osu.Game.Rulesets.Mania.Tests/.vscode/tasks.json create mode 100644 osu.Game.Rulesets.Osu.Tests/.vscode/launch.json create mode 100644 osu.Game.Rulesets.Osu.Tests/.vscode/tasks.json create mode 100644 osu.Game.Rulesets.Taiko.Tests/.vscode/launch.json create mode 100644 osu.Game.Rulesets.Taiko.Tests/.vscode/tasks.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 20af2f68a6..0000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -// Place your settings in this file to overwrite default and user settings. -{ -} \ No newline at end of file diff --git a/osu.Game.Rulesets.Catch.Tests/.vscode/launch.json b/osu.Game.Rulesets.Catch.Tests/.vscode/launch.json new file mode 100644 index 0000000000..5098b78a42 --- /dev/null +++ b/osu.Game.Rulesets.Catch.Tests/.vscode/launch.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/osu.Game.Rulesets.Catch.Tests/.vscode/tasks.json b/osu.Game.Rulesets.Catch.Tests/.vscode/tasks.json new file mode 100644 index 0000000000..d21bb8a69a --- /dev/null +++ b/osu.Game.Rulesets.Catch.Tests/.vscode/tasks.json @@ -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": [] + } + ] +} \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania.Tests/.vscode/launch.json b/osu.Game.Rulesets.Mania.Tests/.vscode/launch.json new file mode 100644 index 0000000000..c71178059b --- /dev/null +++ b/osu.Game.Rulesets.Mania.Tests/.vscode/launch.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania.Tests/.vscode/tasks.json b/osu.Game.Rulesets.Mania.Tests/.vscode/tasks.json new file mode 100644 index 0000000000..781e89598f --- /dev/null +++ b/osu.Game.Rulesets.Mania.Tests/.vscode/tasks.json @@ -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": [] + } + ] +} \ No newline at end of file diff --git a/osu.Game.Rulesets.Osu.Tests/.vscode/launch.json b/osu.Game.Rulesets.Osu.Tests/.vscode/launch.json new file mode 100644 index 0000000000..24431eb8de --- /dev/null +++ b/osu.Game.Rulesets.Osu.Tests/.vscode/launch.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/osu.Game.Rulesets.Osu.Tests/.vscode/tasks.json b/osu.Game.Rulesets.Osu.Tests/.vscode/tasks.json new file mode 100644 index 0000000000..734e15353b --- /dev/null +++ b/osu.Game.Rulesets.Osu.Tests/.vscode/tasks.json @@ -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": [] + } + ] +} \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko.Tests/.vscode/launch.json b/osu.Game.Rulesets.Taiko.Tests/.vscode/launch.json new file mode 100644 index 0000000000..caa90c32ce --- /dev/null +++ b/osu.Game.Rulesets.Taiko.Tests/.vscode/launch.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko.Tests/.vscode/tasks.json b/osu.Game.Rulesets.Taiko.Tests/.vscode/tasks.json new file mode 100644 index 0000000000..13044e1ccb --- /dev/null +++ b/osu.Game.Rulesets.Taiko.Tests/.vscode/tasks.json @@ -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": [] + } + ] +} \ No newline at end of file From 687c889345a286d2e03701b8f4069e2f5045d75c Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 29 Mar 2018 12:47:17 +0900 Subject: [PATCH 101/109] Add back osu.Desktop versions (used in deploy) --- osu.Desktop/osu.Desktop.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 1f17ca9696..2ad7b67842 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -10,6 +10,8 @@ osu!lazer osu!lazer lazer.ico + 0.0.0.0 + 0.0.0.0 $(DefineConstants);NET_FRAMEWORK From cc35b1ab64bbd21356662c5a2659808a5c4489f3 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 29 Mar 2018 12:47:24 +0900 Subject: [PATCH 102/109] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 2ac5cb0464..f60cd46471 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 2ac5cb0464133b570adb1f3408e564691f08d12e +Subproject commit f60cd4647165d1dadb91aa045f41cef42c11bad9 From 187a025d36a70aa649b84b6573770d5412f12dfd Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 29 Mar 2018 16:07:20 +0900 Subject: [PATCH 103/109] Make hitobjects sorted by their start times --- osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs | 1 - osu.Game.Rulesets.Mania/UI/Column.cs | 1 - osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs | 2 -- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs | 2 -- osu.Game/Rulesets/UI/HitObjectContainer.cs | 11 +++++++++++ 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index 39b7ffb387..8bb206543b 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -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); diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index 21f00c003b..109ffd0d25 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -205,7 +205,6 @@ namespace osu.Game.Rulesets.Mania.UI /// The DrawableHitObject to add. public override void Add(DrawableHitObject hitObject) { - hitObject.Depth = (float)hitObject.HitObject.StartTime; hitObject.AccentColour = AccentColour; hitObject.OnJudgement += OnJudgement; diff --git a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs index 98a8096678..0c5d757474 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs @@ -55,8 +55,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; diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index 75aaceaecb..effb9eb54f 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -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); diff --git a/osu.Game/Rulesets/UI/HitObjectContainer.cs b/osu.Game/Rulesets/UI/HitObjectContainer.cs index c26a6cdff0..ecb10dfba2 100644 --- a/osu.Game/Rulesets/UI/HitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/HitObjectContainer.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; +using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Objects.Drawables; @@ -15,5 +16,15 @@ namespace osu.Game.Rulesets.UI public virtual void Add(DrawableHitObject hitObject) => AddInternal(hitObject); public virtual bool Remove(DrawableHitObject hitObject) => RemoveInternal(hitObject); + + protected override int Compare(Drawable x, Drawable y) + { + if (!(x is DrawableHitObject xObj) || !(y is DrawableHitObject yObj)) + return base.Compare(x, y); + + // Put earlier hitobjects towards the end of the list, so they handle input first + int i = yObj.HitObject.StartTime.CompareTo(xObj.HitObject.StartTime); + return i == 0 ? CompareReverseChildID(x, y) : i; + } } } From bb7618eb0c0b4dc38c87786a7e88381718147620 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 29 Mar 2018 16:13:05 +0900 Subject: [PATCH 104/109] FIx mania playfield playing the wrong/duplicated sounds Fixes #2266. --- osu.Game.Rulesets.Mania/UI/Column.cs | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index 109ffd0d25..15c9a83b78 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -262,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; From 5c4b0c2b8d22c2a567d0afbfe6558ec038496c37 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 29 Mar 2018 16:55:07 +0900 Subject: [PATCH 105/109] Add rider run/debug configurations --- .../VisualTests__net461_.xml | 24 +++++++++++++++++++ .../VisualTests__netcoreapp2_0_.xml | 24 +++++++++++++++++++ .../.idea/runConfigurations/osu___net461_.xml | 24 +++++++++++++++++++ .../osu___netcoreapp2_0_.xml | 24 +++++++++++++++++++ 4 files changed, 96 insertions(+) create mode 100644 .idea/.idea.osu/.idea/runConfigurations/VisualTests__net461_.xml create mode 100644 .idea/.idea.osu/.idea/runConfigurations/VisualTests__netcoreapp2_0_.xml create mode 100644 .idea/.idea.osu/.idea/runConfigurations/osu___net461_.xml create mode 100644 .idea/.idea.osu/.idea/runConfigurations/osu___netcoreapp2_0_.xml diff --git a/.idea/.idea.osu/.idea/runConfigurations/VisualTests__net461_.xml b/.idea/.idea.osu/.idea/runConfigurations/VisualTests__net461_.xml new file mode 100644 index 0000000000..5122f08aaa --- /dev/null +++ b/.idea/.idea.osu/.idea/runConfigurations/VisualTests__net461_.xml @@ -0,0 +1,24 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.osu/.idea/runConfigurations/VisualTests__netcoreapp2_0_.xml b/.idea/.idea.osu/.idea/runConfigurations/VisualTests__netcoreapp2_0_.xml new file mode 100644 index 0000000000..a5c78f0a7a --- /dev/null +++ b/.idea/.idea.osu/.idea/runConfigurations/VisualTests__netcoreapp2_0_.xml @@ -0,0 +1,24 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.osu/.idea/runConfigurations/osu___net461_.xml b/.idea/.idea.osu/.idea/runConfigurations/osu___net461_.xml new file mode 100644 index 0000000000..bacfd6c576 --- /dev/null +++ b/.idea/.idea.osu/.idea/runConfigurations/osu___net461_.xml @@ -0,0 +1,24 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.osu/.idea/runConfigurations/osu___netcoreapp2_0_.xml b/.idea/.idea.osu/.idea/runConfigurations/osu___netcoreapp2_0_.xml new file mode 100644 index 0000000000..b02c7977b6 --- /dev/null +++ b/.idea/.idea.osu/.idea/runConfigurations/osu___netcoreapp2_0_.xml @@ -0,0 +1,24 @@ + + + + \ No newline at end of file From 49c8bc44ad2934fa6e522a09f581994336d963af Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 29 Mar 2018 17:08:06 +0900 Subject: [PATCH 106/109] Remove silly stuff --- .../.idea/runConfigurations/VisualTests__net461_.xml | 5 ----- .../.idea/runConfigurations/VisualTests__netcoreapp2_0_.xml | 5 ----- .idea/.idea.osu/.idea/runConfigurations/osu___net461_.xml | 5 ----- .../.idea/runConfigurations/osu___netcoreapp2_0_.xml | 5 ----- 4 files changed, 20 deletions(-) diff --git a/.idea/.idea.osu/.idea/runConfigurations/VisualTests__net461_.xml b/.idea/.idea.osu/.idea/runConfigurations/VisualTests__net461_.xml index 5122f08aaa..0615aa755f 100644 --- a/.idea/.idea.osu/.idea/runConfigurations/VisualTests__net461_.xml +++ b/.idea/.idea.osu/.idea/runConfigurations/VisualTests__net461_.xml @@ -4,10 +4,6 @@