diff --git a/osu-framework b/osu-framework index 1440ae8538..eba12eb4a0 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 1440ae8538560b3c40883ec51ab39108d6a69e3b +Subproject commit eba12eb4a0fa6238873dd266deb35bfdece21a6a diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 3bde7e790b..5dd3d7aa89 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -123,9 +123,7 @@ namespace osu.Game.Rulesets.Osu.Objects StartTime = EndTime, Position = StackedEndPosition, IndexInCurrentCombo = IndexInCurrentCombo, - ComboColour = ComboColour, - Samples = Samples, - SampleControlPoint = SampleControlPoint + ComboColour = ComboColour }; AddNested(HeadCircle); diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index ece1f626ec..0b49bc8bb9 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -24,7 +24,7 @@ namespace osu.Game.Tests.Beatmaps.IO public void TestImportWhenClosed() { //unfortunately for the time being we need to reference osu.Framework.Desktop for a game host here. - using (HeadlessGameHost host = new HeadlessGameHost("TestImportWhenClosed")) + using (HeadlessGameHost host = new CleanRunHeadlessGameHost("TestImportWhenClosed")) { var osu = loadOsu(host); @@ -37,6 +37,8 @@ namespace osu.Game.Tests.Beatmaps.IO ensureLoaded(osu); waitForOrAssert(() => !File.Exists(temp), "Temporary file still exists after standard import", 5000); + + host.Exit(); } } @@ -45,8 +47,8 @@ namespace osu.Game.Tests.Beatmaps.IO [Ignore("Binding IPC on Appveyor isn't working (port in use). Need to figure out why")] public void TestImportOverIPC() { - using (HeadlessGameHost host = new HeadlessGameHost("host", true)) - using (HeadlessGameHost client = new HeadlessGameHost("client", true)) + using (HeadlessGameHost host = new CleanRunHeadlessGameHost("host", true)) + using (HeadlessGameHost client = new CleanRunHeadlessGameHost("client", true)) { Assert.IsTrue(host.IsPrimaryInstance); Assert.IsFalse(client.IsPrimaryInstance); @@ -64,13 +66,15 @@ namespace osu.Game.Tests.Beatmaps.IO ensureLoaded(osu); waitForOrAssert(() => !File.Exists(temp), "Temporary still exists after IPC import", 5000); + + host.Exit(); } } [Test] public void TestImportWhenFileOpen() { - using (HeadlessGameHost host = new HeadlessGameHost("TestImportWhenFileOpen")) + using (HeadlessGameHost host = new CleanRunHeadlessGameHost("TestImportWhenFileOpen")) { var osu = loadOsu(host); @@ -86,6 +90,8 @@ namespace osu.Game.Tests.Beatmaps.IO File.Delete(temp); Assert.IsFalse(File.Exists(temp), "We likely held a read lock on the file when we shouldn't"); + + host.Exit(); } } diff --git a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs index 5e7dda8713..f06313c261 100644 --- a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs +++ b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs @@ -76,6 +76,16 @@ namespace osu.Game.Graphics.UserInterface Nub.Current.BindTo(Current); + Current.DisabledChanged += disabled => + { + Alpha = disabled ? 0.3f : 1; + }; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + Current.ValueChanged += newValue => { if (newValue) @@ -83,11 +93,6 @@ namespace osu.Game.Graphics.UserInterface else sampleUnchecked?.Play(); }; - - Current.DisabledChanged += disabled => - { - Alpha = disabled ? 0.3f : 1; - }; } protected override bool OnHover(InputState state) diff --git a/osu.Game/Tests/CleanRunHeadlessGameHost.cs b/osu.Game/Tests/CleanRunHeadlessGameHost.cs new file mode 100644 index 0000000000..b6ff6dcf84 --- /dev/null +++ b/osu.Game/Tests/CleanRunHeadlessGameHost.cs @@ -0,0 +1,19 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Platform; + +namespace osu.Game.Tests +{ + /// + /// A headless host which cleans up before running (removing any remnants from a previous execution). + /// + public class CleanRunHeadlessGameHost : HeadlessGameHost + { + public CleanRunHeadlessGameHost(string gameName = @"", bool bindIPC = false, bool realtime = true) + : base(gameName, bindIPC, realtime) + { + Storage.DeleteDirectory(string.Empty); + } + } +} diff --git a/osu.Game/Tests/Visual/OsuTestCase.cs b/osu.Game/Tests/Visual/OsuTestCase.cs index f9f198a5c1..97aada2971 100644 --- a/osu.Game/Tests/Visual/OsuTestCase.cs +++ b/osu.Game/Tests/Visual/OsuTestCase.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using osu.Framework.Platform; using osu.Framework.Testing; namespace osu.Game.Tests.Visual @@ -11,11 +10,8 @@ namespace osu.Game.Tests.Visual { public override void RunTest() { - using (var host = new HeadlessGameHost($"test-{Guid.NewGuid()}", realtime: false)) - { - host.Storage.DeleteDirectory(string.Empty); + using (var host = new CleanRunHeadlessGameHost($"test-{Guid.NewGuid()}", realtime: false)) host.Run(new OsuTestCaseTestRunner(this)); - } } public class OsuTestCaseTestRunner : OsuGameBase diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 728347f451..6542160b97 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -856,6 +856,7 @@ + diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index 8767e5374a..3b62dbe579 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -173,7 +173,9 @@ NEXT_LINE True NEVER + NEVER False + NEVER False True False