1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:52:53 +08:00

Merge branch 'master' into unified-hitwindows

This commit is contained in:
Dean Herbert 2018-02-08 17:46:29 +09:00 committed by GitHub
commit 534eb223b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 45 additions and 18 deletions

@ -1 +1 @@
Subproject commit 1440ae8538560b3c40883ec51ab39108d6a69e3b Subproject commit eba12eb4a0fa6238873dd266deb35bfdece21a6a

View File

@ -123,9 +123,7 @@ namespace osu.Game.Rulesets.Osu.Objects
StartTime = EndTime, StartTime = EndTime,
Position = StackedEndPosition, Position = StackedEndPosition,
IndexInCurrentCombo = IndexInCurrentCombo, IndexInCurrentCombo = IndexInCurrentCombo,
ComboColour = ComboColour, ComboColour = ComboColour
Samples = Samples,
SampleControlPoint = SampleControlPoint
}; };
AddNested(HeadCircle); AddNested(HeadCircle);

View File

@ -24,7 +24,7 @@ namespace osu.Game.Tests.Beatmaps.IO
public void TestImportWhenClosed() public void TestImportWhenClosed()
{ {
//unfortunately for the time being we need to reference osu.Framework.Desktop for a game host here. //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); var osu = loadOsu(host);
@ -37,6 +37,8 @@ namespace osu.Game.Tests.Beatmaps.IO
ensureLoaded(osu); ensureLoaded(osu);
waitForOrAssert(() => !File.Exists(temp), "Temporary file still exists after standard import", 5000); 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")] [Ignore("Binding IPC on Appveyor isn't working (port in use). Need to figure out why")]
public void TestImportOverIPC() public void TestImportOverIPC()
{ {
using (HeadlessGameHost host = new HeadlessGameHost("host", true)) using (HeadlessGameHost host = new CleanRunHeadlessGameHost("host", true))
using (HeadlessGameHost client = new HeadlessGameHost("client", true)) using (HeadlessGameHost client = new CleanRunHeadlessGameHost("client", true))
{ {
Assert.IsTrue(host.IsPrimaryInstance); Assert.IsTrue(host.IsPrimaryInstance);
Assert.IsFalse(client.IsPrimaryInstance); Assert.IsFalse(client.IsPrimaryInstance);
@ -64,13 +66,15 @@ namespace osu.Game.Tests.Beatmaps.IO
ensureLoaded(osu); ensureLoaded(osu);
waitForOrAssert(() => !File.Exists(temp), "Temporary still exists after IPC import", 5000); waitForOrAssert(() => !File.Exists(temp), "Temporary still exists after IPC import", 5000);
host.Exit();
} }
} }
[Test] [Test]
public void TestImportWhenFileOpen() public void TestImportWhenFileOpen()
{ {
using (HeadlessGameHost host = new HeadlessGameHost("TestImportWhenFileOpen")) using (HeadlessGameHost host = new CleanRunHeadlessGameHost("TestImportWhenFileOpen"))
{ {
var osu = loadOsu(host); var osu = loadOsu(host);
@ -86,6 +90,8 @@ namespace osu.Game.Tests.Beatmaps.IO
File.Delete(temp); File.Delete(temp);
Assert.IsFalse(File.Exists(temp), "We likely held a read lock on the file when we shouldn't"); Assert.IsFalse(File.Exists(temp), "We likely held a read lock on the file when we shouldn't");
host.Exit();
} }
} }

View File

@ -76,6 +76,16 @@ namespace osu.Game.Graphics.UserInterface
Nub.Current.BindTo(Current); Nub.Current.BindTo(Current);
Current.DisabledChanged += disabled =>
{
Alpha = disabled ? 0.3f : 1;
};
}
protected override void LoadComplete()
{
base.LoadComplete();
Current.ValueChanged += newValue => Current.ValueChanged += newValue =>
{ {
if (newValue) if (newValue)
@ -83,11 +93,6 @@ namespace osu.Game.Graphics.UserInterface
else else
sampleUnchecked?.Play(); sampleUnchecked?.Play();
}; };
Current.DisabledChanged += disabled =>
{
Alpha = disabled ? 0.3f : 1;
};
} }
protected override bool OnHover(InputState state) protected override bool OnHover(InputState state)

View 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);
}
}
}

View File

@ -2,7 +2,6 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System; using System;
using osu.Framework.Platform;
using osu.Framework.Testing; using osu.Framework.Testing;
namespace osu.Game.Tests.Visual namespace osu.Game.Tests.Visual
@ -11,11 +10,8 @@ namespace osu.Game.Tests.Visual
{ {
public override void RunTest() public override void RunTest()
{ {
using (var host = new HeadlessGameHost($"test-{Guid.NewGuid()}", realtime: false)) using (var host = new CleanRunHeadlessGameHost($"test-{Guid.NewGuid()}", realtime: false))
{
host.Storage.DeleteDirectory(string.Empty);
host.Run(new OsuTestCaseTestRunner(this)); host.Run(new OsuTestCaseTestRunner(this));
}
} }
public class OsuTestCaseTestRunner : OsuGameBase public class OsuTestCaseTestRunner : OsuGameBase

View File

@ -856,6 +856,7 @@
<Compile Include="Storyboards\StoryboardSample.cs" /> <Compile Include="Storyboards\StoryboardSample.cs" />
<Compile Include="Storyboards\StoryboardSprite.cs" /> <Compile Include="Storyboards\StoryboardSprite.cs" />
<Compile Include="Tests\Beatmaps\TestWorkingBeatmap.cs" /> <Compile Include="Tests\Beatmaps\TestWorkingBeatmap.cs" />
<Compile Include="Tests\CleanRunHeadlessGameHost.cs" />
<Compile Include="Tests\Platform\TestStorage.cs" /> <Compile Include="Tests\Platform\TestStorage.cs" />
<Compile Include="Tests\Visual\OsuTestCase.cs" /> <Compile Include="Tests\Visual\OsuTestCase.cs" />
<Compile Include="Tests\Visual\TestCasePerformancePoints.cs" /> <Compile Include="Tests\Visual\TestCasePerformancePoints.cs" />

View File

@ -173,7 +173,9 @@
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INITIALIZER_BRACES/@EntryValue">NEXT_LINE</s:String> <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: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_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: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_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_AROUND_MULTIPLICATIVE_OP/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BEFORE_SIZEOF_PARENTHESES/@EntryValue">False</s:Boolean> <s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BEFORE_SIZEOF_PARENTHESES/@EntryValue">False</s:Boolean>