mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 13:37:25 +08:00
Merge branch 'master' into unified-hitwindows
This commit is contained in:
commit
534eb223b3
@ -1 +1 @@
|
||||
Subproject commit 1440ae8538560b3c40883ec51ab39108d6a69e3b
|
||||
Subproject commit eba12eb4a0fa6238873dd266deb35bfdece21a6a
|
@ -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);
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
19
osu.Game/Tests/CleanRunHeadlessGameHost.cs
Normal file
19
osu.Game/Tests/CleanRunHeadlessGameHost.cs
Normal file
@ -0,0 +1,19 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Platform;
|
||||
|
||||
namespace osu.Game.Tests
|
||||
{
|
||||
/// <summary>
|
||||
/// A headless host which cleans up before running (removing any remnants from a previous execution).
|
||||
/// </summary>
|
||||
public class CleanRunHeadlessGameHost : HeadlessGameHost
|
||||
{
|
||||
public CleanRunHeadlessGameHost(string gameName = @"", bool bindIPC = false, bool realtime = true)
|
||||
: base(gameName, bindIPC, realtime)
|
||||
{
|
||||
Storage.DeleteDirectory(string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
@ -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
|
||||
|
@ -856,6 +856,7 @@
|
||||
<Compile Include="Storyboards\StoryboardSample.cs" />
|
||||
<Compile Include="Storyboards\StoryboardSprite.cs" />
|
||||
<Compile Include="Tests\Beatmaps\TestWorkingBeatmap.cs" />
|
||||
<Compile Include="Tests\CleanRunHeadlessGameHost.cs" />
|
||||
<Compile Include="Tests\Platform\TestStorage.cs" />
|
||||
<Compile Include="Tests\Visual\OsuTestCase.cs" />
|
||||
<Compile Include="Tests\Visual\TestCasePerformancePoints.cs" />
|
||||
|
@ -173,7 +173,9 @@
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INITIALIZER_BRACES/@EntryValue">NEXT_LINE</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/LINE_FEED_AT_FILE_END/@EntryValue">True</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSORHOLDER_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_CONSTRUCTOR_INITIALIZER_ON_SAME_LINE/@EntryValue">False</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AFTER_TYPECAST_PARENTHESES/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AROUND_MULTIPLICATIVE_OP/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BEFORE_SIZEOF_PARENTHESES/@EntryValue">False</s:Boolean>
|
||||
|
Loading…
Reference in New Issue
Block a user