diff --git a/.editorconfig b/.editorconfig index 759217430d..0dd7ef8ed1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,3 +7,21 @@ insert_final_newline = true indent_style = space indent_size = 4 trim_trailing_whitespace = true + +#Roslyn naming styles + +#PascalCase for public and protected members +dotnet_naming_style.pascalcase.capitalization = pascal_case +dotnet_naming_symbols.public_members.applicable_accessibilities = public,internal,protected,protected_internal +dotnet_naming_symbols.public_members.applicable_kinds = property,method,field,event,delegate +dotnet_naming_rule.public_members_pascalcase.severity = suggestion +dotnet_naming_rule.public_members_pascalcase.symbols = public_members +dotnet_naming_rule.public_members_pascalcase.style = pascalcase + +#camelCase for private members +dotnet_naming_style.camelcase.capitalization = camel_case +dotnet_naming_symbols.private_members.applicable_accessibilities = private +dotnet_naming_symbols.private_members.applicable_kinds = property,method,field,event,delegate +dotnet_naming_rule.private_members_camelcase.severity = suggestion +dotnet_naming_rule.private_members_camelcase.symbols = private_members +dotnet_naming_rule.private_members_camelcase.style = camelcase \ No newline at end of file diff --git a/osu-framework b/osu-framework index 7cad7cf48b..4c0762eec2 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 7cad7cf48b2ae9f16cac503d46bd0ea801e7561f +Subproject commit 4c0762eec20d2a3063df908a49432326570bea9f diff --git a/osu.Desktop.Deploy/App.config b/osu.Desktop.Deploy/App.config index 6272e396fb..33ae53313b 100644 --- a/osu.Desktop.Deploy/App.config +++ b/osu.Desktop.Deploy/App.config @@ -23,6 +23,10 @@ + + + + \ No newline at end of file diff --git a/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj b/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj index 122c2ec0d6..898a991292 100644 --- a/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj +++ b/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj @@ -36,52 +36,52 @@ osu.Desktop.Deploy.Program - - ..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.dll + + $(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.dll True - - ..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.MsDelta.dll + + $(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.MsDelta.dll True - - ..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.PatchApi.dll + + $(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.PatchApi.dll True - ..\packages\squirrel.windows.1.5.2\lib\Net45\ICSharpCode.SharpZipLib.dll + $(SolutionDir)\packages\squirrel.windows.1.5.2\lib\Net45\ICSharpCode.SharpZipLib.dll True - ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.dll + $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.dll True - ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Mdb.dll + $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Mdb.dll True - ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Pdb.dll + $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Pdb.dll True - ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Rocks.dll + $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Rocks.dll True - ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + $(SolutionDir)\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll True - ..\packages\squirrel.windows.1.5.2\lib\Net45\NuGet.Squirrel.dll + $(SolutionDir)\packages\squirrel.windows.1.5.2\lib\Net45\NuGet.Squirrel.dll True - - ..\packages\Splat.1.6.2\lib\Net45\Splat.dll + + $(SolutionDir)\packages\Splat.2.0.0\lib\Net45\Splat.dll True - ..\packages\squirrel.windows.1.5.2\lib\Net45\Squirrel.dll + $(SolutionDir)\packages\squirrel.windows.1.5.2\lib\Net45\Squirrel.dll True diff --git a/osu.Desktop.Deploy/packages.config b/osu.Desktop.Deploy/packages.config index b7c4b9c3bb..4bbb763e27 100644 --- a/osu.Desktop.Deploy/packages.config +++ b/osu.Desktop.Deploy/packages.config @@ -1,9 +1,9 @@  - - + + - + \ No newline at end of file diff --git a/osu.Desktop.Tests/osu.Desktop.Tests.csproj b/osu.Desktop.Tests/osu.Desktop.Tests.csproj index 7a5bd59074..07495311e0 100644 --- a/osu.Desktop.Tests/osu.Desktop.Tests.csproj +++ b/osu.Desktop.Tests/osu.Desktop.Tests.csproj @@ -34,7 +34,7 @@ - ..\packages\NUnit.3.5.0\lib\net45\nunit.framework.dll + $(SolutionDir)\packages\NUnit.3.5.0\lib\net45\nunit.framework.dll True @@ -54,9 +54,6 @@ $(SolutionDir)\packages\SQLite.Net-PCL.3.1.1\lib\net40\SQLite.Net.Platform.Generic.dll - - $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1339\lib\net45\OpenTK.dll - diff --git a/osu.Desktop.VisualTests/Benchmark.cs b/osu.Desktop.VisualTests/Benchmark.cs index 8c8cffaf3f..3847b6f00f 100644 --- a/osu.Desktop.VisualTests/Benchmark.cs +++ b/osu.Desktop.VisualTests/Benchmark.cs @@ -13,7 +13,7 @@ namespace osu.Desktop.VisualTests private double timePerTest = 200; [BackgroundDependencyLoader] - private void load(Framework.Game game) + private void load() { Host.MaximumDrawHz = int.MaxValue; Host.MaximumUpdateHz = int.MaxValue; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs index 9259f2ea78..dd957ee5a0 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using osu.Framework.Screens.Testing; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; using osu.Framework.MathUtils; using osu.Framework.Timing; using osu.Game.Beatmaps; @@ -27,9 +28,6 @@ namespace osu.Desktop.VisualTests.Tests { base.Reset(); - //ensure we are at offset 0 - Clock = new FramedClock(); - List objects = new List(); int time = 500; @@ -52,33 +50,42 @@ namespace osu.Desktop.VisualTests.Tests Add(new Drawable[] { - new OsuHitRenderer + new Container { - Beatmap = beatmap, - Scale = new Vector2(0.5f), - Anchor = Anchor.TopLeft, - Origin = Anchor.TopLeft - }, - new TaikoHitRenderer - { - Beatmap = beatmap, - Scale = new Vector2(0.5f), - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight - }, - new CatchHitRenderer - { - Beatmap = beatmap, - Scale = new Vector2(0.5f), - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft - }, - new ManiaHitRenderer - { - Beatmap = beatmap, - Scale = new Vector2(0.5f), - Anchor = Anchor.BottomRight, - Origin = Anchor.BottomRight + RelativeSizeAxes = Axes.Both, + //ensure we are at offset 0 + Clock = new FramedClock(), + Children = new Drawable[] + { + new OsuHitRenderer + { + Beatmap = beatmap, + Scale = new Vector2(0.5f), + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft + }, + new TaikoHitRenderer + { + Beatmap = beatmap, + Scale = new Vector2(0.5f), + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight + }, + new CatchHitRenderer + { + Beatmap = beatmap, + Scale = new Vector2(0.5f), + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft + }, + new ManiaHitRenderer + { + Beatmap = beatmap, + Scale = new Vector2(0.5f), + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomRight + } + } } }); } diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index 822ba4e0cb..84e0110a3e 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -82,6 +82,10 @@ + + $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll + True + False $(SolutionDir)\packages\SQLite.Net.Core-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll @@ -99,9 +103,8 @@ $(SolutionDir)\packages\SQLite.Net-PCL.3.1.1\lib\net40\SQLite.Net.Platform.Generic.dll - - $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1339\lib\net45\OpenTK.dll - + + diff --git a/osu.Desktop.VisualTests/packages.config b/osu.Desktop.VisualTests/packages.config index 82404c059e..3da209ee61 100644 --- a/osu.Desktop.VisualTests/packages.config +++ b/osu.Desktop.VisualTests/packages.config @@ -5,7 +5,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste --> - + diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index bdc8bc7e1a..af4a0de73c 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -37,7 +37,7 @@ namespace osu.Desktop.Overlays [BackgroundDependencyLoader] private void load(NotificationManager notification, OsuColour colours, TextureStore textures) { - this.notificationManager = notification; + notificationManager = notification; AutoSizeAxes = Axes.Both; Anchor = Anchor.BottomCentre; diff --git a/osu.Desktop/app.config b/osu.Desktop/app.config index b9af3fdc80..b3c333c783 100644 --- a/osu.Desktop/app.config +++ b/osu.Desktop/app.config @@ -10,6 +10,10 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste + + + + \ No newline at end of file diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index d85671f5be..527a027ca2 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -89,61 +89,61 @@ Properties\app.manifest - - ..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.dll + + $(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.dll True - - ..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.MsDelta.dll + + $(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.MsDelta.dll True - - ..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.PatchApi.dll + + $(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.PatchApi.dll True - ..\packages\squirrel.windows.1.5.2\lib\Net45\ICSharpCode.SharpZipLib.dll + $(SolutionDir)\packages\squirrel.windows.1.5.2\lib\Net45\ICSharpCode.SharpZipLib.dll True - ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.dll + $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.dll True - ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Mdb.dll + $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Mdb.dll True - ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Pdb.dll + $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Pdb.dll True - ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Rocks.dll + $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Rocks.dll True - ..\packages\squirrel.windows.1.5.2\lib\Net45\NuGet.Squirrel.dll + $(SolutionDir)\packages\squirrel.windows.1.5.2\lib\Net45\NuGet.Squirrel.dll True - - ..\packages\Splat.1.6.2\lib\Net45\Splat.dll + + $(SolutionDir)\packages\Splat.2.0.0\lib\Net45\Splat.dll True - ..\packages\squirrel.windows.1.5.2\lib\Net45\Squirrel.dll + $(SolutionDir)\packages\squirrel.windows.1.5.2\lib\Net45\Squirrel.dll True - ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll + $(SolutionDir)\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll True - ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll + $(SolutionDir)\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll True diff --git a/osu.Desktop/packages.config b/osu.Desktop/packages.config index e203f3042a..bdeaf1de89 100644 --- a/osu.Desktop/packages.config +++ b/osu.Desktop/packages.config @@ -4,9 +4,9 @@ Copyright (c) 2007-2017 ppy Pty Ltd . Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE --> - + - - + + \ No newline at end of file diff --git a/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj b/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj index 5e3f0f1d96..6b37963da1 100644 --- a/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj +++ b/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj @@ -33,7 +33,7 @@ - ..\packages\ppy.OpenTK.2.0.50727.1339\lib\net45\OpenTK.dll + $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll True diff --git a/osu.Game.Modes.Catch/packages.config b/osu.Game.Modes.Catch/packages.config index d53e65896a..4031dd62a8 100644 --- a/osu.Game.Modes.Catch/packages.config +++ b/osu.Game.Modes.Catch/packages.config @@ -4,5 +4,5 @@ Copyright (c) 2007-2017 ppy Pty Ltd . Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE --> - + \ No newline at end of file diff --git a/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj b/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj index ecd3fe6423..b9b7e35ae7 100644 --- a/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj +++ b/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj @@ -33,7 +33,7 @@ - ..\packages\ppy.OpenTK.2.0.50727.1339\lib\net45\OpenTK.dll + $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll True diff --git a/osu.Game.Modes.Mania/packages.config b/osu.Game.Modes.Mania/packages.config index d53e65896a..4031dd62a8 100644 --- a/osu.Game.Modes.Mania/packages.config +++ b/osu.Game.Modes.Mania/packages.config @@ -4,5 +4,5 @@ Copyright (c) 2007-2017 ppy Pty Ltd . Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE --> - + \ No newline at end of file diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/TrianglesPiece.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/TrianglesPiece.cs index 33ed93e625..26d44f3865 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/TrianglesPiece.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/TrianglesPiece.cs @@ -14,6 +14,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces public TrianglesPiece() { TriangleScale = 1.2f; + HideAlphaDiscrepancies = false; } protected override void Update() diff --git a/osu.Game.Modes.Osu/app.config b/osu.Game.Modes.Osu/app.config index d9da887349..f77f36199c 100644 --- a/osu.Game.Modes.Osu/app.config +++ b/osu.Game.Modes.Osu/app.config @@ -1,4 +1,4 @@ - + - + \ No newline at end of file diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index 6d09463d93..a964d48288 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -33,7 +33,7 @@ - ..\packages\ppy.OpenTK.2.0.50727.1339\lib\net45\OpenTK.dll + $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll True diff --git a/osu.Game.Modes.Taiko/packages.config b/osu.Game.Modes.Taiko/packages.config index d53e65896a..4031dd62a8 100644 --- a/osu.Game.Modes.Taiko/packages.config +++ b/osu.Game.Modes.Taiko/packages.config @@ -4,5 +4,5 @@ Copyright (c) 2007-2017 ppy Pty Ltd . Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE --> - + \ 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 f555615f09..009cafe59e 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -33,17 +33,15 @@ $(SolutionDir)\packages\NUnit.3.5.0\lib\net45\nunit.framework.dll True + + $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll + True + $(SolutionDir)\packages\NUnit.3.5.0\lib\nunit.framework.dll - - $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1339\lib\net45\OpenTK.dll - True - - - $(SolutionDir)\packages\SQLite.Net.Core-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll diff --git a/osu.Game.Tests/packages.config b/osu.Game.Tests/packages.config index b9f1a2c8cd..c3be99dfd1 100644 --- a/osu.Game.Tests/packages.config +++ b/osu.Game.Tests/packages.config @@ -1,11 +1,11 @@ - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/osu.Game/Beatmaps/Beatmap.cs b/osu.Game/Beatmaps/Beatmap.cs index d92e340e72..f195f8f2ba 100644 --- a/osu.Game/Beatmaps/Beatmap.cs +++ b/osu.Game/Beatmaps/Beatmap.cs @@ -18,8 +18,8 @@ namespace osu.Game.Beatmaps public List HitObjects { get; set; } public List ControlPoints { get; set; } public List ComboColors { get; set; } - public double BPMMaximum => 60000 / ControlPoints.Where(c => c.BeatLength != 0).OrderBy(c => c.BeatLength).First().BeatLength; - public double BPMMinimum => 60000 / ControlPoints.Where(c => c.BeatLength != 0).OrderByDescending(c => c.BeatLength).First().BeatLength; + public double BPMMaximum => 60000 / (ControlPoints?.Where(c => c.BeatLength != 0).OrderBy(c => c.BeatLength).FirstOrDefault() ?? ControlPoint.Default).BeatLength; + public double BPMMinimum => 60000 / (ControlPoints?.Where(c => c.BeatLength != 0).OrderByDescending(c => c.BeatLength).FirstOrDefault() ?? ControlPoint.Default).BeatLength; public double BPMMode => BPMAt(ControlPoints.Where(c => c.BeatLength != 0).GroupBy(c => c.BeatLength).OrderByDescending(grp => grp.Count()).First().First().Time); public double BPMAt(double time) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs b/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs index 39f45273a9..5af2e7c197 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs @@ -16,7 +16,7 @@ namespace osu.Game.Beatmaps.Drawables } [BackgroundDependencyLoader] - private void load(OsuGameBase game) + private void load() { if (working.Background != null) Texture = working.Background; diff --git a/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs b/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs index 36c042ac30..bcdb1c0b5d 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs @@ -64,7 +64,7 @@ namespace osu.Game.Beatmaps.Drawables BeatmapSet = beatmapSet; WorkingBeatmap beatmap = database.GetWorkingBeatmap(BeatmapSet.Beatmaps.FirstOrDefault()); foreach (var b in BeatmapSet.Beatmaps) - b.StarDifficulty = (float)database.GetWorkingBeatmap(b).Beatmap.CalculateStarDifficulty(); + b.StarDifficulty = (float)(database.GetWorkingBeatmap(b).Beatmap?.CalculateStarDifficulty() ?? 0); Header = new BeatmapSetHeader(beatmap) { diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index ccf53ed714..84116a1f70 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -27,6 +27,7 @@ namespace osu.Game.Configuration Set(OsuConfig.DimLevel, 30, 0, 100); Set(OsuConfig.MouseDisableButtons, false); + Set(OsuConfig.MouseDisableWheel, false); Set(OsuConfig.SnakingInSliders, true); Set(OsuConfig.SnakingOutSliders, false); @@ -99,7 +100,6 @@ namespace osu.Game.Configuration Set(OsuConfig.UsePerBeatmapManiaSpeed, true).Disabled = true; Set(OsuConfig.ManiaSpeedBPMScale, true).Disabled = true; Set(OsuConfig.MenuTip, 0).Disabled = true; - Set(OsuConfig.MouseDisableWheel, false).Disabled = true; Set(OsuConfig.MouseSpeed, 1, 0.4, 6).Disabled = true; Set(OsuConfig.Offset, 0, -300, 300).Disabled = true; Set(OsuConfig.ScoreMeterScale, 1, 0.5, 2).Disabled = true; diff --git a/osu.Game/Database/BeatmapDatabase.cs b/osu.Game/Database/BeatmapDatabase.cs index ff58031c57..fc2c7558b0 100644 --- a/osu.Game/Database/BeatmapDatabase.cs +++ b/osu.Game/Database/BeatmapDatabase.cs @@ -57,6 +57,18 @@ namespace osu.Game.Database try { storage.Delete(b.Path); + + GetChildren(b, true); + + foreach (var i in b.Beatmaps) + { + if (i.Metadata != null) connection.Delete(i.Metadata); + if (i.BaseDifficulty != null) connection.Delete(i.BaseDifficulty); + + connection.Delete(i); + } + + if (b.Metadata != null) connection.Delete(b.Metadata); connection.Delete(b); } catch (Exception e) diff --git a/osu.Game/Graphics/Backgrounds/Triangles.cs b/osu.Game/Graphics/Backgrounds/Triangles.cs index 219af9bd38..f3b75ce91a 100644 --- a/osu.Game/Graphics/Backgrounds/Triangles.cs +++ b/osu.Game/Graphics/Backgrounds/Triangles.cs @@ -10,6 +10,7 @@ using osu.Framework.MathUtils; using OpenTK; using OpenTK.Graphics; using System; +using osu.Framework.Graphics.Colour; namespace osu.Game.Graphics.Backgrounds { @@ -37,6 +38,13 @@ namespace osu.Game.Graphics.Backgrounds private float triangleScale = 1; + /// + /// Whether we should drop-off alpha values of triangles more quickly to improve + /// the visual appearance of fading. This defaults to on as it is generally more + /// aesthetically pleasing, but should be turned off in s. + /// + public bool HideAlphaDiscrepancies = true; + public float TriangleScale { get { return triangleScale; } @@ -63,8 +71,14 @@ namespace osu.Game.Graphics.Backgrounds { base.Update(); + float adjustedAlpha = HideAlphaDiscrepancies ? + // Cubically scale alpha to make it drop off more sharply. + (float)Math.Pow(DrawInfo.Colour.AverageColour.Linear.A, 3) : + 1; + foreach (var t in Children) { + t.Alpha = adjustedAlpha; t.Position -= new Vector2(0, (float)(t.Scale.X * (50 / DrawHeight) * (Time.Elapsed / 950)) / triangleScale); if (ExpireOffScreenTriangles && t.DrawPosition.Y + t.DrawSize.Y * t.Scale.Y < 0) t.Expire(); diff --git a/osu.Game/Graphics/Cursor/OsuCursorContainer.cs b/osu.Game/Graphics/Cursor/OsuCursorContainer.cs index 8011359db9..ab681845af 100644 --- a/osu.Game/Graphics/Cursor/OsuCursorContainer.cs +++ b/osu.Game/Graphics/Cursor/OsuCursorContainer.cs @@ -43,7 +43,7 @@ namespace osu.Game.Graphics.Cursor class OsuCursor : Container { private Container cursorContainer; - private BindableDouble cursorScale; + private Bindable cursorScale; public OsuCursor() { @@ -52,9 +52,9 @@ namespace osu.Game.Graphics.Cursor } [BackgroundDependencyLoader] - private void load(TextureStore textures, OsuConfigManager config) + private void load(OsuConfigManager config) { - cursorScale = (BindableDouble)config.GetBindable(OsuConfig.CursorSize); + cursorScale = config.GetBindable(OsuConfig.CursorSize); Children = new Drawable[] { diff --git a/osu.Game/Graphics/UserInterface/StarCounter.cs b/osu.Game/Graphics/UserInterface/StarCounter.cs index d2ca2e72f7..b9d1dca65d 100644 --- a/osu.Game/Graphics/UserInterface/StarCounter.cs +++ b/osu.Game/Graphics/UserInterface/StarCounter.cs @@ -14,8 +14,6 @@ namespace osu.Game.Graphics.UserInterface { private readonly Container stars; - private double transformStartTime; - /// /// Maximum amount of stars displayed. /// diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index 4ae3ae6e50..07a8017294 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -82,9 +82,9 @@ namespace osu.Game.Graphics.UserInterface.Volume [BackgroundDependencyLoader] private void load(AudioManager audio) { - volumeMeterMaster.Bindable.Weld(audio.Volume); - volumeMeterEffect.Bindable.Weld(audio.VolumeSample); - volumeMeterMusic.Bindable.Weld(audio.VolumeTrack); + volumeMeterMaster.Bindable.BindTo(audio.Volume); + volumeMeterEffect.Bindable.BindTo(audio.VolumeSample); + volumeMeterMusic.Bindable.BindTo(audio.VolumeTrack); } ScheduledDelegate popOutDelegate; diff --git a/osu.Game/Modes/UI/ScoreOverlay.cs b/osu.Game/Modes/UI/ScoreOverlay.cs index 7be6af5c6a..e43009adda 100644 --- a/osu.Game/Modes/UI/ScoreOverlay.cs +++ b/osu.Game/Modes/UI/ScoreOverlay.cs @@ -64,7 +64,7 @@ namespace osu.Game.Modes.UI processor.TotalScore.ValueChanged += delegate { ScoreCounter?.Set((ulong)processor.TotalScore.Value); }; processor.Accuracy.ValueChanged += delegate { AccuracyCounter?.Set((float)processor.Accuracy.Value); }; processor.Combo.ValueChanged += delegate { ComboCounter?.Set((ulong)processor.Combo.Value); }; - HealthDisplay?.Current.Weld(processor.Health); + HealthDisplay?.Current.BindTo(processor.Health); } } } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index b8a8fe0618..bfb506fd4f 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -214,7 +214,7 @@ namespace osu.Game } } - return base.OnKeyDown(state, args); + return false; } public event Action ModeChanged; diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index c3138cb571..ab5a255897 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -29,8 +29,6 @@ namespace osu.Game.Overlays { const float textbox_height = 40; - private DrawableChannel channelDisplay; - private ScheduledDelegate messageRequest; private Container content; @@ -126,7 +124,7 @@ namespace osu.Game.Overlays private void addChannel(Channel channel) { - Add(channelDisplay = new DrawableChannel(channel)); + Add(new DrawableChannel(channel)); careChannels.Add(channel); } diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 661cbe06a4..430654b8f5 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -75,8 +75,7 @@ namespace osu.Game.Overlays } [BackgroundDependencyLoader] - private void load(OsuGameBase osuGame, OsuConfigManager config, BeatmapDatabase beatmaps, AudioManager audio, - TextureStore textures, OsuColour colours) + private void load(OsuGameBase osuGame, OsuConfigManager config, BeatmapDatabase beatmaps, OsuColour colours) { game = osuGame; diff --git a/osu.Game/Overlays/NotificationManager.cs b/osu.Game/Overlays/NotificationManager.cs index 7172559a94..77198a7fbe 100644 --- a/osu.Game/Overlays/NotificationManager.cs +++ b/osu.Game/Overlays/NotificationManager.cs @@ -25,7 +25,7 @@ namespace osu.Game.Overlays private FlowContainer sections; [BackgroundDependencyLoader(permitNulls: true)] - private void load(OsuColour colours) + private void load() { Width = width; RelativeSizeAxes = Axes.Y; diff --git a/osu.Game/Overlays/Notifications/Notification.cs b/osu.Game/Overlays/Notifications/Notification.cs index e3a1e55868..179e9bf066 100644 --- a/osu.Game/Overlays/Notifications/Notification.cs +++ b/osu.Game/Overlays/Notifications/Notification.cs @@ -256,7 +256,7 @@ namespace osu.Game.Overlays.Notifications } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load() { Size = new Vector2(6, 15); diff --git a/osu.Game/Overlays/Options/OptionDropDown.cs b/osu.Game/Overlays/Options/OptionDropDown.cs index 2f88ab34ae..72a5160ba0 100644 --- a/osu.Game/Overlays/Options/OptionDropDown.cs +++ b/osu.Game/Overlays/Options/OptionDropDown.cs @@ -101,7 +101,7 @@ namespace osu.Game.Overlays.Options { Margin = new MarginPadding { Top = 5 }, RelativeSizeAxes = Axes.X, - Items = this.Items, + Items = Items, } }; dropdown.ValueChanged += dropdown_ValueChanged; diff --git a/osu.Game/Overlays/Options/OptionTextBox.cs b/osu.Game/Overlays/Options/OptionTextBox.cs index 813d372db6..47c81e6a7e 100644 --- a/osu.Game/Overlays/Options/OptionTextBox.cs +++ b/osu.Game/Overlays/Options/OptionTextBox.cs @@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Options bindable = value; if (bindable != null) { - base.Text = bindable.Value; + Text = bindable.Value; bindable.ValueChanged += bindableValueChanged; } diff --git a/osu.Game/Overlays/Options/Sections/GameplaySection.cs b/osu.Game/Overlays/Options/Sections/GameplaySection.cs index 87de1fd249..85a180ccbc 100644 --- a/osu.Game/Overlays/Options/Sections/GameplaySection.cs +++ b/osu.Game/Overlays/Options/Sections/GameplaySection.cs @@ -14,7 +14,7 @@ namespace osu.Game.Overlays.Options.Sections public GameplaySection() { - base.Children = new Drawable[] + Children = new Drawable[] { new GeneralOptions(), new SongSelectOptions(), diff --git a/osu.Game/Overlays/Pause/QuitButton.cs b/osu.Game/Overlays/Pause/QuitButton.cs index f1a9fd5e1d..dc99669111 100644 --- a/osu.Game/Overlays/Pause/QuitButton.cs +++ b/osu.Game/Overlays/Pause/QuitButton.cs @@ -11,7 +11,7 @@ namespace osu.Game.Overlays.Pause public class QuitButton : PauseButton { [BackgroundDependencyLoader] - private void load(AudioManager audio, OsuColour colours) + private void load(AudioManager audio) { ButtonColour = new Color4(170, 27, 39, 255); // The red from the design isn't in the palette so it's used directly SampleHover = audio.Sample.Get(@"Menu/menuclick"); diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs index 005efb77a2..f411f74361 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs @@ -9,7 +9,7 @@ namespace osu.Game.Screens.Backgrounds public class BackgroundScreenDefault : BackgroundScreen { [BackgroundDependencyLoader] - private void load(Framework.Game game) + private void load() { Add(new Background(@"Backgrounds/bg1")); } diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index dad7490c69..c4d1abd931 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -117,7 +117,7 @@ namespace osu.Game.Screens.Menu } [BackgroundDependencyLoader(true)] - private void load(AudioManager audio, OsuGame game = null) + private void load(OsuGame game = null) { toolbar = game?.Toolbar; } diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 978c21c7dd..cf804de0f4 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -69,23 +69,20 @@ namespace osu.Game.Screens.Menu { base.OnEntering(last); - Scheduler.Add(delegate + welcome.Play(); + + Scheduler.AddDelayed(delegate { - welcome.Play(); + bgm.Start(); + + (mainMenu = new MainMenu()).LoadAsync(Game); Scheduler.AddDelayed(delegate { - bgm.Start(); - - (mainMenu = new MainMenu()).LoadAsync(Game); - - Scheduler.AddDelayed(delegate - { - DidLoadMenu = true; - Push(mainMenu); - }, 2300); - }, 600); - }); + DidLoadMenu = true; + Push(mainMenu); + }, 2300); + }, 600); logo.ScaleTo(0.4f); logo.FadeOut(); diff --git a/osu.Game/Screens/OsuGameScreen.cs b/osu.Game/Screens/OsuGameScreen.cs index 7aa3d5a5d0..871d3a6780 100644 --- a/osu.Game/Screens/OsuGameScreen.cs +++ b/osu.Game/Screens/OsuGameScreen.cs @@ -24,43 +24,20 @@ namespace osu.Game.Screens protected new OsuGameBase Game => base.Game as OsuGameBase; - private bool boundToBeatmap; - private Bindable beatmap; + private readonly Bindable beatmap = new Bindable(); public WorkingBeatmap Beatmap { get { - bindBeatmap(); return beatmap.Value; } set { - bindBeatmap(); beatmap.Value = value; } } - private void bindBeatmap() - { - if (beatmap == null) - beatmap = new Bindable(); - - if (!boundToBeatmap) - { - beatmap.ValueChanged += beatmap_ValueChanged; - boundToBeatmap = true; - } - } - - protected override void Dispose(bool isDisposing) - { - if (boundToBeatmap) - beatmap.ValueChanged -= beatmap_ValueChanged; - - base.Dispose(isDisposing); - } - private void beatmap_ValueChanged(object sender, EventArgs e) { OnBeatmapChanged(beatmap.Value); @@ -69,19 +46,16 @@ namespace osu.Game.Screens [BackgroundDependencyLoader(permitNulls: true)] private void load(OsuGameBase game) { - if (beatmap == null) - beatmap = game?.Beatmap; - } - - public override bool Push(Screen screen) - { - OsuScreen nextOsu = screen as OsuScreen; - if (nextOsu != null) + if (game != null) { - nextOsu.beatmap = beatmap; + //if we were given a beatmap at ctor time, we want to pass this on to the game-wide beatmap. + var localMap = beatmap.Value; + beatmap.BindTo(game.Beatmap); + if (localMap != null) + beatmap.Value = localMap; } - return base.Push(screen); + beatmap.ValueChanged += beatmap_ValueChanged; } protected virtual void OnBeatmapChanged(WorkingBeatmap beatmap) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index b552601458..46f93900fc 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -24,6 +24,7 @@ using OpenTK.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Transforms; using osu.Framework.Logging; +using osu.Framework.Input; namespace osu.Game.Screens.Play { @@ -72,6 +73,8 @@ namespace osu.Game.Screens.Play private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuGameBase game, OsuConfigManager config) { dimLevel = config.GetBindable(OsuConfig.DimLevel); + mouseWheelDisabled = config.GetBindable(OsuConfig.MouseDisableWheel); + try { if (Beatmap == null) @@ -325,5 +328,9 @@ namespace osu.Game.Screens.Play { Background?.FadeTo((100f - dimLevel) / 100, 800); } + + private Bindable mouseWheelDisabled; + + protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !isPaused; } } \ No newline at end of file diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index e84425fbee..c5c9e6722f 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -9,6 +9,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transforms; using osu.Framework.Screens; using osu.Game.Beatmaps; +using osu.Game.Database; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Screens.Backgrounds; @@ -38,7 +39,6 @@ namespace osu.Game.Screens.Play Interactive = false, }, }; - } [BackgroundDependencyLoader] @@ -92,11 +92,6 @@ namespace osu.Game.Screens.Play Content.ScaleTo(0.7f, 150, EasingTypes.InQuint); FadeOut(150); - //OsuScreens are currently never finalised due to the Bindable bindings. - //can be removed once we solve that one. - if (player != null && player.LoadState != LoadState.Alive) - player.Dispose(); - return base.OnExiting(next); } @@ -131,6 +126,8 @@ namespace osu.Game.Screens.Play public BeatmapMetadataDisplay(WorkingBeatmap beatmap) { + var metadata = beatmap?.BeatmapInfo?.Metadata ?? new BeatmapMetadata(); + AutoSizeAxes = Axes.Both; Children = new Drawable[] { @@ -144,7 +141,7 @@ namespace osu.Game.Screens.Play { new OsuSpriteText { - Text = beatmap.BeatmapInfo.Metadata.Title, + Text = metadata.Title, TextSize = 36, Font = @"Exo2.0-MediumItalic", Origin = Anchor.TopCentre, @@ -152,7 +149,7 @@ namespace osu.Game.Screens.Play }, new OsuSpriteText { - Text = beatmap.BeatmapInfo.Metadata.Artist, + Text = metadata.Artist, TextSize = 26, Font = @"Exo2.0-MediumItalic", Origin = Anchor.TopCentre, @@ -179,7 +176,7 @@ namespace osu.Game.Screens.Play }, new OsuSpriteText { - Text = beatmap.BeatmapInfo.Version, + Text = beatmap.BeatmapInfo?.Version, TextSize = 26, Font = @"Exo2.0-MediumItalic", Origin = Anchor.TopCentre, @@ -189,7 +186,7 @@ namespace osu.Game.Screens.Play Bottom = 40 }, }, - new MetadataLine("Source", beatmap.BeatmapInfo.Metadata.Source) + new MetadataLine("Source", metadata.Source) { Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, @@ -199,7 +196,7 @@ namespace osu.Game.Screens.Play Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, }, - new MetadataLine("Mapper", beatmap.BeatmapInfo.Metadata.Author) + new MetadataLine("Mapper", metadata.Author) { Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 7856d0b031..4a3b9b7fcd 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -27,7 +27,7 @@ namespace osu.Game.Screens.Select { private static readonly Vector2 wedged_container_shear = new Vector2(0.15f, 0); - private Container beatmapInfoContainer; + private BufferedContainer beatmapInfoContainer; private OsuGameBase game; @@ -61,8 +61,8 @@ namespace osu.Game.Screens.Select float newDepth = lastContainer?.Depth + 1 ?? 0; - BeatmapSetInfo beatmapSetInfo = beatmap.BeatmapSetInfo; BeatmapInfo beatmapInfo = beatmap.BeatmapInfo; + BeatmapMetadata metadata = beatmap.BeatmapInfo?.Metadata ?? beatmap.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata(); List labels = new List(); @@ -133,7 +133,7 @@ namespace osu.Game.Screens.Select new OsuSpriteText { Font = @"Exo2.0-MediumItalic", - Text = beatmapSetInfo.Metadata.Artist + " -- " + beatmapSetInfo.Metadata.Title, + Text = metadata.Artist + " -- " + metadata.Title, TextSize = 28, Shadow = true, }, @@ -161,7 +161,7 @@ namespace osu.Game.Screens.Select new OsuSpriteText { Font = @"Exo2.0-Bold", - Text = beatmapSetInfo.Metadata.Author, + Text = metadata.Author, TextSize = 15, Shadow = true, }, diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 4f3fdc8dd6..f16f1ef552 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -40,19 +40,19 @@ True - ..\packages\ppy.OpenTK.2.0.50727.1339\lib\net45\OpenTK.dll + $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll True - ..\packages\SQLite.Net.Core-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll + $(SolutionDir)\packages\SQLite.Net.Core-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll True - ..\packages\SQLite.Net-PCL.3.1.1\lib\net40\SQLite.Net.Platform.Generic.dll + $(SolutionDir)\packages\SQLite.Net-PCL.3.1.1\lib\net40\SQLite.Net.Platform.Generic.dll True - ..\packages\SQLite.Net-PCL.3.1.1\lib\net4\SQLite.Net.Platform.Win32.dll + $(SolutionDir)\packages\SQLite.Net-PCL.3.1.1\lib\net4\SQLite.Net.Platform.Win32.dll True @@ -63,6 +63,8 @@ $(SolutionDir)\packages\SQLiteNetExtensions.1.3.0\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\SQLiteNetExtensions.dll + + diff --git a/osu.Game/packages.config b/osu.Game/packages.config index 0249d173ac..15d28ca24f 100644 --- a/osu.Game/packages.config +++ b/osu.Game/packages.config @@ -6,7 +6,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste - +